Version Description
(2019-07-09) = Added * YouTube channel URLs are now supported. * Items imported from YouTube are detected and their embed links are saved. * Embedded YouTube videos can now be shown in a lightbox. * New option to enable or disable the plugin's logging. * New option to set the log age, in days, for daily truncation. * Image URLs are detected and saved in feed item meta, to be used by templates that can show images. * Feed item excerpts are now imported, to be used by templates that can show excerpts. * Activating or pausing feed sources from the Feed Sources page is now asynchronous. * Deleting feed items from the Feed Sources page is now asynchronous. * New plugin-wide error handling to prevent site locks, with the option to deactivate the plugin and its addons. * Feed sources that are missing their respective cron are detected and fixed while on the Feed Sources page. * Added tooltips to various links and controls in the feed source list page. * Import errors are now asynchronously added to the error icon in the feed sources list page.
Changed * Previewing a template no longer requires saving the template. * Redesigned the feed sources page to be more compact and informative at a glance. * The imported item count in the feed sources page is now a link to that feed's imported items. * Improved the responsive styling of the feed sources list table. * The custom feed now uses the Atom 1.0 standard. * Improved the detection of cron scheduling failures, prevent feeds from appearing to be stuck. * Converted log section in the debugging page to use the new module system. * Some options were renamed to be consistent across various plugin pages. * Improved the wording, description and tooltip of the "Import order" option. * Added better error handling during image file creation when using the GD extension. * Rewrote the unique item title checking logic to be faster and more accurate. * Now suppressing "non-numeric value encountered" warnings from SimplePie. * Increased the time by which the plugin detects stuck feeds to 2 minutes. * The addon licensing registration system has been partially converted to the new module system.
Fixed * The default template could not be saved with a particular combination of settings. * The age limit setting was incorrectly being copied to feed sources. * Fixed links in templates not opening in new tabs under certain conditions. * Non image files are no longer wrongly downloaded, cached and treated as images. * The unique titles option caused a PHP warning when enabled. * Fixed use of previously cached version scripts and styles for the Templates page. * Fixed pagination not working correctly when no item limit is set. * Fixed the "Set links as no follow" option not having any effect. * An empty limit for the number of items in a template silently defaults to 5 items. * The name of the user was being shown as the author for feed items that had no author. * Fixed the "property on non-object" error on the Licensing settings page for new addons. * On some sites, multiple default templates are constantly being created. * The default template is auto-created is corrupted data. An update procedure will now fix this data.
Removed * Removed old secure reset code. * The "View items" row action link in the Feed Sources page has been removed. * Removed the "Edit" bulk action from the feed sources list page.
Release Info
Developer | markzahra |
Plugin | WP RSS Aggregator |
Version | 4.14 |
Comparing to | |
See all releases |
Code changes from version 4.13.2 to 4.14
- CHANGELOG.md +52 -0
- css/admin-notifications.css +4 -0
- css/admin-styles.css +304 -22
- css/beacon.css +4 -0
- css/build/common.min.css +0 -0
- css/build/gutenberg-block.min.css +0 -0
- css/build/intro.min.css +0 -0
- css/build/pagination.min.css +0 -0
- css/build/plugins.min.css +0 -0
- css/build/templates.min.css +0 -0
- css/build/update.min.css +1 -1
- css/src/update/index.scss +30 -2
- images/blacklist.png +0 -0
- images/welcome-page/blacklist-feed-item.png +0 -0
- images/welcome-page/blacklist.png +0 -0
- images/welcome-page/bulk-add.png +0 -0
- images/welcome-page/spinning-icon.gif +0 -0
- images/welcome-page/trash-feed-item.png +0 -0
- images/welcome-page/updates.png +0 -0
- includes/Aventura/Wprss/Core/Http/Message/Ajax/AbstractResponse.php +2 -2
- includes/Aventura/Wprss/Core/Licensing/Settings.php +1 -0
- includes/admin-addons.php +33 -34
- includes/admin-ajax-notice.php +1 -1
- includes/admin-dashboard.php +0 -102
- includes/admin-debugging.php +20 -35
- includes/admin-display.php +229 -111
- includes/admin-editor.php +1 -1
- includes/admin-heartbeat.php +16 -6
- includes/admin-help-metaboxes.php +4 -4
- includes/admin-help-settings.php +6 -5
- includes/admin-help.php +5 -5
- includes/admin-log.php +1 -1
- includes/admin-metaboxes.php +51 -15
- includes/admin-options.php +5 -24
- includes/admin-update-page.php +4 -4
- includes/admin-welcome.php +0 -170
- includes/admin.php +33 -0
- includes/feed-importing-images.php +917 -0
- includes/feed-importing.php +219 -157
- includes/feed-processing.php +93 -31
- includes/feed-states.php +1 -29
- includes/functions.php +32 -1
- includes/image-caching.php +66 -18
- includes/legacy-feed-display.php +1 -1
- includes/polyfills.php +170 -0
- includes/scripts.php +7 -4
- includes/secure-reset.php +0 -58
- includes/update.php +26 -3
- includes/youtube.php +50 -0
- js/admin-custom-bulk-actions.js +3 -2
- js/admin-custom.js +166 -29
- js/admin-debug.js +7 -0
- js/build/common.min.js +1 -1
- js/build/gutenberg-block.min.js +1 -1
- js/build/intro.min.js +1 -1
- js/build/pagination.min.js +1 -1
- js/build/plugins.min.js +1 -1
- js/build/settings.min.js +0 -1
- js/build/templates.min.js +1 -1
- js/build/update.min.js +1 -1
- js/build/wpra-manifest.min.js +1 -1
- js/build/wpra-vendor.min.js +3 -3
- js/custom.js +2 -2
- js/gallery.js +116 -0
- js/heartbeat.js +31 -18
- js/src/components/Input.js +11 -1
- js/src/components/MediaInput.js +96 -0
- js/src/libs/NotificationCenter.js +4 -4
- js/src/modules/gutenberg-block/index.js +84 -72
- js/src/modules/pagination/index.js +5 -2
- js/src/modules/settings/index.js +0 -11
- js/src/modules/templates/Edit.js +134 -109
- js/src/modules/templates/List.js +14 -16
- js/src/utils/base64.js +133 -0
- readme.txt +76 -58
- src/Data/ArrayDataSet.php +20 -2
- src/Data/Collections/WpPostCollection.php +11 -2
- src/Data/DelegatorDataSet.php +145 -0
- src/Data/Wp/WpCptDataSet.php +3 -0
- src/Data/Wp/WpOptionsDataSet.php +90 -0
- src/Data/Wp/WpPluginInfoDataSet.php +4 -0
- src/Data/Wp/WpPostDataSet.php +3 -0
- src/{Feeds → Entities/Feeds/Items}/ImportedItemsCollection.php +3 -2
- src/{Feeds/Models → Entities/Feeds/Items}/WpPostFeedItem.php +87 -19
- src/{Feeds/FeedItemCollection.php → Entities/Feeds/Items/WpPostFeedItemCollection.php} +15 -3
- src/Entities/Feeds/Sources/WpPostFeedSource.php +88 -0
- src/Entities/Feeds/Sources/WpPostFeedSourceCollection.php +75 -0
- src/Entities/Feeds/Templates/BuiltInFeedTemplate.php +189 -0
- src/{Templates/Feeds/Models → Entities/Feeds/Templates}/WpPostFeedTemplate.php +1 -1
- src/{Templates/Feeds/FeedTemplateCollection.php → Entities/Feeds/Templates/WpPostFeedTemplateCollection.php} +2 -4
- src/ErrorHandler.php +139 -0
- src/Feeds/Models/WpPostFeedSource.php +0 -47
- src/{Modules/Handlers → Handlers}/AbstractSavePostHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/AddCapabilitiesHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/AddCptMetaCapsHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/CustomFeed/RegisterCustomFeedHandler.php +1 -1
- src/Handlers/CustomFeed/RenderCustomFeedHandler.php +85 -0
- src/{Modules/Handlers → Handlers}/FeedBlacklist/SaveBlacklistHandler.php +2 -2
- src/{Modules/Handlers → Handlers}/FeedShortcode/FeedsShortcodeHandler.php +1 -1
- src/Handlers/FeedSources/FeedSourceSaveMetaHandler.php +54 -0
- src/{Modules/Handlers → Handlers}/FeedSources/RenderFeedSourceContentHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/FeedTemplates/AjaxRenderFeedsTemplateHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/FeedTemplates/CreateDefaultFeedTemplateHandler.php +8 -11
- src/{Modules/Handlers → Handlers}/FeedTemplates/HidePublicTemplateContentHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/FeedTemplates/PreviewTemplateRedirectHandler.php +11 -2
- src/{Modules/Handlers → Handlers}/FeedTemplates/ReSaveTemplateHandler.php +1 -2
- src/Handlers/FeedTemplates/RenderAdminTemplatesPageHandler.php +48 -0
- src/Handlers/FeedTemplates/RenderTemplateContentHandler.php +96 -0
- src/{Modules/Handlers → Handlers}/GutenbergBlock/FetchFeedSourcesHandler.php +1 -1
- src/Handlers/GutenbergBlock/GutenbergBlockAssetsHandler.php +60 -0
- src/Handlers/Images/AddItemsImageColumnHandler.php +61 -0
- src/Handlers/Images/DeleteImagesHandler.php +60 -0
- src/Handlers/Images/RemoveFtImageMetaBoxHandler.php +24 -0
- src/Handlers/Images/RenderItemsImageColumnHandler.php +68 -0
- src/{Modules/Handlers → Handlers}/LoadTextDomainHandler.php +1 -1
- src/Handlers/Logger/ClearLogHandler.php +57 -0
- src/Handlers/Logger/DownloadLogHandler.php +55 -0
- src/Handlers/Logger/RenderLogHandler.php +90 -0
- src/Handlers/Logger/SaveLogOptionsHandler.php +67 -0
- src/{Modules/Handlers → Handlers}/Logger/TruncateLogsCronHandler.php +17 -10
- src/{Modules/Handlers → Handlers}/MultiHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/NullHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/RegisterCptHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/RegisterGutenbergBlockHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/RegisterMenuPageHandler.php +1 -1
- src/Handlers/RegisterMetaBoxHandler.php +141 -0
- src/{Modules/Handlers → Handlers}/RegisterShortcodeHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/RegisterSubMenuPageHandler.php +1 -1
- src/{Modules/Handlers → Handlers}/RenderTemplateHandler.php +21 -3
- src/{Modules/Handlers → Handlers}/ScheduleCronJobHandler.php +1 -1
- src/Importer/Images/FbImageContainer.php +99 -0
- src/Importer/Images/ImageContainer.php +98 -0
- src/Licensing/Addon.php +66 -0
- src/Logger/ConditionalLogger.php +54 -0
- src/Logger/WpdbLogger.php +2 -0
- src/Modules/AssetsModule.php +108 -0
- src/Modules/CoreModule.php +31 -0
- src/Modules/CustomFeedModule.php +9 -4
- src/Modules/FeedBlacklistModule.php +4 -4
- src/Modules/FeedItemsModule.php +6 -5
- src/Modules/FeedShortcodeModule.php +2 -2
- src/Modules/FeedSourcesModule.php +25 -6
- src/Modules/FeedTemplatesModule.php +363 -242
- src/Modules/GutenbergBlockModule.php +76 -10
- src/Modules/Handlers/CustomFeed/RenderCustomFeedHandler.php +0 -98
- src/Modules/Handlers/FeedTemplates/RenderAdminTemplatesPageHandler.php +0 -89
- src/Modules/Handlers/FeedTemplates/RenderTemplateContentHandler.php +0 -64
- src/Modules/Handlers/GutenbergBlock/GutenbergBlockAssetsHandler.php +0 -65
- src/Modules/I18nModule.php +1 -1
- src/Modules/ImagesModule.php +424 -0
- src/Modules/ImporterModule.php +1 -1
- src/Modules/LicensingModule.php +99 -0
- src/Modules/LoggerModule.php +144 -15
- src/Modules/RestApiModule.php +0 -5
- src/Modules/TwigModule.php +3 -1
- src/Query/FeedItemsQueryIterator.php +0 -157
- src/RestApi/EndPoints/FeedTemplates/RenderTemplateEndPoint.php +21 -3
- src/Templates/Feeds/MasterFeedsTemplate.php +8 -8
- src/Templates/Feeds/Models/BuiltInFeedTemplate.php +0 -190
- src/Templates/Feeds/TemplateTypeTemplate.php +189 -0
- src/Templates/Feeds/Types/AbstractWpraFeedTemplateType.php +17 -7
- src/Templates/Feeds/Types/ListTemplateType.php +3 -3
- src/Twig/Extensions/WpraExtension.php +194 -21
@@ -4,6 +4,58 @@ All notable changes to this project will be documented in this file.
|
|
4 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
## [4.13.2] - 2019-05-14
|
8 |
### Added
|
9 |
* A custom Twig extension for WordPress-based i18n.
|
4 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6 |
|
7 |
+
## [4.14] - 2019-07-09
|
8 |
+
### Added
|
9 |
+
* YouTube channel URLs are now supported.
|
10 |
+
* Items imported from YouTube are detected and their embed links are saved.
|
11 |
+
* Embedded YouTube videos can now be shown in a lightbox.
|
12 |
+
* New option to enable or disable the plugin's logging.
|
13 |
+
* New option to set the log age, in days, for daily truncation.
|
14 |
+
* Image URLs are detected and saved in feed item meta, to be used by templates that can show images.
|
15 |
+
* Feed item excerpts are now imported, to be used by templates that can show excerpts.
|
16 |
+
* Activating or pausing feed sources from the Feed Sources page is now asynchronous.
|
17 |
+
* Deleting feed items from the Feed Sources page is now asynchronous.
|
18 |
+
* New plugin-wide error handling to prevent site locks, with the option to deactivate the plugin and its addons.
|
19 |
+
* Feed sources that are missing their respective cron are detected and fixed while on the Feed Sources page.
|
20 |
+
* Added tooltips to various links and controls in the feed source list page.
|
21 |
+
* Import errors are now asynchronously added to the error icon in the feed sources list page.
|
22 |
+
|
23 |
+
### Changed
|
24 |
+
* Previewing a template no longer requires saving the template.
|
25 |
+
* Redesigned the feed sources page to be more compact and informative at a glance.
|
26 |
+
* The imported item count in the feed sources page is now a link to that feed's imported items.
|
27 |
+
* Improved the responsive styling of the feed sources list table.
|
28 |
+
* The custom feed now uses the Atom 1.0 standard.
|
29 |
+
* Improved the detection of cron scheduling failures, prevent feeds from appearing to be stuck.
|
30 |
+
* Converted log section in the debugging page to use the new module system.
|
31 |
+
* Some options were renamed to be consistent across various plugin pages.
|
32 |
+
* Improved the wording, description and tooltip of the "Import order" option.
|
33 |
+
* Added better error handling during image file creation when using the GD extension.
|
34 |
+
* Rewrote the unique item title checking logic to be faster and more accurate.
|
35 |
+
* Now suppressing "non-numeric value encountered" warnings from SimplePie.
|
36 |
+
* Increased the time by which the plugin detects stuck feeds to 2 minutes.
|
37 |
+
* The addon licensing registration system has been partially converted to the new module system.
|
38 |
+
|
39 |
+
### Fixed
|
40 |
+
* The default template could not be saved with a particular combination of settings.
|
41 |
+
* The age limit setting was incorrectly being copied to feed sources.
|
42 |
+
* Fixed links in templates not opening in new tabs under certain conditions.
|
43 |
+
* Non image files are no longer wrongly downloaded, cached and treated as images.
|
44 |
+
* The unique titles option caused a PHP warning when enabled.
|
45 |
+
* Fixed use of previously cached version scripts and styles for the Templates page.
|
46 |
+
* Fixed pagination not working correctly when no item limit is set.
|
47 |
+
* Fixed the "Set links as no follow" option not having any effect.
|
48 |
+
* An empty limit for the number of items in a template silently defaults to 5 items.
|
49 |
+
* The name of the user was being shown as the author for feed items that had no author.
|
50 |
+
* Fixed the "property on non-object" error on the Licensing settings page for new addons.
|
51 |
+
* On some sites, multiple default templates are constantly being created.
|
52 |
+
* The default template is auto-created is corrupted data. An update procedure will now fix this data.
|
53 |
+
|
54 |
+
### Removed
|
55 |
+
* Removed old secure reset code.
|
56 |
+
* The "View items" row action link in the Feed Sources page has been removed.
|
57 |
+
* Removed the "Edit" bulk action from the feed sources list page.
|
58 |
+
|
59 |
## [4.13.2] - 2019-05-14
|
60 |
### Added
|
61 |
* A custom Twig extension for WordPress-based i18n.
|
@@ -7,6 +7,10 @@
|
|
7 |
margin-right: 200px;
|
8 |
}
|
9 |
|
|
|
|
|
|
|
|
|
10 |
.wprss_admin-notice .btn-close {
|
11 |
position: absolute;
|
12 |
right: 15px;
|
7 |
margin-right: 200px;
|
8 |
}
|
9 |
|
10 |
+
.wprss_admin-notice .notice-inside {
|
11 |
+
margin-right: 200px;
|
12 |
+
}
|
13 |
+
|
14 |
.wprss_admin-notice .btn-close {
|
15 |
position: absolute;
|
16 |
right: 15px;
|
@@ -263,16 +263,22 @@ input#thumbnails-width {
|
|
263 |
display: block;
|
264 |
}
|
265 |
|
266 |
-
|
267 |
display: inline-block;
|
268 |
margin: 15px 5px 15px 0;
|
269 |
}
|
|
|
|
|
|
|
|
|
|
|
270 |
form.wprss-error-log-action input[type="submit"]:active {
|
271 |
vertical-align: baseline;
|
272 |
}
|
273 |
/* The debug log root element */
|
274 |
div.wpra-log {
|
275 |
display: none;
|
|
|
276 |
}
|
277 |
|
278 |
/* The "Filters" label */
|
@@ -413,6 +419,43 @@ div.wpra-log-container > table > tbody > tr.wpra-log-error > td {
|
|
413 |
font-weight: bold;
|
414 |
}
|
415 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
416 |
@media screen and (min-width: 782px) {
|
417 |
#custom_feed_title {
|
418 |
width: 400px;
|
@@ -535,32 +578,28 @@ body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th {
|
|
535 |
text-align: left;
|
536 |
overflow: hidden;
|
537 |
}
|
538 |
-
/*
|
539 |
-
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead
|
540 |
-
width:
|
541 |
}
|
542 |
-
/*
|
543 |
-
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#
|
544 |
-
width:
|
545 |
}
|
546 |
/* NAME */
|
547 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#title {
|
548 |
-
width:
|
549 |
}
|
550 |
/* NEXT UPDATE */
|
551 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#updates {
|
552 |
-
width:
|
553 |
}
|
554 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts td.column-updates p {
|
555 |
margin-bottom: 0 !important;
|
556 |
}
|
557 |
-
/* STATE */
|
558 |
-
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#state {
|
559 |
-
width: 90px !important;
|
560 |
-
}
|
561 |
/* FEED COUNT */
|
562 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#feed-count {
|
563 |
-
width:
|
564 |
}
|
565 |
/* CATEGORIES */
|
566 |
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts thead th#category,
|
@@ -568,15 +607,14 @@ body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#category {
|
|
568 |
width: 130px !important;
|
569 |
}
|
570 |
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
display: none;
|
578 |
-
}
|
579 |
}
|
|
|
580 |
@media screen and (max-width: 660px) {
|
581 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#id,
|
582 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts tfoot th.column-id,
|
@@ -587,7 +625,46 @@ body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#category {
|
|
587 |
display: none;
|
588 |
}
|
589 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
590 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
591 |
|
592 |
/* For feed items */
|
593 |
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts thead th#publishdate {
|
@@ -604,6 +681,7 @@ i.wprss-feed-error-symbol {
|
|
604 |
font-size: 1.2em;
|
605 |
vertical-align: middle;
|
606 |
color: rgb(200,0,0);
|
|
|
607 |
}
|
608 |
|
609 |
i.wprss-updating-feed-icon {
|
@@ -883,3 +961,207 @@ body.post-type-wprss_blacklist .alignleft.actions.bulkactions {
|
|
883 |
list-style: disc;
|
884 |
list-style-position: inside;
|
885 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
display: block;
|
264 |
}
|
265 |
|
266 |
+
.wprss-error-log-action {
|
267 |
display: inline-block;
|
268 |
margin: 15px 5px 15px 0;
|
269 |
}
|
270 |
+
|
271 |
+
#wprss-download-error-log-form {
|
272 |
+
float: right;
|
273 |
+
}
|
274 |
+
|
275 |
form.wprss-error-log-action input[type="submit"]:active {
|
276 |
vertical-align: baseline;
|
277 |
}
|
278 |
/* The debug log root element */
|
279 |
div.wpra-log {
|
280 |
display: none;
|
281 |
+
width: 800px;
|
282 |
}
|
283 |
|
284 |
/* The "Filters" label */
|
419 |
font-weight: bold;
|
420 |
}
|
421 |
|
422 |
+
#wprss-error-log-options {
|
423 |
+
display: none;
|
424 |
+
margin: 10px 0;
|
425 |
+
padding: 10px;
|
426 |
+
background: #fff;
|
427 |
+
border: 1px solid #ccc;
|
428 |
+
border-radius: 2px;
|
429 |
+
}
|
430 |
+
|
431 |
+
#wprss-error-log-options form {
|
432 |
+
display: block;
|
433 |
+
}
|
434 |
+
|
435 |
+
#wprss-error-log-options label {
|
436 |
+
display: inline-block;
|
437 |
+
line-height: 1;
|
438 |
+
font-size: 1em;
|
439 |
+
margin: 3px 0;
|
440 |
+
}
|
441 |
+
|
442 |
+
#wprss-error-log-options label > span:first-child {
|
443 |
+
display: inline-block;
|
444 |
+
font-weight: bold;
|
445 |
+
width: 200px;
|
446 |
+
}
|
447 |
+
|
448 |
+
#wprss-log-options-form input[name="logging_limit_days"] {
|
449 |
+
width: 80px;
|
450 |
+
}
|
451 |
+
|
452 |
+
#wpra-log-options-submit-wrap {
|
453 |
+
text-align: right;
|
454 |
+
}
|
455 |
+
#wpra-log-options-submit-wrap > button {
|
456 |
+
text-align: center;
|
457 |
+
}
|
458 |
+
|
459 |
@media screen and (min-width: 782px) {
|
460 |
#custom_feed_title {
|
461 |
width: 400px;
|
578 |
text-align: left;
|
579 |
overflow: hidden;
|
580 |
}
|
581 |
+
/* CHECKBOX */
|
582 |
+
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead td#cb {
|
583 |
+
width: 30px !important;
|
584 |
}
|
585 |
+
/* STATE */
|
586 |
+
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#state {
|
587 |
+
width: 70px !important;
|
588 |
}
|
589 |
/* NAME */
|
590 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#title {
|
591 |
+
width: auto;
|
592 |
}
|
593 |
/* NEXT UPDATE */
|
594 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#updates {
|
595 |
+
width: 300px !important;
|
596 |
}
|
597 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts td.column-updates p {
|
598 |
margin-bottom: 0 !important;
|
599 |
}
|
|
|
|
|
|
|
|
|
600 |
/* FEED COUNT */
|
601 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#feed-count {
|
602 |
+
width: 200px !important;
|
603 |
}
|
604 |
/* CATEGORIES */
|
605 |
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts thead th#category,
|
607 |
width: 130px !important;
|
608 |
}
|
609 |
|
610 |
+
/* FEED ITEM IMAGE */
|
611 |
+
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts thead th#image {
|
612 |
+
width: 120px;
|
613 |
+
}
|
614 |
+
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts tbody img.wpra-item-ft-image {
|
615 |
+
width: 100px;
|
|
|
|
|
616 |
}
|
617 |
+
|
618 |
@media screen and (max-width: 660px) {
|
619 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#id,
|
620 |
body.post-type-wprss_feed.edit-php table.wp-list-table.posts tfoot th.column-id,
|
625 |
display: none;
|
626 |
}
|
627 |
}
|
628 |
+
@media only screen and (max-width: 782px) {
|
629 |
+
/* WIDEN CHECKBOX COLUMN */
|
630 |
+
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead td#cb {
|
631 |
+
width: 50px !important;
|
632 |
+
}
|
633 |
+
|
634 |
+
/* HIDE STATE COLUMN */
|
635 |
+
body.post-type-wprss_feed.edit-php table.wp-list-table.posts thead th#state,
|
636 |
+
body.post-type-wprss_feed.edit-php table.wp-list-table.posts tfoot th.column-state,
|
637 |
+
body.post-type-wprss_feed.edit-php table.wp-list-table.posts tbody td.column-state {
|
638 |
+
display: none;
|
639 |
+
padding: 8px 10px;
|
640 |
+
}
|
641 |
+
|
642 |
+
/* HIDE ITEM IMAGE COLUMN */
|
643 |
+
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts thead th#image,
|
644 |
+
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts tfoot th.column-image,
|
645 |
+
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts tbody td.column-image {
|
646 |
+
display: none;
|
647 |
+
}
|
648 |
+
|
649 |
+
/* IMAGE IS LARGER IN RESPONSIVE MOBILE VIEW */
|
650 |
+
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts tbody img.wpra-item-ft-image {
|
651 |
+
width: 350px;
|
652 |
+
}
|
653 |
+
|
654 |
+
/* HIDE INLINE IMAGE COLUMN NAME IN RESPONSIVE MOBILE VIEW */
|
655 |
+
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts tbody td.column-image::before {
|
656 |
+
display: none;
|
657 |
+
}
|
658 |
+
}
|
659 |
|
660 |
+
@media only screen and (max-width: 1200px) {
|
661 |
+
/* HIDE ITEM PERMALINK COLUMN */
|
662 |
+
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts thead th#permalink,
|
663 |
+
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts tfoot th.column-permalink,
|
664 |
+
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts tbody td.column-permalink {
|
665 |
+
display: none;
|
666 |
+
}
|
667 |
+
}
|
668 |
|
669 |
/* For feed items */
|
670 |
body.post-type-wprss_feed_item.edit-php table.wp-list-table.posts thead th#publishdate {
|
681 |
font-size: 1.2em;
|
682 |
vertical-align: middle;
|
683 |
color: rgb(200,0,0);
|
684 |
+
margin-left: 8px;
|
685 |
}
|
686 |
|
687 |
i.wprss-updating-feed-icon {
|
961 |
list-style: disc;
|
962 |
list-style-position: inside;
|
963 |
}
|
964 |
+
|
965 |
+
.wpra_ft_image_option {
|
966 |
+
margin-top: 10px;
|
967 |
+
}
|
968 |
+
|
969 |
+
#wpra_image_min_size_row {
|
970 |
+
display: none;
|
971 |
+
}
|
972 |
+
|
973 |
+
/* Spacing between image width and height fields */
|
974 |
+
#wpra_image_min_size_row > td > label {
|
975 |
+
margin-right: 10px;
|
976 |
+
}
|
977 |
+
|
978 |
+
#wprss-feed-def-ft-image-preview {
|
979 |
+
width: 220px;
|
980 |
+
}
|
981 |
+
|
982 |
+
#wprss-feed-def-ft-image-preview-hint {
|
983 |
+
margin-bottom: 8px;
|
984 |
+
}
|
985 |
+
|
986 |
+
|
987 |
+
/*
|
988 |
+
* The Feed Source List Table styles that mimic the plugins table
|
989 |
+
*/
|
990 |
+
|
991 |
+
.post-type-wprss_feed table.wp-list-table.posts tbody tr th,
|
992 |
+
.post-type-wprss_feed table.wp-list-table.posts tbody tr td
|
993 |
+
{
|
994 |
+
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .1);
|
995 |
+
}
|
996 |
+
|
997 |
+
/* Feed updating/deleting animation in feed sources table */
|
998 |
+
.post-type-wprss_feed table.wp-list-table.posts tbody tr.wpra-feed-is-updating,
|
999 |
+
.post-type-wprss_feed table.wp-list-table.posts tbody tr.wpra-feed-is-deleting {
|
1000 |
+
/*background-image: linear-gradient(-45deg, rgba(30, 30, 30, 0.05) 25%, transparent 0, transparent 50%, rgba(50, 50, 50, 0.05) 50%, rgba(30, 30, 30, 0.05) 75%, transparent 0, #0000);*/
|
1001 |
+
/*background-image: linear-gradient(*/
|
1002 |
+
/* -45deg, rgba(0, 0, 0, 0.9) 25%,*/
|
1003 |
+
/* transparent 0,*/
|
1004 |
+
/* transparent 50%,*/
|
1005 |
+
/* rgba(0, 0, 0, 0.9) 50%,*/
|
1006 |
+
/* rgba(0, 0, 0, 0.9) 75%,*/
|
1007 |
+
/* transparent 0, #0000*/
|
1008 |
+
/*);*/
|
1009 |
+
background-size: 80px 80px;
|
1010 |
+
background-blend-mode: overlay;
|
1011 |
+
}
|
1012 |
+
|
1013 |
+
.post-type-wprss_feed table.wp-list-table.posts tbody tr.wpra-feed-is-updating > *,
|
1014 |
+
.post-type-wprss_feed table.wp-list-table.posts tbody tr.wpra-feed-is-deleting > * {
|
1015 |
+
background: transparent !important;
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
.post-type-wprss_feed table.wp-list-table.posts tbody tr.wpra-feed-is-updating {
|
1019 |
+
animation: wpra-feed-updating-animation 1.3s linear infinite;
|
1020 |
+
background-color: #e9f9ee;
|
1021 |
+
}
|
1022 |
+
.post-type-wprss_feed table.wp-list-table.posts tbody tr.wpra-feed-is-deleting {
|
1023 |
+
animation: wpra-feed-updating-animation 1s linear infinite;
|
1024 |
+
background-color: #f8eaea;
|
1025 |
+
}
|
1026 |
+
|
1027 |
+
@keyframes wpra-feed-updating-animation {
|
1028 |
+
0% {
|
1029 |
+
background-position: 0 0;
|
1030 |
+
}
|
1031 |
+
50% {
|
1032 |
+
background-position: 80px 80px;
|
1033 |
+
}
|
1034 |
+
100% {
|
1035 |
+
background-position: 160px 160px;
|
1036 |
+
}
|
1037 |
+
}
|
1038 |
+
|
1039 |
+
/*
|
1040 |
+
* Styles for the Feed Source List Table "State" column
|
1041 |
+
*/
|
1042 |
+
div.wprss-feed-state-container,
|
1043 |
+
div.wprss-feed-source-type
|
1044 |
+
{
|
1045 |
+
display: inline-block;
|
1046 |
+
}
|
1047 |
+
|
1048 |
+
/* the feed type icon */
|
1049 |
+
div.wprss-feed-source-type {
|
1050 |
+
float: right;
|
1051 |
+
}
|
1052 |
+
/* inactive color */
|
1053 |
+
.post-type-wprss_feed table.wp-list-table tr div.wprss-feed-source-type {
|
1054 |
+
color: #aaa;
|
1055 |
+
}
|
1056 |
+
/* active color */
|
1057 |
+
.post-type-wprss_feed table.wp-list-table tr.active div.wprss-feed-source-type {
|
1058 |
+
color: #ff792b;
|
1059 |
+
}
|
1060 |
+
/* youtube color */
|
1061 |
+
.post-type-wprss_feed table.wp-list-table tr.active div.wprss-feed-source-type.wprss-feed-source-type-yt {
|
1062 |
+
color: #ff0000;
|
1063 |
+
}
|
1064 |
+
|
1065 |
+
.post-type-wprss_feed table.wp-list-table tbody td.column-state {
|
1066 |
+
padding-right: 0;
|
1067 |
+
}
|
1068 |
+
|
1069 |
+
.column-updates > p {
|
1070 |
+
margin: 0 !important;
|
1071 |
+
}
|
1072 |
+
.post-type-wprss_feed table.wp-list-table.posts tbody tr .next-update-container {
|
1073 |
+
font-weight: bold;
|
1074 |
+
}
|
1075 |
+
.post-type-wprss_feed table.wp-list-table.posts tbody tr:not(.active) .next-update-container {
|
1076 |
+
display: none;
|
1077 |
+
}
|
1078 |
+
|
1079 |
+
/* The last update time in the feed sources page table */
|
1080 |
+
.post-type-wprss_feed table.wp-list-table.posts .last-update-num-items-container {
|
1081 |
+
color: #666;
|
1082 |
+
font-style: italic;
|
1083 |
+
font-size: 90%;
|
1084 |
+
}
|
1085 |
+
|
1086 |
+
/* The imported items link in the feed sources page - disabled when 0 items */
|
1087 |
+
.post-type-wprss_feed table.wp-list-table.posts .items-imported-link.has-imported-items {
|
1088 |
+
font-weight: bold;
|
1089 |
+
line-height: 20px;
|
1090 |
+
}
|
1091 |
+
.post-type-wprss_feed table.wp-list-table.posts .items-imported-link:not(.has-imported-items) {
|
1092 |
+
color: #777;
|
1093 |
+
pointer-events: none;
|
1094 |
+
}
|
1095 |
+
|
1096 |
+
/* The delete items row action in the feed sources page - hidden when 0 items */
|
1097 |
+
.post-type-wprss_feed table.wp-list-table.posts .row-actions .purge-posts:not(.has-imported-items) {
|
1098 |
+
display: none;
|
1099 |
+
}
|
1100 |
+
|
1101 |
+
/* Styles for the disabled "Fetch" and "Delete" feed source row actions */
|
1102 |
+
.post-type-wprss_feed table.wp-list-table.posts .row-actions a.wprss_fetch_items_ajax_action[disabled] {
|
1103 |
+
color: #555;
|
1104 |
+
}
|
1105 |
+
.post-type-wprss_feed table.wp-list-table.posts .row-actions a.wprss_delete_items_ajax_action[disabled] {
|
1106 |
+
color: #666;
|
1107 |
+
}
|
1108 |
+
|
1109 |
+
/* The feed updating/deleting spinner icon */
|
1110 |
+
.post-type-wprss_feed table.wp-list-table.posts .column-feed-count .spinner {
|
1111 |
+
float: none;
|
1112 |
+
vertical-align: bottom;
|
1113 |
+
}
|
1114 |
+
.post-type-wprss_feed table.wp-list-table.posts tr.wpra-feed-is-updating .column-feed-count .spinner,
|
1115 |
+
.post-type-wprss_feed table.wp-list-table.posts tr.wpra-feed-is-deleting .column-feed-count .spinner {
|
1116 |
+
visibility: visible;
|
1117 |
+
}
|
1118 |
+
|
1119 |
+
/*
|
1120 |
+
* TOGGLE SWITCH
|
1121 |
+
*/
|
1122 |
+
.wprss-switch {
|
1123 |
+
position: relative;
|
1124 |
+
display: inline-block;
|
1125 |
+
width: 34px;
|
1126 |
+
height: 18px;
|
1127 |
+
}
|
1128 |
+
.wprss-switch input {
|
1129 |
+
opacity: 0;
|
1130 |
+
width: 0;
|
1131 |
+
height: 0;
|
1132 |
+
}
|
1133 |
+
.wprss-switch-slider {
|
1134 |
+
position: absolute;
|
1135 |
+
cursor: pointer;
|
1136 |
+
top: 0;
|
1137 |
+
left: 0;
|
1138 |
+
right: 0;
|
1139 |
+
bottom: 0;
|
1140 |
+
border-radius: 34px;
|
1141 |
+
background-color: #ccc;
|
1142 |
+
transition: .2s;
|
1143 |
+
-webkit-transition: .2s;
|
1144 |
+
}
|
1145 |
+
.wprss-switch-slider:before {
|
1146 |
+
position: absolute;
|
1147 |
+
content: "";
|
1148 |
+
width: 12px;
|
1149 |
+
height: 12px;
|
1150 |
+
left: 4px;
|
1151 |
+
bottom: 3px;
|
1152 |
+
border-radius: 50%;
|
1153 |
+
background-color: white;
|
1154 |
+
transition: .2s;
|
1155 |
+
-webkit-transition: .2s;
|
1156 |
+
}
|
1157 |
+
input:checked + .wprss-switch-slider {
|
1158 |
+
background-color: #0baa3c;
|
1159 |
+
}
|
1160 |
+
input:focus + .wprss-switch-slider {
|
1161 |
+
box-shadow: 0 0 1px #2196F3;
|
1162 |
+
}
|
1163 |
+
input:checked + .wprss-switch-slider:before {
|
1164 |
+
-webkit-transform: translateX(14px);
|
1165 |
+
-ms-transform: translateX(14px);
|
1166 |
+
transform: translateX(14px);
|
1167 |
+
}
|
@@ -7,3 +7,7 @@
|
|
7 |
bottom: 86px !important;
|
8 |
right: 20px !important;
|
9 |
}
|
|
|
|
|
|
|
|
7 |
bottom: 86px !important;
|
8 |
right: 20px !important;
|
9 |
}
|
10 |
+
|
11 |
+
#beacon-container iframe {
|
12 |
+
z-index: 1000000 !important;
|
13 |
+
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1 +1 @@
|
|
1 |
-
.mobile-collapsed{display:inherit}.mobile-only{display:none!important}@media (max-width:782px){.mobile-only{display:inherit!important}.mobile-collapsed{display:none!important}}.wrap--wpra-update{padding-top:1rem}@media (min-width:782px){.wrap--wpra-update{width:100%;max-width:
|
1 |
+
.mobile-collapsed{display:inherit}.mobile-only{display:none!important}@media (max-width:782px){.mobile-only{display:inherit!important}.mobile-collapsed{display:none!important}}.wrap--wpra-update{padding-top:1rem}@media (min-width:782px){.wrap--wpra-update{width:100%;max-width:1400px;margin:0 auto;padding-right:20px;box-sizing:border-box}}.wpra-text-center{text-align:center}.wpra-updates ul{list-style:disc;padding:0 1.25rem}.wpra-inline-form{display:flex;align-items:baseline}.wpra-inline-form button{margin-right:12px!important}.wpra-inline-form small{font-size:12px;opacity:.75}.wpra-update-head__title{font-size:24px;font-weight:500;padding:1.5rem 0;line-height:1.4}.wpra-update__logo img{width:56px}.button-icon span{vertical-align:baseline;margin-right:-7px;opacity:.6;font-size:16px;top:4px;position:relative}.wpra-links{padding-top:.5rem}.wpra-update-head__link{font-size:1rem;padding-bottom:1.5rem;line-height:1.5}.wpra-update-feature{display:flex;padding:0 18px 12px!important}@media (max-width:782px){.wpra-update-feature{flex-direction:column-reverse}}@media (min-width:782px){.wpra-update-feature__text{padding-right:12px}}.wpra-update-feature__text h3{margin-top:8px}@media (max-width:782px){.wpra-update-feature__text h3{margin-top:16px}}.wpra-update-feature__text p{font-size:14px}.wpra-update-feature__image{flex-shrink:0;width:30rem;overflow:hidden;min-height:336px;position:relative;margin:-11px -18px -23px 0;cursor:pointer;transition-duration:.5s}.wpra-update-feature__image:hover{transition-duration:.2s;background-color:#111}.wpra-update-feature__image:hover img{opacity:.95}.wpra-update-feature__image:hover:before{content:"\F177";display:block;position:absolute;top:calc(50% - 45px);width:100%;height:90px;font-size:5em;font-family:dashicons;text-align:center;z-index:100;opacity:.5}@media (max-width:782px){.wpra-update-feature__image{flex-shrink:unset;width:unset;min-height:unset;max-height:15rem;margin:-11px -18px 0}}.wpra-update-feature__image img{max-height:29rem;position:absolute}@media (max-width:782px){.wpra-update-feature__image img{max-height:unset;position:unset;max-width:100%}}
|
@@ -5,8 +5,10 @@
|
|
5 |
|
6 |
@include breakpoint(not-mobile) {
|
7 |
width: 100%;
|
8 |
-
max-width:
|
9 |
margin: 0 auto;
|
|
|
|
|
10 |
}
|
11 |
}
|
12 |
|
@@ -92,11 +94,37 @@
|
|
92 |
|
93 |
.wpra-update-feature__image {
|
94 |
flex-shrink: 0;
|
95 |
-
width:
|
96 |
overflow: hidden;
|
97 |
min-height: 336px;
|
98 |
position: relative;
|
99 |
margin: -11px -18px -23px 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
@include breakpoint(mobile) {
|
102 |
flex-shrink: unset;
|
5 |
|
6 |
@include breakpoint(not-mobile) {
|
7 |
width: 100%;
|
8 |
+
max-width: 1400px;
|
9 |
margin: 0 auto;
|
10 |
+
padding-right: 20px;
|
11 |
+
box-sizing: border-box;
|
12 |
}
|
13 |
}
|
14 |
|
94 |
|
95 |
.wpra-update-feature__image {
|
96 |
flex-shrink: 0;
|
97 |
+
width: 30rem;
|
98 |
overflow: hidden;
|
99 |
min-height: 336px;
|
100 |
position: relative;
|
101 |
margin: -11px -18px -23px 0;
|
102 |
+
cursor: pointer;
|
103 |
+
transition-duration: 0.5s;
|
104 |
+
|
105 |
+
&:hover {
|
106 |
+
transition-duration: 0.2s;
|
107 |
+
background-color: #111;
|
108 |
+
|
109 |
+
img {
|
110 |
+
opacity: 0.95;
|
111 |
+
|
112 |
+
}
|
113 |
+
|
114 |
+
&::before {
|
115 |
+
content: "\f177";
|
116 |
+
display: block;
|
117 |
+
position: absolute;
|
118 |
+
top: calc(50% - 45px);
|
119 |
+
width: 100%;
|
120 |
+
height: 90px;
|
121 |
+
font-size: 5em;
|
122 |
+
font-family: dashicons;
|
123 |
+
text-align: center;
|
124 |
+
z-index: 100;
|
125 |
+
opacity: 0.5;
|
126 |
+
}
|
127 |
+
}
|
128 |
|
129 |
@include breakpoint(mobile) {
|
130 |
flex-shrink: unset;
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -29,8 +29,8 @@ abstract class AbstractResponse extends Message\AbstractResponse implements Core
|
|
29 |
*
|
30 |
* @since 4.9
|
31 |
* @see Core\DataObject::addData()
|
32 |
-
* @param
|
33 |
-
* @param
|
34 |
* @return \Aventura\Wprss\Core\Http\Message\Ajax\AbstractResponse
|
35 |
*/
|
36 |
public function setAjaxData($key, $value = null) {
|
29 |
*
|
30 |
* @since 4.9
|
31 |
* @see Core\DataObject::addData()
|
32 |
+
* @param string $key
|
33 |
+
* @param mixed $value
|
34 |
* @return \Aventura\Wprss\Core\Http\Message\Ajax\AbstractResponse
|
35 |
*/
|
36 |
public function setAjaxData($key, $value = null) {
|
@@ -274,6 +274,7 @@ class Settings {
|
|
274 |
$addonId = $args[0];
|
275 |
$manager = $this->getManager();
|
276 |
$data = $manager->checkLicense( $addonId, 'ALL' );
|
|
|
277 |
$status = is_string( $data ) ? $data : $data->license;
|
278 |
if ( $status === 'site_inactive' ) $status = 'inactive';
|
279 |
if ( $status === 'item_name_mismatch' ) $status = 'invalid';
|
274 |
$addonId = $args[0];
|
275 |
$manager = $this->getManager();
|
276 |
$data = $manager->checkLicense( $addonId, 'ALL' );
|
277 |
+
$data = empty($data) ? 'invalid' : $data;
|
278 |
$status = is_string( $data ) ? $data : $data->license;
|
279 |
if ( $status === 'site_inactive' ) $status = 'inactive';
|
280 |
if ( $status === 'item_name_mismatch' ) $status = 'invalid';
|
@@ -14,11 +14,17 @@
|
|
14 |
<div class="wrap">
|
15 |
<h2><?php _e( 'More Features With Our Premium Add-Ons', WPRSS_TEXT_DOMAIN ); ?></h2>
|
16 |
<p><?php echo sprintf(__( 'The following <a href="%1$s" target="_blank">add-ons</a> are available to increase the functionality of the WP RSS Aggregator plugin.', WPRSS_TEXT_DOMAIN ), 'https://www.wprssaggregator.com/extensions') ?></p>
|
17 |
-
<p
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
<div id="add-ons" class="clearfix">
|
24 |
|
@@ -67,52 +73,45 @@
|
|
67 |
),
|
68 |
'ftr' => array(
|
69 |
'title' => 'Full Text RSS Feeds',
|
70 |
-
'description' => __("
|
71 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
72 |
'basename' => 'wp-rss-full-text-feeds/wp-rss-full-text.php',
|
73 |
'url' => 'https://www.wprssaggregator.com/extension/full-text-rss-feeds/'
|
74 |
),
|
75 |
-
'
|
76 |
-
'title' => '
|
77 |
-
'description' => __(
|
78 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
79 |
-
'basename' => 'wp-rss-
|
80 |
-
'url' => 'https://www.wprssaggregator.com/extension/
|
81 |
),
|
82 |
-
'
|
83 |
-
'title' => '
|
84 |
-
'description' => __("
|
85 |
-
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
86 |
-
'basename' => 'wp-rss-spinnerchief/wp-rss-spinnerchief.php',
|
87 |
-
'url' => 'https://www.wprssaggregator.com/extension/spinnerchief/'
|
88 |
-
),
|
89 |
-
'et' => array(
|
90 |
-
'title' => 'Excerpts & Thumbnails',
|
91 |
-
'description' => __("Displays an excerpt and thumbnail image (taken from within the RSS feed) together with the title, date and source of each feed item. It uses the shortcode to display the feed items.", WPRSS_TEXT_DOMAIN),
|
92 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
93 |
-
'basename' => 'wp-rss-
|
94 |
-
'url' => 'https://www.wprssaggregator.com/extension/
|
95 |
),
|
96 |
'c' => array(
|
97 |
-
'title' => 'Categories',
|
98 |
'description' => __("Categorises your feed sources and allows you to display feed items from a particular category within your site using the shortcode parameters.", WPRSS_TEXT_DOMAIN),
|
99 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
100 |
'basename' => 'wp-rss-categories/wp-rss-categories.php',
|
101 |
'url' => 'https://www.wprssaggregator.com/extension/categories/'
|
102 |
),
|
103 |
-
'
|
104 |
-
'title' => '
|
105 |
-
'description' => __("
|
106 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
107 |
-
'basename' => 'wp-rss-
|
108 |
-
'url' => 'https://www.wprssaggregator.com/extension/
|
109 |
),
|
110 |
-
'
|
111 |
-
'title' => '
|
112 |
-
'description' => __("
|
113 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
114 |
-
'basename' => 'wp-rss-
|
115 |
-
'url' => 'https://www.wprssaggregator.com/extension/
|
116 |
),
|
117 |
));
|
118 |
}
|
14 |
<div class="wrap">
|
15 |
<h2><?php _e( 'More Features With Our Premium Add-Ons', WPRSS_TEXT_DOMAIN ); ?></h2>
|
16 |
<p><?php echo sprintf(__( 'The following <a href="%1$s" target="_blank">add-ons</a> are available to increase the functionality of the WP RSS Aggregator plugin.', WPRSS_TEXT_DOMAIN ), 'https://www.wprssaggregator.com/extensions') ?></p>
|
17 |
+
<p>
|
18 |
+
<?php
|
19 |
+
$pricingLink = sprintf(
|
20 |
+
'<a href="%s" target="_blank">%s</a>',
|
21 |
+
'https://www.wprssaggregator.com/pricing',
|
22 |
+
_x('pricing plans', 'Check out our pricing plans for bigger savings!', 'wprss')
|
23 |
+
);
|
24 |
+
|
25 |
+
printf(_x('Check out our %s for bigger savings!', '%s = "pricing plans"', 'wprss'), $pricingLink);
|
26 |
+
?>
|
27 |
+
</p>
|
28 |
|
29 |
<div id="add-ons" class="clearfix">
|
30 |
|
73 |
),
|
74 |
'ftr' => array(
|
75 |
'title' => 'Full Text RSS Feeds',
|
76 |
+
'description' => __("An extension for Feed to Post that adds connectivity to our premium full text service, which allows you to import the full post content for an unlimited number of feed items per feed source, even when the feed itself doesn't provide it", WPRSS_TEXT_DOMAIN),
|
77 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
78 |
'basename' => 'wp-rss-full-text-feeds/wp-rss-full-text.php',
|
79 |
'url' => 'https://www.wprssaggregator.com/extension/full-text-rss-feeds/'
|
80 |
),
|
81 |
+
'tmp' => array(
|
82 |
+
'title' => 'Templates',
|
83 |
+
'description' => __('Premium templates to display images and excerpts in various ways. It includes a fully customisable grid template and a list template that includes excerpts & thumbnails, both of which will spruce up your site!', WPRSS_TEXT_DOMAIN),
|
84 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
85 |
+
'basename' => 'wp-rss-templates/wp-rss-templates.php',
|
86 |
+
'url' => 'https://www.wprssaggregator.com/extension/templates/'
|
87 |
),
|
88 |
+
'kf' => array(
|
89 |
+
'title' => 'Keyword Filtering',
|
90 |
+
'description' => __("Filters the feed items to be imported based on your own keywords, key phrases, or tags; you only get the items you're interested in. It is compatible with all other add-ons.", WPRSS_TEXT_DOMAIN),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
92 |
+
'basename' => 'wp-rss-keyword-filtering/wp-rss-keyword-filtering.php',
|
93 |
+
'url' => 'https://www.wprssaggregator.com/extension/keyword-filtering/'
|
94 |
),
|
95 |
'c' => array(
|
96 |
+
'title' => 'Source Categories',
|
97 |
'description' => __("Categorises your feed sources and allows you to display feed items from a particular category within your site using the shortcode parameters.", WPRSS_TEXT_DOMAIN),
|
98 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
99 |
'basename' => 'wp-rss-categories/wp-rss-categories.php',
|
100 |
'url' => 'https://www.wprssaggregator.com/extension/categories/'
|
101 |
),
|
102 |
+
'wai' => array(
|
103 |
+
'title' => 'WordAi',
|
104 |
+
'description' => __("An extension for Feed to Post that allows you to integrate the WordAi article spinner so that the imported content is both completely unique and completely readable.", WPRSS_TEXT_DOMAIN),
|
105 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
106 |
+
'basename' => 'wp-rss-wordai/wp-rss-wordai.php',
|
107 |
+
'url' => 'https://www.wprssaggregator.com/extension/wordai/'
|
108 |
),
|
109 |
+
'spc' => array(
|
110 |
+
'title' => 'SpinnerChief',
|
111 |
+
'description' => __("An extension for Feed to Post that allows you to integrate the SpinnerChief article spinner so that the imported content is both completely unique and completely readable.", WPRSS_TEXT_DOMAIN),
|
112 |
'thumbnail' => WPRSS_IMG . 'add-ons/wprss.jpg',
|
113 |
+
'basename' => 'wp-rss-spinnerchief/wp-rss-spinnerchief.php',
|
114 |
+
'url' => 'https://www.wprssaggregator.com/extension/spinnerchief/'
|
115 |
),
|
116 |
));
|
117 |
}
|
@@ -1079,7 +1079,7 @@ class WPRSS_Admin_Notices {
|
|
1079 |
?>
|
1080 |
|
1081 |
<div id="<?php echo $notice['id'] ?>" class="<?php echo $notice['notice_type'] ?> <?php echo $notice['notice_element_class'] ?> <?php echo $this->get_notice_base_class() ?> dismiss-mode-<?php echo $notice['dismiss_mode'] ?>">
|
1082 |
-
<div class="notice-
|
1083 |
<?php echo $notice['content'] ?>
|
1084 |
</div>
|
1085 |
<?php if ($notice['dismiss_mode'] !== NoticeInterface::DISMISS_MODE_NONE): ?>
|
1079 |
?>
|
1080 |
|
1081 |
<div id="<?php echo $notice['id'] ?>" class="<?php echo $notice['notice_type'] ?> <?php echo $notice['notice_element_class'] ?> <?php echo $this->get_notice_base_class() ?> dismiss-mode-<?php echo $notice['dismiss_mode'] ?>">
|
1082 |
+
<div class="notice-inside">
|
1083 |
<?php echo $notice['content'] ?>
|
1084 |
</div>
|
1085 |
<?php if ($notice['dismiss_mode'] !== NoticeInterface::DISMISS_MODE_NONE): ?>
|
@@ -1,102 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Adds a dashboard page for the admin
|
4 |
-
* It is triggered on plugin activation and upon
|
5 |
-
* update.
|
6 |
-
*
|
7 |
-
* @since 3.3
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
// Exit if the page is accessed directly
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
-
|
14 |
-
|
15 |
-
add_action( 'admin_menu', 'wprss_admin_menu' );
|
16 |
-
/**
|
17 |
-
* Adds a dashboard page.
|
18 |
-
* Usde to add the Welcome Page to the dashboard.
|
19 |
-
*
|
20 |
-
* @since 3.3
|
21 |
-
*/
|
22 |
-
function wprss_admin_menu() {
|
23 |
-
// Welcome Page
|
24 |
-
add_dashboard_page(
|
25 |
-
__( 'Welcome to WP RSS Aggregator', WPRSS_TEXT_DOMAIN ),
|
26 |
-
__( 'Welcome to WP RSS Aggregator', WPRSS_TEXT_DOMAIN ),
|
27 |
-
'manage_options',
|
28 |
-
'wprss-welcome',
|
29 |
-
'wprss_show_welcome_screen'
|
30 |
-
);
|
31 |
-
|
32 |
-
}
|
33 |
-
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Callback for the Welcome Dashboard page.
|
37 |
-
* It merely includes the contents of the admin-welcome.php file,
|
38 |
-
* which contains the markup for the welcome screen.
|
39 |
-
*
|
40 |
-
* @since 3.3
|
41 |
-
*/
|
42 |
-
function wprss_show_welcome_screen() {
|
43 |
-
include_once( 'admin-welcome.php' );
|
44 |
-
}
|
45 |
-
|
46 |
-
add_action( 'admin_head', 'wprss_admin_head' );
|
47 |
-
/**
|
48 |
-
* Removes the dashboard welcome page from the dashboard
|
49 |
-
* menu, and adds some styles for the welcome page.
|
50 |
-
*
|
51 |
-
* @since 3.3
|
52 |
-
*/
|
53 |
-
function wprss_admin_head() {
|
54 |
-
remove_submenu_page( 'index.php', 'wprss-welcome' );
|
55 |
-
?>
|
56 |
-
<style type="text/css" media="screen">
|
57 |
-
/*<![CDATA[*/
|
58 |
-
|
59 |
-
/*.wprss-welcome-table > tbody > tr > td {
|
60 |
-
line-height: 30px;
|
61 |
-
}
|
62 |
-
.wprss-welcome-table > tbody > tr {
|
63 |
-
font-size: 1.3em;
|
64 |
-
font-weight: normal;
|
65 |
-
}
|
66 |
-
.wprss-welcome-table > thead > tr > th{
|
67 |
-
font-size: 2em;
|
68 |
-
border-bottom: 8px solid #999;
|
69 |
-
}*/
|
70 |
-
|
71 |
-
/*]]>*/
|
72 |
-
</style>
|
73 |
-
<?php
|
74 |
-
}
|
75 |
-
|
76 |
-
add_filter( 'admin_footer_text', 'wprss_admin_footer' );
|
77 |
-
/**
|
78 |
-
* Adds footer text on the plugin pages.
|
79 |
-
*
|
80 |
-
* @param string $footer The footer text to filter
|
81 |
-
* @return string The filtered footer text with added plugin text, or the param
|
82 |
-
* value if the page is not specific to the plugin.
|
83 |
-
*/
|
84 |
-
function wprss_admin_footer( $footer ) {
|
85 |
-
// Current post type
|
86 |
-
global $typenow;
|
87 |
-
// Check if type is a plugin type. If not, stop
|
88 |
-
// Plugin type is in the form 'wprss_*'' where * is 'feed', 'blacklist', etc)
|
89 |
-
if ( stripos( $typenow, 'wprss_' ) !== 0 )
|
90 |
-
return $footer;
|
91 |
-
// Prepare fragments of the message
|
92 |
-
$thank_you = sprintf(
|
93 |
-
__( 'Thank you for using <a href="%1$s" target="_blank">WP RSS Aggregator</a>!', WPRSS_TEXT_DOMAIN ),
|
94 |
-
'https://www.wprssaggregator.com/'
|
95 |
-
);
|
96 |
-
$rate_us = sprintf(
|
97 |
-
__( 'Please <a href="%1$s" target="_blank">rate us</a>!', WPRSS_TEXT_DOMAIN ),
|
98 |
-
'https://wordpress.org/support/view/plugin-reviews/wp-rss-aggregator?filter=5#postform'
|
99 |
-
);
|
100 |
-
// Return the final text
|
101 |
-
return sprintf( '%1$s | <span class="wp-rss-footer-text">%2$s %3$s</span>', $footer, $thank_you, $rate_us );
|
102 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -50,36 +50,6 @@ use Psr\Log\LogLevel;
|
|
50 |
)
|
51 |
);
|
52 |
|
53 |
-
$operations['render-error-log'] = apply_filters(
|
54 |
-
'wprss_render_error_log_operation',
|
55 |
-
array(
|
56 |
-
'nonce' => null,
|
57 |
-
'run' => null,
|
58 |
-
'redirect' => 'edit.php?post_type=wprss_feed&page=wprss-debugging',
|
59 |
-
'render' => 'wprss_debug_render_error_log'
|
60 |
-
)
|
61 |
-
);
|
62 |
-
|
63 |
-
$operations['download-error-log'] = apply_filters(
|
64 |
-
'wprss_debug_download_error_log_operation',
|
65 |
-
array(
|
66 |
-
'nonce' => 'wprss-download-error-log',
|
67 |
-
'run' => 'wprss_download_log',
|
68 |
-
'redirect' => 'edit.php?post_type=wprss_feed&page=wprss-debugging',
|
69 |
-
'render' => 'wprss_debug_download_log_button'
|
70 |
-
)
|
71 |
-
);
|
72 |
-
|
73 |
-
$operations['clear-error-log'] = apply_filters(
|
74 |
-
'wprss_debug_error_log_operation',
|
75 |
-
array(
|
76 |
-
'nonce' => 'wprss-clear-error-log',
|
77 |
-
'run' => 'wprss_clear_log',
|
78 |
-
'redirect' => 'edit.php?post_type=wprss_feed&page=wprss-debugging&debug_message=3',
|
79 |
-
'render' => 'wprss_debug_clear_log_button'
|
80 |
-
)
|
81 |
-
);
|
82 |
-
|
83 |
$operations ['restore-settings'] = apply_filters(
|
84 |
'wprss_debug_restore_settings_operation',
|
85 |
array(
|
@@ -109,11 +79,26 @@ use Psr\Log\LogLevel;
|
|
109 |
// Check which of the operations needs to be run
|
110 |
foreach ( $debug_operations as $id => $operation ) {
|
111 |
// If page loading after having clicked 'Update all fields'
|
112 |
-
if ( isset(
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
116 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
}
|
118 |
}
|
119 |
|
@@ -285,7 +270,6 @@ use Psr\Log\LogLevel;
|
|
285 |
array(
|
286 |
'1' => 'debug_feeds_updating',
|
287 |
'2' => 'debug_feeds_reimporting',
|
288 |
-
'3' => 'debug_cleared_log',
|
289 |
'4' => 'debug_settings_reset',
|
290 |
)
|
291 |
);
|
@@ -361,6 +345,7 @@ use Psr\Log\LogLevel;
|
|
361 |
?>
|
362 |
</div>
|
363 |
<?php
|
|
|
364 |
}
|
365 |
|
366 |
|
50 |
)
|
51 |
);
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
$operations ['restore-settings'] = apply_filters(
|
54 |
'wprss_debug_restore_settings_operation',
|
55 |
array(
|
79 |
// Check which of the operations needs to be run
|
80 |
foreach ( $debug_operations as $id => $operation ) {
|
81 |
// If page loading after having clicked 'Update all fields'
|
82 |
+
if ( !isset($_POST[$id]) ) {
|
83 |
+
continue;
|
84 |
+
}
|
85 |
+
|
86 |
+
$nonce = isset($operation['nonce']) ? $operation['nonce'] : null;
|
87 |
+
if ( ! check_admin_referer( $nonce ) ) {
|
88 |
+
continue;
|
89 |
}
|
90 |
+
|
91 |
+
$run = isset($operation['run']) ? $operation['run'] : null;
|
92 |
+
if ( is_callable($run) ) {
|
93 |
+
call_user_func( $run );
|
94 |
+
}
|
95 |
+
|
96 |
+
$redirect = isset( $operation['redirect'] )
|
97 |
+
? $operation['redirect']
|
98 |
+
: 'edit.php?post_type=wprss_feed&page=wprss-debugging';
|
99 |
+
wp_redirect( $redirect );
|
100 |
+
|
101 |
+
break;
|
102 |
}
|
103 |
}
|
104 |
|
270 |
array(
|
271 |
'1' => 'debug_feeds_updating',
|
272 |
'2' => 'debug_feeds_reimporting',
|
|
|
273 |
'4' => 'debug_settings_reset',
|
274 |
)
|
275 |
);
|
345 |
?>
|
346 |
</div>
|
347 |
<?php
|
348 |
+
wp_enqueue_script('wpra-admin-debug-js', WPRSS_JS . 'admin-debug.js', ['jquery'], WPRSS_VERSION, true);
|
349 |
}
|
350 |
|
351 |
|
@@ -5,6 +5,20 @@
|
|
5 |
* @package WP RSS Aggregator
|
6 |
*/
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
add_filter( 'manage_wprss_feed_posts_columns', 'wprss_set_feed_custom_columns', 20, 1 );
|
10 |
/**
|
@@ -13,23 +27,27 @@
|
|
13 |
* @since 2.0
|
14 |
*/
|
15 |
function wprss_set_feed_custom_columns( $columns ) {
|
|
|
16 |
|
17 |
$columns = array(
|
18 |
'cb' => '<input type="checkbox" />',
|
19 |
-
'errors' => '',
|
20 |
-
'title' => __( 'Name', WPRSS_TEXT_DOMAIN ),
|
21 |
);
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
$columns = apply_filters( 'wprss_set_feed_custom_columns', $columns );
|
24 |
|
25 |
-
|
26 |
-
if ( !isset( $_GET['post_status'] ) || $_GET['post_status'] !== 'trash' ) {
|
27 |
-
$columns['state'] = __( 'State', WPRSS_TEXT_DOMAIN );
|
28 |
$columns['updates'] = __( 'Updates', WPRSS_TEXT_DOMAIN );
|
29 |
$columns['feed-count'] = __( apply_filters( 'wprss_feed_items_count_column', 'Imported items' ), WPRSS_TEXT_DOMAIN );
|
30 |
}
|
31 |
|
32 |
-
return $columns;
|
33 |
}
|
34 |
|
35 |
|
@@ -42,34 +60,41 @@
|
|
42 |
function wprss_show_custom_columns( $column, $post_id ) {
|
43 |
|
44 |
switch ( $column ) {
|
45 |
-
case 'errors':
|
46 |
-
$errors = get_post_meta( $post_id, 'wprss_error_last_import', true );
|
47 |
-
$showClass = ( $errors !== '' )? 'wprss-show' : '';
|
48 |
-
$default_msg = __( "This feed source experienced an error during the last feed fetch or validation check. Re-check the feed source URL or check the Error Log in the Debugging page for more details.", WPRSS_TEXT_DOMAIN );
|
49 |
-
$msg = strlen( $errors ) > 0 ? $errors : $default_msg;
|
50 |
-
echo sprintf('<i title="%1$s" class="fa fa-warning fa-fw wprss-feed-error-symbol %2$s"></i>', esc_attr($msg), $showClass);
|
51 |
-
break;
|
52 |
case 'state':
|
53 |
-
$
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
?>
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
<
|
66 |
-
|
67 |
-
<i class='fa fa-<?php echo $icon; ?>'></i>
|
68 |
-
</button>
|
69 |
-
</p>
|
70 |
<?php
|
71 |
|
72 |
-
|
73 |
|
74 |
case 'updates':
|
75 |
// Get the update interval
|
@@ -88,41 +113,83 @@
|
|
88 |
if ( wprss_is_feed_source_active( $post_id ) ) {
|
89 |
$next_update_text = $next_update === FALSE ? __( 'None', WPRSS_TEXT_DOMAIN ) : human_time_diff( $next_update, time() );
|
90 |
} else {
|
91 |
-
$next_update_text = __( '
|
92 |
}
|
93 |
update_post_meta( $post_id, 'wprss_next_update', $next_update_text );
|
94 |
|
|
|
95 |
?>
|
96 |
|
97 |
-
<p>
|
98 |
-
<?php _e( 'Next update
|
99 |
<code class="next-update">
|
100 |
<?php echo $next_update_text; ?>
|
101 |
</code>
|
102 |
</p>
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
113 |
|
|
|
114 |
break;
|
115 |
|
116 |
case 'feed-count':
|
117 |
$items = wprss_get_feed_items_for_source( $post_id );
|
118 |
-
$
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
|
|
|
|
|
121 |
?>
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
<?php
|
127 |
|
128 |
// Set meta field for items imported
|
@@ -142,9 +209,9 @@
|
|
142 |
function wprss_feed_sortable_columns() {
|
143 |
$sortable_columns = array(
|
144 |
// meta column id => sortby value used in query
|
|
|
145 |
'title' => 'title',
|
146 |
'updates' => 'updates',
|
147 |
-
'state' => 'state',
|
148 |
'feed-count' => 'feed-count'
|
149 |
);
|
150 |
return apply_filters( 'wprss_feed_sortable_columns', $sortable_columns );
|
@@ -328,7 +395,9 @@
|
|
328 |
|
329 |
$page = isset( $_GET['paged'] )? '&paged=' . $_GET['paged'] : '';
|
330 |
if ( get_post_type($post) === 'wprss_feed_item' ) {
|
331 |
-
|
|
|
|
|
332 |
unset( $actions[ 'view' ] );
|
333 |
//unset( $actions[ 'trash' ] );
|
334 |
unset( $actions[ 'inline hide-if-no-js' ] );
|
@@ -340,76 +409,18 @@
|
|
340 |
|
341 |
unset( $actions[ 'view'] );
|
342 |
unset( $actions[ 'inline hide-if-no-js'] );
|
343 |
-
if ( get_post_status( $post->ID ) !== 'trash' ) {
|
344 |
-
$trash = $actions['trash'];
|
345 |
-
unset( $actions['trash'] );
|
346 |
-
|
347 |
-
$view_items_link = apply_filters(
|
348 |
-
'wprss_view_feed_items_row_action_link',
|
349 |
-
admin_url( 'edit.php?post_type=wprss_feed_item&wprss_feed=' . $post->ID ),
|
350 |
-
$post->ID
|
351 |
-
);
|
352 |
-
$view_items_text = apply_filters( 'wprss_view_feed_items_row_action_text', __( 'View Items', WPRSS_TEXT_DOMAIN ) );
|
353 |
-
$actions['view-items'] = '<a href="' . $view_items_link . '">' . $view_items_text . '</a>';
|
354 |
-
|
355 |
-
$fetch_items_row_action_text = apply_filters( 'wprss_fetch_items_row_action_text', __( 'Fetch Items', WPRSS_TEXT_DOMAIN ) );
|
356 |
-
$actions[ 'fetch' ] = '<a href="javascript:;" class="wprss_ajax_action" pid="'. $post->ID .'" purl="'.home_url().'/wp-admin/admin-ajax.php">' . $fetch_items_row_action_text . '</a>';
|
357 |
-
|
358 |
-
$purge_feeds_row_action_text = apply_filters( 'wprss_purge_feeds_row_action_text', __( 'Delete Items', WPRSS_TEXT_DOMAIN ) );
|
359 |
-
$purge_feeds_row_action_title = apply_filters( 'wprss_purge_feeds_row_action_title', __( 'Delete feed items imported by this feed source', WPRSS_TEXT_DOMAIN ) );
|
360 |
-
$actions['purge-posts'] = "<a href='".admin_url("edit.php?post_type=wprss_feed&purge-feed-items=" . $post->ID . $page ) . "' title='" . $purge_feeds_row_action_title . "' >" . __( $purge_feeds_row_action_text, WPRSS_TEXT_DOMAIN ) . "</a>";
|
361 |
-
|
362 |
-
$actions['trash'] = $trash;
|
363 |
-
}
|
364 |
}
|
365 |
return apply_filters( 'wprss_remove_row_actions', $actions );
|
366 |
}
|
367 |
|
368 |
|
369 |
-
add_action( 'admin_init', 'check_delete_for_feed_source' );
|
370 |
-
/**
|
371 |
-
* Checks the GET data for the delete per feed source action request
|
372 |
-
*
|
373 |
-
* @since 3.5
|
374 |
-
*/
|
375 |
-
function check_delete_for_feed_source( $source_id = NULL ) {
|
376 |
-
if ( ! current_user_can( 'delete_feed_sources' ) ) return;
|
377 |
-
// then we need to check the GET data for the request
|
378 |
-
if ( isset( $_GET['purge-feed-items'] ) ) {
|
379 |
-
$source_id = $_GET['purge-feed-items'];
|
380 |
-
// Schedule a job that runs this function with the source id parameter
|
381 |
-
wp_schedule_single_event( time(), 'wprss_delete_feed_items_from_source_hook', array( $source_id ) );
|
382 |
-
// Set a transient
|
383 |
-
set_transient( 'wprss_delete_posts_by_source_notif', 'true', 30 );
|
384 |
-
// Mark feed as deleting its items
|
385 |
-
update_post_meta( $source_id, 'wprss_feed_is_deleting_items', time() );
|
386 |
-
// check pagination
|
387 |
-
$page = isset( $_GET['paged'] )? '&paged=' . $_GET['paged'] : '';
|
388 |
-
// Refresh the page without the GET parameter
|
389 |
-
header( 'Location: ' . admin_url( 'edit.php?post_type=wprss_feed' . $page ) );
|
390 |
-
exit();
|
391 |
-
} else {
|
392 |
-
// Get the notification transient
|
393 |
-
$transient = get_transient( 'wprss_delete_posts_by_source_notif' );
|
394 |
-
// If the transient is set and is set to 'true'
|
395 |
-
if ( $transient !== FALSE && $transient === 'true' ) {
|
396 |
-
// delete it
|
397 |
-
delete_transient( 'wprss_delete_posts_by_source_notif' );
|
398 |
-
// Add an action to show the notification
|
399 |
-
wprss()->getAdminAjaxNotices()->addNotice('deleting_feed_items');
|
400 |
-
// add_action( 'all_admin_notices', 'wprss_notify_about_deleting_source_feed_items' );
|
401 |
-
}
|
402 |
-
}
|
403 |
-
}
|
404 |
-
|
405 |
-
|
406 |
|
407 |
add_action( 'wprss_delete_feed_items_from_source_hook', 'wprss_delete_feed_items_of_feed_source', 10 , 1 );
|
408 |
/**
|
409 |
* Deletes the feed items of the feed source identified by the given ID.
|
410 |
*
|
411 |
-
* @param $source_id The ID of the feed source
|
412 |
* @since 3.5
|
|
|
413 |
*/
|
414 |
function wprss_delete_feed_items_of_feed_source( $source_id ) {
|
415 |
$force_delete = apply_filters( 'wprss_force_delete_when_by_source', TRUE );
|
@@ -424,7 +435,7 @@
|
|
424 |
array(
|
425 |
'meta_key' => 'wprss_feed_id',
|
426 |
'meta_value' => $source_id,
|
427 |
-
'post_type' =>
|
428 |
'post_status' => 'any',
|
429 |
'posts_per_page' => -1
|
430 |
)
|
@@ -435,6 +446,8 @@
|
|
435 |
$query->the_post();
|
436 |
wp_delete_post( get_the_ID(), $force_delete );
|
437 |
}
|
|
|
|
|
438 |
}
|
439 |
|
440 |
|
@@ -449,7 +462,7 @@
|
|
449 |
}
|
450 |
|
451 |
|
452 |
-
add_action( '
|
453 |
/**
|
454 |
* The AJAX function for the 'Fetch Feed Items' row action on the
|
455 |
* 'All Feed Sources' page.
|
@@ -498,7 +511,11 @@
|
|
498 |
}
|
499 |
|
500 |
// Schedule the event for 5 seconds from now
|
501 |
-
|
|
|
|
|
|
|
|
|
502 |
wprss_flag_feed_as_updating( $id );
|
503 |
} catch (Exception $e) {
|
504 |
$response = wprss()->createAjaxErrorResponse($e);
|
@@ -510,10 +527,111 @@
|
|
510 |
}
|
511 |
|
512 |
$response->setAjaxData('message', $wprss->__(array('Fetch for feed source #%1$s successfully scheduled', $id)));
|
|
|
513 |
echo $response->getBody();
|
514 |
exit();
|
515 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
516 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
517 |
|
518 |
add_action('manage_posts_extra_tablenav', function($which) {
|
519 |
$screen = get_current_screen();
|
5 |
* @package WP RSS Aggregator
|
6 |
*/
|
7 |
|
8 |
+
// Adds the "active" class to the feed source list table rows, for active feed sources
|
9 |
+
add_filter( 'post_class', function( $classes, $class, $postId ) {
|
10 |
+
$post = get_post($postId);
|
11 |
+
|
12 |
+
if ($post->post_type !== 'wprss_feed') {
|
13 |
+
return $classes;
|
14 |
+
}
|
15 |
+
|
16 |
+
if (wprss_is_feed_source_active($postId)) {
|
17 |
+
$classes[] = 'active';
|
18 |
+
}
|
19 |
+
|
20 |
+
return $classes;
|
21 |
+
}, 10, 3 );
|
22 |
|
23 |
add_filter( 'manage_wprss_feed_posts_columns', 'wprss_set_feed_custom_columns', 20, 1 );
|
24 |
/**
|
27 |
* @since 2.0
|
28 |
*/
|
29 |
function wprss_set_feed_custom_columns( $columns ) {
|
30 |
+
$isTrashPage = filter_input(INPUT_GET, 'post_status') === 'trash';
|
31 |
|
32 |
$columns = array(
|
33 |
'cb' => '<input type="checkbox" />',
|
|
|
|
|
34 |
);
|
35 |
|
36 |
+
|
37 |
+
if (!$isTrashPage) {
|
38 |
+
$columns['state'] = __( 'State', WPRSS_TEXT_DOMAIN );
|
39 |
+
}
|
40 |
+
|
41 |
+
$columns['title'] = __( 'Name', WPRSS_TEXT_DOMAIN );
|
42 |
+
|
43 |
$columns = apply_filters( 'wprss_set_feed_custom_columns', $columns );
|
44 |
|
45 |
+
if (!$isTrashPage) {
|
|
|
|
|
46 |
$columns['updates'] = __( 'Updates', WPRSS_TEXT_DOMAIN );
|
47 |
$columns['feed-count'] = __( apply_filters( 'wprss_feed_items_count_column', 'Imported items' ), WPRSS_TEXT_DOMAIN );
|
48 |
}
|
49 |
|
50 |
+
return apply_filters( 'wprss_feed_columns', $columns );
|
51 |
}
|
52 |
|
53 |
|
60 |
function wprss_show_custom_columns( $column, $post_id ) {
|
61 |
|
62 |
switch ( $column ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
case 'state':
|
64 |
+
$switch_title = __('Activate or pause auto importing for this feed', 'wprss');
|
65 |
+
?>
|
66 |
+
<div class="wprss-feed-state-container" title="<?php echo esc_attr($switch_title); ?>">
|
67 |
+
<label class="wprss-switch">
|
68 |
+
<input type="checkbox"
|
69 |
+
class="wprss-toggle-feed-state"
|
70 |
+
autocomplete="off"
|
71 |
+
value="<?php echo esc_attr($post_id); ?>"
|
72 |
+
<?php checked(true, wprss_is_feed_source_active($post_id)) ?>
|
73 |
+
/>
|
74 |
+
<span class="wprss-switch-slider"></span>
|
75 |
+
</label>
|
76 |
+
</div>
|
77 |
|
78 |
+
<?php
|
79 |
+
$feed_type = 'rss';
|
80 |
+
$feed_icon = 'rss';
|
81 |
+
$icon_title = __('Normal RSS Feed', 'wprss');
|
82 |
+
|
83 |
+
if (wprss_is_feed_youtube($post_id)) {
|
84 |
+
$feed_type = 'yt';
|
85 |
+
$feed_icon = 'video-alt3';
|
86 |
+
$icon_title = __('YouTube Feed', 'wprss');
|
87 |
+
}
|
88 |
?>
|
89 |
+
|
90 |
+
<div class="wprss-feed-source-type wprss-feed-source-type-<?php echo $feed_type ?>"
|
91 |
+
title="<?php echo esc_attr($icon_title) ?>"
|
92 |
+
>
|
93 |
+
<span class="dashicons dashicons-<?php echo $feed_icon ?>"></span>
|
94 |
+
</div>
|
|
|
|
|
|
|
95 |
<?php
|
96 |
|
97 |
+
break;
|
98 |
|
99 |
case 'updates':
|
100 |
// Get the update interval
|
113 |
if ( wprss_is_feed_source_active( $post_id ) ) {
|
114 |
$next_update_text = $next_update === FALSE ? __( 'None', WPRSS_TEXT_DOMAIN ) : human_time_diff( $next_update, time() );
|
115 |
} else {
|
116 |
+
$next_update_text = __( '...', 'wprss' );
|
117 |
}
|
118 |
update_post_meta( $post_id, 'wprss_next_update', $next_update_text );
|
119 |
|
120 |
+
$timeago = empty($last_update) ? '' : human_time_diff( $last_update, time() );
|
121 |
?>
|
122 |
|
123 |
+
<p class="next-update-container">
|
124 |
+
<?php _e( 'Next update in', WPRSS_TEXT_DOMAIN ) ?>
|
125 |
<code class="next-update">
|
126 |
<?php echo $next_update_text; ?>
|
127 |
</code>
|
128 |
</p>
|
129 |
|
130 |
+
<p class="last-update-container"
|
131 |
+
style="display: <?php echo empty($timeago) ? 'none' : 'inline-block'; ?>">
|
132 |
+
<span class="last-update-num-items-container">
|
133 |
+
<?php echo _x( 'Updated', 'Example: "Updated 2 days ago"', 'wprss' ); ?>
|
134 |
+
<span class="last-update-time-container">
|
135 |
+
<code class="last-update-time"><?php printf(__('%1$s ago', 'wprss'), $timeago) ?></code>
|
136 |
+
</span>
|
137 |
+
(<span class="last-update-num-items"><?php echo
|
138 |
+
$last_update_items ?></span>
|
139 |
+
<?php echo _x('items', 'Example: "15 new"', 'wprss'); ?>)
|
140 |
+
</span>
|
141 |
+
</p>
|
142 |
|
143 |
+
<?php
|
144 |
break;
|
145 |
|
146 |
case 'feed-count':
|
147 |
$items = wprss_get_feed_items_for_source( $post_id );
|
148 |
+
$has_items_class = ($items->post_count > 0) ? 'has-imported-items' : '';
|
149 |
+
|
150 |
+
$errors = get_post_meta( $post_id, 'wprss_error_last_import', true );
|
151 |
+
$errorShowClass = ( $errors !== '' )? 'wprss-show' : '';
|
152 |
+
$default_msg = __( "This feed source experienced an error during the last feed fetch or validation check. Re-check the feed source URL or check the Error Log in the Debugging page for more details.", WPRSS_TEXT_DOMAIN );
|
153 |
+
$msg = strlen( $errors ) > 0 ? $errors : $default_msg;
|
154 |
+
$errorIcon = sprintf(
|
155 |
+
'<i title="%1$s" class="fa fa-warning fa-fw wprss-feed-error-symbol %2$s"></i>',
|
156 |
+
esc_attr($msg),
|
157 |
+
$errorShowClass
|
158 |
+
);
|
159 |
|
160 |
+
$view_items_url = admin_url( 'edit.php?post_type=wprss_feed_item&wprss_feed=' . $post_id );
|
161 |
+
$view_items_url = apply_filters( 'wprss_view_feed_items_row_action_link', $view_items_url, $post_id );
|
162 |
?>
|
163 |
+
<a href="<?php echo esc_attr($view_items_url); ?>"
|
164 |
+
class="items-imported-link <?php echo $has_items_class; ?>"
|
165 |
+
title="<?php echo esc_attr(__('View the imported items for this feed source', 'wprss')); ?>"
|
166 |
+
>
|
167 |
+
<span class="items-imported"><?php echo $items->post_count ?></span>
|
168 |
+
<?php _e('items', 'wprss') ?>
|
169 |
+
</a>
|
170 |
+
<div class="spinner"></div>
|
171 |
+
|
172 |
+
<?php echo $errorIcon; ?>
|
173 |
+
|
174 |
+
<div class="row-actions">
|
175 |
+
<span class="fetch">
|
176 |
+
<a href="javascript:;"
|
177 |
+
class="wprss_fetch_items_ajax_action"
|
178 |
+
pid="<?php echo esc_attr ($post_id); ?>"
|
179 |
+
purl="<?php echo admin_url('admin-ajax.php'); ?>">
|
180 |
+
<?php _e('Fetch', 'wprss'); ?>
|
181 |
+
</a>
|
182 |
+
</span>
|
183 |
+
<span class="purge-posts trash <?php echo $has_items_class; ?>">
|
184 |
+
|
|
185 |
+
<a href="javascript:;"
|
186 |
+
class="wprss_delete_items_ajax_action"
|
187 |
+
pid="<?php echo esc_attr ($post_id); ?>"
|
188 |
+
purl="<?php echo admin_url('admin-ajax.php'); ?>">
|
189 |
+
<?php _e('Delete items', 'wprss'); ?>
|
190 |
+
</a>
|
191 |
+
</span>
|
192 |
+
</div>
|
193 |
<?php
|
194 |
|
195 |
// Set meta field for items imported
|
209 |
function wprss_feed_sortable_columns() {
|
210 |
$sortable_columns = array(
|
211 |
// meta column id => sortby value used in query
|
212 |
+
'state' => 'state',
|
213 |
'title' => 'title',
|
214 |
'updates' => 'updates',
|
|
|
215 |
'feed-count' => 'feed-count'
|
216 |
);
|
217 |
return apply_filters( 'wprss_feed_sortable_columns', $sortable_columns );
|
395 |
|
396 |
$page = isset( $_GET['paged'] )? '&paged=' . $_GET['paged'] : '';
|
397 |
if ( get_post_type($post) === 'wprss_feed_item' ) {
|
398 |
+
if ( apply_filters('wpra_dev_mode', false) === false ) {
|
399 |
+
unset($actions['edit']);
|
400 |
+
}
|
401 |
unset( $actions[ 'view' ] );
|
402 |
//unset( $actions[ 'trash' ] );
|
403 |
unset( $actions[ 'inline hide-if-no-js' ] );
|
409 |
|
410 |
unset( $actions[ 'view'] );
|
411 |
unset( $actions[ 'inline hide-if-no-js'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
}
|
413 |
return apply_filters( 'wprss_remove_row_actions', $actions );
|
414 |
}
|
415 |
|
416 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
|
418 |
add_action( 'wprss_delete_feed_items_from_source_hook', 'wprss_delete_feed_items_of_feed_source', 10 , 1 );
|
419 |
/**
|
420 |
* Deletes the feed items of the feed source identified by the given ID.
|
421 |
*
|
|
|
422 |
* @since 3.5
|
423 |
+
* @param int $source_id The ID of the feed source
|
424 |
*/
|
425 |
function wprss_delete_feed_items_of_feed_source( $source_id ) {
|
426 |
$force_delete = apply_filters( 'wprss_force_delete_when_by_source', TRUE );
|
435 |
array(
|
436 |
'meta_key' => 'wprss_feed_id',
|
437 |
'meta_value' => $source_id,
|
438 |
+
'post_type' => get_post_types(),
|
439 |
'post_status' => 'any',
|
440 |
'posts_per_page' => -1
|
441 |
)
|
446 |
$query->the_post();
|
447 |
wp_delete_post( get_the_ID(), $force_delete );
|
448 |
}
|
449 |
+
|
450 |
+
update_post_meta($source_id, 'wprss_feed_is_deleting_items', '');
|
451 |
}
|
452 |
|
453 |
|
462 |
}
|
463 |
|
464 |
|
465 |
+
add_action( 'wp_ajax_wprss_fetch_items_row_action', 'wprss_fetch_feeds_action_hook' );
|
466 |
/**
|
467 |
* The AJAX function for the 'Fetch Feed Items' row action on the
|
468 |
* 'All Feed Sources' page.
|
511 |
}
|
512 |
|
513 |
// Schedule the event for 5 seconds from now
|
514 |
+
$offset = floor(count(wp_get_ready_cron_jobs()) / 2);
|
515 |
+
$success = wp_schedule_single_event( time() + $offset, 'wprss_fetch_single_feed_hook', $schedule_args );
|
516 |
+
if (!$success) {
|
517 |
+
throw new Exception(__('Failed to schedule cron', 'wprss'));
|
518 |
+
}
|
519 |
wprss_flag_feed_as_updating( $id );
|
520 |
} catch (Exception $e) {
|
521 |
$response = wprss()->createAjaxErrorResponse($e);
|
527 |
}
|
528 |
|
529 |
$response->setAjaxData('message', $wprss->__(array('Fetch for feed source #%1$s successfully scheduled', $id)));
|
530 |
+
$response->setAjaxData('success', $success);
|
531 |
echo $response->getBody();
|
532 |
exit();
|
533 |
}
|
534 |
+
|
535 |
+
add_action( 'wp_ajax_wprss_delete_items_row_action', 'wprss_delete_items_ajax_action_hook' );
|
536 |
+
/**
|
537 |
+
* The AJAX function for the 'Delete Items' row action on the 'All Feed Sources' page.
|
538 |
+
*
|
539 |
+
* @since 4.14
|
540 |
+
*/
|
541 |
+
function wprss_delete_items_ajax_action_hook() {
|
542 |
+
$kFeedSourceId = 'feed_source_id';
|
543 |
+
$response = wprss()->createAjaxResponse();
|
544 |
+
$wprss = wprss();
|
545 |
+
try {
|
546 |
+
$id = filter_input(INPUT_POST, 'id', FILTER_DEFAULT);
|
547 |
+
if (empty($id)) {
|
548 |
+
throw new Exception($wprss->__('Source ID was not specified'));
|
549 |
+
}
|
550 |
|
551 |
+
$response->setAjaxData($kFeedSourceId, $id);
|
552 |
+
|
553 |
+
if (!current_user_can('edit_feed_sources')) {
|
554 |
+
throw new Exception($wprss->__(array('User must have sufficient privileges', $id)));
|
555 |
+
}
|
556 |
+
|
557 |
+
// Verify admin referer
|
558 |
+
if (!wprss_verify_nonce( 'wprss_feed_source_action', 'wprss_admin_ajax_nonce' )) {
|
559 |
+
throw new Exception($wprss->__(array('Nonce has expired - Please refresh the page.', $id)));
|
560 |
+
}
|
561 |
+
|
562 |
+
// Schedule a job that runs this function with the source id parameter
|
563 |
+
$offset = floor(count(wp_get_ready_cron_jobs()) / 2);
|
564 |
+
$success = wp_schedule_single_event( time() + $offset, 'wprss_delete_feed_items_from_source_hook', array( $id ) );
|
565 |
+
if (!$success) {
|
566 |
+
throw new Exception(__('Failed to schedule cron', 'wprss'));
|
567 |
+
}
|
568 |
+
// Mark feed as deleting its items
|
569 |
+
update_post_meta( $id, 'wprss_feed_is_deleting_items', time() );
|
570 |
+
} catch (Exception $e) {
|
571 |
+
$response = wprss()->createAjaxErrorResponse($e);
|
572 |
+
if (isset($id)) {
|
573 |
+
$response->setAjaxData($kFeedSourceId, $id);
|
574 |
+
}
|
575 |
+
echo $response->getBody();
|
576 |
+
exit();
|
577 |
+
}
|
578 |
+
|
579 |
+
$response->setAjaxData('message', $wprss->__(array('Items are being deleted', $id)));
|
580 |
+
$response->setAjaxData('success', $success);
|
581 |
+
echo $response->getBody();
|
582 |
+
exit();
|
583 |
+
}
|
584 |
+
|
585 |
+
|
586 |
+
add_action( 'wp_ajax_wprss_toggle_feed_state', 'wprss_ajax_toggle_feed_state' );
|
587 |
+
/**
|
588 |
+
* The AJAX function for toggling a feed's state from the 'All Feed Sources' page.
|
589 |
+
*
|
590 |
+
* @since 4.14
|
591 |
+
*/
|
592 |
+
function wprss_ajax_toggle_feed_state() {
|
593 |
+
$kFeedSourceId = 'feed_source_id';
|
594 |
+
$response = wprss()->createAjaxResponse();
|
595 |
+
$wprss = wprss();
|
596 |
+
try {
|
597 |
+
$id = filter_input(INPUT_POST, 'id', FILTER_DEFAULT);
|
598 |
+
if (empty($id)) {
|
599 |
+
throw new Exception($wprss->__('Source ID was not specified'));
|
600 |
+
}
|
601 |
+
|
602 |
+
$response->setAjaxData($kFeedSourceId, $id);
|
603 |
+
|
604 |
+
if (!current_user_can('edit_feed_sources')) {
|
605 |
+
throw new Exception($wprss->__(array('User must have sufficient privileges', $id)));
|
606 |
+
}
|
607 |
+
|
608 |
+
// Verify admin referer
|
609 |
+
if (!wprss_verify_nonce( 'wprss_feed_source_action', 'wprss_admin_ajax_nonce' )) {
|
610 |
+
throw new Exception($wprss->__(array('Nonce has expired - Please refresh the page.', $id)));
|
611 |
+
}
|
612 |
+
|
613 |
+
$active = wprss_is_feed_source_active( $id );
|
614 |
+
|
615 |
+
if ( $active ) {
|
616 |
+
wprss_pause_feed_source( $id );
|
617 |
+
} else {
|
618 |
+
wprss_activate_feed_source( $id );
|
619 |
+
}
|
620 |
+
|
621 |
+
$response->setAjaxData('active', !$active);
|
622 |
+
} catch (Exception $e) {
|
623 |
+
$response = wprss()->createAjaxErrorResponse($e);
|
624 |
+
if (isset($id)) {
|
625 |
+
$response->setAjaxData($kFeedSourceId, $id);
|
626 |
+
}
|
627 |
+
echo $response->getBody();
|
628 |
+
exit();
|
629 |
+
}
|
630 |
+
|
631 |
+
$response->setAjaxData('message', $wprss->__(array('Feed state changed successfully', $id)));
|
632 |
+
echo $response->getBody();
|
633 |
+
exit();
|
634 |
+
}
|
635 |
|
636 |
add_action('manage_posts_extra_tablenav', function($which) {
|
637 |
$screen = get_current_screen();
|
@@ -71,7 +71,7 @@
|
|
71 |
* Renders the TinyMCE button dialog contents.
|
72 |
*/
|
73 |
function wprss_return_dialog_contents() {
|
74 |
-
$templates_collection = wpra_get('templates/
|
75 |
$templates_options = [];
|
76 |
foreach ($templates_collection as $template) {
|
77 |
$template_name = $template['name'];
|
71 |
* Renders the TinyMCE button dialog contents.
|
72 |
*/
|
73 |
function wprss_return_dialog_contents() {
|
74 |
+
$templates_collection = wpra_get('feeds/templates/collection');
|
75 |
$templates_options = [];
|
76 |
foreach ($templates_collection as $template) {
|
77 |
$template_name = $template['name'];
|
@@ -13,7 +13,8 @@ function wprss_feed_source_updates() {
|
|
13 |
|
14 |
// Get the wprss heartbeat data and extract the data
|
15 |
$wprss_heartbeat = $_POST['wprss_heartbeat'];
|
16 |
-
|
|
|
17 |
|
18 |
// Perform the action specified by the heartbeat data
|
19 |
switch( $action ) {
|
@@ -29,8 +30,12 @@ function wprss_feed_source_updates() {
|
|
29 |
$feed_source_data = &$feed_sources_data[$feed_id];
|
30 |
|
31 |
// Check if the feed source is updating
|
32 |
-
$
|
33 |
-
|
|
|
|
|
|
|
|
|
34 |
|
35 |
// Add the number of imported items
|
36 |
$items = wprss_get_feed_items_for_source( $feed_id );
|
@@ -47,13 +52,18 @@ function wprss_feed_source_updates() {
|
|
47 |
}
|
48 |
// Set the text appropriately
|
49 |
if ( ! wprss_is_feed_source_active( $feed_id ) ) {
|
50 |
-
$feed_source_data['next-update'] = __( '
|
51 |
}
|
52 |
elseif( $next_update === FALSE ) {
|
53 |
-
$feed_source_data['next-update'] = __( 'None',
|
|
|
54 |
}
|
55 |
else {
|
56 |
-
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
// Update the meta field
|
59 |
update_post_meta( $feed_id, 'wprss_next_update', $feed_source_data['next-update'] );
|
13 |
|
14 |
// Get the wprss heartbeat data and extract the data
|
15 |
$wprss_heartbeat = $_POST['wprss_heartbeat'];
|
16 |
+
$action = $wprss_heartbeat['action'];
|
17 |
+
$params = $wprss_heartbeat['params'];
|
18 |
|
19 |
// Perform the action specified by the heartbeat data
|
20 |
switch( $action ) {
|
30 |
$feed_source_data = &$feed_sources_data[$feed_id];
|
31 |
|
32 |
// Check if the feed source is updating
|
33 |
+
$next_fetch = wprss_get_next_feed_source_update($feed_id);
|
34 |
+
$fetches_soon = $next_fetch !== false && $next_fetch < 2 && $next_fetch > 0;
|
35 |
+
$is_fetching = wprss_is_feed_source_updating($feed_id);
|
36 |
+
$is_deleting = wprss_is_feed_source_deleting($feed_id);
|
37 |
+
$feed_source_data['fetching'] = $fetches_soon || $is_fetching;
|
38 |
+
$feed_source_data['deleting'] = $is_deleting;
|
39 |
|
40 |
// Add the number of imported items
|
41 |
$items = wprss_get_feed_items_for_source( $feed_id );
|
52 |
}
|
53 |
// Set the text appropriately
|
54 |
if ( ! wprss_is_feed_source_active( $feed_id ) ) {
|
55 |
+
$feed_source_data['next-update'] = __( '...', 'wprss' );
|
56 |
}
|
57 |
elseif( $next_update === FALSE ) {
|
58 |
+
$feed_source_data['next-update'] = __( 'None', 'wprss' );
|
59 |
+
wprss_activate_feed_source( $feed_id );
|
60 |
}
|
61 |
else {
|
62 |
+
$time_diff = absint($next_update - time());
|
63 |
+
|
64 |
+
$feed_source_data['next-update'] = ($time_diff > 1)
|
65 |
+
? human_time_diff( $next_update, time() )
|
66 |
+
: _x('now', 'Next update: now', 'wprss');
|
67 |
}
|
68 |
// Update the meta field
|
69 |
update_post_meta( $feed_id, 'wprss_next_update', $feed_source_data['next-update'] );
|
@@ -24,11 +24,11 @@
|
|
24 |
|
25 |
'. 'If you already have items imported from this feed source, setting this option now may delete some of your items, in order to comply with the limit.', WPRSS_TEXT_DOMAIN),
|
26 |
// Link to Enclosure
|
27 |
-
'wprss_enclosure' => __('Tick this box to make
|
28 |
|
29 |
-
'. '
|
30 |
|
31 |
-
'. 'If you are not sure leave this
|
32 |
|
33 |
'wprss_unique_titles' => __('Whether to allow multiple feed items to have the same title. When checked, if a feed item has the same title as a previously-imported feed item, it will not be imported.
|
34 |
|
@@ -69,7 +69,7 @@
|
|
69 |
|
70 |
'. 'Also, items in the RSS feed that are already older than this age will not be imported at all.
|
71 |
|
72 |
-
'. '
|
73 |
|
74 |
/* ----------------------
|
75 |
* Feed Preview Metabox
|
24 |
|
25 |
'. 'If you already have items imported from this feed source, setting this option now may delete some of your items, in order to comply with the limit.', WPRSS_TEXT_DOMAIN),
|
26 |
// Link to Enclosure
|
27 |
+
'wprss_enclosure' => __('Tick this box to make imported items link to their enclosure, rather than to the original article.
|
28 |
|
29 |
+
'. 'Enclosures are typically links to attachments, such as images, audio, videos, documents or flash content.
|
30 |
|
31 |
+
'. 'If you are not sure, leave this option unticked', WPRSS_TEXT_DOMAIN),
|
32 |
|
33 |
'wprss_unique_titles' => __('Whether to allow multiple feed items to have the same title. When checked, if a feed item has the same title as a previously-imported feed item, it will not be imported.
|
34 |
|
69 |
|
70 |
'. 'Also, items in the RSS feed that are already older than this age will not be imported at all.
|
71 |
|
72 |
+
'. 'Leave empty to use the <em>Limit feed items by age</em> option in the general settings.', WPRSS_TEXT_DOMAIN),
|
73 |
|
74 |
/* ----------------------
|
75 |
* Feed Preview Metabox
|
@@ -43,16 +43,17 @@ function wprss_settings_add_tooltips() {
|
|
43 |
'. '<em>Leave empty for no limit.</em>',
|
44 |
WPRSS_TEXT_DOMAIN),
|
45 |
// Feed items import order
|
46 |
-
'feed_items_import_order' => __('The order
|
47 |
'. '<hr />
|
48 |
|
49 |
-
'. '
|
50 |
-
'. '
|
51 |
-
'. '
|
|
|
52 |
'. 'This setting is very useful in combination with the per-import limit.
|
53 |
'. '<hr />
|
54 |
|
55 |
-
'. '<em>
|
56 |
WPRSS_TEXT_DOMAIN),
|
57 |
// Feed processing interval
|
58 |
'cron-interval' => __('How frequently should the feed sources (that do not have their own update interval) check for updates and fetch items accordingly.
|
43 |
'. '<em>Leave empty for no limit.</em>',
|
44 |
WPRSS_TEXT_DOMAIN),
|
45 |
// Feed items import order
|
46 |
+
'feed_items_import_order' => __('The order in which feed items will be imported.
|
47 |
'. '<hr />
|
48 |
|
49 |
+
'. '<strong>Latest items first</strong> will import the most recent items in the feed first.
|
50 |
+
'. '<strong>Oldest items first</strong> will import the oldest items in the feed first.
|
51 |
+
'. '<strong>Original feed order</strong> only works well on PHP7 or later.
|
52 |
+
'. '
|
53 |
'. 'This setting is very useful in combination with the per-import limit.
|
54 |
'. '<hr />
|
55 |
|
56 |
+
'. 'Default: <em>Latest items first</em>',
|
57 |
WPRSS_TEXT_DOMAIN),
|
58 |
// Feed processing interval
|
59 |
'cron-interval' => __('How frequently should the feed sources (that do not have their own update interval) check for updates and fetch items accordingly.
|
@@ -23,28 +23,28 @@
|
|
23 |
|
24 |
<div class="wrap">
|
25 |
<h2><?php _e( 'Help & Support', WPRSS_TEXT_DOMAIN ); ?></h2>
|
26 |
-
<h3><?php _e( '
|
27 |
<?php
|
28 |
printf(
|
29 |
wpautop(
|
30 |
-
__( 'In the <a href="%s">
|
31 |
|
32 |
There are also some videos to help you make a quick start to setting up and enjoying this plugin.',
|
33 |
WPRSS_TEXT_DOMAIN
|
34 |
)
|
35 |
),
|
36 |
-
'https://
|
37 |
);
|
38 |
?>
|
39 |
<h3><?php _e( 'Frequently Asked Questions (FAQ)', WPRSS_TEXT_DOMAIN ) ?></h3>
|
40 |
<?php
|
41 |
printf(
|
42 |
wpautop(
|
43 |
-
__( 'If after going through the
|
44 |
WPRSS_TEXT_DOMAIN
|
45 |
)
|
46 |
),
|
47 |
-
'https://
|
48 |
)
|
49 |
?>
|
50 |
|
23 |
|
24 |
<div class="wrap">
|
25 |
<h2><?php _e( 'Help & Support', WPRSS_TEXT_DOMAIN ); ?></h2>
|
26 |
+
<h3><?php _e( 'Knowledge Base', WPRSS_TEXT_DOMAIN ) ?></h3>
|
27 |
<?php
|
28 |
printf(
|
29 |
wpautop(
|
30 |
+
__( 'In the <a href="%s">WP RSS Aggregator knowledge base</a> you will find comprehensive details and tutorials on how to use the core plugin and all the add-ons.
|
31 |
|
32 |
There are also some videos to help you make a quick start to setting up and enjoying this plugin.',
|
33 |
WPRSS_TEXT_DOMAIN
|
34 |
)
|
35 |
),
|
36 |
+
'https://kb.wprssaggregator.com/'
|
37 |
);
|
38 |
?>
|
39 |
<h3><?php _e( 'Frequently Asked Questions (FAQ)', WPRSS_TEXT_DOMAIN ) ?></h3>
|
40 |
<?php
|
41 |
printf(
|
42 |
wpautop(
|
43 |
+
__( 'If after going through the knowledge base you still have questions, please take a look at the <a href="%s">FAQ section</a>. We set this up purposely to answer the most commonly asked questions from our users.',
|
44 |
WPRSS_TEXT_DOMAIN
|
45 |
)
|
46 |
),
|
47 |
+
'https://kb.wprssaggregator.com/category/359-faqs'
|
48 |
)
|
49 |
?>
|
50 |
|
@@ -131,7 +131,7 @@ function wprss_download_log()
|
|
131 |
|
132 |
header('Content-Description: File Transfer');
|
133 |
header('Content-type: text/plain');
|
134 |
-
header('Content-Disposition: attachment; filename="
|
135 |
header('Expires: 0');
|
136 |
header('Cache-Control: must-revalidate');
|
137 |
header('Pragma: public');
|
131 |
|
132 |
header('Content-Description: File Transfer');
|
133 |
header('Content-type: text/plain');
|
134 |
+
header('Content-Disposition: attachment; filename="wpra-log.txt"');
|
135 |
header('Expires: 0');
|
136 |
header('Cache-Control: must-revalidate');
|
137 |
header('Pragma: public');
|
@@ -136,7 +136,7 @@
|
|
136 |
$help = WPRSS_Help::get_instance();
|
137 |
|
138 |
// Use nonce for verification
|
139 |
-
wp_nonce_field(
|
140 |
|
141 |
// Fix for WordpRess SEO JS issue
|
142 |
?><input type="hidden" id="content" value="" /><?php
|
@@ -203,13 +203,31 @@
|
|
203 |
case 'checkbox':
|
204 |
?>
|
205 |
<input type="hidden" name="<?php echo $field['id'] ?>" value="false" />
|
206 |
-
<input type="checkbox" name="<?php echo $field['id'] ?>" id="<?php echo $field['id'] ?>" value="true" <?php checked( $meta, 'true' ) ?>
|
|
|
207 |
echo $help->tooltip( $tooltip_id, $tooltip );
|
208 |
if ( strlen( trim( $field['desc'] ) ) > 0 ) {
|
209 |
?><label for="<?php echo $field['id'] ?>"><span class="description"><?php echo $field_description ?></span></label><?php
|
210 |
}
|
211 |
break;
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
// select
|
214 |
case 'select':
|
215 |
?><select name="<?php echo $field['id'] ?>" id="<?php $field['id'] ?>"><?php
|
@@ -302,8 +320,10 @@
|
|
302 |
$meta_fields = wprss_get_custom_fields();
|
303 |
|
304 |
/* Verify the nonce before proceeding. */
|
305 |
-
if ( !isset( $_POST['wprss_meta_box_nonce'] ) ||
|
|
|
306 |
return $post_id;
|
|
|
307 |
|
308 |
/* Get the post type object. */
|
309 |
$post_type = get_post_type_object( $post->post_type );
|
@@ -328,6 +348,17 @@
|
|
328 |
if ( defined( 'DOING_CRON' ) && DOING_CRON )
|
329 |
return;
|
330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
// Change the limit, if it is zero, to an empty string
|
332 |
if ( isset( $_POST['wprss_limit'] ) && strval( $_POST['wprss_limit'] ) == '0' ) {
|
333 |
$_POST['wprss_limit'] = '';
|
@@ -397,26 +428,30 @@
|
|
397 |
if ( ! empty( $feed_url ) ) {
|
398 |
$feed = wprss_fetch_feed( $feed_url, $post->ID );
|
399 |
if ( ! is_wp_error( $feed ) ) {
|
400 |
-
|
401 |
// Figure out how many total items there are
|
402 |
-
$total =
|
403 |
// Get the number of items again, but limit it to 5.
|
404 |
$maxitems = $feed->get_item_quantity(5);
|
405 |
|
406 |
// Build an array of all the items, starting with element 0 (first element).
|
407 |
$items = $feed->get_items( 0, $maxitems );
|
|
|
408 |
?>
|
409 |
<h4><?php echo sprintf( __( 'Latest %1$s feed items out of %2$s available from %3$s' ), $maxitems, $total, get_the_title() ) ?></h4>
|
410 |
<ul>
|
411 |
<?php
|
412 |
foreach ( $items as $item ) {
|
413 |
-
|
414 |
-
$has_date = $
|
|
|
|
|
415 |
if ( $has_date ) {
|
416 |
-
$item_date = human_time_diff( $
|
417 |
} else {
|
418 |
$item_date = '<em>[' . __( 'No Date', WPRSS_TEXT_DOMAIN ) . ']</em>';
|
419 |
}
|
|
|
420 |
// Start displaying item content within a <li> tag
|
421 |
echo '<li>';
|
422 |
// create item link
|
@@ -494,11 +529,8 @@
|
|
494 |
$pause = get_post_meta( $post->ID, 'wprss_pause_feed', TRUE );
|
495 |
$update_interval = get_post_meta( $post->ID, 'wprss_update_interval', TRUE );
|
496 |
|
497 |
-
$age_limit = get_post_meta( $post->ID, 'wprss_age_limit',
|
498 |
-
$age_unit = get_post_meta( $post->ID, 'wprss_age_unit',
|
499 |
-
|
500 |
-
$age_limit = ( count( $age_limit ) === 0 )? wprss_get_general_setting( 'limit_feed_items_age' ) : $age_limit[0];
|
501 |
-
$age_unit = ( count( $age_unit ) === 0 )? wprss_get_general_setting( 'limit_feed_items_age_unit' ) : $age_unit[0];
|
502 |
|
503 |
// Set default strings for activate and pause times
|
504 |
$default_activate = 'immediately';
|
@@ -600,8 +632,12 @@
|
|
600 |
|
601 |
<div class="wprss-meta-side-setting">
|
602 |
<p>
|
603 |
-
<label id="wprss-age-limit-feed-label" for="" data-when-empty="
|
604 |
-
|
|
|
|
|
|
|
|
|
605 |
<a href="#">Edit</a>
|
606 |
<?php echo $help->tooltip( 'field_wprss_age_limit', null, $help_options ) ?>
|
607 |
</p>
|
136 |
$help = WPRSS_Help::get_instance();
|
137 |
|
138 |
// Use nonce for verification
|
139 |
+
wp_nonce_field( 'wpra_feed_source', 'wprss_meta_box_nonce' );
|
140 |
|
141 |
// Fix for WordpRess SEO JS issue
|
142 |
?><input type="hidden" id="content" value="" /><?php
|
203 |
case 'checkbox':
|
204 |
?>
|
205 |
<input type="hidden" name="<?php echo $field['id'] ?>" value="false" />
|
206 |
+
<input type="checkbox" name="<?php echo $field['id'] ?>" id="<?php echo $field['id'] ?>" value="true" <?php checked( $meta, 'true' ) ?> />
|
207 |
+
<?php
|
208 |
echo $help->tooltip( $tooltip_id, $tooltip );
|
209 |
if ( strlen( trim( $field['desc'] ) ) > 0 ) {
|
210 |
?><label for="<?php echo $field['id'] ?>"><span class="description"><?php echo $field_description ?></span></label><?php
|
211 |
}
|
212 |
break;
|
213 |
|
214 |
+
// improved checkbox
|
215 |
+
case 'checkbox2':
|
216 |
+
?>
|
217 |
+
<input type="hidden" name="<?php echo $field['id'] ?>" value="0" />
|
218 |
+
<input type="checkbox"
|
219 |
+
id="<?php echo $field['id'] ?>"
|
220 |
+
name="<?php echo $field['id'] ?>"
|
221 |
+
value="1"
|
222 |
+
<?php checked( $meta, '1' ) ?>
|
223 |
+
/>
|
224 |
+
<?php
|
225 |
+
echo $help->tooltip( $tooltip_id, $tooltip );
|
226 |
+
if ( strlen( trim( $field['desc'] ) ) > 0 ) {
|
227 |
+
?><label for="<?php echo $field['id'] ?>"><span class="description"><?php echo $field_description ?></span></label><?php
|
228 |
+
}
|
229 |
+
break;
|
230 |
+
|
231 |
// select
|
232 |
case 'select':
|
233 |
?><select name="<?php echo $field['id'] ?>" id="<?php $field['id'] ?>"><?php
|
320 |
$meta_fields = wprss_get_custom_fields();
|
321 |
|
322 |
/* Verify the nonce before proceeding. */
|
323 |
+
if ( !isset( $_POST['wprss_meta_box_nonce'] ) ||
|
324 |
+
!wp_verify_nonce( $_POST['wprss_meta_box_nonce'], 'wpra_feed_source' ) ) {
|
325 |
return $post_id;
|
326 |
+
}
|
327 |
|
328 |
/* Get the post type object. */
|
329 |
$post_type = get_post_type_object( $post->post_type );
|
348 |
if ( defined( 'DOING_CRON' ) && DOING_CRON )
|
349 |
return;
|
350 |
|
351 |
+
if ( isset($_POST['wpra_feed_def_ft_image']) ) {
|
352 |
+
$def_ft_image_id = $_POST['wpra_feed_def_ft_image'];
|
353 |
+
|
354 |
+
if (empty($def_ft_image_id)) {
|
355 |
+
// Does not actually delete the image
|
356 |
+
delete_post_thumbnail( $post_id );
|
357 |
+
} else {
|
358 |
+
set_post_thumbnail( $post_id, $def_ft_image_id );
|
359 |
+
}
|
360 |
+
}
|
361 |
+
|
362 |
// Change the limit, if it is zero, to an empty string
|
363 |
if ( isset( $_POST['wprss_limit'] ) && strval( $_POST['wprss_limit'] ) == '0' ) {
|
364 |
$_POST['wprss_limit'] = '';
|
428 |
if ( ! empty( $feed_url ) ) {
|
429 |
$feed = wprss_fetch_feed( $feed_url, $post->ID );
|
430 |
if ( ! is_wp_error( $feed ) ) {
|
431 |
+
ob_start();
|
432 |
// Figure out how many total items there are
|
433 |
+
$total = @$feed->get_item_quantity();
|
434 |
// Get the number of items again, but limit it to 5.
|
435 |
$maxitems = $feed->get_item_quantity(5);
|
436 |
|
437 |
// Build an array of all the items, starting with element 0 (first element).
|
438 |
$items = $feed->get_items( 0, $maxitems );
|
439 |
+
ob_clean();
|
440 |
?>
|
441 |
<h4><?php echo sprintf( __( 'Latest %1$s feed items out of %2$s available from %3$s' ), $maxitems, $total, get_the_title() ) ?></h4>
|
442 |
<ul>
|
443 |
<?php
|
444 |
foreach ( $items as $item ) {
|
445 |
+
$date = $item->get_date( 'U' );
|
446 |
+
$has_date = $date ? true : false;
|
447 |
+
|
448 |
+
// Get human date
|
449 |
if ( $has_date ) {
|
450 |
+
$item_date = human_time_diff( $date, current_time('timestamp')).' '.__( 'ago', 'wprss' );
|
451 |
} else {
|
452 |
$item_date = '<em>[' . __( 'No Date', WPRSS_TEXT_DOMAIN ) . ']</em>';
|
453 |
}
|
454 |
+
|
455 |
// Start displaying item content within a <li> tag
|
456 |
echo '<li>';
|
457 |
// create item link
|
529 |
$pause = get_post_meta( $post->ID, 'wprss_pause_feed', TRUE );
|
530 |
$update_interval = get_post_meta( $post->ID, 'wprss_update_interval', TRUE );
|
531 |
|
532 |
+
$age_limit = get_post_meta( $post->ID, 'wprss_age_limit', true );
|
533 |
+
$age_unit = get_post_meta( $post->ID, 'wprss_age_unit', true );
|
|
|
|
|
|
|
534 |
|
535 |
// Set default strings for activate and pause times
|
536 |
$default_activate = 'immediately';
|
632 |
|
633 |
<div class="wprss-meta-side-setting">
|
634 |
<p>
|
635 |
+
<label id="wprss-age-limit-feed-label" for="" data-when-empty="Limit items by age:">
|
636 |
+
<?php _e( 'Limit items by age:', 'wprss' ); ?>
|
637 |
+
</label>
|
638 |
+
<strong id="wprss-age-limit-feed-viewer">
|
639 |
+
<?php _e( 'Default', WPRSS_TEXT_DOMAIN ); ?>
|
640 |
+
</strong>
|
641 |
<a href="#">Edit</a>
|
642 |
<?php echo $help->tooltip( 'field_wprss_age_limit', null, $help_options ) ?>
|
643 |
</p>
|
@@ -65,7 +65,7 @@
|
|
65 |
array(
|
66 |
'general' => array(
|
67 |
'limit-feed-items-by-age' => array(
|
68 |
-
'label' => __( 'Limit
|
69 |
'callback' => 'wprss_setting_limit_feed_items_age_callback'
|
70 |
),
|
71 |
'limit-feed-items-imported' => array(
|
@@ -85,7 +85,7 @@
|
|
85 |
'callback' => 'wprss_setting_feed_items_import_order_callback'
|
86 |
),
|
87 |
'cron-interval' => array(
|
88 |
-
'label' => __( '
|
89 |
'callback' => 'wprss_setting_cron_interval_callback'
|
90 |
),
|
91 |
'unique-titles' => array(
|
@@ -247,25 +247,6 @@
|
|
247 |
* @since 1.1
|
248 |
*/
|
249 |
function wprss_settings_page_display() {
|
250 |
-
$etText = wprss_is_et_active() ? '<br/><br/>' . sprintf(__('Wondering how Templates work with Excerpts & Thumbnails? <a href="%s" target="_blank">Click here to learn more.</a>', WPRSS_TEXT_DOMAIN), 'https://kb.wprssaggregator.com/article/459-using-excerpts-thumbnails-with-templates') : '';
|
251 |
-
|
252 |
-
wprss_plugin_enqueue_app_scripts('wpra-settings', WPRSS_APP_JS . 'settings.min.js');
|
253 |
-
wp_enqueue_style('wpra-settings', WPRSS_APP_CSS . 'common.min.css');
|
254 |
-
wp_localize_script('wpra-settings', 'WpraSettings', [
|
255 |
-
'notice' => [
|
256 |
-
'id' => 'settings-notice',
|
257 |
-
'visible' => !wprss_is_new_user(),
|
258 |
-
'title' => __('The display options for WP RSS Aggregator have now become Templates.', WPRSS_TEXT_DOMAIN),
|
259 |
-
'body' => __('As of Core version 4.13, we have introduced the concept of templates to replace the'
|
260 |
-
. ' display settings that were previously available on this page. These templates provide you'
|
261 |
-
. ' with more flexibility and new designs. They also come with a revamped <a target="_blank" href="https://kb.wprssaggregator.com/article/54-displaying-imported-items-shortcode">TinyMCE shortcode button</a>'
|
262 |
-
. ' for the Classic Editor and a <em><a href="https://kb.wprssaggregator.com/article/454-displaying-imported-items-block-gutenberg" target="_blank">brand new block</a></em> for those using WP 5.0+ with the Gutenberg block editor.'
|
263 |
-
. '<br/><br/>'
|
264 |
-
. 'Go to <em>Templates</em> under <em>RSS Aggregator</em> to set up your templates. Please note that the default '
|
265 |
-
. 'template you will see there is set up using your pre-existing display options, nothing is lost or changed.', WPRSS_TEXT_DOMAIN) . $etText,
|
266 |
-
'learnMore' => 'https://www.wprssaggregator.com/core-version-4-13-celebrating-one-million-downloads/'
|
267 |
-
]
|
268 |
-
])
|
269 |
|
270 |
?>
|
271 |
<div class="wrap">
|
@@ -556,9 +537,9 @@
|
|
556 |
$mainOptionName = 'wprss_settings_general';
|
557 |
$value = wprss_get_general_setting($id);
|
558 |
$items = array(
|
559 |
-
''
|
560 |
-
'
|
561 |
-
'
|
562 |
);
|
563 |
?>
|
564 |
<select id="<?php echo $id ?>" name="<?php echo \Aventura\Wprss\Core\Model\SettingsAbstract::getNameHtml(array($mainOptionName, $id)) ?>">
|
65 |
array(
|
66 |
'general' => array(
|
67 |
'limit-feed-items-by-age' => array(
|
68 |
+
'label' => __( 'Limit items by age', WPRSS_TEXT_DOMAIN ),
|
69 |
'callback' => 'wprss_setting_limit_feed_items_age_callback'
|
70 |
),
|
71 |
'limit-feed-items-imported' => array(
|
85 |
'callback' => 'wprss_setting_feed_items_import_order_callback'
|
86 |
),
|
87 |
'cron-interval' => array(
|
88 |
+
'label' => __( 'Update interval', WPRSS_TEXT_DOMAIN ),
|
89 |
'callback' => 'wprss_setting_cron_interval_callback'
|
90 |
),
|
91 |
'unique-titles' => array(
|
247 |
* @since 1.1
|
248 |
*/
|
249 |
function wprss_settings_page_display() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
|
251 |
?>
|
252 |
<div class="wrap">
|
537 |
$mainOptionName = 'wprss_settings_general';
|
538 |
$value = wprss_get_general_setting($id);
|
539 |
$items = array(
|
540 |
+
'latest' => __('Latest items first', WPRSS_TEXT_DOMAIN),
|
541 |
+
'oldest' => __('Oldest items first', WPRSS_TEXT_DOMAIN),
|
542 |
+
'' => __('Original feed order', WPRSS_TEXT_DOMAIN),
|
543 |
);
|
544 |
?>
|
545 |
<select id="<?php echo $id ?>" name="<?php echo \Aventura\Wprss\Core\Model\SettingsAbstract::getNameHtml(array($mainOptionName, $id)) ?>">
|
@@ -33,15 +33,15 @@ function wprss_render_update_page()
|
|
33 |
wprss_update_previous_update_page_version();
|
34 |
|
35 |
wp_enqueue_style('update-page', WPRSS_APP_CSS . 'update.min.css');
|
|
|
|
|
36 |
|
37 |
$changelog = wpra_get('core/changelog_dataset');
|
38 |
$parsedown = wpra_get('parsedown');
|
39 |
|
40 |
echo wprss_render_template('admin/update-page.twig', array(
|
41 |
-
'title' => __('What\'s new in WP RSS Aggregator 4.
|
42 |
'version' => WPRSS_VERSION,
|
43 |
-
'beacon_nonce_field' => wp_nonce_field('wprss_hs_beacon_enabled'),
|
44 |
-
'beacon_enabled' => wprss_is_help_beacon_enabled(),
|
45 |
'url' => array(
|
46 |
'main' => admin_url('edit.php?post_type=wprss_feed'),
|
47 |
'website' => 'https://www.wprssaggregator.com/',
|
@@ -51,7 +51,7 @@ function wprss_render_update_page()
|
|
51 |
'path' => array(
|
52 |
'images' => WPRSS_IMG,
|
53 |
),
|
54 |
-
'changelog' => $parsedown->text($changelog['4.
|
55 |
));
|
56 |
}
|
57 |
|
33 |
wprss_update_previous_update_page_version();
|
34 |
|
35 |
wp_enqueue_style('update-page', WPRSS_APP_CSS . 'update.min.css');
|
36 |
+
wp_enqueue_script('wpra-colorbox', WPRSS_JS . 'jquery.colorbox-min.js', ['jquery'], WPRSS_VERSION);
|
37 |
+
wp_enqueue_style('colorbox', WPRSS_CSS . 'colorbox.css', [], '1.4.33');
|
38 |
|
39 |
$changelog = wpra_get('core/changelog_dataset');
|
40 |
$parsedown = wpra_get('parsedown');
|
41 |
|
42 |
echo wprss_render_template('admin/update-page.twig', array(
|
43 |
+
'title' => __('What\'s new in WP RSS Aggregator 4.14', WPRSS_TEXT_DOMAIN),
|
44 |
'version' => WPRSS_VERSION,
|
|
|
|
|
45 |
'url' => array(
|
46 |
'main' => admin_url('edit.php?post_type=wprss_feed'),
|
47 |
'website' => 'https://www.wprssaggregator.com/',
|
51 |
'path' => array(
|
52 |
'images' => WPRSS_IMG,
|
53 |
),
|
54 |
+
'changelog' => $parsedown->text($changelog['4.14']['raw'])
|
55 |
));
|
56 |
}
|
57 |
|
@@ -1,170 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @todo Localize
|
5 |
-
*/
|
6 |
-
|
7 |
-
// Exit if the page is accessed directly
|
8 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
9 |
-
|
10 |
-
// The readme lib
|
11 |
-
require_once( WPRSS_INC . '/readme.php' );
|
12 |
-
|
13 |
-
|
14 |
-
// The tabs to be shown
|
15 |
-
$tabs = array(
|
16 |
-
/* 'cat' => 'Categories',
|
17 |
-
'et' => 'Excerpts & Thumbnails',
|
18 |
-
'kf' => 'Keyword Filtering'*/
|
19 |
-
);
|
20 |
-
|
21 |
-
// Determine the tab currently being shown
|
22 |
-
$tab = null;
|
23 |
-
if ( isset( $_GET['tab'] ) && !empty( $_GET['tab'] ) ) {
|
24 |
-
$tab = $_GET['tab'];
|
25 |
-
}
|
26 |
-
|
27 |
-
$settings_url = admin_url( 'edit.php?post_type=wprss_feed&page=wprss-aggregator-settings');
|
28 |
-
|
29 |
-
?>
|
30 |
-
|
31 |
-
<div class="wrap about-wrap">
|
32 |
-
<h1><?php printf( __( 'Welcome to WP RSS Aggregator %1$s!', WPRSS_TEXT_DOMAIN ), WPRSS_VERSION ); ?></h1>
|
33 |
-
<div class="wprss-about-text">
|
34 |
-
<?php _e( 'Thank you for upgrading to the latest version!', WPRSS_TEXT_DOMAIN ) ?>
|
35 |
-
</div>
|
36 |
-
<!-- <div class="wprss-badge">Version</div>-->
|
37 |
-
|
38 |
-
<!-- TAB WRAPPER -->
|
39 |
-
<h2 class="nav-tab-wrapper">
|
40 |
-
<!--<a class="nav-tab <?php if ( $tab === null ) echo 'nav-tab-active'; ?>"
|
41 |
-
href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wprss-welcome' ), 'index.php' ) ) ); ?>">
|
42 |
-
<?php _e( "What's New?", WPRSS_TEXT_DOMAIN ) ?>
|
43 |
-
</a>-->
|
44 |
-
|
45 |
-
<!-- SHOW ALL TABS -->
|
46 |
-
<?php foreach ($tabs as $slug => $title) : ?>
|
47 |
-
|
48 |
-
<a class="nav-tab <?php if ( $tab === $slug ) echo 'nav-tab-active'; ?>"
|
49 |
-
href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wprss-welcome', 'tab' => $slug ), 'index.php' ) ) ); ?>">
|
50 |
-
<?php _e( $title, WPRSS_TEXT_DOMAIN ) ?>
|
51 |
-
</a>
|
52 |
-
|
53 |
-
<?php endforeach; ?>
|
54 |
-
|
55 |
-
</h2>
|
56 |
-
|
57 |
-
<!-- TAB CONTENT -->
|
58 |
-
<?php
|
59 |
-
/* Show content depending on the current tab */
|
60 |
-
switch( $tab ) {
|
61 |
-
|
62 |
-
// Default tab. ( when tab = null )
|
63 |
-
default: ?>
|
64 |
-
<div class="changelog">
|
65 |
-
|
66 |
-
<!--<h2 class="about-headline-callout"><?php _e( 'Bulk Adding Feed Sources', WPRSS_TEXT_DOMAIN ) ?></h2>
|
67 |
-
<div class="about-overview">
|
68 |
-
<img src="<?php echo WPRSS_IMG; ?>welcome-page/bulk-add.png" />
|
69 |
-
<?php echo wpautop( sprintf( __('The new bulk adding option saves you time by allowing you to enter your feed names and URLs all at once.
|
70 |
-
Simply type in or paste your feed sources, and with the press of a button, your feed sources will instantly be created!
|
71 |
-
Try it now from the <a href="%1$s">Import & Export</a> page.', WPRSS_TEXT_DOMAIN), 'edit.php?post_type=wprss_feed&page=wprss-import-export-settings' ) ) ?>
|
72 |
-
</div>
|
73 |
-
|
74 |
-
<h2 class="about-headline-callout"><?php _e( 'Feed Item Blacklist', WPRSS_TEXT_DOMAIN ) ?></h2>
|
75 |
-
<div class="feature-section col three-col">
|
76 |
-
<div class="col-1">
|
77 |
-
<img src="<?php echo WPRSS_IMG;?>welcome-page/trash-feed-item.png" />
|
78 |
-
<h4><?php _e( 'Trash undesired items', WPRSS_TEXT_DOMAIN ) ?></h4>
|
79 |
-
<?php echo wpautop( sprintf( __('Did a feed import an item that you do not wish to keep? Up till now, <strong>WP RSS Aggregator</strong>'
|
80 |
-
. 'only allowed you to trash the item and keep it in your trash.', WPRSS_TEXT_DOMAIN) ) ) ?>
|
81 |
-
</div>
|
82 |
-
<div class="col-2">
|
83 |
-
<img src="<?php echo WPRSS_IMG;?>welcome-page/blacklist-feed-item.png" />
|
84 |
-
<h4><?php _e( 'Blacklist Trashed Items', WPRSS_TEXT_DOMAIN ) ?></h4>
|
85 |
-
<?php echo wpautop( sprintf( __('Permanently deleting the item will cause it to be re-imported. '
|
86 |
-
. 'Using the new <strong>Delete Permanently & Blacklist</strong> option, the feed item is deleted '
|
87 |
-
. 'and added to the <strong>Blacklist</strong>.', WPRSS_TEXT_DOMAIN) ) ) ?>
|
88 |
-
</div>
|
89 |
-
<div class="col-3 last-feature">
|
90 |
-
<img src="<?php echo WPRSS_IMG;?>welcome-page/blacklist.png" />
|
91 |
-
<h4><?php _e( 'The Blacklist', WPRSS_TEXT_DOMAIN ) ?></h4>
|
92 |
-
<?php echo wpautop( sprintf( __('This is your list of unwanted feed item links. Any item in this list will be ignored by '
|
93 |
-
. "<strong>WP RSS Aggregator</strong> in the future, meaning it won't be imported from any of your feed sources."
|
94 |
-
. 'and added to the <strong>Blacklist</strong>.', WPRSS_TEXT_DOMAIN) ) ) ?>
|
95 |
-
</div>
|
96 |
-
</div>-->
|
97 |
-
|
98 |
-
<hr/>
|
99 |
-
|
100 |
-
<h3><?php _e( 'Check out our add-ons:', WPRSS_TEXT_DOMAIN ) ?></h3>
|
101 |
-
|
102 |
-
<ul>
|
103 |
-
<li><strong><a href="https://www.wprssaggregator.com/extension/widget/" target="wprss_widget"><?php _e( 'Widget', WPRSS_TEXT_DOMAIN ); ?></a></strong></li>
|
104 |
-
<li><strong><a href="https://www.wprssaggregator.com/extension/feed-to-post/" target="wprss_ftp"><?php _e( 'Feed to Post', WPRSS_TEXT_DOMAIN ); ?></a></strong></li>
|
105 |
-
<li><strong><a href="https://www.wprssaggregator.com/extension/excerpts-thumbnails/" target="wprss_et"><?php _e( 'Excerpts & Thumbnails', WPRSS_TEXT_DOMAIN ); ?></a></strong></li>
|
106 |
-
<li><strong><a href="https://www.wprssaggregator.com/extension/categories/" target="wprss_cat"><?php _e( 'Categories', WPRSS_TEXT_DOMAIN ); ?></a></strong></li>
|
107 |
-
<li><strong><a href="https://www.wprssaggregator.com/extension/keyword-filtering/" target="wprss_kf"><?php _e( 'Keyword Filtering', WPRSS_TEXT_DOMAIN ); ?></a></strong></li>
|
108 |
-
<li><strong><a href="https://www.wprssaggregator.com/extension/full-text-rss-feeds/" target="wprss_kf"><?php _e( 'Full Text RSS Feeds', WPRSS_TEXT_DOMAIN ); ?></a></strong></li>
|
109 |
-
<li><strong><a href="https://www.wprssaggregator.com/extension/wordai/" target="wprss_ai"><?php _e( 'WordAi', WPRSS_TEXT_DOMAIN ); ?></a></strong></li>
|
110 |
-
<li><strong><a href="https://www.wprssaggregator.com/extension/spinnerchief/" target="wprss_sc"><?php _e( 'SpinnerChief', WPRSS_TEXT_DOMAIN ); ?></a></strong></li>
|
111 |
-
</ul>
|
112 |
-
</p>
|
113 |
-
<?php echo wpautop( sprintf( __( 'More information about add-ons can be found on our website <a href="%1$s">%2$s</a>', WPRSS_TEXT_DOMAIN ), 'https://www.wprssaggregator.com', 'www.wprssaggregator.com' ) ) ?>
|
114 |
-
|
115 |
-
<hr/>
|
116 |
-
|
117 |
-
<?php $changelog = wprss_parse_changelog() ?>
|
118 |
-
<?php if ( count( $changelog ) ): foreach( $changelog as $_version => $_changes_html ): ?>
|
119 |
-
<h3><?php printf( __( 'Changelog for v%1$s', WPRSS_TEXT_DOMAIN ), $_version ) ?></h3>
|
120 |
-
<div class="changelog-changeset" >
|
121 |
-
<?php echo $_changes_html ?>
|
122 |
-
</div>
|
123 |
-
<?php break; endforeach; endif; ?>
|
124 |
-
|
125 |
-
<?php echo wpautop( sprintf( __( 'Need functionality not already available in core or the add-ons? You can <a href="%1$s">suggest new features</a>!', WPRSS_TEXT_DOMAIN ), 'https://www.wprssaggregator.com/feature-requests/' ) ) ?>
|
126 |
-
|
127 |
-
</div>
|
128 |
-
|
129 |
-
<?php
|
130 |
-
break;
|
131 |
-
|
132 |
-
// Excerpts and Thumbnails tab
|
133 |
-
case 'et': ?>
|
134 |
-
|
135 |
-
<p class="about-description">
|
136 |
-
<?php _e( 'Fetch RSS feed excerpts to your blog and add thumbnails! Perfect for adding some life and color to your feeds.', WPRSS_TEXT_DOMAIN ) ?>
|
137 |
-
</p>
|
138 |
-
|
139 |
-
<?php
|
140 |
-
break;
|
141 |
-
|
142 |
-
// Categories Tab
|
143 |
-
case 'cat': ?>
|
144 |
-
|
145 |
-
<p class="about-description">
|
146 |
-
<?php _e( 'Organize your feeds into custom categories. Filter feed items by category and make custom WordPress feeds for specific categories.', WPRSS_TEXT_DOMAIN ) ?>
|
147 |
-
</p>
|
148 |
-
|
149 |
-
<?php
|
150 |
-
break;
|
151 |
-
|
152 |
-
// Keyword Filtering tab
|
153 |
-
case 'kf': ?>
|
154 |
-
|
155 |
-
<p class="about-description">
|
156 |
-
<?php _e( 'Import and store feeds that contain specific keywords in either the title or their content. Control what gets imported to your blog.', WPRSS_TEXT_DOMAIN ) ?>
|
157 |
-
</p>
|
158 |
-
|
159 |
-
<?php
|
160 |
-
break;
|
161 |
-
}
|
162 |
-
?>
|
163 |
-
|
164 |
-
<hr/>
|
165 |
-
|
166 |
-
<p><a href="<?php echo $settings_url; ?>"><?php _e( 'Go to WP RSS Aggregator settings', WPRSS_TEXT_DOMAIN ) ?></a></p>
|
167 |
-
|
168 |
-
</div>
|
169 |
-
|
170 |
-
<?php update_option( 'wprss_pwsv', WPRSS_VERSION ); // Update the previous welcome screen version ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -172,3 +172,36 @@
|
|
172 |
), $deps);
|
173 |
wp_enqueue_script($handle, $src, $deps, $ver, $in_footer);
|
174 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
), $deps);
|
173 |
wp_enqueue_script($handle, $src, $deps, $ver, $in_footer);
|
174 |
}
|
175 |
+
|
176 |
+
add_filter('admin_footer_text', 'wprss_admin_footer');
|
177 |
+
/**
|
178 |
+
* Adds footer text on the plugin pages.
|
179 |
+
*
|
180 |
+
* @param string $footer The footer text to filter
|
181 |
+
*
|
182 |
+
* @return string The filtered footer text with added plugin text, or the param
|
183 |
+
* value if the page is not specific to the plugin.
|
184 |
+
*/
|
185 |
+
function wprss_admin_footer($footer)
|
186 |
+
{
|
187 |
+
// Current post type
|
188 |
+
global $typenow;
|
189 |
+
// Check if type is a plugin type. If not, stop
|
190 |
+
// Plugin type is in the form 'wprss_*'' where * is 'feed', 'blacklist', etc)
|
191 |
+
if (stripos($typenow, 'wprss_') !== 0) {
|
192 |
+
return $footer;
|
193 |
+
}
|
194 |
+
|
195 |
+
// Prepare fragments of the message
|
196 |
+
$thank_you = sprintf(
|
197 |
+
__('Thank you for using <a href="%1$s" target="_blank">WP RSS Aggregator</a>.', 'wprss'),
|
198 |
+
'https://www.wprssaggregator.com/'
|
199 |
+
);
|
200 |
+
$rate_us = sprintf(
|
201 |
+
__('Please <a href="%1$s" target="_blank">rate us</a>!', 'wprss'),
|
202 |
+
'https://wordpress.org/support/view/plugin-reviews/wp-rss-aggregator?filter=5#postform'
|
203 |
+
);
|
204 |
+
|
205 |
+
// Return the final text
|
206 |
+
return sprintf('<span class="wp-rss-footer-text">%1$s %2$s</span>', $thank_you, $rate_us);
|
207 |
+
}
|
@@ -0,0 +1,917 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Save item image info during import
|
4 |
+
use Psr\Log\LoggerInterface;
|
5 |
+
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
6 |
+
|
7 |
+
class Wpra_Rss_Namespace {
|
8 |
+
const ITUNES = 'http://www.itunes.com/dtds/podcast-1.0.dtd';
|
9 |
+
}
|
10 |
+
|
11 |
+
add_action('wprss_items_create_post_meta', 'wpra_detect_item_type', 10, 3);
|
12 |
+
add_action('wprss_items_create_post_meta', 'wpra_import_item_images', 11, 3);
|
13 |
+
add_filter('wprss_ftp_post_meta', function ($meta, $id, $source, $item) {
|
14 |
+
wpra_detect_item_type($id, $item, $source);
|
15 |
+
|
16 |
+
return $meta;
|
17 |
+
}, 11, 4);
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Imports images for a feed item.
|
21 |
+
*
|
22 |
+
* The "import" process here basically just fetches the images from the item's content/excerpt, the media:thumbnail
|
23 |
+
* tag and the enclosures. The entire list of images is saved, along with the URL of the best image.
|
24 |
+
*
|
25 |
+
* @param int|string $itemId The ID of the feed item.
|
26 |
+
* @param SimplePie_Item $item The simple pie item object.
|
27 |
+
* @param int|string $sourceId The ID of the feed source from which the item was imported.
|
28 |
+
*/
|
29 |
+
function wpra_detect_item_type($itemId, $item, $sourceId)
|
30 |
+
{
|
31 |
+
$logger = wpra_get_logger($sourceId);
|
32 |
+
$url = parse_url($item->get_permalink());
|
33 |
+
$url['query_str'] = isset($url['query']) ? $url['query'] : '';
|
34 |
+
parse_str($url['query_str'], $url['query']);
|
35 |
+
|
36 |
+
if (stripos($url['host'], 'youtube.com') !== false && !empty($url['query']['v'])) {
|
37 |
+
$logger->info('Detected YouTube feed item');
|
38 |
+
|
39 |
+
$videoCode = $url['query']['v'];
|
40 |
+
$embedUrl = sprintf('https://youtube.com/embed/%s', $videoCode);
|
41 |
+
|
42 |
+
update_post_meta($itemId, 'wprss_item_is_yt', '1');
|
43 |
+
update_post_meta($itemId, 'wprss_item_yt_embed_url', $embedUrl);
|
44 |
+
update_post_meta($itemId, 'wprss_item_embed_url', $embedUrl);
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Imports images for a feed item.
|
50 |
+
*
|
51 |
+
* The "import" process here basically just fetches the images from the item's content/excerpt, the media:thumbnail
|
52 |
+
* tag and the enclosures. The entire list of images is saved, along with the URL of the best image.
|
53 |
+
*
|
54 |
+
* @param int|string $itemId The ID of the feed item.
|
55 |
+
* @param SimplePie_Item $item The simple pie item object.
|
56 |
+
* @param int|string $sourceId The ID of the feed source from which the item was imported.
|
57 |
+
*/
|
58 |
+
function wpra_import_item_images($itemId, $item, $sourceId)
|
59 |
+
{
|
60 |
+
// Start with empty meta
|
61 |
+
update_post_meta($itemId, 'wprss_images', []);
|
62 |
+
update_post_meta($itemId, 'wprss_best_image', '');
|
63 |
+
|
64 |
+
/* @var $logger LoggerInterface */
|
65 |
+
$container = wpra_container();
|
66 |
+
$loggerDataSet = $container->get('wpra/images/logging/feed_logger_dataset');
|
67 |
+
$logger = $loggerDataSet[$sourceId];
|
68 |
+
|
69 |
+
$title = $item->get_title();
|
70 |
+
$logger->debug('Importing images for item "{title}"', ['title' => $title]);
|
71 |
+
|
72 |
+
$collection = wpra_container()->get('wpra/feeds/sources/collection');
|
73 |
+
try {
|
74 |
+
$source = $collection[$sourceId];
|
75 |
+
} catch (Exception $exception) {
|
76 |
+
$logger->warning('Feed source #{id} could not be found', ['id' => $sourceId]);
|
77 |
+
return;
|
78 |
+
}
|
79 |
+
|
80 |
+
// Get the featured image option from the feed source
|
81 |
+
$ftImageOpt = $source['import_ft_images'];
|
82 |
+
|
83 |
+
// Stop if source has featured images disabled
|
84 |
+
if (empty($ftImageOpt)) {
|
85 |
+
$logger->debug('Feed source has featured images disabled');
|
86 |
+
return;
|
87 |
+
}
|
88 |
+
|
89 |
+
// Get all of the item's images
|
90 |
+
$allImages = wpra_get_item_images($item);
|
91 |
+
// Process the images, removing duds, and find the best image
|
92 |
+
$images = wpra_process_images($allImages, $source, $bestImage);
|
93 |
+
|
94 |
+
$ftImageUrl = null;
|
95 |
+
switch ($ftImageOpt)
|
96 |
+
{
|
97 |
+
case 'auto':
|
98 |
+
if (!empty($bestImage)) {
|
99 |
+
$ftImageUrl = $bestImage;
|
100 |
+
}
|
101 |
+
break;
|
102 |
+
|
103 |
+
case 'media':
|
104 |
+
if (isset($images['media'])) {
|
105 |
+
$ftImageUrl = $images['media'];
|
106 |
+
}
|
107 |
+
break;
|
108 |
+
|
109 |
+
case 'enclosure':
|
110 |
+
if (is_array($images['enclosure']) && !empty($images['enclosure'])) {
|
111 |
+
$ftImageUrl = reset($images['enclosure']);
|
112 |
+
}
|
113 |
+
break;
|
114 |
+
|
115 |
+
case 'content':
|
116 |
+
if (is_array($images['content']) && !empty($images['content'])) {
|
117 |
+
$ftImageUrl = reset($images['content']);
|
118 |
+
}
|
119 |
+
break;
|
120 |
+
|
121 |
+
case 'itunes':
|
122 |
+
if (is_array($images['itunes']) && !empty($images['itunes'])) {
|
123 |
+
$ftImageUrl = reset($images['itunes']);
|
124 |
+
}
|
125 |
+
break;
|
126 |
+
|
127 |
+
case 'default':
|
128 |
+
default:
|
129 |
+
$ftImageUrl = '';
|
130 |
+
break;
|
131 |
+
}
|
132 |
+
|
133 |
+
if (empty($ftImageUrl)) {
|
134 |
+
// If not always using the default image, and items must have an image, delete the item
|
135 |
+
if ($ftImageOpt !== 'default' && wpra_image_feature_enabled('must_have_ft_image') && $source['must_have_ft_image']) {
|
136 |
+
$logger->debug('Rejecting item "{title}" due to a lack of a featured image.', [
|
137 |
+
'title' => get_post($itemId)->post_title,
|
138 |
+
]);
|
139 |
+
|
140 |
+
wp_delete_post($itemId, true);
|
141 |
+
} else {
|
142 |
+
// Get the feed source's default featured image
|
143 |
+
$defaultFtImage = get_post_thumbnail_id($sourceId);
|
144 |
+
// Assign it to the feed item
|
145 |
+
$defaultSuccessful = set_post_thumbnail($itemId, $defaultFtImage);
|
146 |
+
// The feed item is classified as using the default image if:
|
147 |
+
// - the default image was successfully assigned
|
148 |
+
// - the user did NOT explicitly want to use the default
|
149 |
+
$usedDefault = $defaultSuccessful && $ftImageOpt !== 'default';
|
150 |
+
|
151 |
+
if ($usedDefault) {
|
152 |
+
update_post_meta($itemId, 'wprss_item_is_using_def_image', '1');
|
153 |
+
$logger->notice('Used the feed source\'s default featured image for "{title}"', ['title' => $title]);
|
154 |
+
} else {
|
155 |
+
$logger->notice('No featured image was found for item "{title}"', ['title' => $title]);
|
156 |
+
}
|
157 |
+
}
|
158 |
+
} else {
|
159 |
+
$logger->info('Set featured image from URL: "{url}"', ['url' => $ftImageUrl]);
|
160 |
+
wpra_set_featured_image_from_url($itemId, $ftImageUrl);
|
161 |
+
|
162 |
+
if (wpra_image_feature_enabled('siphon_ft_image') && $source['siphon_ft_image']) {
|
163 |
+
$content = get_post($itemId)->post_content;
|
164 |
+
$newContent = wpra_remove_image_from_content($content, $ftImageUrl);
|
165 |
+
|
166 |
+
wp_update_post([
|
167 |
+
'ID' => $itemId,
|
168 |
+
'post_content' => $newContent
|
169 |
+
]);
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
// Maybe download other images and replace the URLs in the item's content
|
174 |
+
if (wpra_image_feature_enabled('download_images') && $source['download_images']) {
|
175 |
+
// Flatten the list of images from a 2d array to a 1d array
|
176 |
+
$imagesList = call_user_func_array('array_merge', $images);
|
177 |
+
// Download the images and attach them to the item
|
178 |
+
$urlMapping = wpra_download_item_images($imagesList, $itemId);
|
179 |
+
// Replace the URLs in the item's content
|
180 |
+
$content = str_replace(
|
181 |
+
array_keys($urlMapping),
|
182 |
+
array_values($urlMapping),
|
183 |
+
get_post($itemId)->post_content
|
184 |
+
);
|
185 |
+
// Update the post content
|
186 |
+
wp_update_post([
|
187 |
+
'ID' => $itemId,
|
188 |
+
'post_content' => $content
|
189 |
+
]);
|
190 |
+
}
|
191 |
+
|
192 |
+
// Save the image URLs in meta
|
193 |
+
update_post_meta($itemId, 'wprss_images', $images);
|
194 |
+
update_post_meta($itemId, 'wprss_best_image', $bestImage);
|
195 |
+
|
196 |
+
// Log number of found images
|
197 |
+
$logger->info('Found {count} images', ['count' => count($images)]);
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Downloads a given list of images and attaches them to an imported item.
|
202 |
+
*
|
203 |
+
* @since 4.14
|
204 |
+
*
|
205 |
+
* @param string[] $images The URLs of the images to download.
|
206 |
+
* @param int $postId The ID of the WordPress post to which the images will be attached.
|
207 |
+
*
|
208 |
+
* @return string[] A mapping of the given URLs pointing to the corresponding local URLs of the downloaded images.
|
209 |
+
*/
|
210 |
+
function wpra_download_item_images($images, $postId)
|
211 |
+
{
|
212 |
+
$mapping = [];
|
213 |
+
|
214 |
+
foreach ($images as $url) {
|
215 |
+
// No need to download
|
216 |
+
if (wpra_is_url_local($url)) {
|
217 |
+
continue;
|
218 |
+
}
|
219 |
+
|
220 |
+
$imageId = wpra_download_item_image($postId, $url);
|
221 |
+
|
222 |
+
// Failed to download
|
223 |
+
if ($imageId === null) {
|
224 |
+
continue;
|
225 |
+
}
|
226 |
+
|
227 |
+
$mapping[$url] = wp_get_attachment_url($imageId);
|
228 |
+
}
|
229 |
+
|
230 |
+
return $mapping;
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Retrieves the URLs of all the images in a feed item.
|
235 |
+
*
|
236 |
+
* @param SimplePie_Item $item The simple pie item object.
|
237 |
+
*
|
238 |
+
* @return string[] A list of image URLs.
|
239 |
+
*/
|
240 |
+
function wpra_get_item_images($item)
|
241 |
+
{
|
242 |
+
// Detect images and save them
|
243 |
+
$images = [];
|
244 |
+
|
245 |
+
// Add the media thumbnail image
|
246 |
+
$images['media'] = [wpra_get_item_media_thumbnail_image($item)];
|
247 |
+
$images['enclosure'] = wpra_get_item_enclosure_images($item);
|
248 |
+
$images['content'] = wpra_get_item_content_images($item);
|
249 |
+
$images['itunes'] = wpra_get_item_itunes_images($item);
|
250 |
+
|
251 |
+
return $images;
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Processes a list of image URLs to strip away images that are unreachable or too small, as well as identify which
|
256 |
+
* image in the list is the best image (in terms of dimensions and aspect ratio).
|
257 |
+
*
|
258 |
+
* @param array $images The image URLs.
|
259 |
+
* @param array|DataSetInterface $source The feed source data set.
|
260 |
+
* @param string|null $bestImage This variable given as this parameter will be set to the URL of
|
261 |
+
* the best found image.
|
262 |
+
*
|
263 |
+
* @return mixed
|
264 |
+
*/
|
265 |
+
function wpra_process_images($images, $source, &$bestImage = null)
|
266 |
+
{
|
267 |
+
if (!wpra_container()->has('wpra/images/container')) {
|
268 |
+
return [];
|
269 |
+
}
|
270 |
+
|
271 |
+
$imgContainer = wpra_container()->get('wpra/images/container');
|
272 |
+
|
273 |
+
// The list of images of keep and their sizes
|
274 |
+
$imageInfos = [];
|
275 |
+
// The largest image size found so far, as width * height
|
276 |
+
$maxSize = 0;
|
277 |
+
|
278 |
+
// The minimum dimensions for an image to be valid
|
279 |
+
$minWidth = 0;
|
280 |
+
$minHeight = 0;
|
281 |
+
if (wpra_image_feature_enabled('image_min_size')) {
|
282 |
+
$minWidth = (int)apply_filters('wprss_thumbnail_min_width', $source['image_min_width']);
|
283 |
+
$minHeight = (int)apply_filters('wprss_thumbnail_min_height', $source['image_min_height']);
|
284 |
+
}
|
285 |
+
|
286 |
+
foreach ($images as $group => $urls) {
|
287 |
+
foreach ($urls as $imageUrl) {
|
288 |
+
try {
|
289 |
+
/* @var $tmp_img WPRSS_Image_Cache_Image */
|
290 |
+
$tmp_img = $imgContainer->get($imageUrl);
|
291 |
+
|
292 |
+
$dimensions = ($tmp = $tmp_img->get_local_path())
|
293 |
+
? $tmp_img->get_size()
|
294 |
+
: null;
|
295 |
+
|
296 |
+
// Ignore image if too small in either dimension
|
297 |
+
if ($dimensions === null || $dimensions[0] < $minWidth || $dimensions[1] < $minHeight) {
|
298 |
+
continue;
|
299 |
+
}
|
300 |
+
|
301 |
+
$area = $dimensions[0] * $dimensions[1];
|
302 |
+
$ratio = floatval($dimensions[0]) / floatval($dimensions[1]);
|
303 |
+
|
304 |
+
// If larger than the current best image and its aspect ratio is between 1 and 2,
|
305 |
+
// then set this image as the new best image
|
306 |
+
if ($maxSize === 0 || ($area > $maxSize && $ratio > 1.0 && $ratio < 2.0)) {
|
307 |
+
$maxSize = $area;
|
308 |
+
$bestImage = $imageUrl;
|
309 |
+
}
|
310 |
+
|
311 |
+
// Add to the list of images to save
|
312 |
+
$imageInfos[$group][] = [$imageUrl, $dimensions, $area, $ratio];
|
313 |
+
} catch (Exception $exception) {
|
314 |
+
// If failed to get dimensions, skip the image
|
315 |
+
continue;
|
316 |
+
}
|
317 |
+
}
|
318 |
+
}
|
319 |
+
|
320 |
+
$finalImages = [];
|
321 |
+
foreach ($imageInfos as $group => $infos) {
|
322 |
+
// Do not sort images found in the content
|
323 |
+
if ($group !== 'content') {
|
324 |
+
// Sort each group by image size in descending order (largest image first)
|
325 |
+
usort($infos, function ($img1, $img2) {
|
326 |
+
$area1 = $img1[1];
|
327 |
+
$area2 = $img2[1];
|
328 |
+
|
329 |
+
return ($area1 >= $area2) ? -1 : 1;
|
330 |
+
});
|
331 |
+
}
|
332 |
+
// Save only the URLs
|
333 |
+
$finalImages[$group] = array_map(function ($info) {
|
334 |
+
return $info[0];
|
335 |
+
}, $infos);
|
336 |
+
}
|
337 |
+
|
338 |
+
return $finalImages;
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Returns the <media:thumbnail> image for the given feed item.
|
343 |
+
*
|
344 |
+
* @since 4.14
|
345 |
+
*
|
346 |
+
* @param SimplePie_Item $item The feed item
|
347 |
+
*
|
348 |
+
* @return string|null The string URL of the image, or null if the item does not contain a <media:thumbnail> image.
|
349 |
+
*/
|
350 |
+
function wpra_get_item_media_thumbnail_image($item)
|
351 |
+
{
|
352 |
+
// Try to get image from enclosure if available
|
353 |
+
$enclosure = $item->get_enclosure();
|
354 |
+
|
355 |
+
// Stop if item has no enclosure tag
|
356 |
+
if (is_null($enclosure)) {
|
357 |
+
return null;
|
358 |
+
}
|
359 |
+
|
360 |
+
// Stop if enclosure is not an image
|
361 |
+
$type = $enclosure->get_type();
|
362 |
+
if (!empty($type) && stripos($type, 'image/') !== 0) {
|
363 |
+
return null;
|
364 |
+
}
|
365 |
+
|
366 |
+
// Stop if enclosure tag has no link
|
367 |
+
$url = $enclosure->get_link();
|
368 |
+
if (empty($url)) {
|
369 |
+
return null;
|
370 |
+
}
|
371 |
+
|
372 |
+
// Check if image can be downloaded
|
373 |
+
if (wpra_container()->has('wpra/images/container')) {
|
374 |
+
try {
|
375 |
+
/* @var $image WPRSS_Image_Cache_Image */
|
376 |
+
$image = wpra_container()->get('wpra/images/container')->get($url);
|
377 |
+
} catch (Exception $exception) {
|
378 |
+
return null;
|
379 |
+
}
|
380 |
+
}
|
381 |
+
|
382 |
+
if ($image->get_local_path()) {
|
383 |
+
return $url;
|
384 |
+
}
|
385 |
+
|
386 |
+
return null;
|
387 |
+
}
|
388 |
+
|
389 |
+
/**
|
390 |
+
* Returns the enclosure images for the given feed item.
|
391 |
+
*
|
392 |
+
* @since 4.14
|
393 |
+
*
|
394 |
+
* @param SimplePie_Item $item The feed item
|
395 |
+
*
|
396 |
+
* @return string[] The string URLs of the found enclosure images.
|
397 |
+
*/
|
398 |
+
function wpra_get_item_enclosure_images($item)
|
399 |
+
{
|
400 |
+
$enclosure = $item->get_enclosure();
|
401 |
+
|
402 |
+
// Stop if item has no enclosure
|
403 |
+
if (is_null($enclosure)) {
|
404 |
+
return [];
|
405 |
+
}
|
406 |
+
|
407 |
+
// Get all the thumbnails from the enclosure
|
408 |
+
$thumbnails = (array) $enclosure->get_thumbnails();
|
409 |
+
|
410 |
+
return $thumbnails;
|
411 |
+
}
|
412 |
+
|
413 |
+
/**
|
414 |
+
* Returns the images found in the given item's content
|
415 |
+
*
|
416 |
+
* @since 4.14
|
417 |
+
*
|
418 |
+
* @param SimplePie_Item $item The feed item
|
419 |
+
*
|
420 |
+
* @return string[] Returns the string URLs of the images found.
|
421 |
+
*/
|
422 |
+
function wpra_get_item_content_images($item)
|
423 |
+
{
|
424 |
+
// Extract all images from the content into the $matches array
|
425 |
+
preg_match_all('/<img.*?src=[\'"](.*?)[\'"].*?>/xis', $item->get_content(), $matches);
|
426 |
+
|
427 |
+
$i = 0;
|
428 |
+
$images = [];
|
429 |
+
while (!empty($matches[1][$i])) {
|
430 |
+
$imageUrl = urldecode(trim($matches[1][$i]));
|
431 |
+
// Increment early to allow the iteration body to use "continue" statements
|
432 |
+
$i++;
|
433 |
+
|
434 |
+
// Add http prefix if not included
|
435 |
+
if (stripos($imageUrl, '//') === 0) {
|
436 |
+
$imageUrl = 'http:' . $imageUrl;
|
437 |
+
}
|
438 |
+
|
439 |
+
// Add to the list
|
440 |
+
$images[] = $imageUrl;
|
441 |
+
}
|
442 |
+
|
443 |
+
return $images;
|
444 |
+
}
|
445 |
+
|
446 |
+
/**
|
447 |
+
* Returns the itunes images for the given feed item.
|
448 |
+
*
|
449 |
+
* @since 4.14
|
450 |
+
*
|
451 |
+
* @param SimplePie_Item $item The feed item
|
452 |
+
*
|
453 |
+
* @return string[] Returns the string URLs of the images found.
|
454 |
+
*/
|
455 |
+
function wpra_get_item_itunes_images($item)
|
456 |
+
{
|
457 |
+
$tags = $item->get_item_tags(Wpra_Rss_Namespace::ITUNES,'image');
|
458 |
+
|
459 |
+
$images = [];
|
460 |
+
foreach ($tags as $tag) {
|
461 |
+
if (empty($tag['attribs']) || empty($tag['attribs'][''])) {
|
462 |
+
continue;
|
463 |
+
}
|
464 |
+
|
465 |
+
$attribs = $tag['attribs'][''];
|
466 |
+
|
467 |
+
if (!empty($attribs['href'])) {
|
468 |
+
$images[] = $attribs['href'];
|
469 |
+
}
|
470 |
+
}
|
471 |
+
|
472 |
+
return $images;
|
473 |
+
}
|
474 |
+
|
475 |
+
/**
|
476 |
+
* Removes an image tag, matched by an image URL, from a string of HTML content.
|
477 |
+
*
|
478 |
+
* @since 4.14
|
479 |
+
*
|
480 |
+
* @param string $content The content in which to search for and remove the image.
|
481 |
+
* @param string $url The URL of the image to remove.
|
482 |
+
* @param int $limit Optional number of image occurrences to remove.
|
483 |
+
*
|
484 |
+
* @return string The new content, with any matching `img` HTML tags removed.
|
485 |
+
*/
|
486 |
+
function wpra_remove_image_from_content($content, $url, $limit = 1)
|
487 |
+
{
|
488 |
+
$tag_search = array(
|
489 |
+
'<img[^<>]*?src="%s"[^<>]*?>',
|
490 |
+
'<img[^<>]*?srcset="[^<>]*?%s.[^<>]*?"[^<>]*?>'
|
491 |
+
);
|
492 |
+
|
493 |
+
foreach ($tag_search as $regex) {
|
494 |
+
// This will transform the expression to match images in html-encoded content
|
495 |
+
$regex = wprss_html_regex_encodify($regex);
|
496 |
+
// Prepare the URL to be inserted into the sprintf-style regex string
|
497 |
+
$regexUrl = preg_quote(esc_attr($url), '!');
|
498 |
+
// Insert the URL into the regex string, and add the regex delimiter and modifiers
|
499 |
+
$regex = sprintf($regex, $regexUrl);
|
500 |
+
$regex = sprintf('!%s!Uis', $regex);
|
501 |
+
// Replace the tag with an empty string, and get the new content
|
502 |
+
$content = preg_replace($regex, '', $content, $limit);
|
503 |
+
}
|
504 |
+
|
505 |
+
$filtered = wp_filter_post_kses($content);
|
506 |
+
$trimmed = trim($filtered);
|
507 |
+
|
508 |
+
return $trimmed;
|
509 |
+
}
|
510 |
+
|
511 |
+
/**
|
512 |
+
* Downloads a feed item image.
|
513 |
+
*
|
514 |
+
* This function will attempt to download the image at the given URL. If the image URL is a local URL, the function
|
515 |
+
* will skip the downloading process. The post ID is required in order to use WordPress side-loading function.
|
516 |
+
*
|
517 |
+
* @since 4.14
|
518 |
+
*
|
519 |
+
* @param int $post_id The ID of the post.
|
520 |
+
* @param string $url The URL of the image.
|
521 |
+
*
|
522 |
+
* @return string|null The ID of the locally downloaded image or null on failure.
|
523 |
+
*/
|
524 |
+
function wpra_download_item_image($post_id, $url)
|
525 |
+
{
|
526 |
+
// Download image if needed
|
527 |
+
if (wpra_is_url_local($url)) {
|
528 |
+
return null;
|
529 |
+
}
|
530 |
+
|
531 |
+
$id = wpra_media_sideload_image($url, $post_id, false);
|
532 |
+
|
533 |
+
if ($id instanceof WP_Error) {
|
534 |
+
return null;
|
535 |
+
}
|
536 |
+
|
537 |
+
return $id;
|
538 |
+
}
|
539 |
+
|
540 |
+
/**
|
541 |
+
* Sets a featured image to a post, from a URL.
|
542 |
+
*
|
543 |
+
* This function will attempt to download the image at the given URL and then assign it to the post with the given ID.
|
544 |
+
* If the image URL is a local URL, the function will skip the downloading process.
|
545 |
+
*
|
546 |
+
* @since 4.14
|
547 |
+
*
|
548 |
+
* @param int $post_id The ID of the post.
|
549 |
+
* @param string $url The URL of the image.
|
550 |
+
*/
|
551 |
+
function wpra_set_featured_image_from_url($post_id, $url)
|
552 |
+
{
|
553 |
+
// Download image if needed
|
554 |
+
if (!wpra_is_url_local($url)) {
|
555 |
+
wpra_media_sideload_image($url, $post_id, true);
|
556 |
+
|
557 |
+
return;
|
558 |
+
}
|
559 |
+
|
560 |
+
// Otherwise, get the attachment ID for the URL from the database
|
561 |
+
set_post_thumbnail( $post_id, wpra_get_attachment_id_from_url($url) );
|
562 |
+
}
|
563 |
+
|
564 |
+
/**
|
565 |
+
* Checks if the given url is a local or external one
|
566 |
+
*
|
567 |
+
* @since 4.14
|
568 |
+
*/
|
569 |
+
function wpra_is_url_local($url, $home_url = null)
|
570 |
+
{
|
571 |
+
if (is_null($home_url)) {
|
572 |
+
$home_url = get_option('siteurl');
|
573 |
+
}
|
574 |
+
|
575 |
+
// What about the URLs are we comparing?
|
576 |
+
$relevant_parts = ['host', 'path'];
|
577 |
+
|
578 |
+
// Get the site's url
|
579 |
+
$siteurl = trim(wpra_rebuild_url($home_url, $relevant_parts), '/');
|
580 |
+
// The URL in question
|
581 |
+
$url = trim(wpra_rebuild_url(wpra_encode_and_parse_url($url), $relevant_parts), '/');
|
582 |
+
|
583 |
+
return strpos($url, $siteurl) === 0;
|
584 |
+
}
|
585 |
+
|
586 |
+
/**
|
587 |
+
* Builds a URL from a given URL, using only the specified parts of it.
|
588 |
+
*
|
589 |
+
* @since 4.14
|
590 |
+
*
|
591 |
+
* @see parse_url()
|
592 |
+
*
|
593 |
+
* @param string|array $url The URL which is to be rebuilt, or a result of parse_url().
|
594 |
+
*
|
595 |
+
* @param bool|array $parts An array of which parts to use for building the new URL. Boolean false for all.
|
596 |
+
*
|
597 |
+
* @return null|string The rebuilt URL on success, or null of given URL is malformed.
|
598 |
+
*/
|
599 |
+
function wpra_rebuild_url($url, $parts = false)
|
600 |
+
{
|
601 |
+
|
602 |
+
// Allow parsed array
|
603 |
+
if (is_string($url)) {
|
604 |
+
$url = parse_url($url);
|
605 |
+
}
|
606 |
+
|
607 |
+
// malformed or empty URL
|
608 |
+
if (!$url) {
|
609 |
+
return null;
|
610 |
+
}
|
611 |
+
|
612 |
+
// Include all parts
|
613 |
+
if ($parts === false) {
|
614 |
+
return http_build_url($url);
|
615 |
+
}
|
616 |
+
|
617 |
+
// Nothing to do here
|
618 |
+
if (empty($parts)) {
|
619 |
+
return '';
|
620 |
+
}
|
621 |
+
|
622 |
+
$newParts = [];
|
623 |
+
foreach ($parts as $_idx => $_part) {
|
624 |
+
$_part = trim($_part);
|
625 |
+
if (isset($url[$_part])) {
|
626 |
+
$newParts[$_part] = $url[$_part];
|
627 |
+
}
|
628 |
+
}
|
629 |
+
|
630 |
+
// Rebuilding the URL from parts
|
631 |
+
return http_build_url($newParts);
|
632 |
+
}
|
633 |
+
|
634 |
+
function wpra_encode_and_parse_url($url)
|
635 |
+
{
|
636 |
+
$encodedUrl = @preg_replace_callback('%[^:/?#&=\.]+%usD', function ($matches) {
|
637 |
+
return sprintf('urlencode(\'%s\')', $matches[0]);
|
638 |
+
}, $url);
|
639 |
+
$components = parse_url($encodedUrl);
|
640 |
+
foreach ($components as &$component) {
|
641 |
+
$component = urldecode($component);
|
642 |
+
}
|
643 |
+
|
644 |
+
return $components;
|
645 |
+
}
|
646 |
+
|
647 |
+
/**
|
648 |
+
* Download an image from the specified URL and attach it to a post.
|
649 |
+
*
|
650 |
+
* Modified version of core function media_sideload_image() in /wp-admin/includes/media.php
|
651 |
+
* (which returns an html img tag instead of attachment ID).
|
652 |
+
* Additional functionality: ability override actual filename,
|
653 |
+
* and to pass $post_data to override values in wp_insert_attachment (original only allowed $desc).
|
654 |
+
*
|
655 |
+
* Uses image cache to avoid re-downloading images. Keeps cache intact by
|
656 |
+
* creating a copy of the cache file, which will eventually be moved.
|
657 |
+
*
|
658 |
+
* Credits to somatic
|
659 |
+
* http://wordpress.stackexchange.com/questions/30284/media-sideload-image-file-name/44115#44115
|
660 |
+
*
|
661 |
+
* @since 2.7.4
|
662 |
+
*
|
663 |
+
* @param string $url (required) The URL of the image to download
|
664 |
+
* @param int $post_id (required) The post ID the media is to be associated with
|
665 |
+
* @param bool $attach (optional) Whether to make this attachment the Featured Image for the post.
|
666 |
+
* @param string $filename (optional) Replacement filename for the URL filename (do not include extension)
|
667 |
+
* @param array $post_data (optional) Array of key => values for wp_posts table (ex: 'post_title' => 'foobar',
|
668 |
+
* 'post_status' => 'draft')
|
669 |
+
*
|
670 |
+
* @return int|object The ID of the attachment or a WP_Error on failure
|
671 |
+
*/
|
672 |
+
function wpra_media_sideload_image($url = null, $post_id = null, $attach = null, $filename = null, $post_data = [])
|
673 |
+
{
|
674 |
+
if (!$url || !$post_id) {
|
675 |
+
return new WP_Error('missing', "Need a valid URL and post ID...");
|
676 |
+
}
|
677 |
+
|
678 |
+
if (!wpra_container()->has('wpra/images/container')) {
|
679 |
+
return new WP_Error('Images module is not loaded');
|
680 |
+
}
|
681 |
+
|
682 |
+
$logger = wpra_get_logger();
|
683 |
+
$images = wpra_container()->get('wpra/images/container');
|
684 |
+
|
685 |
+
try {
|
686 |
+
/* @var $img WPRSS_Image_Cache_Image */
|
687 |
+
$img = $images->get($url);
|
688 |
+
} catch (Exception $e) {
|
689 |
+
return new WP_Error('could_not_load_image', $e->getMessage(), $url);
|
690 |
+
}
|
691 |
+
|
692 |
+
$logger->debug('Image from cache: {url} -> {path}', [
|
693 |
+
'url' => $img->get_url(),
|
694 |
+
'path' => $img->get_local_path(),
|
695 |
+
]);
|
696 |
+
|
697 |
+
// Get the path
|
698 |
+
$tmp = $img->get_local_path();
|
699 |
+
|
700 |
+
// Required for wp_tempnam() function
|
701 |
+
require_once(ABSPATH . 'wp-admin/includes/file.php');
|
702 |
+
|
703 |
+
// media_handle_sideload() will move the file, but we need the cache to remain
|
704 |
+
copy($tmp, $tmp = wp_tempnam());
|
705 |
+
$tmpPath = pathinfo($tmp);
|
706 |
+
$ext = isset($tmpPath['extension']) ? trim($tmpPath['extension']) : null;
|
707 |
+
$url_filename = $img->get_unique_name();
|
708 |
+
|
709 |
+
$logger->debug('Copied cached image to {path}', [
|
710 |
+
'path' => $tmp,
|
711 |
+
]);
|
712 |
+
|
713 |
+
// override filename if given, reconstruct server path
|
714 |
+
if (!empty($filename)) {
|
715 |
+
$filename = sanitize_file_name($filename);
|
716 |
+
// build new path
|
717 |
+
$new = $tmpPath['dirname'] . "/" . $filename . "." . $ext;
|
718 |
+
// renames temp file on server
|
719 |
+
rename($tmp, $new);
|
720 |
+
// push new filename (in path) to be used in file array later
|
721 |
+
$tmp = $new;
|
722 |
+
}
|
723 |
+
|
724 |
+
// determine file type (ext and mime/type)
|
725 |
+
$url_type = wp_check_filetype($url_filename);
|
726 |
+
|
727 |
+
// If the wp_check_filetype function fails to determine the MIME type
|
728 |
+
if (empty($url_type['type'])) {
|
729 |
+
$url_type = wpra_check_file_type($tmp, $url);
|
730 |
+
}
|
731 |
+
$ext = $url_type['ext'];
|
732 |
+
|
733 |
+
// assemble file data (should be built like $_FILES since wp_handle_sideload() will be using)
|
734 |
+
$file_array = [];
|
735 |
+
// full server path to temp file
|
736 |
+
$file_array['tmp_name'] = $tmp;
|
737 |
+
$url = trim($img->get_url());
|
738 |
+
$parts = parse_url($url);
|
739 |
+
$baseName = uniqid($parts['host']);
|
740 |
+
|
741 |
+
if (!empty($filename)) {
|
742 |
+
// user given filename for title, add original URL extension
|
743 |
+
$baseName = $filename . "." . $ext;
|
744 |
+
} else {
|
745 |
+
// The original basename, falling back to auto-generated based on domain
|
746 |
+
$base = basename($parts['path']);
|
747 |
+
if (strlen($baseName) || trim($baseName) !== '/') {
|
748 |
+
$baseName = $base;
|
749 |
+
}
|
750 |
+
}
|
751 |
+
|
752 |
+
$file_array['name'] = $baseName;
|
753 |
+
|
754 |
+
// set additional wp_posts columns
|
755 |
+
if (empty($post_data['post_title'])) {
|
756 |
+
// just use the original filename (no extension)
|
757 |
+
$post_data['post_title'] = $file_array['name'];
|
758 |
+
}
|
759 |
+
|
760 |
+
// make sure gets tied to parent
|
761 |
+
if (empty($post_data['post_parent'])) {
|
762 |
+
$post_data['post_parent'] = $post_id;
|
763 |
+
}
|
764 |
+
|
765 |
+
// required files for WP media_handle_sideload
|
766 |
+
require_once(ABSPATH . 'wp-admin/includes/media.php');
|
767 |
+
require_once(ABSPATH . 'wp-admin/includes/image.php');
|
768 |
+
|
769 |
+
// NO FILENAME FIX
|
770 |
+
// WordPress does not allow file images that are not in the form of a filename
|
771 |
+
// ex: http://domain.com/thoufiqadsjucpqwuamoshfjnax8mtrh/iorqhewufjasj
|
772 |
+
|
773 |
+
if (apply_filters('wpra_override_upload_security', true) === true) {
|
774 |
+
// If we successfully retrieved the MIME type
|
775 |
+
if ($url_type !== false && isset($url_type['type']) && !empty($url_type['type'])) {
|
776 |
+
$mime_to_ext = wpra_get_mime_type_ext_mapping();
|
777 |
+
|
778 |
+
$mime_type = $url_type['type'];
|
779 |
+
$file_ext = isset($mime_to_ext[$mime_type])
|
780 |
+
? $mime_to_ext[$mime_type]
|
781 |
+
: null;
|
782 |
+
|
783 |
+
// If no file extension, check if the mime type begins with "image/" and if so default to "png"
|
784 |
+
$mime_type_parts = explode('/', $mime_type);
|
785 |
+
if ($file_ext === null && count($mime_type_parts) > 1 && $mime_type_parts[0] === 'image') {
|
786 |
+
$file_ext = 'png';
|
787 |
+
}
|
788 |
+
|
789 |
+
// Add a filter to ensure that the image ext and mime type get passed through WordPress' security
|
790 |
+
add_filter('wp_check_filetype_and_ext', function ($image) use ($file_ext, $mime_type) {
|
791 |
+
$image['ext'] = empty($image['ext']) ? $file_ext : $image['ext'];
|
792 |
+
$image['type'] = empty($image['type']) ? $mime_type : $image['type'];
|
793 |
+
|
794 |
+
return $image;
|
795 |
+
}, 10);
|
796 |
+
}
|
797 |
+
}
|
798 |
+
|
799 |
+
// do the validation and storage stuff
|
800 |
+
// For some reason, deep down filesize() returned 0 for the temporary file without this
|
801 |
+
clearstatcache(false, $file_array['tmp_name']);
|
802 |
+
|
803 |
+
// $post_data can override the items saved to wp_posts table,
|
804 |
+
// like post_mime_type, guid, post_parent, post_title, post_content, post_status
|
805 |
+
$att_id = media_handle_sideload( $file_array, $post_id, '', $post_data);
|
806 |
+
|
807 |
+
// If error storing permanently, unlink
|
808 |
+
if (is_wp_error($att_id)) {
|
809 |
+
$logger->warning('Failed to download and attach image to post #{id}. Image URL: {url}', [
|
810 |
+
'id' => $post_id,
|
811 |
+
'url' => $url,
|
812 |
+
]);
|
813 |
+
|
814 |
+
// Delete the cache copy needed for media_handle_sideload()
|
815 |
+
$img->delete();
|
816 |
+
@unlink($tmp);
|
817 |
+
|
818 |
+
return $att_id;
|
819 |
+
}
|
820 |
+
|
821 |
+
// set as post thumbnail if desired
|
822 |
+
if ($attach) {
|
823 |
+
set_post_thumbnail( $post_id, $att_id );
|
824 |
+
}
|
825 |
+
|
826 |
+
return $att_id;
|
827 |
+
}
|
828 |
+
|
829 |
+
/**
|
830 |
+
* Fallback function for determining mime type and extension of an image
|
831 |
+
*
|
832 |
+
* @since 4.14
|
833 |
+
*
|
834 |
+
* @param string $local_image_path Local path of the downloaded image
|
835 |
+
* @param string $remote_image_path Remote image url
|
836 |
+
*
|
837 |
+
* @return array Values with extension first and mime type.
|
838 |
+
*/
|
839 |
+
function wpra_check_file_type($local_image_path, $remote_image_path)
|
840 |
+
{
|
841 |
+
$ext = false;
|
842 |
+
$type = false;
|
843 |
+
|
844 |
+
$mime_to_ext_mapping = wpra_get_mime_type_ext_mapping();
|
845 |
+
|
846 |
+
$mime_var = 'mime';
|
847 |
+
$image_response = @getimagesize($local_image_path);
|
848 |
+
|
849 |
+
// Trying to get MIME type of the image
|
850 |
+
if (!isset($image_response) || $image_response == false) {
|
851 |
+
$image_response = @get_headers($remote_image_path, 1);
|
852 |
+
if ($image_response !== false) {
|
853 |
+
$mime_var = 'Content-Type';
|
854 |
+
}
|
855 |
+
}
|
856 |
+
|
857 |
+
// If mime type successfully determined
|
858 |
+
if (!empty($image_response[$mime_var])) {
|
859 |
+
$type = $image_response[$mime_var];
|
860 |
+
|
861 |
+
if (isset($mime_to_ext_mapping[$type])) {
|
862 |
+
$ext = $mime_to_ext_mapping[$type];
|
863 |
+
}
|
864 |
+
}
|
865 |
+
|
866 |
+
return compact('ext', 'type');
|
867 |
+
}
|
868 |
+
|
869 |
+
/**
|
870 |
+
* Return Mime type and ext mapping array
|
871 |
+
*
|
872 |
+
* @since 4.14
|
873 |
+
* @return array Mime type and ext mapping
|
874 |
+
*/
|
875 |
+
function wpra_get_mime_type_ext_mapping()
|
876 |
+
{
|
877 |
+
|
878 |
+
// Get MIME to extension mappings ( from WordPress wp_check_filetype_and_ext() function )
|
879 |
+
return apply_filters(
|
880 |
+
'getimagesize_mimes_to_exts', [
|
881 |
+
'image/jpeg' => 'jpg',
|
882 |
+
'image/png' => 'png',
|
883 |
+
'image/gif' => 'gif',
|
884 |
+
'image/bmp' => 'bmp',
|
885 |
+
'image/tiff' => 'tif',
|
886 |
+
]
|
887 |
+
);
|
888 |
+
}
|
889 |
+
|
890 |
+
/**
|
891 |
+
* Returns the attachment ID of the image with the given source
|
892 |
+
*
|
893 |
+
* @since 4.14
|
894 |
+
*/
|
895 |
+
function wpra_get_attachment_id_from_url( $image_src ) {
|
896 |
+
global $wpdb;
|
897 |
+
$query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
|
898 |
+
$id = $wpdb->get_var($query);
|
899 |
+
return $id;
|
900 |
+
}
|
901 |
+
|
902 |
+
/**
|
903 |
+
* Checks if an images feature is enabled.
|
904 |
+
*
|
905 |
+
* @since 4.14
|
906 |
+
*
|
907 |
+
* @param string $feature The feature name.
|
908 |
+
*
|
909 |
+
* @return bool True if the feature is enabled, false if the feature is disabled.
|
910 |
+
*/
|
911 |
+
function wpra_image_feature_enabled($feature)
|
912 |
+
{
|
913 |
+
$c = wpra_container();
|
914 |
+
$key = 'wpra/images/features/' . $feature;
|
915 |
+
|
916 |
+
return $c->has($key) && $c->get($key) === true;
|
917 |
+
}
|
@@ -27,184 +27,192 @@
|
|
27 |
* @since 3.2
|
28 |
*/
|
29 |
function wprss_fetch_insert_single_feed_items( $feed_ID ) {
|
30 |
-
|
31 |
|
32 |
-
|
|
|
33 |
|
34 |
-
|
35 |
-
$wprss_importing_feed = $feed_ID;
|
36 |
-
register_shutdown_function( 'wprss_detect_exec_timeout' );
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
$logger->info('Feed is not active. Finished');
|
41 |
-
return;
|
42 |
-
}
|
43 |
|
44 |
-
|
45 |
-
if ( wprss_feed_source_force_next_fetch( $feed_ID ) ) {
|
46 |
-
delete_post_meta( $feed_ID, 'wprss_force_next_fetch' );
|
47 |
-
}
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
// Get the feed limit from post meta
|
55 |
-
$feed_limit = get_post_meta( $feed_ID, 'wprss_limit', true );
|
56 |
-
|
57 |
-
// If the feed has no individual limit
|
58 |
-
if ( $feed_limit === '' || intval( $feed_limit ) <= 0 ) {
|
59 |
-
// Get the global limit
|
60 |
-
$global_limit = wprss_get_general_setting('limit_feed_items_imported');
|
61 |
-
// If no global limit is set, mark as NULL
|
62 |
-
if ( $global_limit === '' || intval($global_limit) <= 0 ) {
|
63 |
-
$feed_limit = NULL;
|
64 |
-
}
|
65 |
-
else $feed_limit = $global_limit;
|
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 |
-
count($items_to_insert)
|
92 |
-
]);
|
93 |
}
|
|
|
94 |
}
|
95 |
|
96 |
-
|
97 |
-
$existing_permalinks = wprss_get_existing_permalinks( $feed_ID );
|
98 |
-
|
99 |
-
// Check if we should only import uniquely-titled feed items.
|
100 |
-
$existing_titles = array();
|
101 |
-
$unique_titles = FALSE;
|
102 |
-
if ( wprss_get_general_setting( 'unique_titles' ) ) {
|
103 |
-
$unique_titles = TRUE;
|
104 |
-
$existing_titles = wprss_get_existing_titles( );
|
105 |
-
} else if ( get_post_meta( $feed_ID, 'wprss_unique_titles', true ) === 'true' ) {
|
106 |
-
$unique_titles = TRUE;
|
107 |
-
$existing_titles = wprss_get_existing_titles( $feed_ID );
|
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 |
$logger->debug('Item "{0}" already exists in the database', [$item_title]);
|
135 |
-
|
136 |
-
|
|
|
|
|
|
|
137 |
$logger->debug('An item with the title "{0}" already exists', [$item_title]);
|
138 |
-
}
|
139 |
-
}
|
140 |
-
}
|
141 |
|
142 |
-
|
143 |
-
|
144 |
|
145 |
-
|
146 |
-
|
147 |
-
}
|
148 |
|
149 |
-
|
150 |
-
|
151 |
-
if (!empty($per_import)) {
|
152 |
-
$logger->debug('Applying per-import item limit of {0} items', [$per_import]);
|
153 |
-
$items_to_insert = array_slice( $items_to_insert, 0, $per_import );
|
154 |
-
}
|
155 |
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
$db_feed_items = wprss_get_feed_items_for_source( $feed_ID );
|
160 |
-
$num_db_feed_items = $db_feed_items->post_count;
|
161 |
-
|
162 |
-
// Get the number of feed items we can store until we reach the limit
|
163 |
-
$num_can_insert = $feed_limit - $num_db_feed_items;
|
164 |
-
// Calculate how many feed items we must delete before importing, to keep to the limit
|
165 |
-
$num_new_items = count( $new_items );
|
166 |
-
$num_feed_items_to_delete = $num_can_insert > $num_new_items
|
167 |
-
? 0
|
168 |
-
: $num_new_items - $num_can_insert;
|
169 |
-
|
170 |
-
// Get an array with the DB feed items in reverse order (oldest first)
|
171 |
-
$db_feed_items_reversed = array_reverse( $db_feed_items->posts );
|
172 |
-
// Cut the array to get only the first few that are to be deleted ( equal to $num_feed_items_to_delete )
|
173 |
-
$feed_items_to_delete = array_slice( $db_feed_items_reversed, 0, $num_feed_items_to_delete );
|
174 |
-
|
175 |
-
// Iterate the feed items and delete them
|
176 |
-
$num_items_deleted = 0;
|
177 |
-
foreach ( $feed_items_to_delete as $key => $post ) {
|
178 |
-
wp_delete_post( $post->ID, TRUE );
|
179 |
-
$num_items_deleted++;
|
180 |
-
}
|
181 |
|
182 |
-
|
183 |
-
|
|
|
|
|
|
|
184 |
}
|
185 |
-
}
|
186 |
|
187 |
-
|
188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
|
190 |
-
|
191 |
-
|
192 |
-
wprss_items_insert_post( $items_to_insert, $feed_ID );
|
193 |
-
}
|
194 |
-
}
|
195 |
|
196 |
-
|
|
|
|
|
|
|
|
|
197 |
|
198 |
-
|
199 |
-
wprss_feed_source_update_start_schedule( $feed_ID );
|
200 |
-
delete_post_meta( $feed_ID, 'wprss_reschedule_event' );
|
201 |
-
$logger->info('Scheduled next update');
|
202 |
-
}
|
203 |
|
204 |
-
|
|
|
|
|
|
|
|
|
205 |
|
206 |
-
|
207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
$wprss_importing_feed = null;
|
209 |
}
|
210 |
|
@@ -230,7 +238,7 @@
|
|
230 |
|
231 |
if ( !is_wp_error( $feed ) ) {
|
232 |
// Return the items in the feed.
|
233 |
-
return
|
234 |
}
|
235 |
|
236 |
wpra_get_logger($source)->error('Failed to fetch the feed from {0}. Error: {1}', [
|
@@ -276,6 +284,10 @@ function wpse_cron_add_xdebug_cookie ($cron_request_array, $doing_wp_cron)
|
|
276 |
{
|
277 |
// Trim the URL
|
278 |
$url = trim($url);
|
|
|
|
|
|
|
|
|
279 |
|
280 |
// Initialize the Feed
|
281 |
$feed = new SimplePie();
|
@@ -515,12 +527,6 @@ function wpse_cron_add_xdebug_cookie ($cron_request_array, $doing_wp_cron)
|
|
515 |
}
|
516 |
}
|
517 |
|
518 |
-
/* OLD NORMALIZATION CODE - TO NORMALIZE URLS FROM PROXY URLS
|
519 |
-
$response = wp_remote_head( $permalink );
|
520 |
-
if ( !is_wp_error( $response ) && isset( $response['headers']['location'] ) ) {
|
521 |
-
$permalink = current( explode( '?', $response['headers']['location'] ) );
|
522 |
-
}*/
|
523 |
-
|
524 |
// Check if newly fetched item already present in existing feed items,
|
525 |
// if not insert it into wp_posts and insert post meta.
|
526 |
if ( ! ( array_key_exists( $permalink, $existing_permalinks ) ) ) {
|
@@ -542,12 +548,19 @@ function wpse_cron_add_xdebug_cookie ($cron_request_array, $doing_wp_cron)
|
|
542 |
$timestamp = $has_date ? $item->get_date( 'U' ) : date( 'U' );
|
543 |
$date = date( $format, $timestamp );
|
544 |
$date_gmt = gmdate( $format, $timestamp );
|
|
|
|
|
|
|
|
|
|
|
|
|
545 |
// Prepare the item data
|
546 |
$feed_item = apply_filters(
|
547 |
'wprss_populate_post_data',
|
548 |
array(
|
549 |
'post_title' => html_entity_decode( $item->get_title() ),
|
550 |
-
'post_content' =>
|
|
|
551 |
'post_status' => 'publish',
|
552 |
'post_type' => 'wprss_feed_item',
|
553 |
'post_date' => $date,
|
@@ -899,3 +912,52 @@ function wpse_cron_add_xdebug_cookie ($cron_request_array, $doing_wp_cron)
|
|
899 |
$helper->createCommand('wprss_item_comparator_date', $defaultArgs),
|
900 |
);
|
901 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
* @since 3.2
|
28 |
*/
|
29 |
function wprss_fetch_insert_single_feed_items( $feed_ID ) {
|
30 |
+
set_transient('wpra/feeds/importing/' . $feed_ID, true, 0);
|
31 |
|
32 |
+
global $wprss_importing_feed;
|
33 |
+
$wprss_importing_feed = $feed_ID;
|
34 |
|
35 |
+
register_shutdown_function('wprss_detect_exec_timeout');
|
|
|
|
|
36 |
|
37 |
+
$importFn = function ($feed_ID) {
|
38 |
+
$logger = wpra_get_logger($feed_ID);
|
|
|
|
|
|
|
39 |
|
40 |
+
$logger->info('Starting import of feed {id}', ['id' => $feed_ID]);
|
|
|
|
|
|
|
41 |
|
42 |
+
// Check if the feed source is active.
|
43 |
+
if ( ! wprss_is_feed_source_active( $feed_ID ) && ! wprss_feed_source_force_next_fetch( $feed_ID ) ) {
|
44 |
+
$logger->info('Feed is not active. Finished');
|
45 |
+
return;
|
46 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
// If the feed source is forced for next fetch, remove the force next fetch data
|
49 |
+
if ( wprss_feed_source_force_next_fetch( $feed_ID ) ) {
|
50 |
+
delete_post_meta( $feed_ID, 'wprss_force_next_fetch' );
|
51 |
+
}
|
52 |
+
|
53 |
+
// Truncate old items first
|
54 |
+
wprss_truncate_items_for_source( $feed_ID );
|
55 |
+
|
56 |
+
// Get the feed source URL from post meta, and filter it
|
57 |
+
$feed_url = get_post_meta( $feed_ID, 'wprss_url', true );
|
58 |
+
$feed_url = apply_filters( 'wprss_feed_source_url', $feed_url, $feed_ID );
|
59 |
+
$logger->debug('Feed source URL: {0}', [$feed_url]);
|
60 |
+
|
61 |
+
// Get the feed limit from post meta
|
62 |
+
$feed_limit = get_post_meta( $feed_ID, 'wprss_limit', true );
|
63 |
+
|
64 |
+
// If the feed has no individual limit
|
65 |
+
if ( $feed_limit === '' || intval( $feed_limit ) <= 0 ) {
|
66 |
+
// Get the global limit
|
67 |
+
$global_limit = wprss_get_general_setting('limit_feed_items_imported');
|
68 |
+
// If no global limit is set, mark as NULL
|
69 |
+
if ( $global_limit === '' || intval($global_limit) <= 0 ) {
|
70 |
+
$feed_limit = NULL;
|
|
|
|
|
71 |
}
|
72 |
+
else $feed_limit = $global_limit;
|
73 |
}
|
74 |
|
75 |
+
$logger->debug('Feed item import limit: {0}', [$feed_limit]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
+
// Filter the URL for validaty
|
78 |
+
if ( ! wprss_validate_url( $feed_url ) ) {
|
79 |
+
$logger->error('Feed URL is not valid!');
|
80 |
+
} else {
|
81 |
+
// Get the feed items from the source
|
82 |
+
$items = wprss_get_feed_items( $feed_url, $feed_ID );
|
83 |
|
84 |
+
// If got NULL, convert to an empty array
|
85 |
+
if ( $items === NULL ) {
|
86 |
+
$items_to_insert = array();
|
87 |
+
} else {
|
88 |
+
// See `wprss_item_comparators` filter
|
89 |
+
wprss_sort_items($items);
|
90 |
+
|
91 |
+
// If using a limit ...
|
92 |
+
if ( $feed_limit === NULL ) {
|
93 |
+
$items_to_insert = $items;
|
94 |
+
} else {
|
95 |
+
$items_to_insert = array_slice( $items, 0, $feed_limit );
|
96 |
+
$logger->info('Fetched {0} items. Got {1} items after applying limit', [
|
97 |
+
count($items),
|
98 |
+
count($items_to_insert)
|
99 |
+
]);
|
100 |
+
}
|
101 |
+
}
|
102 |
|
103 |
+
// Gather the permalinks of existing feed item's related to this feed source
|
104 |
+
$existing_permalinks = wprss_get_existing_permalinks( $feed_ID );
|
105 |
+
// Gather the titles of the items that are imported
|
106 |
+
$existing_titles = [];
|
107 |
|
108 |
+
// Generate a list of items fetched, that are not already in the DB
|
109 |
+
$new_items = array();
|
110 |
+
foreach ( $items_to_insert as $item ) {
|
111 |
+
$item_title = $item->get_title();
|
112 |
|
113 |
+
$permalink = wprss_normalize_permalink( $item->get_permalink(), $item, $feed_ID );
|
114 |
+
$logger->debug('Checking item "{0}"', [$item_title]);
|
115 |
+
|
116 |
+
// Check if not blacklisted and not already imported
|
117 |
+
$is_blacklisted = wprss_is_blacklisted( $permalink );
|
118 |
+
$permalink_exists = array_key_exists( $permalink, $existing_permalinks );
|
119 |
+
$title_exists_db = wprss_item_title_exists( $item->get_title() );
|
120 |
+
$title_exists_feed = array_key_exists($item_title, $existing_titles);
|
121 |
+
$title_exists = $title_exists_db || $title_exists_feed;
|
122 |
+
|
123 |
+
$existing_titles[$item_title] = 1;
|
124 |
+
|
125 |
+
if ($is_blacklisted) {
|
126 |
+
$logger->debug('Item "{0}" is blacklisted', [$item_title]);
|
127 |
+
|
128 |
+
continue;
|
129 |
+
}
|
130 |
+
|
131 |
+
if ($permalink_exists) {
|
132 |
$logger->debug('Item "{0}" already exists in the database', [$item_title]);
|
133 |
+
|
134 |
+
continue;
|
135 |
+
}
|
136 |
+
|
137 |
+
if ($title_exists) {
|
138 |
$logger->debug('An item with the title "{0}" already exists', [$item_title]);
|
|
|
|
|
|
|
139 |
|
140 |
+
continue;
|
141 |
+
}
|
142 |
|
143 |
+
$new_items[] = $item;
|
144 |
+
}
|
|
|
145 |
|
146 |
+
$original_count = count( $items_to_insert );
|
147 |
+
$new_count = count( $new_items );
|
|
|
|
|
|
|
|
|
148 |
|
149 |
+
if ( $new_count !== $original_count ) {
|
150 |
+
$logger->debug('{0} will be skipped', [$original_count - $new_count]);
|
151 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
+
$items_to_insert = $new_items;
|
154 |
+
$per_import = wprss_get_general_setting('limit_feed_items_per_import');
|
155 |
+
if (!empty($per_import)) {
|
156 |
+
$logger->debug('Applying per-import item limit of {0} items', [$per_import]);
|
157 |
+
$items_to_insert = array_slice( $items_to_insert, 0, $per_import );
|
158 |
}
|
|
|
159 |
|
160 |
+
// If using a limit - delete any excess items to make room for the new items
|
161 |
+
if ( $feed_limit !== NULL ) {
|
162 |
+
// Get the number of feed items in DB, and their count
|
163 |
+
$db_feed_items = wprss_get_feed_items_for_source( $feed_ID );
|
164 |
+
$num_db_feed_items = $db_feed_items->post_count;
|
165 |
+
|
166 |
+
// Get the number of feed items we can store until we reach the limit
|
167 |
+
$num_can_insert = $feed_limit - $num_db_feed_items;
|
168 |
+
// Calculate how many feed items we must delete before importing, to keep to the limit
|
169 |
+
$num_new_items = count( $new_items );
|
170 |
+
$num_feed_items_to_delete = $num_can_insert > $num_new_items
|
171 |
+
? 0
|
172 |
+
: $num_new_items - $num_can_insert;
|
173 |
+
|
174 |
+
// Get an array with the DB feed items in reverse order (oldest first)
|
175 |
+
$db_feed_items_reversed = array_reverse( $db_feed_items->posts );
|
176 |
+
// Cut the array to get only the first few that are to be deleted ( equal to $num_feed_items_to_delete )
|
177 |
+
$feed_items_to_delete = array_slice( $db_feed_items_reversed, 0, $num_feed_items_to_delete );
|
178 |
+
|
179 |
+
// Iterate the feed items and delete them
|
180 |
+
$num_items_deleted = 0;
|
181 |
+
foreach ( $feed_items_to_delete as $key => $post ) {
|
182 |
+
wp_delete_post( $post->ID, TRUE );
|
183 |
+
$num_items_deleted++;
|
184 |
+
}
|
185 |
+
|
186 |
+
if ($num_items_deleted > 0) {
|
187 |
+
$logger->info('Deleted the oldest {0} items from the database', [$num_items_deleted]);
|
188 |
+
}
|
189 |
+
}
|
190 |
|
191 |
+
update_post_meta( $feed_ID, 'wprss_last_update', $last_update_time = time() );
|
192 |
+
update_post_meta( $feed_ID, 'wprss_last_update_items', 0 );
|
|
|
|
|
|
|
193 |
|
194 |
+
// Insert the items into the db
|
195 |
+
if ( !empty( $items_to_insert ) ) {
|
196 |
+
wprss_items_insert_post( $items_to_insert, $feed_ID );
|
197 |
+
}
|
198 |
+
}
|
199 |
|
200 |
+
$next_scheduled = get_post_meta( $feed_ID, 'wprss_reschedule_event', TRUE );
|
|
|
|
|
|
|
|
|
201 |
|
202 |
+
if ( $next_scheduled !== '' ) {
|
203 |
+
wprss_feed_source_update_start_schedule( $feed_ID );
|
204 |
+
delete_post_meta( $feed_ID, 'wprss_reschedule_event' );
|
205 |
+
$logger->info('Scheduled next update');
|
206 |
+
}
|
207 |
|
208 |
+
$logger->info('Import completed!');
|
209 |
|
210 |
+
};
|
211 |
+
|
212 |
+
$importFn($feed_ID);
|
213 |
+
|
214 |
+
delete_transient('wpra/feeds/importing/' . $feed_ID);
|
215 |
+
wprss_flag_feed_as_idle($feed_ID);
|
216 |
$wprss_importing_feed = null;
|
217 |
}
|
218 |
|
238 |
|
239 |
if ( !is_wp_error( $feed ) ) {
|
240 |
// Return the items in the feed.
|
241 |
+
return @$feed->get_items();
|
242 |
}
|
243 |
|
244 |
wpra_get_logger($source)->error('Failed to fetch the feed from {0}. Error: {1}', [
|
284 |
{
|
285 |
// Trim the URL
|
286 |
$url = trim($url);
|
287 |
+
// Parse the URL
|
288 |
+
$parsed = wpra_parse_url($url);
|
289 |
+
// Filter the URL
|
290 |
+
$url = apply_filters('wpra/importer/feed/url', $url, $parsed);
|
291 |
|
292 |
// Initialize the Feed
|
293 |
$feed = new SimplePie();
|
527 |
}
|
528 |
}
|
529 |
|
|
|
|
|
|
|
|
|
|
|
|
|
530 |
// Check if newly fetched item already present in existing feed items,
|
531 |
// if not insert it into wp_posts and insert post meta.
|
532 |
if ( ! ( array_key_exists( $permalink, $existing_permalinks ) ) ) {
|
548 |
$timestamp = $has_date ? $item->get_date( 'U' ) : date( 'U' );
|
549 |
$date = date( $format, $timestamp );
|
550 |
$date_gmt = gmdate( $format, $timestamp );
|
551 |
+
|
552 |
+
// Do not let WordPress sanitize the excerpt
|
553 |
+
// WordPress sanitizes the excerpt because it's expected to be typed by a user and sent in a POST
|
554 |
+
// request. However, our excerpt is being inserted as a raw string with custom sanitization.
|
555 |
+
remove_all_filters( 'excerpt_save_pre' );
|
556 |
+
|
557 |
// Prepare the item data
|
558 |
$feed_item = apply_filters(
|
559 |
'wprss_populate_post_data',
|
560 |
array(
|
561 |
'post_title' => html_entity_decode( $item->get_title() ),
|
562 |
+
'post_content' => $item->get_content(),
|
563 |
+
'post_excerpt' => wprss_sanitize_excerpt($item->get_description()),
|
564 |
'post_status' => 'publish',
|
565 |
'post_type' => 'wprss_feed_item',
|
566 |
'post_date' => $date,
|
912 |
$helper->createCommand('wprss_item_comparator_date', $defaultArgs),
|
913 |
);
|
914 |
}
|
915 |
+
|
916 |
+
/**
|
917 |
+
* Sanitizes a post excerpt, cleverly removing all HTML markup while preserving text content and whitespace.
|
918 |
+
*
|
919 |
+
* @since 4.14
|
920 |
+
*
|
921 |
+
* @param string $excerpt The excerpt to sanitize.
|
922 |
+
*
|
923 |
+
* @return string
|
924 |
+
*/
|
925 |
+
function wprss_sanitize_excerpt($excerpt) {
|
926 |
+
// Decode HTML entities back to their respective characters
|
927 |
+
$excerpt = html_entity_decode($excerpt);
|
928 |
+
// Add a space between any HTML elements
|
929 |
+
$excerpt = str_replace('>', ' >', $excerpt);
|
930 |
+
// Strip all HTML tags
|
931 |
+
$excerpt = strip_tags($excerpt);
|
932 |
+
// Remove any redundant spaces
|
933 |
+
$excerpt = str_replace(' ', ' ', trim($excerpt));
|
934 |
+
|
935 |
+
return $excerpt;
|
936 |
+
}
|
937 |
+
|
938 |
+
/**
|
939 |
+
* Parses a URL, it's query and its path.
|
940 |
+
*
|
941 |
+
* @since 4.14
|
942 |
+
*
|
943 |
+
* @param string $url The URL to parse.
|
944 |
+
*
|
945 |
+
* @return string
|
946 |
+
*/
|
947 |
+
function wpra_parse_url($url)
|
948 |
+
{
|
949 |
+
// Parse the URL
|
950 |
+
$parsed = parse_url($url);
|
951 |
+
|
952 |
+
// Move the path to "path_str"
|
953 |
+
$parsed['path_str'] = isset($parsed['path']) ? $parsed['path'] : '';
|
954 |
+
// Explode the path
|
955 |
+
$parsed['path'] = explode('/', $parsed['path_str']);
|
956 |
+
|
957 |
+
// Move the query to "query_str"
|
958 |
+
$parsed['query_str'] = isset($parsed['query']) ? $parsed['query'] : '';
|
959 |
+
// Parse the query
|
960 |
+
parse_str($parsed['query_str'], $parsed['query']);
|
961 |
+
|
962 |
+
return $parsed;
|
963 |
+
}
|
@@ -134,6 +134,30 @@
|
|
134 |
return @array_flip($cols);
|
135 |
}
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
|
138 |
/**
|
139 |
* Database query to get existing titles
|
@@ -388,7 +412,7 @@
|
|
388 |
* @since 4.6.6
|
389 |
*/
|
390 |
function wprss_flag_feed_as_idle( $feed_ID ) {
|
391 |
-
|
392 |
}
|
393 |
|
394 |
|
@@ -419,12 +443,28 @@
|
|
419 |
// Calculate the allowed maximum time, based on the maximum number of items allowed to be
|
420 |
// imported from this source.
|
421 |
// If no limit is used, 60s (1min) is used.
|
422 |
-
$single_item_time_limit =
|
423 |
-
$allowed_time = $limit === NULL ?
|
424 |
|
425 |
// Calculate how many seconds have passed since the feed last signalled that it is updating
|
426 |
$diff = time() - $is_updating_meta;
|
427 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
428 |
// If the difference is greater than the allowed maximum amount of time, mark the feed as idle.
|
429 |
if ( $diff > $allowed_time ) {
|
430 |
wprss_flag_feed_as_idle( $id );
|
@@ -454,7 +494,7 @@
|
|
454 |
$diff = time() - $is_deleting_meta;
|
455 |
|
456 |
$items = wprss_get_feed_items_for_source( $id );
|
457 |
-
if ( $items->post_count
|
458 |
delete_post_meta( $id, 'wprss_feed_is_deleting_items' );
|
459 |
return FALSE;
|
460 |
}
|
@@ -517,6 +557,53 @@
|
|
517 |
return strtotime( "-$age_limit $age_unit" );
|
518 |
}
|
519 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
520 |
|
521 |
/**
|
522 |
* Delete old feed items from the database to avoid bloat.
|
@@ -532,35 +619,10 @@
|
|
532 |
|
533 |
// Check if there are feed sources
|
534 |
if( $feed_sources->have_posts() ) {
|
535 |
-
//
|
536 |
while ( $feed_sources->have_posts() ) {
|
537 |
$feed_sources->the_post();
|
538 |
-
|
539 |
-
$max_age = wprss_get_max_age_for_feed_source( get_the_ID() );
|
540 |
-
|
541 |
-
// If the data is empty, do not delete
|
542 |
-
if ( $max_age === FALSE ) continue;
|
543 |
-
|
544 |
-
// Get all feed items for this source
|
545 |
-
$feed_items = wprss_get_feed_items_for_source( get_the_ID() );
|
546 |
-
// If there are feed items
|
547 |
-
if ( $feed_items-> have_posts() ) {
|
548 |
-
// Extend the timeout time limit for the deletion of the feed items
|
549 |
-
$time_limit = wprss_get_item_import_time_limit();
|
550 |
-
wprss_log( "Extended execution time limit by {$time_limit}s for imported items truncation.", null, WPRSS_LOG_LEVEL_SYSTEM );
|
551 |
-
set_time_limit( $time_limit );
|
552 |
-
// For each feed item
|
553 |
-
while ( $feed_items->have_posts() ) {
|
554 |
-
$feed_items->the_post();
|
555 |
-
// If the post is older than the maximum age
|
556 |
-
if ( wprss_is_feed_item_older_than( get_the_ID(), $max_age ) === TRUE ){
|
557 |
-
// Delete the post
|
558 |
-
wp_delete_post( get_the_ID(), true );
|
559 |
-
}
|
560 |
-
}
|
561 |
-
// Reset feed items query data
|
562 |
-
wp_reset_postdata();
|
563 |
-
}
|
564 |
}
|
565 |
// Reset feed sources query data
|
566 |
wp_reset_postdata();
|
134 |
return @array_flip($cols);
|
135 |
}
|
136 |
|
137 |
+
/**
|
138 |
+
* Checks if an item title exists in the database.
|
139 |
+
*
|
140 |
+
* @since 4.14
|
141 |
+
*
|
142 |
+
* @param string $title The title to search for.
|
143 |
+
*
|
144 |
+
* @return bool True if the title exists, false if not.
|
145 |
+
*/
|
146 |
+
function wprss_item_title_exists( $title ) {
|
147 |
+
global $wpdb;
|
148 |
+
|
149 |
+
$cols = $wpdb->get_col(
|
150 |
+
$wpdb->prepare(
|
151 |
+
"SELECT *
|
152 |
+
FROM `{$wpdb->posts}` AS p
|
153 |
+
JOIN `{$wpdb->postmeta}` AS q ON p.`ID` = q.`post_id`
|
154 |
+
WHERE q.`meta_key` = 'wprss_feed_id' AND p.`post_title` = %s",
|
155 |
+
[$title]
|
156 |
+
)
|
157 |
+
);
|
158 |
+
|
159 |
+
return count($cols) > 0;
|
160 |
+
}
|
161 |
|
162 |
/**
|
163 |
* Database query to get existing titles
|
412 |
* @since 4.6.6
|
413 |
*/
|
414 |
function wprss_flag_feed_as_idle( $feed_ID ) {
|
415 |
+
update_post_meta( $feed_ID, 'wprss_feed_is_updating', '' );
|
416 |
}
|
417 |
|
418 |
|
443 |
// Calculate the allowed maximum time, based on the maximum number of items allowed to be
|
444 |
// imported from this source.
|
445 |
// If no limit is used, 60s (1min) is used.
|
446 |
+
$single_item_time_limit = wprss_get_feed_fetch_time_limit();
|
447 |
+
$allowed_time = $limit === NULL ? 120 : $single_item_time_limit * intval( $limit );
|
448 |
|
449 |
// Calculate how many seconds have passed since the feed last signalled that it is updating
|
450 |
$diff = time() - $is_updating_meta;
|
451 |
|
452 |
+
// Get the transient that is set when the import function is called and the time of the next scheduled cron
|
453 |
+
$is_updating_transient = get_transient('wpra/feeds/importing/' . $id);
|
454 |
+
$scheduled = (wprss_get_next_feed_source_update($id) !== false);
|
455 |
+
// If more than 5 seconds have passed and the transient is not yet set and the cron was not scheduled
|
456 |
+
// then the cron probably failed to be registered
|
457 |
+
if ( $diff > 5 && !$is_updating_transient && !$scheduled) {
|
458 |
+
wprss_flag_feed_as_idle($id);
|
459 |
+
update_post_meta(
|
460 |
+
$id,
|
461 |
+
'wprss_error_last_import',
|
462 |
+
__('The plugin failed to schedule a fetch for this feed. Please try again.', 'wprss')
|
463 |
+
);
|
464 |
+
|
465 |
+
return false;
|
466 |
+
}
|
467 |
+
|
468 |
// If the difference is greater than the allowed maximum amount of time, mark the feed as idle.
|
469 |
if ( $diff > $allowed_time ) {
|
470 |
wprss_flag_feed_as_idle( $id );
|
494 |
$diff = time() - $is_deleting_meta;
|
495 |
|
496 |
$items = wprss_get_feed_items_for_source( $id );
|
497 |
+
if ( $items->post_count === 0 || $diff > 300 ) {
|
498 |
delete_post_meta( $id, 'wprss_feed_is_deleting_items' );
|
499 |
return FALSE;
|
500 |
}
|
557 |
return strtotime( "-$age_limit $age_unit" );
|
558 |
}
|
559 |
|
560 |
+
/**
|
561 |
+
* Truncates the items for a single feed source based on its age limit.
|
562 |
+
*
|
563 |
+
* @since 4.14
|
564 |
+
*
|
565 |
+
* @param int|WP_Post $source The source ID or post instance.
|
566 |
+
*/
|
567 |
+
function wprss_truncate_items_for_source( $source )
|
568 |
+
{
|
569 |
+
$id = ( $source instanceof WP_Post )
|
570 |
+
? $source->ID
|
571 |
+
: $source;
|
572 |
+
|
573 |
+
// Get the max age setting for this feed source
|
574 |
+
$max_age = wprss_get_max_age_for_feed_source( $id );
|
575 |
+
|
576 |
+
// If the data is empty, do not delete
|
577 |
+
if ( $max_age === false ) {
|
578 |
+
return;
|
579 |
+
}
|
580 |
+
|
581 |
+
// Get all feed items for this source
|
582 |
+
$feed_items = wprss_get_feed_items_for_source( $id );
|
583 |
+
|
584 |
+
// If there are no feed items, stop
|
585 |
+
if ( ! $feed_items->have_posts() ) {
|
586 |
+
return;
|
587 |
+
}
|
588 |
+
|
589 |
+
// Extend the timeout time limit for the deletion of the feed items
|
590 |
+
set_time_limit( wprss_get_item_import_time_limit() );
|
591 |
+
|
592 |
+
// For each feed item
|
593 |
+
while ( $feed_items->have_posts() ) {
|
594 |
+
$feed_items->the_post();
|
595 |
+
// If the post is older than the maximum age
|
596 |
+
$item_id = get_the_ID();
|
597 |
+
|
598 |
+
if ( wprss_is_feed_item_older_than( $item_id, $max_age ) === true ){
|
599 |
+
// Delete the post
|
600 |
+
wp_delete_post( $item_id, true );
|
601 |
+
}
|
602 |
+
}
|
603 |
+
|
604 |
+
// Reset feed items query data
|
605 |
+
wp_reset_postdata();
|
606 |
+
}
|
607 |
|
608 |
/**
|
609 |
* Delete old feed items from the database to avoid bloat.
|
619 |
|
620 |
// Check if there are feed sources
|
621 |
if( $feed_sources->have_posts() ) {
|
622 |
+
// Truncate items for each feed source
|
623 |
while ( $feed_sources->have_posts() ) {
|
624 |
$feed_sources->the_post();
|
625 |
+
wprss_truncate_items_for_source( get_the_ID() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
626 |
}
|
627 |
// Reset feed sources query data
|
628 |
wp_reset_postdata();
|
@@ -6,34 +6,6 @@
|
|
6 |
*/
|
7 |
|
8 |
|
9 |
-
add_action( 'admin_init', 'wprss_change_feed_state' );
|
10 |
-
/**
|
11 |
-
* Changes the state of a feed source, using POST data
|
12 |
-
*
|
13 |
-
* @since 3.7
|
14 |
-
*/
|
15 |
-
function wprss_change_feed_state() {
|
16 |
-
// If the id and state are in POST data
|
17 |
-
if ( isset( $_GET['wprss-feed-id'] ) ) {
|
18 |
-
// Get the id and state
|
19 |
-
$feed_ID = $_GET['wprss-feed-id'];
|
20 |
-
// Change the state
|
21 |
-
if ( wprss_is_feed_source_active( $feed_ID ) ) {
|
22 |
-
wprss_pause_feed_source( $feed_ID );
|
23 |
-
} else {
|
24 |
-
wprss_activate_feed_source( $feed_ID );
|
25 |
-
}
|
26 |
-
// Check for a redirect
|
27 |
-
if ( isset( $_GET['wprss-redirect'] ) && $_GET['wprss-redirect'] == '1' ) {
|
28 |
-
wp_redirect( admin_url( 'edit.php?post_type=wprss_feed', 301 ) );
|
29 |
-
exit();
|
30 |
-
}
|
31 |
-
}
|
32 |
-
}
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
add_action( 'admin_init', 'wprss_bulk_change_state', 2 );
|
38 |
/**
|
39 |
* Changes the state of feed sources selected from the table bulk actions.
|
@@ -147,4 +119,4 @@
|
|
147 |
function wprss_is_feed_source_active( $source_id ) {
|
148 |
$state = get_post_meta( $source_id, 'wprss_state', TRUE );
|
149 |
return ( $state === '' || $state === 'active' );
|
150 |
-
}
|
6 |
*/
|
7 |
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
add_action( 'admin_init', 'wprss_bulk_change_state', 2 );
|
10 |
/**
|
11 |
* Changes the state of feed sources selected from the table bulk actions.
|
119 |
function wprss_is_feed_source_active( $source_id ) {
|
120 |
$state = get_post_meta( $source_id, 'wprss_state', TRUE );
|
121 |
return ( $state === '' || $state === 'active' );
|
122 |
+
}
|
@@ -1,10 +1,41 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
2 |
/**
|
3 |
* Helper and misc functions.
|
4 |
*
|
5 |
* @todo Make this part of Core instead
|
6 |
*/
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
if (!function_exists('wprss_get_namespace')) {
|
9 |
|
10 |
/**
|
@@ -156,4 +187,4 @@ if (!function_exists('array_pick')) {
|
|
156 |
$keys = (array)$keys;
|
157 |
return array_intersect_key($array, array_flip($keys));
|
158 |
}
|
159 |
-
}
|
1 |
<?php
|
2 |
+
|
3 |
+
use Aventura\Wprss\Core\Model\Regex\HtmlEncoder;
|
4 |
+
|
5 |
/**
|
6 |
* Helper and misc functions.
|
7 |
*
|
8 |
* @todo Make this part of Core instead
|
9 |
*/
|
10 |
|
11 |
+
/**
|
12 |
+
* Returns a representation of an HTML expression that matches all representations of that HTML.
|
13 |
+
*
|
14 |
+
* @since 4.14
|
15 |
+
*
|
16 |
+
* @param string $expr The expression to encodify.
|
17 |
+
* @param string|null $delim The delimiter of the expression.
|
18 |
+
*
|
19 |
+
* @return string The encodified HTML expression.
|
20 |
+
*/
|
21 |
+
function wprss_html_regex_encodify($expr, $delim = null)
|
22 |
+
{
|
23 |
+
static $instance;
|
24 |
+
|
25 |
+
if ($instance === null) {
|
26 |
+
$instance = new HtmlEncoder();
|
27 |
+
}
|
28 |
+
|
29 |
+
$instance->reset();
|
30 |
+
|
31 |
+
if ($delim !== null) {
|
32 |
+
// Not a bug: the `setDelimiter` method call is handled using magic `__call()`
|
33 |
+
$instance->setDelimiter($delim);
|
34 |
+
}
|
35 |
+
|
36 |
+
return $instance->encodify($expr);
|
37 |
+
}
|
38 |
+
|
39 |
if (!function_exists('wprss_get_namespace')) {
|
40 |
|
41 |
/**
|
187 |
$keys = (array)$keys;
|
188 |
return array_intersect_key($array, array_flip($keys));
|
189 |
}
|
190 |
+
}
|
@@ -510,30 +510,36 @@ class WPRSS_Image_Cache {
|
|
510 |
$path = $this->get_unique_filename( $url );
|
511 |
}
|
512 |
|
513 |
-
if ( !$url )
|
514 |
throw new Exception( sprintf( __( 'Invalid URL provided: "%1$s"' ), $url ) );
|
|
|
515 |
|
516 |
-
if ( !is_null( $target_path ) )
|
517 |
$path = $target_path;
|
|
|
518 |
|
519 |
-
if ( !is_null( $request_timeout ) )
|
520 |
$timeout = $request_timeout;
|
|
|
521 |
|
522 |
// Absolute path to the cache file
|
523 |
$tmpfname = $image instanceof WPRSS_Image_Cache_Image
|
524 |
? $image->get_tmp_dir( $path )
|
525 |
: $this->get_tmp_dir( $path );
|
526 |
|
527 |
-
|
|
|
|
|
528 |
$dirname = dirname( $tmpfname );
|
529 |
-
if ( !wp_mkdir_p( $dirname ) )
|
530 |
throw new Exception( sprintf( __( 'Could not create directory: "%1$s". Filename: "%2$s"' ), $dirname, $tmpfname ) );
|
531 |
-
|
532 |
|
533 |
// Getting file download lib
|
534 |
$file_lib_path = ABSPATH . 'wp-admin/includes/file.php';
|
535 |
-
if ( !is_readable( $file_lib_path ) )
|
536 |
throw new Exception( sprintf( __( 'The file library cannot be read from %1$s' ), $file_lib_path ) );
|
|
|
537 |
|
538 |
require_once( $file_lib_path );
|
539 |
|
@@ -565,6 +571,42 @@ class WPRSS_Image_Cache {
|
|
565 |
return $tmpfname;
|
566 |
}
|
567 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
568 |
|
569 |
/**
|
570 |
* Uses one of the registered hashing functions to hash the given value.
|
@@ -1305,24 +1347,30 @@ class WPRSS_Image_Cache_Image {
|
|
1305 |
*/
|
1306 |
public function get_size() {
|
1307 |
if ( !isset( $this->_size ) ) {
|
1308 |
-
$error_caption = 'Could not get image size';
|
1309 |
$path = $this->get_local_path();
|
1310 |
if ( !$this->is_readable() ) throw new Exception( sprintf( '%1$s: image file is not readable', $path ) );
|
1311 |
|
1312 |
// Trying simplest way
|
1313 |
-
if ( $size = getimagesize( $path ) )
|
1314 |
-
|
1315 |
-
|
1316 |
-
wprss_log( sprintf( 'Tried `getimagesize()`: %1$s', empty($this->_size) ? 'failure' : 'success' ), __METHOD__, WPRSS_LOG_LEVEL_SYSTEM );
|
1317 |
|
1318 |
-
|
1319 |
$image = file_get_contents( $path );
|
1320 |
$image = imagecreatefromstring( $image );
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1326 |
}
|
1327 |
|
1328 |
return $this->_size;
|
510 |
$path = $this->get_unique_filename( $url );
|
511 |
}
|
512 |
|
513 |
+
if ( !$url ) {
|
514 |
throw new Exception( sprintf( __( 'Invalid URL provided: "%1$s"' ), $url ) );
|
515 |
+
}
|
516 |
|
517 |
+
if ( !is_null( $target_path ) ) {
|
518 |
$path = $target_path;
|
519 |
+
}
|
520 |
|
521 |
+
if ( !is_null( $request_timeout ) ) {
|
522 |
$timeout = $request_timeout;
|
523 |
+
}
|
524 |
|
525 |
// Absolute path to the cache file
|
526 |
$tmpfname = $image instanceof WPRSS_Image_Cache_Image
|
527 |
? $image->get_tmp_dir( $path )
|
528 |
: $this->get_tmp_dir( $path );
|
529 |
|
530 |
+
$this->check_is_image($tmpfname, $url);
|
531 |
+
|
532 |
+
// WARNING: The file is not automatically deleted, The script must unlink() the file.
|
533 |
$dirname = dirname( $tmpfname );
|
534 |
+
if ( !wp_mkdir_p( $dirname ) ) {
|
535 |
throw new Exception( sprintf( __( 'Could not create directory: "%1$s". Filename: "%2$s"' ), $dirname, $tmpfname ) );
|
536 |
+
}
|
537 |
|
538 |
// Getting file download lib
|
539 |
$file_lib_path = ABSPATH . 'wp-admin/includes/file.php';
|
540 |
+
if ( !is_readable( $file_lib_path ) ) {
|
541 |
throw new Exception( sprintf( __( 'The file library cannot be read from %1$s' ), $file_lib_path ) );
|
542 |
+
}
|
543 |
|
544 |
require_once( $file_lib_path );
|
545 |
|
571 |
return $tmpfname;
|
572 |
}
|
573 |
|
574 |
+
/**
|
575 |
+
* Checks if a remote resource is an image.
|
576 |
+
*
|
577 |
+
* This method will first check the file type of the locally downloaded copy.
|
578 |
+
* If that fails, the method will attempt to fetch the MIME type from the original remote file.
|
579 |
+
*
|
580 |
+
* @since 4.14
|
581 |
+
*
|
582 |
+
* @param string $path The path to the local file.
|
583 |
+
* @param string $url The URL to the remote file.
|
584 |
+
*
|
585 |
+
* @return bool
|
586 |
+
*/
|
587 |
+
public function check_is_image( $path, $url )
|
588 |
+
{
|
589 |
+
// Determine file type (ext and mime/type)
|
590 |
+
$url_type = wp_check_filetype($path);
|
591 |
+
|
592 |
+
// If the wp_check_filetype function fails to determine the MIME type
|
593 |
+
if (empty($url_type['type'])) {
|
594 |
+
$url_type = wpra_check_file_type($path, $url);
|
595 |
+
}
|
596 |
+
|
597 |
+
$mime_type = $url_type['type'];
|
598 |
+
$mime_parts = explode('/', $mime_type);
|
599 |
+
|
600 |
+
if (count($mime_parts) < 1) {
|
601 |
+
return false;
|
602 |
+
}
|
603 |
+
|
604 |
+
if ($mime_parts[0] !== 'image') {
|
605 |
+
return false;
|
606 |
+
}
|
607 |
+
|
608 |
+
return true;
|
609 |
+
}
|
610 |
|
611 |
/**
|
612 |
* Uses one of the registered hashing functions to hash the given value.
|
1347 |
*/
|
1348 |
public function get_size() {
|
1349 |
if ( !isset( $this->_size ) ) {
|
|
|
1350 |
$path = $this->get_local_path();
|
1351 |
if ( !$this->is_readable() ) throw new Exception( sprintf( '%1$s: image file is not readable', $path ) );
|
1352 |
|
1353 |
// Trying simplest way
|
1354 |
+
if ( $size = getimagesize( $path ) ) {
|
1355 |
+
$this->_size = [0 => $size[0], 1 => $size[1]];
|
1356 |
+
}
|
|
|
1357 |
|
1358 |
+
if( !$this->_size && function_exists( 'gd_info' ) ) {
|
1359 |
$image = file_get_contents( $path );
|
1360 |
$image = imagecreatefromstring( $image );
|
1361 |
+
|
1362 |
+
if ($image !== false) {
|
1363 |
+
$width = imagesx($image);
|
1364 |
+
$height = imagesy($image);
|
1365 |
+
$this->_size = [0 => $width, 1 => $height];
|
1366 |
+
|
1367 |
+
wprss_log(
|
1368 |
+
sprintf('Tried GD: %1$s', empty($this->_size) ? 'failure' : 'success'),
|
1369 |
+
__METHOD__,
|
1370 |
+
WPRSS_LOG_LEVEL_SYSTEM
|
1371 |
+
);
|
1372 |
+
}
|
1373 |
+
}
|
1374 |
}
|
1375 |
|
1376 |
return $this->_size;
|
@@ -32,7 +32,7 @@
|
|
32 |
* @since 2.1
|
33 |
*/
|
34 |
function wp_rss_aggregator( $args = array() ) {
|
35 |
-
$template = wpra_get('templates/
|
36 |
$fullArgs = $args;
|
37 |
|
38 |
// Use legacy mode if arg was not explicitly given
|
32 |
* @since 2.1
|
33 |
*/
|
34 |
function wp_rss_aggregator( $args = array() ) {
|
35 |
+
$template = wpra_get('feeds/templates/master_template');
|
36 |
$fullArgs = $args;
|
37 |
|
38 |
// Use legacy mode if arg was not explicitly given
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// See https://github.com/jakeasmith/http_build_url/blob/master/src/http_build_url.php
|
4 |
+
if (!function_exists('http_build_url')) {
|
5 |
+
/**
|
6 |
+
* URL constants as defined in the PHP Manual under "Constants usable with
|
7 |
+
* http_build_url()".
|
8 |
+
*
|
9 |
+
* @see http://us2.php.net/manual/en/http.constants.php#http.constants.url
|
10 |
+
*/
|
11 |
+
if (!defined('HTTP_URL_REPLACE')) {
|
12 |
+
define('HTTP_URL_REPLACE', 1);
|
13 |
+
}
|
14 |
+
if (!defined('HTTP_URL_JOIN_PATH')) {
|
15 |
+
define('HTTP_URL_JOIN_PATH', 2);
|
16 |
+
}
|
17 |
+
if (!defined('HTTP_URL_JOIN_QUERY')) {
|
18 |
+
define('HTTP_URL_JOIN_QUERY', 4);
|
19 |
+
}
|
20 |
+
if (!defined('HTTP_URL_STRIP_USER')) {
|
21 |
+
define('HTTP_URL_STRIP_USER', 8);
|
22 |
+
}
|
23 |
+
if (!defined('HTTP_URL_STRIP_PASS')) {
|
24 |
+
define('HTTP_URL_STRIP_PASS', 16);
|
25 |
+
}
|
26 |
+
if (!defined('HTTP_URL_STRIP_AUTH')) {
|
27 |
+
define('HTTP_URL_STRIP_AUTH', 32);
|
28 |
+
}
|
29 |
+
if (!defined('HTTP_URL_STRIP_PORT')) {
|
30 |
+
define('HTTP_URL_STRIP_PORT', 64);
|
31 |
+
}
|
32 |
+
if (!defined('HTTP_URL_STRIP_PATH')) {
|
33 |
+
define('HTTP_URL_STRIP_PATH', 128);
|
34 |
+
}
|
35 |
+
if (!defined('HTTP_URL_STRIP_QUERY')) {
|
36 |
+
define('HTTP_URL_STRIP_QUERY', 256);
|
37 |
+
}
|
38 |
+
if (!defined('HTTP_URL_STRIP_FRAGMENT')) {
|
39 |
+
define('HTTP_URL_STRIP_FRAGMENT', 512);
|
40 |
+
}
|
41 |
+
if (!defined('HTTP_URL_STRIP_ALL')) {
|
42 |
+
define('HTTP_URL_STRIP_ALL', 1024);
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Build a URL.
|
48 |
+
*
|
49 |
+
* The parts of the second URL will be merged into the first according to
|
50 |
+
* the flags argument.
|
51 |
+
*
|
52 |
+
* @param mixed $url (part(s) of) an URL in form of a string or
|
53 |
+
* associative array like parse_url() returns
|
54 |
+
* @param mixed $parts same as the first argument
|
55 |
+
* @param int $flags a bitmask of binary or'ed HTTP_URL constants;
|
56 |
+
* HTTP_URL_REPLACE is the default
|
57 |
+
* @param array $new_url if set, it will be filled with the parts of the
|
58 |
+
* composed url like parse_url() would return
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
+
function http_build_url($url, $parts = array(), $flags = HTTP_URL_REPLACE, &$new_url = array()) {
|
62 |
+
is_array($url) || $url = parse_url($url);
|
63 |
+
is_array($parts) || $parts = parse_url($parts);
|
64 |
+
|
65 |
+
isset($url['query']) && is_string($url['query']) || $url['query'] = null;
|
66 |
+
isset($parts['query']) && is_string($parts['query']) || $parts['query'] = null;
|
67 |
+
|
68 |
+
$keys = array('user', 'pass', 'port', 'path', 'query', 'fragment');
|
69 |
+
|
70 |
+
// HTTP_URL_STRIP_ALL and HTTP_URL_STRIP_AUTH cover several other flags.
|
71 |
+
if ($flags & HTTP_URL_STRIP_ALL) {
|
72 |
+
$flags |= HTTP_URL_STRIP_USER | HTTP_URL_STRIP_PASS
|
73 |
+
| HTTP_URL_STRIP_PORT | HTTP_URL_STRIP_PATH
|
74 |
+
| HTTP_URL_STRIP_QUERY | HTTP_URL_STRIP_FRAGMENT;
|
75 |
+
} elseif ($flags & HTTP_URL_STRIP_AUTH) {
|
76 |
+
$flags |= HTTP_URL_STRIP_USER | HTTP_URL_STRIP_PASS;
|
77 |
+
}
|
78 |
+
|
79 |
+
// Schema and host are alwasy replaced
|
80 |
+
foreach (array('scheme', 'host') as $part) {
|
81 |
+
if (isset($parts[$part])) {
|
82 |
+
$url[$part] = $parts[$part];
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
if ($flags & HTTP_URL_REPLACE) {
|
87 |
+
foreach ($keys as $key) {
|
88 |
+
if (isset($parts[$key])) {
|
89 |
+
$url[$key] = $parts[$key];
|
90 |
+
}
|
91 |
+
}
|
92 |
+
} else {
|
93 |
+
if (isset($parts['path']) && ($flags & HTTP_URL_JOIN_PATH)) {
|
94 |
+
if (isset($url['path']) && substr($parts['path'], 0, 1) !== '/') {
|
95 |
+
$url['path'] = rtrim(
|
96 |
+
str_replace(basename($url['path']), '', $url['path']),
|
97 |
+
'/'
|
98 |
+
) . '/' . ltrim($parts['path'], '/');
|
99 |
+
} else {
|
100 |
+
$url['path'] = $parts['path'];
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
if (isset($parts['query']) && ($flags & HTTP_URL_JOIN_QUERY)) {
|
105 |
+
if (isset($url['query'])) {
|
106 |
+
parse_str($url['query'], $url_query);
|
107 |
+
parse_str($parts['query'], $parts_query);
|
108 |
+
|
109 |
+
$url['query'] = http_build_query(
|
110 |
+
array_replace_recursive(
|
111 |
+
$url_query,
|
112 |
+
$parts_query
|
113 |
+
)
|
114 |
+
);
|
115 |
+
} else {
|
116 |
+
$url['query'] = $parts['query'];
|
117 |
+
}
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
foreach ($keys as $key) {
|
122 |
+
$strip = 'HTTP_URL_STRIP_' . strtoupper($key);
|
123 |
+
if ($flags & constant($strip)) {
|
124 |
+
unset($url[$key]);
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
$parsed_string = '';
|
129 |
+
|
130 |
+
if (isset($url['scheme'])) {
|
131 |
+
$parsed_string .= $url['scheme'] . '://';
|
132 |
+
}
|
133 |
+
|
134 |
+
if (isset($url['user'])) {
|
135 |
+
$parsed_string .= $url['user'];
|
136 |
+
|
137 |
+
if (isset($url['pass'])) {
|
138 |
+
$parsed_string .= ':' . $url['pass'];
|
139 |
+
}
|
140 |
+
|
141 |
+
$parsed_string .= '@';
|
142 |
+
}
|
143 |
+
|
144 |
+
if (isset($url['host'])) {
|
145 |
+
$parsed_string .= $url['host'];
|
146 |
+
}
|
147 |
+
|
148 |
+
if (isset($url['port'])) {
|
149 |
+
$parsed_string .= ':' . $url['port'];
|
150 |
+
}
|
151 |
+
|
152 |
+
if (!empty($url['path'])) {
|
153 |
+
$parsed_string .= $url['path'];
|
154 |
+
} else {
|
155 |
+
$parsed_string .= '/';
|
156 |
+
}
|
157 |
+
|
158 |
+
if (isset($url['query'])) {
|
159 |
+
$parsed_string .= '?' . $url['query'];
|
160 |
+
}
|
161 |
+
|
162 |
+
if (isset($url['fragment'])) {
|
163 |
+
$parsed_string .= '#' . $url['fragment'];
|
164 |
+
}
|
165 |
+
|
166 |
+
$new_url = $url;
|
167 |
+
|
168 |
+
return $parsed_string;
|
169 |
+
}
|
170 |
+
}
|
@@ -29,7 +29,8 @@
|
|
29 |
wp_register_script( 'wprss-admin-custom', WPRSS_JS .'admin-custom.js', array('jquery','jquery-ui-datepicker','jquery-ui-slider'), $version );
|
30 |
wp_localize_script( 'wprss-admin-custom', 'wprss_admin_custom', array(
|
31 |
'failed_to_import' => __( 'Failed to import', WPRSS_TEXT_DOMAIN ),
|
32 |
-
'items_are_importing' => __( '
|
|
|
33 |
'please_wait' => __( 'Please wait ...', WPRSS_TEXT_DOMAIN ),
|
34 |
'bulk_add' => __( 'Bulk Add', WPRSS_TEXT_DOMAIN ),
|
35 |
'ok' => __( 'OK', WPRSS_TEXT_DOMAIN ),
|
@@ -78,6 +79,8 @@
|
|
78 |
wp_localize_script( 'wprss-hs-beacon-js', 'WprssHelpBeaconConfig', array (
|
79 |
'premiumSupport' => ( wprss_licensing_get_manager()->licenseWithStatusExists( License_Status::VALID ) )
|
80 |
));
|
|
|
|
|
81 |
}
|
82 |
|
83 |
|
@@ -122,7 +125,6 @@
|
|
122 |
$page = isset( $_GET['page'] )? $_GET['page'] : '';
|
123 |
$version = wprss()->getVersion();
|
124 |
|
125 |
-
wp_enqueue_style( 'wprss-styles' );
|
126 |
wp_enqueue_style( 'wprss-admin-styles' );
|
127 |
wp_enqueue_style( 'wprss-fa' );
|
128 |
wp_enqueue_style( 'wprss-admin-3.8-styles' );
|
@@ -141,6 +143,8 @@
|
|
141 |
if ($pageBase === 'post' && $postType = 'wprss_feed') {
|
142 |
// Change text on post screen from 'Enter title here' to 'Enter feed name here'
|
143 |
add_filter( 'enter_title_here', 'wprss_change_title_text' );
|
|
|
|
|
144 |
}
|
145 |
if ('wprss_feed' === $postType) {
|
146 |
wp_enqueue_script( 'wprss-custom-bulk-actions' );
|
@@ -219,13 +223,12 @@
|
|
219 |
{
|
220 |
$version = wprss()->getVersion();
|
221 |
|
222 |
-
wp_register_style( 'wprss-styles', WPRSS_CSS . 'admin-styles.css', array(), $version );
|
223 |
wp_register_style( 'wprss-admin-styles', WPRSS_CSS . 'admin-styles.css', array(), $version );
|
224 |
wp_register_style( 'wprss-fa', WPRSS_CSS . 'font-awesome.min.css', array(), $version );
|
225 |
wp_register_style( 'wprss-admin-3.8-styles', WPRSS_CSS . 'admin-3.8.css', array(), $version );
|
226 |
wp_register_style( 'wprss-admin-editor-styles', WPRSS_CSS . 'admin-editor.css', array(), $version );
|
227 |
wp_register_style( 'wprss-admin-tracking-styles', WPRSS_CSS . 'admin-tracking-styles.css', array(), $version );
|
228 |
wp_register_style( 'wprss-admin-general-styles', WPRSS_CSS . 'admin-general-styles.css', array(), $version );
|
229 |
-
wp_register_style( 'wprss-hs-beacon-css', WPRSS_CSS
|
230 |
wp_register_style( 'jquery-style', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css', array(), $version );
|
231 |
}
|
29 |
wp_register_script( 'wprss-admin-custom', WPRSS_JS .'admin-custom.js', array('jquery','jquery-ui-datepicker','jquery-ui-slider'), $version );
|
30 |
wp_localize_script( 'wprss-admin-custom', 'wprss_admin_custom', array(
|
31 |
'failed_to_import' => __( 'Failed to import', WPRSS_TEXT_DOMAIN ),
|
32 |
+
'items_are_importing' => __( 'Importing!', WPRSS_TEXT_DOMAIN ),
|
33 |
+
'items_are_deleting' => __( 'Deleting!', WPRSS_TEXT_DOMAIN ),
|
34 |
'please_wait' => __( 'Please wait ...', WPRSS_TEXT_DOMAIN ),
|
35 |
'bulk_add' => __( 'Bulk Add', WPRSS_TEXT_DOMAIN ),
|
36 |
'ok' => __( 'OK', WPRSS_TEXT_DOMAIN ),
|
79 |
wp_localize_script( 'wprss-hs-beacon-js', 'WprssHelpBeaconConfig', array (
|
80 |
'premiumSupport' => ( wprss_licensing_get_manager()->licenseWithStatusExists( License_Status::VALID ) )
|
81 |
));
|
82 |
+
|
83 |
+
wp_register_script( 'wprss-gallery-js', WPRSS_JS . 'gallery.js', array('jquery'), $version, true );
|
84 |
}
|
85 |
|
86 |
|
125 |
$page = isset( $_GET['page'] )? $_GET['page'] : '';
|
126 |
$version = wprss()->getVersion();
|
127 |
|
|
|
128 |
wp_enqueue_style( 'wprss-admin-styles' );
|
129 |
wp_enqueue_style( 'wprss-fa' );
|
130 |
wp_enqueue_style( 'wprss-admin-3.8-styles' );
|
143 |
if ($pageBase === 'post' && $postType = 'wprss_feed') {
|
144 |
// Change text on post screen from 'Enter title here' to 'Enter feed name here'
|
145 |
add_filter( 'enter_title_here', 'wprss_change_title_text' );
|
146 |
+
wp_enqueue_media();
|
147 |
+
wp_enqueue_script( 'wprss-gallery-js' );
|
148 |
}
|
149 |
if ('wprss_feed' === $postType) {
|
150 |
wp_enqueue_script( 'wprss-custom-bulk-actions' );
|
223 |
{
|
224 |
$version = wprss()->getVersion();
|
225 |
|
|
|
226 |
wp_register_style( 'wprss-admin-styles', WPRSS_CSS . 'admin-styles.css', array(), $version );
|
227 |
wp_register_style( 'wprss-fa', WPRSS_CSS . 'font-awesome.min.css', array(), $version );
|
228 |
wp_register_style( 'wprss-admin-3.8-styles', WPRSS_CSS . 'admin-3.8.css', array(), $version );
|
229 |
wp_register_style( 'wprss-admin-editor-styles', WPRSS_CSS . 'admin-editor.css', array(), $version );
|
230 |
wp_register_style( 'wprss-admin-tracking-styles', WPRSS_CSS . 'admin-tracking-styles.css', array(), $version );
|
231 |
wp_register_style( 'wprss-admin-general-styles', WPRSS_CSS . 'admin-general-styles.css', array(), $version );
|
232 |
+
wp_register_style( 'wprss-hs-beacon-css', WPRSS_CSS . 'beacon.css', array(), $version );
|
233 |
wp_register_style( 'jquery-style', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css', array(), $version );
|
234 |
}
|
@@ -1,58 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Contains the secure reset functionality.
|
4 |
-
*
|
5 |
-
* @package WP PRSS Aggregator
|
6 |
-
*/
|
7 |
-
|
8 |
-
|
9 |
-
add_action( 'plugins_loaded', 'wprss_check_secure_reset' );
|
10 |
-
/**
|
11 |
-
*
|
12 |
-
*
|
13 |
-
* @since 3.7.1
|
14 |
-
*/
|
15 |
-
function wprss_check_secure_reset() {
|
16 |
-
// Get the GET parameters
|
17 |
-
$wprss_action = ( isset( $_GET['wprss_action'] ) )? $_GET['wprss_action'] : NULL;
|
18 |
-
$wprss_security_code = ( isset( $_GET['wprss_security_code'] ) )? $_GET['wprss_security_code'] : NULL;
|
19 |
-
|
20 |
-
// If at least one of them is not specified, exit
|
21 |
-
if ( $wprss_action === NULL || $wprss_security_code === NULL ) {
|
22 |
-
return;
|
23 |
-
}
|
24 |
-
|
25 |
-
// Get the code from the Database
|
26 |
-
$DB_CODE = get_option( 'wprss_secure_reset_code', '' );
|
27 |
-
|
28 |
-
// Check if the code is empty
|
29 |
-
if ( $DB_CODE === '' || strlen( $DB_CODE ) === 0 ) {
|
30 |
-
return;
|
31 |
-
}
|
32 |
-
|
33 |
-
// Check if the code in $_GET matches the one in the Database
|
34 |
-
if ( $DB_CODE !== $wprss_security_code ) {
|
35 |
-
// If not exit
|
36 |
-
return;
|
37 |
-
}
|
38 |
-
|
39 |
-
// Do a reset of settings
|
40 |
-
if ( $wprss_action === 'reset' || $wprss_action === 'reset_and_deactivate' ) {
|
41 |
-
delete_option( 'wprss_settings_general' );
|
42 |
-
delete_option( 'wprss_db_version' );
|
43 |
-
delete_option( 'wprss_settings_license_keys' );
|
44 |
-
delete_option( 'wprss_settings_license_statuses' );
|
45 |
-
delete_option( 'wprss_addon_notices' );
|
46 |
-
delete_option( 'wprss_settings_notices' );
|
47 |
-
delete_option( 'wprss_pwsv' );
|
48 |
-
delete_option( WPRSS_UPDATE_PAGE_PREV_VERSION_OPTION );
|
49 |
-
delete_option( WPRSS_INTRO_DID_INTRO_OPTION );
|
50 |
-
}
|
51 |
-
|
52 |
-
// Deactivate the plugin
|
53 |
-
if ( $wprss_action === 'deactivate' || $wprss_action === 'reset_and_deactivate' ) {
|
54 |
-
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
55 |
-
deactivate_plugins( WPRSS_FILE_CONSTANT, TRUE );
|
56 |
-
}
|
57 |
-
|
58 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -71,6 +71,30 @@
|
|
71 |
}
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
}
|
75 |
|
76 |
|
@@ -261,12 +285,11 @@
|
|
261 |
'expiration_notice_period' => '2 weeks',
|
262 |
|
263 |
// From 4.8.2
|
264 |
-
'feed_request_useragent' =>
|
265 |
|
266 |
// From 4.11.2
|
267 |
'limit_feed_items_per_import' => null,
|
268 |
-
'feed_items_import_order' => '',
|
269 |
-
'feed_items_import_order' => '',
|
270 |
|
271 |
// From 4.13
|
272 |
'custom_css' => '',
|
71 |
}
|
72 |
}
|
73 |
|
74 |
+
// Update to 4.14
|
75 |
+
if ( !empty($old_db_version) && intval($old_db_version) < 16 ) {
|
76 |
+
// Copy the default template's meta to its settings options
|
77 |
+
// In 4.13.x, a bug caused corruption such that the meta data was more up-to-date than the settings
|
78 |
+
// This also meant that the options users saw in the Templates edit page did not match what was stored in
|
79 |
+
// the database, and what was used by the templates during rendering.
|
80 |
+
// This was fixed in 4.14. Since the options that users saw in the Templates Edit page are what they most
|
81 |
+
// likely wanted to have be saved in the database, we are here copying the meta over to the settings.
|
82 |
+
try {
|
83 |
+
$templates = wpra_container()->get('wpra/feeds/templates/collection');
|
84 |
+
$default = $templates['default'];
|
85 |
+
$id = $default['id'];
|
86 |
+
$options = $default['options'];
|
87 |
+
|
88 |
+
$meta = get_post_meta($id, 'wprss_template_options',true);
|
89 |
+
foreach ($meta as $k => $v) {
|
90 |
+
$options[$k] = $v;
|
91 |
+
}
|
92 |
+
|
93 |
+
$default['options'] = $options;
|
94 |
+
} catch (Exception $exception) {
|
95 |
+
// Fail silently
|
96 |
+
}
|
97 |
+
}
|
98 |
}
|
99 |
|
100 |
|
285 |
'expiration_notice_period' => '2 weeks',
|
286 |
|
287 |
// From 4.8.2
|
288 |
+
'feed_request_useragent' => 'WordPress',
|
289 |
|
290 |
// From 4.11.2
|
291 |
'limit_feed_items_per_import' => null,
|
292 |
+
'feed_items_import_order' => 'latest',
|
|
|
293 |
|
294 |
// From 4.13
|
295 |
'custom_css' => '',
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function wprss_is_url_youtube($url)
|
4 |
+
{
|
5 |
+
$parsed = is_array($url) ? $url : wpra_parse_url($url);
|
6 |
+
|
7 |
+
return isset($parsed['host']) && stripos($parsed['host'], 'youtube.com') !== false;
|
8 |
+
}
|
9 |
+
|
10 |
+
function wprss_is_feed_youtube($feed)
|
11 |
+
{
|
12 |
+
$id = ($feed instanceof WP_Post) ? $feed->ID : $feed;
|
13 |
+
$url = get_post_meta($id, 'wprss_url', true);
|
14 |
+
|
15 |
+
return wprss_is_url_youtube($url);
|
16 |
+
}
|
17 |
+
|
18 |
+
// Filters URLs to allow WPRA to be able to use YouTube channel URLs as feed URLs
|
19 |
+
add_filter('wpra/importer/feed/url', function ($url, $parsed) {
|
20 |
+
$pathArray = $parsed['path'];
|
21 |
+
|
22 |
+
// Check if it's a Youtube URL
|
23 |
+
if (stripos($parsed['host'], 'youtube.com') === false) {
|
24 |
+
return $url;
|
25 |
+
}
|
26 |
+
|
27 |
+
// Check if the YouTube URL has "channel" in the path
|
28 |
+
$channelPos = array_search('channel', $pathArray);
|
29 |
+
if ($channelPos !== false && !empty($pathArray[$channelPos + 1])) {
|
30 |
+
// Check if there's another part that follows the "channel" part in the URL path
|
31 |
+
// And use it to construct the Youtube feed URL
|
32 |
+
return sprintf(
|
33 |
+
'https://www.youtube.com/feeds/videos.xml?channel_id=%s',
|
34 |
+
$pathArray[$channelPos + 1]
|
35 |
+
);
|
36 |
+
}
|
37 |
+
|
38 |
+
// Check if the YouTube URL has "user" in the path
|
39 |
+
$userPos = array_search('user', $pathArray);
|
40 |
+
if ($userPos !== false && !empty($pathArray[$userPos + 1])) {
|
41 |
+
// Check if there's another part that follows the "user" part in the URL path
|
42 |
+
// And use it to construct the Youtube feed URL
|
43 |
+
return sprintf(
|
44 |
+
'https://www.youtube.com/feeds/videos.xml?user=%s',
|
45 |
+
$pathArray[$userPos + 1]
|
46 |
+
);
|
47 |
+
}
|
48 |
+
|
49 |
+
return $url;
|
50 |
+
}, 10, 2);
|
@@ -8,10 +8,11 @@
|
|
8 |
$(document).ready( function(){
|
9 |
var bulk_actions_select = $( 'select#bulk-action-selector-top, select#bulk-action-selector-bottom' );
|
10 |
var bulk_actions_trash = bulk_actions_select.find( "option[value='trash']" );
|
11 |
-
|
|
|
12 |
$( '<option>' ).attr( 'value', 'activate' ).text( wprss_admin_bulk.activate ).insertBefore( bulk_actions_trash );
|
13 |
$( '<option>' ).attr( 'value', 'pause' ).text( wprss_admin_bulk.pause ).insertBefore( bulk_actions_trash );
|
14 |
});
|
15 |
|
16 |
|
17 |
-
})(jQuery, wprss_admin_bulk);
|
8 |
$(document).ready( function(){
|
9 |
var bulk_actions_select = $( 'select#bulk-action-selector-top, select#bulk-action-selector-bottom' );
|
10 |
var bulk_actions_trash = bulk_actions_select.find( "option[value='trash']" );
|
11 |
+
|
12 |
+
bulk_actions_select.find( 'option[value="edit"]' ).remove();
|
13 |
$( '<option>' ).attr( 'value', 'activate' ).text( wprss_admin_bulk.activate ).insertBefore( bulk_actions_trash );
|
14 |
$( '<option>' ).attr( 'value', 'pause' ).text( wprss_admin_bulk.pause ).insertBefore( bulk_actions_trash );
|
15 |
});
|
16 |
|
17 |
|
18 |
+
})(jQuery, wprss_admin_bulk);
|
@@ -1,38 +1,106 @@
|
|
1 |
// jQuery for 'Fetch Feed Items' Row Action in 'All Feed Sources' page
|
2 |
function fetch_items_row_action_callback(e){
|
3 |
var link = jQuery(this);
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
var id = link.attr('pid');
|
6 |
-
var url = link.attr('purl');
|
7 |
|
8 |
var errorImportingHandler = function(jqXHR, status, exceptionText) {
|
9 |
-
displayResultMessage(status === 'parsererror' ? 'Error parsing response' : exceptionText, 'ajax-error')
|
10 |
};
|
11 |
|
12 |
var displayResultMessage = function(message, className) {
|
13 |
link.text(message);
|
14 |
-
if (className)
|
15 |
link.addClass(className);
|
|
|
16 |
|
17 |
setTimeout(function(){
|
18 |
-
link.
|
19 |
-
|
20 |
-
if (className)
|
21 |
link.removeClass(className);
|
22 |
-
|
|
|
23 |
};
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
e.preventDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
if (link.attr('disabled')) {
|
27 |
return;
|
28 |
}
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
jQuery.ajax({
|
31 |
url: ajaxurl,
|
32 |
type: 'POST',
|
33 |
dataType: 'json',
|
34 |
data: {
|
35 |
-
'action': '
|
36 |
'id': id,
|
37 |
'wprss_admin_ajax_nonce': jQuery('#wprss_feed_source_action_nonce').data('value'), // nonce
|
38 |
'wprss_admin_ajax_referer': jQuery('#_wp_http_referer').val() // referer
|
@@ -43,32 +111,55 @@ function fetch_items_row_action_callback(e){
|
|
43 |
return;
|
44 |
}
|
45 |
|
46 |
-
displayResultMessage(wprss_admin_custom.
|
47 |
-
jQuery('table.wp-list-table tbody tr.post-' + id
|
48 |
},
|
49 |
error: errorImportingHandler,
|
50 |
timeout: 60000 // set timeout to 1 minute
|
51 |
});
|
52 |
-
|
53 |
-
|
54 |
-
url,
|
55 |
-
{
|
56 |
-
'action': 'wprss_fetch_feeds_row_action',
|
57 |
-
'id': id
|
58 |
-
},
|
59 |
-
function(response){
|
60 |
-
link.text('Feed items imported!');
|
61 |
-
setTimeout( function(){
|
62 |
-
link.text( original_text ).click( fetch_items_row_action_callback );
|
63 |
-
}, 3500 );
|
64 |
-
}
|
65 |
-
);*/
|
66 |
-
link.text( wprss_admin_custom.please_wait );
|
67 |
-
link.attr('disabled', 'disabled');
|
68 |
};
|
69 |
|
70 |
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
jQuery(window).load( function(){
|
73 |
|
74 |
|
@@ -137,8 +228,10 @@ jQuery(window).load( function(){
|
|
137 |
}
|
138 |
);
|
139 |
|
140 |
-
jQuery('.wp-list-table').on( 'click', '.
|
141 |
-
|
|
|
|
|
142 |
// Make the number rollers change their value to empty string when value is 0, making
|
143 |
// them use the placeholder.
|
144 |
jQuery('.wprss-number-roller').on('change', function(){
|
@@ -507,3 +600,47 @@ if ( !String.prototype.trim ) {
|
|
507 |
});
|
508 |
});
|
509 |
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
// jQuery for 'Fetch Feed Items' Row Action in 'All Feed Sources' page
|
2 |
function fetch_items_row_action_callback(e){
|
3 |
var link = jQuery(this);
|
4 |
+
if (link.attr('disabled')) {
|
5 |
+
return;
|
6 |
+
}
|
7 |
+
|
8 |
+
var allLinks = jQuery('a.wprss_fetch_items_ajax_action, a.wprss_delete_items_ajax_action');
|
9 |
+
allLinks.attr('disabled', 'disabled');
|
10 |
+
|
11 |
+
var original_text = link.html();
|
12 |
var id = link.attr('pid');
|
|
|
13 |
|
14 |
var errorImportingHandler = function(jqXHR, status, exceptionText) {
|
15 |
+
displayResultMessage(status === 'parsererror' ? 'Error parsing response' : exceptionText, 'ajax-error');
|
16 |
};
|
17 |
|
18 |
var displayResultMessage = function(message, className) {
|
19 |
link.text(message);
|
20 |
+
if (className) {
|
21 |
link.addClass(className);
|
22 |
+
}
|
23 |
|
24 |
setTimeout(function(){
|
25 |
+
link.html(original_text);
|
26 |
+
allLinks.removeAttr('disabled');
|
27 |
+
if (className) {
|
28 |
link.removeClass(className);
|
29 |
+
}
|
30 |
+
}, 2000);
|
31 |
};
|
32 |
|
33 |
+
link.text( wprss_admin_custom.please_wait );
|
34 |
+
|
35 |
+
jQuery.ajax({
|
36 |
+
url: ajaxurl,
|
37 |
+
type: 'POST',
|
38 |
+
dataType: 'json',
|
39 |
+
data: {
|
40 |
+
'action': 'wprss_fetch_items_row_action',
|
41 |
+
'id': id,
|
42 |
+
'wprss_admin_ajax_nonce': jQuery('#wprss_feed_source_action_nonce').data('value'), // nonce
|
43 |
+
'wprss_admin_ajax_referer': jQuery('#_wp_http_referer').val() // referer
|
44 |
+
},
|
45 |
+
success: function( response, status, jqXHR ){
|
46 |
+
if (response.is_error) {
|
47 |
+
errorImportingHandler(jqXHR, status, response.error_message);
|
48 |
+
return;
|
49 |
+
}
|
50 |
+
|
51 |
+
displayResultMessage(wprss_admin_custom.items_are_importing);
|
52 |
+
jQuery('table.wp-list-table tbody tr.post-' + id).addClass('wpra-feed-is-updating wpra-manual-update');
|
53 |
+
},
|
54 |
+
error: errorImportingHandler,
|
55 |
+
timeout: 60000 // set timeout to 1 minute
|
56 |
+
});
|
57 |
+
|
58 |
e.preventDefault();
|
59 |
+
};
|
60 |
+
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
// jQuery for 'Delete Items' Row Action in 'All Feed Sources' page
|
65 |
+
function delete_items_row_action_callback(e){
|
66 |
+
var link = jQuery(this);
|
67 |
if (link.attr('disabled')) {
|
68 |
return;
|
69 |
}
|
70 |
|
71 |
+
var allLinks = jQuery('a.wprss_fetch_items_ajax_action, a.wprss_delete_items_ajax_action');
|
72 |
+
allLinks.attr('disabled', 'disabled');
|
73 |
+
|
74 |
+
var original_text = link.text();
|
75 |
+
var id = link.attr('pid');
|
76 |
+
|
77 |
+
var errorImportingHandler = function(jqXHR, status, exceptionText) {
|
78 |
+
displayResultMessage(status === 'parsererror' ? 'Error parsing response' : exceptionText, 'ajax-error');
|
79 |
+
};
|
80 |
+
|
81 |
+
var displayResultMessage = function(message, className) {
|
82 |
+
link.text(message);
|
83 |
+
if (className) {
|
84 |
+
link.addClass(className);
|
85 |
+
}
|
86 |
+
|
87 |
+
setTimeout(function(){
|
88 |
+
link.text(original_text);
|
89 |
+
allLinks.removeAttr('disabled');
|
90 |
+
if (className) {
|
91 |
+
link.removeClass(className);
|
92 |
+
}
|
93 |
+
}, 2000);
|
94 |
+
};
|
95 |
+
|
96 |
+
link.text( wprss_admin_custom.please_wait );
|
97 |
+
|
98 |
jQuery.ajax({
|
99 |
url: ajaxurl,
|
100 |
type: 'POST',
|
101 |
dataType: 'json',
|
102 |
data: {
|
103 |
+
'action': 'wprss_delete_items_row_action',
|
104 |
'id': id,
|
105 |
'wprss_admin_ajax_nonce': jQuery('#wprss_feed_source_action_nonce').data('value'), // nonce
|
106 |
'wprss_admin_ajax_referer': jQuery('#_wp_http_referer').val() // referer
|
111 |
return;
|
112 |
}
|
113 |
|
114 |
+
displayResultMessage(wprss_admin_custom.items_are_deleting);
|
115 |
+
jQuery('table.wp-list-table tbody tr.post-' + id).addClass('wpra-feed-is-deleting wpra-manual-delete');
|
116 |
},
|
117 |
error: errorImportingHandler,
|
118 |
timeout: 60000 // set timeout to 1 minute
|
119 |
});
|
120 |
+
|
121 |
+
e.preventDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
};
|
123 |
|
124 |
|
125 |
|
126 |
+
// jQuery for the feed state toggle buttons
|
127 |
+
function toggle_feed_state_ajax_callback(e) {
|
128 |
+
var checkbox = jQuery(this);
|
129 |
+
var id = checkbox.val();
|
130 |
+
var checked = checkbox.prop('checked') === true;
|
131 |
+
var container = checkbox.closest('.wprss-feed-state-container');
|
132 |
+
var row = checkbox.closest('tr');
|
133 |
+
|
134 |
+
var errorFunction = function (response) {
|
135 |
+
console.log(response);
|
136 |
+
};
|
137 |
+
|
138 |
+
row.toggleClass('active');
|
139 |
+
|
140 |
+
jQuery.ajax({
|
141 |
+
url: ajaxurl,
|
142 |
+
type: 'POST',
|
143 |
+
dataType: 'json',
|
144 |
+
data: {
|
145 |
+
'action': 'wprss_toggle_feed_state',
|
146 |
+
'id': id,
|
147 |
+
'wprss_admin_ajax_nonce': jQuery('#wprss_feed_source_action_nonce').data('value'), // nonce
|
148 |
+
'wprss_admin_ajax_referer': jQuery('#_wp_http_referer').val() // referer
|
149 |
+
},
|
150 |
+
success: function( response, status, jqXHR ){
|
151 |
+
if (response.is_error) {
|
152 |
+
errorFunction(response.error_message);
|
153 |
+
}
|
154 |
+
},
|
155 |
+
error: errorFunction,
|
156 |
+
timeout: 60000
|
157 |
+
});
|
158 |
+
}
|
159 |
+
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
jQuery(window).load( function(){
|
164 |
|
165 |
|
228 |
}
|
229 |
);
|
230 |
|
231 |
+
jQuery('.wp-list-table').on( 'click', '.wprss_fetch_items_ajax_action', fetch_items_row_action_callback );
|
232 |
+
jQuery('.wp-list-table').on( 'click', '.wprss_delete_items_ajax_action', delete_items_row_action_callback );
|
233 |
+
jQuery('.wp-list-table').on( 'change', '.wprss-toggle-feed-state', toggle_feed_state_ajax_callback );
|
234 |
+
|
235 |
// Make the number rollers change their value to empty string when value is 0, making
|
236 |
// them use the placeholder.
|
237 |
jQuery('.wprss-number-roller').on('change', function(){
|
600 |
});
|
601 |
});
|
602 |
})(jQuery);
|
603 |
+
|
604 |
+
// Image options in feed source edit page
|
605 |
+
(function($) {
|
606 |
+
function update() {
|
607 |
+
var ftImage = $('#wpra_ft_image').val();
|
608 |
+
var downloadImages = $('#wpra_download_images').prop('checked') === true;
|
609 |
+
var ftImagesEnabled = (ftImage !== '');
|
610 |
+
var useDefaultftImage = (ftImage === 'default');
|
611 |
+
|
612 |
+
// Only show the "must have ft image" and "remove ft image" options if featured images are enabled
|
613 |
+
$('#wpra_siphon_ft_image').toggle(ftImagesEnabled);
|
614 |
+
$('#wpra_must_have_ft_image').toggle(ftImagesEnabled);
|
615 |
+
|
616 |
+
// Show the image minimum size options if either featured images or image downloading are enabled
|
617 |
+
$('#wpra_image_min_size_row').toggle( (ftImagesEnabled || downloadImages) && !useDefaultftImage );
|
618 |
+
}
|
619 |
+
|
620 |
+
$(document).ready(function () {
|
621 |
+
var defFtImage = $('#wprss-feed-def-ft-image');
|
622 |
+
|
623 |
+
if (defFtImage.length) {
|
624 |
+
$('#wpra_ft_image').on('change', update);
|
625 |
+
$('#wpra_download_images').on('change', update);
|
626 |
+
|
627 |
+
update();
|
628 |
+
|
629 |
+
var gallery = new WpraGallery({
|
630 |
+
id: 'wpra-feed-def-ft-image',
|
631 |
+
title: "Choose a default featured image",
|
632 |
+
button: "Set default featured image",
|
633 |
+
library: {type: 'image'},
|
634 |
+
multiple: false,
|
635 |
+
elements: {
|
636 |
+
value: defFtImage,
|
637 |
+
open: $('#wprss-feed-set-def-ft-image'),
|
638 |
+
remove: $('#wprss-feed-remove-def-ft-image'),
|
639 |
+
preview: $('#wprss-feed-def-ft-image-preview'),
|
640 |
+
previewHint: $('#wprss-feed-def-ft-image-preview-hint'),
|
641 |
+
},
|
642 |
+
});
|
643 |
+
}
|
644 |
+
|
645 |
+
});
|
646 |
+
})(jQuery);
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function ($) {
|
2 |
+
$(document).ready(function() {
|
3 |
+
$('#wprss-error-log-options-link').click(function () {
|
4 |
+
$('#wprss-error-log-options').slideToggle(200);
|
5 |
+
});
|
6 |
+
});
|
7 |
+
})(jQuery);
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.WPRA=o():e.WPRA=o()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([
|
1 |
+
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.WPRA=o():e.WPRA=o()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([6],{53:function(e,o){}},[53])});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e){function t(r){if(n[r])return n[r].exports;var
|
1 |
+
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t){!function(){e.exports=this.wp.components}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=n(3),a=n(4),s=n(5),u=n(0),p=n(6),c=n(7),b="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},f=function(e){function t(n){r(this,t);var i=o(this,e.apply(this,arguments));return i.props=n,i.state={tokens:[],loading:!1,items:[]},i}return i(t,e),t.prototype.componentDidMount=function(){var e=this;this.setState({loading:!0}),jQuery.post(WPRA_BLOCK.ajax_url,{action:"wprss_fetch_items"},function(t){t=JSON.parse(t),e.setState({loading:!1,items:t.items})})},t.prototype.render=function(){var e=this.setState.bind(this),t=this.props.onChange,n=this.state.items;return this.state.loading?wp.element.createElement(u.Placeholder,null,wp.element.createElement(u.Spinner,null)):wp.element.createElement(u.BaseControl,{help:this.props.help||""},wp.element.createElement(u.FormTokenField,{label:this.props.label||"",placeholder:this.props.placeholder||"",value:this.props.value.map(function(e){return n.find(function(t){return t.value===e})}).filter(function(e){return!!e}),suggestions:this.state.items.map(function(e){return e.toLocaleLowerCase=function(){return e.title.toLocaleLowerCase()},e.toString=function(){return e.title},e}),displayTransform:function(e){return"number"==typeof e&&(e=n.find(function(t){return t.value===e})),"object"===(void 0===e?"undefined":b(e))?e.title:e},saveTransform:function(e){return e},onChange:function(n){e({tokens:n}),t(n.map(function(e){return e.value}))}}))},t}(c.Component),m=f;n(2);var g=WPRA_BLOCK.templates[0],d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return g[e]?t(g[e]):n},h={},y=!1;Object(a.registerBlockType)("wpra-shortcode/wpra-shortcode",{title:Object(l.__)("WP RSS Aggregator Feeds"),description:Object(l.__)("Display feed items imported using WP RSS Aggregator."),icon:"rss",category:"widgets",supportHTML:!1,attributes:Object(p.applyFilters)("wpra.gutenbergBlock.attributes",{isAll:{type:"boolean",default:!0},template:{type:"string",default:"default"},pagination:{type:"boolean",default:!0},limit:{type:"number"},page:{type:"number"},exclude:{type:"string"},source:{type:"string"}}),edit:function(e){!y&&e.attributes.template&&(g=WPRA_BLOCK.templates.find(function(t){return t.value===(e.attributes.template||"default")}),parseInt(e.attributes.limit)!==d("limit",parseInt)&&(h.limit=!0),!!e.attributes.pagination!==d("pagination",function(e){return!!e},!1)&&(h.pagination=!0),y=!0);var t=WPRA_BLOCK.is_et_active?wp.element.createElement("p",{style:{fontStyle:"italic"}},"Excerpts & Thumbnails is incompatible with the WP RSS Aggregator Feeds block. ",wp.element.createElement("a",{href:"https://kb.wprssaggregator.com/article/459-using-excerpts-thumbnails-with-templates",target:"_blank"},"Learn more"),"."):null,n=Object(p.applyFilters)("wpra.gutenbergBlock.panels",[wp.element.createElement(u.PanelBody,{title:Object(l.__)("Feed Sources"),initialOpen:!0},Object(p.applyFilters)("wpra.gutenbergBlock.panelItems",[wp.element.createElement(u.ToggleControl,{label:Object(l.__)("Show all Feed Sources "),checked:e.attributes.isAll,onChange:function(t){e.setAttributes({isAll:t}),e.setAttributes({exclude:""}),e.setAttributes({source:""})}}),wp.element.createElement(m,{label:e.attributes.isAll?Object(l.__)("Feed Sources to Exclude"):Object(l.__)("Feed Sources to Show"),key:"select",help:Object(l.__)("Start typing to search feed sources by name"),value:((e.attributes.isAll?e.attributes.exclude:e.attributes.source)||"").split(",").map(function(e){return parseInt(e)}),onChange:function(t){if(t=t.join(","),e.attributes.isAll)return e.setAttributes({exclude:t}),void e.setAttributes({source:""});e.setAttributes({exclude:""}),e.setAttributes({source:t})}})],"feedSources",{props:e})),wp.element.createElement(u.PanelBody,{title:Object(l.__)("Display Options"),initialOpen:!1},Object(p.applyFilters)("wpra.gutenbergBlock.panelItems",[wp.element.createElement(u.SelectControl,{label:Object(l.__)("Select Template"),value:e.attributes.template,onChange:function(t){g=WPRA_BLOCK.templates.find(function(e){return e.value===t}),e.setAttributes({template:t||""}),h.limit||e.setAttributes({limit:d("limit",parseInt,15)}),h.pagination||e.setAttributes({pagination:d("pagination",function(e){return!!e},!1)})},options:WPRA_BLOCK.templates}),wp.element.createElement(u.TextControl,{label:Object(l.__)("Feed Limit"),help:Object(l.__)("Number of feed items to display"),placeholder:d("limit",parseInt),type:"number",min:1,value:e.attributes.limit||d("limit",parseInt),onChange:function(t){h.limit=!0,e.setAttributes({limit:parseInt(t)||d("limit",parseInt)})}}),wp.element.createElement(u.ToggleControl,{label:Object(l.__)("Show Pagination "),checked:e.attributes.pagination,onChange:function(t){h.pagination=!0,e.setAttributes({pagination:t})}}),wp.element.createElement(u.TextControl,{label:Object(l.__)("Page"),placeholder:Object(l.__)("1"),type:"number",min:1,value:e.attributes.page||1,onChange:function(t){e.setAttributes({page:parseInt(t)||1})}}),t],"displayOptions",{props:e}))],{props:e});return wp.element.createElement("div",null,wp.element.createElement(u.ServerSideRender,{block:"wpra-shortcode/wpra-shortcode",attributes:e.attributes,className:"wpra-gutenberg-block"}),Object(p.applyFilters)("wpra.gutenbergBlock.before",[],{props:e}),wp.element.createElement(s.InspectorControls,null,n),Object(p.applyFilters)("wpra.gutenbergBlock.after",[],{props:e}))},save:function(e){return null}})},function(e,t){},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.editor}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t){!function(){e.exports=this.wp.element}()}]);
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WPRA=t():e.WPRA=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([2],{18:function(e,t,i){"use strict";function s(e,t){for(var i=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],new FormData),s=Object.keys(t),n=Array.isArray(s),r=0,s=n?s:s[Symbol.iterator]();;){var a;if(n){if(r>=s.length)break;a=s[r++]}else{if(r=s.next(),r.done)break;a=r.value}var o=a;i.set(o,t[o])}return fetch(e,{method:"post",body:i}).then(function(e){return e.json()}).then(function(e){if(200!==e.status)throw e;return e})}Object.defineProperty(t,"__esModule",{value:!0});var n=i(6),r=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wizard-holder animated fadeIn"},[i("div",{staticClass:"connect-steps"},[i("div",{staticClass:"step-items"},[i("div",{staticClass:"step-progress",class:"step-progress--"+e.activeScreenIndex}),e._v(" "),e._l(e.screens,function(t,s){return i("div",{staticClass:"step-item",class:{"step-item_active":e.active(t.id),"step-item_completed":t.completed()&&s<e.activeScreenIndex}},[i("div",{staticClass:"step-item__status"},[t.completed()&&s<e.activeScreenIndex?i("span",{staticClass:"dashicons dashicons-yes"}):e._e()]),e._v(" "),i("div",{staticClass:"step-item__info"},[i("div",{staticClass:"step-item__title"},[e._v(e._s(t.title))]),e._v(" "),t.description?i("div",{staticClass:"step-item__description"},[e._v(e._s(t.description))]):e._e()])])})],2)]),e._v(" "),i("div",{staticClass:"wizard"},[i("transition",{attrs:{name:e.transition,mode:"out-in"}},[e.active("feed")?i("div",{key:e.activeScreen,staticClass:"wizard_content"},[i("div",{staticClass:"wizard_hello"},[e._v("\n Enter your first RSS Feed URL\n ")]),e._v(" "),i("form",{staticClass:"wizard_info",attrs:{id:"feedForm"},on:{submit:function(t){return t.preventDefault(),e.next(t)}}},[i("div",{staticClass:"form-group"},[i("input",{directives:[{name:"model",rawName:"v-model",value:e.form.feedSourceUrl,expression:"form.feedSourceUrl"}],staticClass:"wpra-feed-input",attrs:{type:"text",placeholder:"https://www.sourcedomain.com/feed/"},domProps:{value:e.form.feedSourceUrl},on:{input:function(t){t.target.composing||e.$set(e.form,"feedSourceUrl",t.target.value)}}}),e._v(" "),e.isFeedError?i("span",{staticClass:"dashicons dashicons-warning warning-icon"}):e._e(),e._v(" "),e.isFeedError?i("a",{attrs:{href:e.validateLink,target:"_blank"}},[e._v("Validate feed")]):e._e()])]),e._v(" "),e.isFeedError?i("div",{staticClass:"wizard_error"},[i("p",[e._v("This RSS feed URL appears to be invalid. Here are a couple of things you can try:")]),e._v(" "),i("ol",[i("li",[e._v('Check whether the URL you entered is the correct one by trying one of the options when clicking on "How do I find an RSS feed URL?" below.')]),e._v(" "),i("li",[e._v("\n Test out this other RSS feed URL to make sure the plugin is working correctly - https://www.wpmayor.com/feed/ - If it works, you may "),i("a",{attrs:{href:e.supportUrl,target:"_blank"}},[e._v("contact us here")]),e._v(" to help you with your source.\n ")]),e._v(" "),i("li",[e._v("Test the URL's validity by W3C standards, the standards we use in our plugins, using the “Validate feed” link above.")])])]):e._e(),e._v(" "),i("expander",{attrs:{title:"How do I find an RSS feed URL?"}},[i("p",[e._v("WP RSS Aggregator fetches feed items through RSS feeds. Almost every website in the world provides an RSS feed. Here's how to find it:")]),e._v(" "),i("p",[e._v("Option 1: Add /feed to the website's homepage URL ")]),e._v(" "),i("p",[e._v("Many sites have their RSS feed at the same URL. For instance, if the website's URL is www.thiswebsite.com, then the RSS feed could be at www.thiswebsite.com/feed.")]),e._v(" "),i("p",[e._v("Option 2: Look for the RSS share icon")]),e._v(" "),i("p",[e._v("Many websites have share icons on their pages for Facebook, Twitter and more. Many times, there will also be an orange RSS icon. Click on that to access the RSS feed URL.")]),e._v(" "),i("p",[e._v("Option 3: Browser RSS Auto-Discovery")]),e._v(" "),i("p",[e._v("Most browsers either include an RSS auto-discovery tool by default or they allow you to add extensions for it. Firefox shows an RSS icon above the website, in the address bar, which you can click on directly. Chrome offers extensions such as this one.")]),e._v(" "),i("p",[e._v("Option 4: Look at the Page Source")]),e._v(" "),i("p",[e._v('When on any page of the website you\'re looking to import feed items from, right click and press "View Page Source". Once the new window opens, use the “Find” feature (Ctrl-F on PC, Command-F on Mac) and search for " RSS". This should take you to a line that reads like this (or similar):')]),e._v(" "),i("p",[i("code",[e._v('\n <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="https://www.sourcedomain.com/feed/" />\n ')])]),e._v(" "),i("p",[e._v("The RSS feed’s URL is found between the quotes after href=. In the above case, it would be https://www.sourcedomain.com/feed/.")]),e._v(" "),i("p",[i("a",{attrs:{href:e.knowledgeBaseUrl,target:"_blank"}},[e._v("Browse our Knowledge Base for more information.")])])])],1):e._e(),e._v(" "),e.active("feedItems")?i("div",{key:e.activeScreen,staticClass:"wizard_content"},[i("div",{staticClass:"wizard_hello"},[e._v("\n Latest feed items from your selected feed source:\n ")]),e._v(" "),i("div",{staticClass:"wpra-feed-items"},e._l(e.feed.items,function(t){return i("div",{staticClass:"wpra-feed-item"},[i("div",{staticClass:"wpra-feed-item__link"},[i("a",{attrs:{href:t.permalink,target:"_blank"}},[e._v(e._s(t.title))])]),e._v(" "),i("div",{staticClass:"wpra-feed-item__info"},[t.date||t.author?[t.date?[e._v("\n Published on "+e._s(t.date)+"\n ")]:e._e(),e._v(" "),t.date&&t.author?[e._v("|")]:e._e(),e._v(" "),t.author?[e._v("\n By "+e._s(t.author)+"\n ")]:e._e()]:e._e()],2)])}),0),e._v(" "),i("div",{staticClass:"wrpa-shortcode"},[i("div",{staticClass:"wrpa-shortcode-preview"},[i("div",{staticClass:"wrpa-shortcode-label"},[e._v("\n Create a draft page to preview these feed items on your site:\n ")]),e._v(" "),i("a",{staticClass:"button",class:{"button-primary":e.isPrepared,"loading-button":e.isPreparing},attrs:{href:e.previewUrl,target:"_blank"},on:{click:e.preparePreview}},[e._v("\n "+e._s(e.isPrepared?"Preview the Page":"Create Draft Page")+"\n ")])]),e._v(" "),i("div",{staticClass:"wrpa-shortcode-form",on:{click:function(t){e.copyToClipboard()}}},[i("div",{staticClass:"wrpa-shortcode-label"},[e._v("\n Copy the shortcode to any page or post on your site:\n ")]),e._v(" "),i("input",{ref:"selected",staticClass:"wrpa-shortcode-form__shortcode",attrs:{type:"text",readonly:"",value:"[wp-rss-aggregator]"}}),e._v(" "),i("div",{staticClass:"wrpa-shortcode-form__button"},[e._v("\n "+e._s(e.isCopied?"Copied!":"Click to copy")+"\n ")])])])]):e._e(),e._v(" "),e.active("finish")?i("div",{key:e.activeScreen,staticClass:"wizard_content"},[i("div",{staticClass:"wizard_hello"},[e._v("\n You’ve successfully set up your first feed source 😄\n ")]),e._v(" "),i("div",{staticClass:"wpra-cols-title"},[e._v("\n Do more with WP RSS Aggregator - here is what we did at CryptoHeadlines.com.\n ")]),e._v(" "),i("div",{staticClass:"wpra-cols"},[i("div",{staticClass:"col"},[i("p",[e._v("CryptoHeadlines.com displays latest news, Youtube videos, podcasts, jobs and more from the Cryptocurrency industry.")]),e._v(" "),i("p",[e._v("It uses Feed to Post to import articles, Youtube videos, and podcast links.")]),e._v(" "),i("p",[e._v("Full Text RSS Feeds is used to fetch the full content of the job listings to present more information to the potential applicant.")]),e._v(" "),i("p",[e._v("Keyword Filtering is used to filter out content that contains profanity and keywords or phrases deemed as inappropriate.")]),e._v(" "),i("div",{staticStyle:{"margin-bottom":".5rem"}},[i("a",{staticClass:"button",attrs:{href:e.addOnsUrl,target:"_blank"}},[e._v("\n Browse Add-ons ⭐️\n ")])]),e._v(" "),i("div",[i("a",{staticStyle:{"font-size":".9em"},attrs:{href:e.supportUrl,target:"_blank"}},[e._v("Contact support for more information.")])])]),e._v(" "),i("div",{staticClass:"col"},[i("img",{staticClass:"img wpra-demo-photo",attrs:{src:e.demoImageUrl}}),e._v(" "),i("div",{staticClass:"wpra-feedback"},[i("div",{staticClass:"wpra-feedback__copy"},[i("div",{staticClass:"wpra-feedback__text"},[e._v("\n This plugin has made my life a lot easier, and the support has been great as well.\n ")]),e._v(" "),i("div",{staticClass:"wpra-feedback__rating"},[i("span",{staticClass:"dashicons dashicons-star-filled"}),e._v(" "),i("span",{staticClass:"dashicons dashicons-star-filled"}),e._v(" "),i("span",{staticClass:"dashicons dashicons-star-filled"}),e._v(" "),i("span",{staticClass:"dashicons dashicons-star-filled"}),e._v(" "),i("span",{staticClass:"dashicons dashicons-star-filled"})]),e._v(" "),i("div",{staticClass:"wpra-feedback__by"},[i("a",{attrs:{href:e.feedbackUrl,target:"_blank"}},[e._v("\n Review by officeinnovator\n ")])])])])])])]):e._e()]),e._v(" "),i("div",{staticClass:"connect-actions pad"},[i("div",{staticClass:"pad-item--grow"},[e.active("finish")?e._e():i("button",{staticClass:"button-clear",on:{click:e.finish}},[e._v("\n Skip the introduction\n ")])]),e._v(" "),i("div",{staticClass:"pad-item--no-shrink"},[e.isBackAvailable?i("button",{staticClass:"button-clear",on:{click:e.back}},[e._v("\n Back\n ")]):e._e(),e._v(" "),i("button",{staticClass:"button button-primary button-large",class:{"loading-button":e.isLoading},on:{click:e.next}},[e._v("\n "+e._s(e.active("finish")?"Continue to Plugin":"Next")+"\n ")])])])],1)])},a=[],o=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wpra-expander",class:{"wpra-expander--expanded":e.isExpanded}},[i("div",{staticClass:"wpra-expander__title",on:{click:function(t){e.isExpanded=!e.isExpanded}}},[e._v("\n "+e._s(e.title)+"\n "),i("span",{staticClass:"dashicons dashicons-arrow-down-alt2"})]),e._v(" "),i("transition-expand",[e.isExpanded?i("div",[i("div",{staticClass:"wpra-expander__content"},[e._t("default")],2)]):e._e()])],1)},c=[],d=i(7),l={data:function(){return{isExpanded:this.defaultExpanded}},props:{title:{},defaultExpanded:{value:!1}},components:{TransitionExpand:d.a}},u=l,p=i(1),v=Object(p.a)(u,o,c,!1,null,null,null);v.options.__file="Expander.vue";var f=v.exports,h=i(8),_=function(e){return e},m=window.wprssWizardConfig,w={data:function(){var e=this;return{prevHeight:0,screens:[{id:"feed",title:_("Add feed source URL"),description:!1,next:this.submitFeed,completed:function(){return e.feed.items.length},entered:function(){e.focusOnInput("feed")}},{id:"feedItems",title:_("Display feed items"),description:!1,next:this.continueItems,completed:function(){return e.feed.items.length&&e.itemsPassed}},{id:"finish",title:_("Complete introduction"),description:!1,next:this.completeIntroduction,completed:function(){return e.feed.items.length&&e.itemsPassed}}],isCopied:!1,isPreparing:!1,isPrepared:!1,transition:"slide-up",activeScreen:"feed",form:{feedSourceUrl:null},itemsPassed:!1,stepLoading:!1,isLoading:!1,isFeedError:!1,feed:{items:[]},previewUrl:m.previewUrl,addOnsUrl:m.addOnsUrl,supportUrl:m.supportUrl,demoImageUrl:m.demoImageUrl,feedbackUrl:m.feedbackUrl,knowledgeBaseUrl:m.knowledgeBaseUrl}},computed:{validateLink:function(){return"https://validator.w3.org/feed/check.cgi?url="+encodeURI(this.form.feedSourceUrl)},activeScreenIndex:function(){var e=this;return this.screens.findIndex(function(t){return t.id===e.activeScreen})},currentScreen:function(){var e=this;return this.screens.find(function(t){return t.id===e.activeScreen})},actionCompleted:function(){return this.currentScreen.completed()},isBackAvailable:function(){return this.activeScreenIndex>0&&this.activeScreenIndex<this.screens.length}},mounted:function(){this.onScreenEnter()},methods:{preparePreview:function(e){var t=this;if(this.isPreparing)return void e.preventDefault();this.isPrepared||(e.preventDefault(),this.isPreparing=!0,fetch(this.previewUrl).then(function(){t.isPreparing=!1,t.isPrepared=!0}))},submitFeed:function(){var e=this,t=Object.assign(m.feedEndpoint.defaultPayload,{wprss_intro_feed_url:this.form.feedSourceUrl});return this.isLoading=!0,this.isFeedError=!1,s(m.feedEndpoint.url,t).then(function(t){return e.feed.items=t.data.feed_items.slice(0,3),e.isLoading=!1,{}}).catch(function(t){throw e.isLoading=!1,e.isFeedError=!0,t})},continueItems:function(){return this.itemsPassed=!0,Promise.resolve({})},completeIntroduction:function(){return Promise.resolve({})},next:function(){var e=this;this.transition="slide-up";var t=this.currentScreen.next?this.currentScreen.next:function(){return Promise.resolve(!1)};this.stepLoading=!0,t().then(function(t){e.stepLoading=!1},function(e){throw e}).then(function(){var t=e.activeScreenIndex+1;t>=e.screens.length?e.finish():(e.activeScreen=e.screens[t].id,e.onScreenEnter())}).catch(function(e){console.error(e)})},onScreenEnter:function(){var e=this;this.$nextTick(function(){e.currentScreen.entered&&e.currentScreen.entered()})},focusOnInput:function(e){if(!this.$refs[e]||!this.$refs[e].focus)return!1;this.$refs[e].focus()},back:function(){this.transition="slide-down",this.activeScreen=this.screens[this.activeScreenIndex-1].id},finish:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=function(){return window.location.href=m.feedListUrl};if(e)return void(confirm("Are you sure you want to skip the introduction?")&&t());t()},active:function(e){return this.activeScreen===e},copyToClipboard:function(){var e=this;this.isCopied||(Object(h.a)("[wp-rss-aggregator]"),this.isCopied=!0,setTimeout(function(){e.isCopied=!1},1e3))}},components:{Expander:f}},g=w,y=Object(p.a)(g,r,a,!1,null,null,null);y.options.__file="Wizard.vue";var b=y.exports;i(22),i(19),new n.a({el:"#wpra-wizard-app",template:"<Wizard/>",components:{Wizard:b}})},19:function(e,t){},7:function(e,t,i){"use strict";var s={name:"TransitionExpand",functional:!0,render:function(e,t){return e("transition",{props:{name:"expand"},on:{afterEnter:function(e){e.style.height="auto"},enter:function(e){var t=getComputedStyle(e),i=t.width;e.style.width=i,e.style.position="absolute",e.style.visibility="hidden",e.style.height="auto";var s=getComputedStyle(e),n=s.height;e.style.width=null,e.style.position=null,e.style.visibility=null,e.style.height=0,getComputedStyle(e).height,setTimeout(function(){e.style.height=n})},leave:function(e){var t=getComputedStyle(e),i=t.height;e.style.height=i,getComputedStyle(e).height,setTimeout(function(){e.style.height=0})}}},t.children)}},n=s,r=i(1),a=Object(r.a)(n,void 0,void 0,!1,null,null,null);a.options.__file="TransitionExpand.vue",t.a=a.exports},8:function(e,t,i){"use strict";function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!navigator.clipboard)return void n(e,t);navigator.clipboard.writeText(e).then(function(){},function(e){console.error("Async: Could not copy text: ",e)})}t.a=s;var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t=t||document.body.parentElement;var i=document.createElement("textarea");i.value=e;var s=t.scrollTop;document.body.appendChild(i),i.focus(),i.select();try{document.execCommand("copy")}catch(e){console.error("Fallback: Oops, unable to copy",e)}document.body.removeChild(i),t.scrollTop=s}}},[18])});
|
1 |
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WPRA=t():e.WPRA=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([2],{16:function(e,t,i){"use strict";function s(e,t){for(var i=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],new FormData),s=Object.keys(t),n=Array.isArray(s),r=0,s=n?s:s[Symbol.iterator]();;){var a;if(n){if(r>=s.length)break;a=s[r++]}else{if(r=s.next(),r.done)break;a=r.value}var o=a;i.set(o,t[o])}return fetch(e,{method:"post",body:i}).then(function(e){return e.json()}).then(function(e){if(200!==e.status)throw e;return e})}Object.defineProperty(t,"__esModule",{value:!0});var n=i(4),r=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wizard-holder animated fadeIn"},[i("div",{staticClass:"connect-steps"},[i("div",{staticClass:"step-items"},[i("div",{staticClass:"step-progress",class:"step-progress--"+e.activeScreenIndex}),e._v(" "),e._l(e.screens,function(t,s){return i("div",{staticClass:"step-item",class:{"step-item_active":e.active(t.id),"step-item_completed":t.completed()&&s<e.activeScreenIndex}},[i("div",{staticClass:"step-item__status"},[t.completed()&&s<e.activeScreenIndex?i("span",{staticClass:"dashicons dashicons-yes"}):e._e()]),e._v(" "),i("div",{staticClass:"step-item__info"},[i("div",{staticClass:"step-item__title"},[e._v(e._s(t.title))]),e._v(" "),t.description?i("div",{staticClass:"step-item__description"},[e._v(e._s(t.description))]):e._e()])])})],2)]),e._v(" "),i("div",{staticClass:"wizard"},[i("transition",{attrs:{name:e.transition,mode:"out-in"}},[e.active("feed")?i("div",{key:e.activeScreen,staticClass:"wizard_content"},[i("div",{staticClass:"wizard_hello"},[e._v("\n Enter your first RSS Feed URL\n ")]),e._v(" "),i("form",{staticClass:"wizard_info",attrs:{id:"feedForm"},on:{submit:function(t){return t.preventDefault(),e.next(t)}}},[i("div",{staticClass:"form-group"},[i("input",{directives:[{name:"model",rawName:"v-model",value:e.form.feedSourceUrl,expression:"form.feedSourceUrl"}],staticClass:"wpra-feed-input",attrs:{type:"text",placeholder:"https://www.sourcedomain.com/feed/"},domProps:{value:e.form.feedSourceUrl},on:{input:function(t){t.target.composing||e.$set(e.form,"feedSourceUrl",t.target.value)}}}),e._v(" "),e.isFeedError?i("span",{staticClass:"dashicons dashicons-warning warning-icon"}):e._e(),e._v(" "),e.isFeedError?i("a",{attrs:{href:e.validateLink,target:"_blank"}},[e._v("Validate feed")]):e._e()])]),e._v(" "),e.isFeedError?i("div",{staticClass:"wizard_error"},[i("p",[e._v("This RSS feed URL appears to be invalid. Here are a couple of things you can try:")]),e._v(" "),i("ol",[i("li",[e._v('Check whether the URL you entered is the correct one by trying one of the options when clicking on "How do I find an RSS feed URL?" below.')]),e._v(" "),i("li",[e._v("\n Test out this other RSS feed URL to make sure the plugin is working correctly - https://www.wpmayor.com/feed/ - If it works, you may "),i("a",{attrs:{href:e.supportUrl,target:"_blank"}},[e._v("contact us here")]),e._v(" to help you with your source.\n ")]),e._v(" "),i("li",[e._v("Test the URL's validity by W3C standards, the standards we use in our plugins, using the “Validate feed” link above.")])])]):e._e(),e._v(" "),i("expander",{attrs:{title:"How do I find an RSS feed URL?"}},[i("p",[e._v("WP RSS Aggregator fetches feed items through RSS feeds. Almost every website in the world provides an RSS feed. Here's how to find it:")]),e._v(" "),i("p",[e._v("Option 1: Add /feed to the website's homepage URL ")]),e._v(" "),i("p",[e._v("Many sites have their RSS feed at the same URL. For instance, if the website's URL is www.thiswebsite.com, then the RSS feed could be at www.thiswebsite.com/feed.")]),e._v(" "),i("p",[e._v("Option 2: Look for the RSS share icon")]),e._v(" "),i("p",[e._v("Many websites have share icons on their pages for Facebook, Twitter and more. Many times, there will also be an orange RSS icon. Click on that to access the RSS feed URL.")]),e._v(" "),i("p",[e._v("Option 3: Browser RSS Auto-Discovery")]),e._v(" "),i("p",[e._v("Most browsers either include an RSS auto-discovery tool by default or they allow you to add extensions for it. Firefox shows an RSS icon above the website, in the address bar, which you can click on directly. Chrome offers extensions such as this one.")]),e._v(" "),i("p",[e._v("Option 4: Look at the Page Source")]),e._v(" "),i("p",[e._v('When on any page of the website you\'re looking to import feed items from, right click and press "View Page Source". Once the new window opens, use the “Find” feature (Ctrl-F on PC, Command-F on Mac) and search for " RSS". This should take you to a line that reads like this (or similar):')]),e._v(" "),i("p",[i("code",[e._v('\n <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="https://www.sourcedomain.com/feed/" />\n ')])]),e._v(" "),i("p",[e._v("The RSS feed’s URL is found between the quotes after href=. In the above case, it would be https://www.sourcedomain.com/feed/.")]),e._v(" "),i("p",[i("a",{attrs:{href:e.knowledgeBaseUrl,target:"_blank"}},[e._v("Browse our Knowledge Base for more information.")])])])],1):e._e(),e._v(" "),e.active("feedItems")?i("div",{key:e.activeScreen,staticClass:"wizard_content"},[i("div",{staticClass:"wizard_hello"},[e._v("\n Latest feed items from your selected feed source:\n ")]),e._v(" "),i("div",{staticClass:"wpra-feed-items"},e._l(e.feed.items,function(t){return i("div",{staticClass:"wpra-feed-item"},[i("div",{staticClass:"wpra-feed-item__link"},[i("a",{attrs:{href:t.permalink,target:"_blank"}},[e._v(e._s(t.title))])]),e._v(" "),i("div",{staticClass:"wpra-feed-item__info"},[t.date||t.author?[t.date?[e._v("\n Published on "+e._s(t.date)+"\n ")]:e._e(),e._v(" "),t.date&&t.author?[e._v("|")]:e._e(),e._v(" "),t.author?[e._v("\n By "+e._s(t.author)+"\n ")]:e._e()]:e._e()],2)])}),0),e._v(" "),i("div",{staticClass:"wrpa-shortcode"},[i("div",{staticClass:"wrpa-shortcode-preview"},[i("div",{staticClass:"wrpa-shortcode-label"},[e._v("\n Create a draft page to preview these feed items on your site:\n ")]),e._v(" "),i("a",{staticClass:"button",class:{"button-primary":e.isPrepared,"loading-button":e.isPreparing},attrs:{href:e.previewUrl,target:"_blank"},on:{click:e.preparePreview}},[e._v("\n "+e._s(e.isPrepared?"Preview the Page":"Create Draft Page")+"\n ")])]),e._v(" "),i("div",{staticClass:"wrpa-shortcode-form",on:{click:function(t){e.copyToClipboard()}}},[i("div",{staticClass:"wrpa-shortcode-label"},[e._v("\n Copy the shortcode to any page or post on your site:\n ")]),e._v(" "),i("input",{ref:"selected",staticClass:"wrpa-shortcode-form__shortcode",attrs:{type:"text",readonly:"",value:"[wp-rss-aggregator]"}}),e._v(" "),i("div",{staticClass:"wrpa-shortcode-form__button"},[e._v("\n "+e._s(e.isCopied?"Copied!":"Click to copy")+"\n ")])])])]):e._e(),e._v(" "),e.active("finish")?i("div",{key:e.activeScreen,staticClass:"wizard_content"},[i("div",{staticClass:"wizard_hello"},[e._v("\n You’ve successfully set up your first feed source 😄\n ")]),e._v(" "),i("div",{staticClass:"wpra-cols-title"},[e._v("\n Do more with WP RSS Aggregator - here is what we did at CryptoHeadlines.com.\n ")]),e._v(" "),i("div",{staticClass:"wpra-cols"},[i("div",{staticClass:"col"},[i("p",[e._v("CryptoHeadlines.com displays latest news, Youtube videos, podcasts, jobs and more from the Cryptocurrency industry.")]),e._v(" "),i("p",[e._v("It uses Feed to Post to import articles, Youtube videos, and podcast links.")]),e._v(" "),i("p",[e._v("Full Text RSS Feeds is used to fetch the full content of the job listings to present more information to the potential applicant.")]),e._v(" "),i("p",[e._v("Keyword Filtering is used to filter out content that contains profanity and keywords or phrases deemed as inappropriate.")]),e._v(" "),i("div",{staticStyle:{"margin-bottom":".5rem"}},[i("a",{staticClass:"button",attrs:{href:e.addOnsUrl,target:"_blank"}},[e._v("\n Browse Add-ons ⭐️\n ")])]),e._v(" "),i("div",[i("a",{staticStyle:{"font-size":".9em"},attrs:{href:e.supportUrl,target:"_blank"}},[e._v("Contact support for more information.")])])]),e._v(" "),i("div",{staticClass:"col"},[i("img",{staticClass:"img wpra-demo-photo",attrs:{src:e.demoImageUrl}}),e._v(" "),i("div",{staticClass:"wpra-feedback"},[i("div",{staticClass:"wpra-feedback__copy"},[i("div",{staticClass:"wpra-feedback__text"},[e._v("\n This plugin has made my life a lot easier, and the support has been great as well.\n ")]),e._v(" "),i("div",{staticClass:"wpra-feedback__rating"},[i("span",{staticClass:"dashicons dashicons-star-filled"}),e._v(" "),i("span",{staticClass:"dashicons dashicons-star-filled"}),e._v(" "),i("span",{staticClass:"dashicons dashicons-star-filled"}),e._v(" "),i("span",{staticClass:"dashicons dashicons-star-filled"}),e._v(" "),i("span",{staticClass:"dashicons dashicons-star-filled"})]),e._v(" "),i("div",{staticClass:"wpra-feedback__by"},[i("a",{attrs:{href:e.feedbackUrl,target:"_blank"}},[e._v("\n Review by officeinnovator\n ")])])])])])])]):e._e()]),e._v(" "),i("div",{staticClass:"connect-actions pad"},[i("div",{staticClass:"pad-item--grow"},[e.active("finish")?e._e():i("button",{staticClass:"button-clear",on:{click:e.finish}},[e._v("\n Skip the introduction\n ")])]),e._v(" "),i("div",{staticClass:"pad-item--no-shrink"},[e.isBackAvailable?i("button",{staticClass:"button-clear",on:{click:e.back}},[e._v("\n Back\n ")]):e._e(),e._v(" "),i("button",{staticClass:"button button-primary button-large",class:{"loading-button":e.isLoading},on:{click:e.next}},[e._v("\n "+e._s(e.active("finish")?"Continue to Plugin":"Next")+"\n ")])])])],1)])},a=[],o=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wpra-expander",class:{"wpra-expander--expanded":e.isExpanded}},[i("div",{staticClass:"wpra-expander__title",on:{click:function(t){e.isExpanded=!e.isExpanded}}},[e._v("\n "+e._s(e.title)+"\n "),i("span",{staticClass:"dashicons dashicons-arrow-down-alt2"})]),e._v(" "),i("transition-expand",[e.isExpanded?i("div",[i("div",{staticClass:"wpra-expander__content"},[e._t("default")],2)]):e._e()])],1)},c=[],d=i(5),l={data:function(){return{isExpanded:this.defaultExpanded}},props:{title:{},defaultExpanded:{value:!1}},components:{TransitionExpand:d.a}},u=l,p=i(1),v=Object(p.a)(u,o,c,!1,null,null,null);v.options.__file="Expander.vue";var f=v.exports,h=i(6),_=function(e){return e},m=window.wprssWizardConfig,w={data:function(){var e=this;return{prevHeight:0,screens:[{id:"feed",title:_("Add feed source URL"),description:!1,next:this.submitFeed,completed:function(){return e.feed.items.length},entered:function(){e.focusOnInput("feed")}},{id:"feedItems",title:_("Display feed items"),description:!1,next:this.continueItems,completed:function(){return e.feed.items.length&&e.itemsPassed}},{id:"finish",title:_("Complete introduction"),description:!1,next:this.completeIntroduction,completed:function(){return e.feed.items.length&&e.itemsPassed}}],isCopied:!1,isPreparing:!1,isPrepared:!1,transition:"slide-up",activeScreen:"feed",form:{feedSourceUrl:null},itemsPassed:!1,stepLoading:!1,isLoading:!1,isFeedError:!1,feed:{items:[]},previewUrl:m.previewUrl,addOnsUrl:m.addOnsUrl,supportUrl:m.supportUrl,demoImageUrl:m.demoImageUrl,feedbackUrl:m.feedbackUrl,knowledgeBaseUrl:m.knowledgeBaseUrl}},computed:{validateLink:function(){return"https://validator.w3.org/feed/check.cgi?url="+encodeURI(this.form.feedSourceUrl)},activeScreenIndex:function(){var e=this;return this.screens.findIndex(function(t){return t.id===e.activeScreen})},currentScreen:function(){var e=this;return this.screens.find(function(t){return t.id===e.activeScreen})},actionCompleted:function(){return this.currentScreen.completed()},isBackAvailable:function(){return this.activeScreenIndex>0&&this.activeScreenIndex<this.screens.length}},mounted:function(){this.onScreenEnter()},methods:{preparePreview:function(e){var t=this;if(this.isPreparing)return void e.preventDefault();this.isPrepared||(e.preventDefault(),this.isPreparing=!0,fetch(this.previewUrl).then(function(){t.isPreparing=!1,t.isPrepared=!0}))},submitFeed:function(){var e=this,t=Object.assign(m.feedEndpoint.defaultPayload,{wprss_intro_feed_url:this.form.feedSourceUrl});return this.isLoading=!0,this.isFeedError=!1,s(m.feedEndpoint.url,t).then(function(t){return e.feed.items=t.data.feed_items.slice(0,3),e.isLoading=!1,{}}).catch(function(t){throw e.isLoading=!1,e.isFeedError=!0,t})},continueItems:function(){return this.itemsPassed=!0,Promise.resolve({})},completeIntroduction:function(){return Promise.resolve({})},next:function(){var e=this;this.transition="slide-up";var t=this.currentScreen.next?this.currentScreen.next:function(){return Promise.resolve(!1)};this.stepLoading=!0,t().then(function(t){e.stepLoading=!1},function(e){throw e}).then(function(){var t=e.activeScreenIndex+1;t>=e.screens.length?e.finish():(e.activeScreen=e.screens[t].id,e.onScreenEnter())}).catch(function(e){console.error(e)})},onScreenEnter:function(){var e=this;this.$nextTick(function(){e.currentScreen.entered&&e.currentScreen.entered()})},focusOnInput:function(e){if(!this.$refs[e]||!this.$refs[e].focus)return!1;this.$refs[e].focus()},back:function(){this.transition="slide-down",this.activeScreen=this.screens[this.activeScreenIndex-1].id},finish:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=function(){return window.location.href=m.feedListUrl};if(e)return void(confirm("Are you sure you want to skip the introduction?")&&t());t()},active:function(e){return this.activeScreen===e},copyToClipboard:function(){var e=this;this.isCopied||(Object(h.a)("[wp-rss-aggregator]"),this.isCopied=!0,setTimeout(function(){e.isCopied=!1},1e3))}},components:{Expander:f}},g=w,y=Object(p.a)(g,r,a,!1,null,null,null);y.options.__file="Wizard.vue";var b=y.exports;i(20),i(17),new n.a({el:"#wpra-wizard-app",template:"<Wizard/>",components:{Wizard:b}})},17:function(e,t){},5:function(e,t,i){"use strict";var s={name:"TransitionExpand",functional:!0,render:function(e,t){return e("transition",{props:{name:"expand"},on:{afterEnter:function(e){e.style.height="auto"},enter:function(e){var t=getComputedStyle(e),i=t.width;e.style.width=i,e.style.position="absolute",e.style.visibility="hidden",e.style.height="auto";var s=getComputedStyle(e),n=s.height;e.style.width=null,e.style.position=null,e.style.visibility=null,e.style.height=0,getComputedStyle(e).height,setTimeout(function(){e.style.height=n})},leave:function(e){var t=getComputedStyle(e),i=t.height;e.style.height=i,getComputedStyle(e).height,setTimeout(function(){e.style.height=0})}}},t.children)}},n=s,r=i(1),a=Object(r.a)(n,void 0,void 0,!1,null,null,null);a.options.__file="TransitionExpand.vue",t.a=a.exports},6:function(e,t,i){"use strict";function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!navigator.clipboard)return void n(e,t);navigator.clipboard.writeText(e).then(function(){},function(e){console.error("Async: Could not copy text: ",e)})}t.a=s;var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t=t||document.body.parentElement;var i=document.createElement("textarea");i.value=e;var s=t.scrollTop;document.body.appendChild(i),i.focus(),i.select();try{document.execCommand("copy")}catch(e){console.error("Fallback: Oops, unable to copy",e)}document.body.removeChild(i),t.scrollTop=s}}},[16])});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WPRA=t():e.WPRA=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([
|
1 |
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WPRA=t():e.WPRA=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([4],{51:function(e,t,a){a(52),jQuery(document).ready(function(e){var t=function(t,a){t.addClass("wpra-loading"),e([document.documentElement,document.body]).animate({scrollTop:t.offset().top-50},500);var n=a.template;delete a.template;var o=n.length?n:"0",p=WpraPagination.baseUri.replace("%s",o);e.ajax({type:"POST",url:p,data:JSON.stringify(a),contentType:"application/json"}).done(function(a){$newEl=e(a.html),$newEl.find(".colorbox").colorbox({iframe:!0,width:"80%",height:"80%"}),t.replaceWith($newEl)})},a=function(e){var a=e.closest("[data-template-ctx]"),n=a.data("wpra-template"),o=a.data("template-ctx"),p=Object.assign({},{template:n},JSON.parse(atob(o)));p.page=e.data("wpra-page"),t(a,p)};e("body").on("click","a[data-wpra-page]",function(t){t.preventDefault(),a(e(this))})})},52:function(e,t){}},[51])});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WPRA=t():e.WPRA=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([
|
1 |
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WPRA=t():e.WPRA=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([3],{21:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=o(4),i=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"wpra-plugin-disable-poll"},[o("modal",{attrs:{active:e.isModalVisible,"header-class":"invisible-header"},on:{close:e.closeModal}},[o("div",{attrs:{slot:"header"},slot:"header"},[o("div",{staticClass:"wpra-plugin-disable-poll__logo"},[o("img",{attrs:{src:e.image("light-line-logo.png"),alt:""}})]),e._v(" "),o("h3",[e._v("\n Do you have a moment to share why you are deactivating WP RSS Aggregator?\n ")]),e._v(" "),o("p",[e._v("\n Your feedback will help us to improve our plugins and service.\n ")])]),e._v(" "),o("div",{attrs:{slot:"body"},slot:"body"},[o("SerializedForm",{attrs:{form:e.form},model:{value:e.model,callback:function(t){e.model=t},expression:"model"}})],1),e._v(" "),o("div",{attrs:{slot:"footer"},slot:"footer"},[o("div",{staticClass:"footer-confirm__buttons"},[o("button",{staticClass:"button button-clear",on:{click:e.deactivate}},[e._v("\n Skip & Deactivate\n ")]),e._v(" "),o("button",{staticClass:"button button-primary",class:{"loading-button":e.isDeactivating},on:{click:e.submit}},[e._v("\n Submit & Deactivate\n ")])])])])],1)},n=[],l=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("transition",{attrs:{name:"modal-transition"}},[e.active?o("div",{staticClass:"modal",on:{click:function(t){if(t.target!==t.currentTarget)return null;e.$emit("close")}}},[o("div",{class:["modal__body",this.modalBodyClass]},[o("div",{staticClass:"modal__header",class:e.headerClass},[e._t("header")],2),e._v(" "),o("div",{staticClass:"modal__content"},[e._t("body")],2),e._v(" "),o("div",{staticClass:"modal__footer"},[e._t("footer")],2)])]):e._e()])},s=[],r={props:{active:{type:Boolean},title:{type:String},modalBodyClass:{type:String,default:""},headerClass:{default:function(){return{}}},dialogOpenedClass:{type:String,default:"modal-opened"}},watch:{active:function(e){this.$emit(e?"open":"close")}},mounted:function(){var e=this;this.$on("open",function(){document.querySelector("body").classList.add(e.dialogOpenedClass)}),this.$on("close",function(){document.querySelector("body").classList.remove(e.dialogOpenedClass)})}},d=r,c=o(1),u=Object(c.a)(d,l,s,!1,null,null,null);u.options.__file="Modal.vue";var m=u.exports,v=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"form"},e._l(e.form,function(t){return e.satisfiesCondition(t)?o("div",{staticClass:"form-group"},["radio"===t.type?[t.label?o("label",{attrs:{for:t.name},domProps:{innerHTML:e._s(t.label)}}):e._e(),e._v(" "),e._l(t.options,function(a,i){return o("div",{staticClass:"form-check"},[o("input",{directives:[{name:"model",rawName:"v-model",value:e.model[t.name],expression:"model[datum.name]"}],attrs:{type:"radio",name:t.name,id:t.name+"_"+i},domProps:{value:a.value,checked:e._q(e.model[t.name],a.value)},on:{change:function(o){e.$set(e.model,t.name,a.value)}}}),e._v(" "),o("label",{attrs:{for:t.name+"_"+i}},[e._v("\n "+e._s(a.label||a.value)+"\n ")])])})]:e._e(),e._v(" "),"textarea"===t.type?[t.label?o("label",{attrs:{for:t.name},domProps:{innerHTML:e._s(t.label)}}):e._e(),e._v(" "),o("textarea",{directives:[{name:"model",rawName:"v-model",value:e.model[t.name],expression:"model[datum.name]"}],attrs:{id:t.name},domProps:{value:e.model[t.name]},on:{input:function(o){o.target.composing||e.$set(e.model,t.name,o.target.value)}}})]:e._e(),e._v(" "),"content"===t.type?[o("div",{class:t.className},[o("p",{domProps:{innerHTML:e._s(t.label)}})])]:e._e()],2):e._e()}),0)},p=[],f={props:{form:{type:Array},value:{type:Object}},computed:{model:{get:function(){return this.value},set:function(e){this.$emit("input",e)}}},methods:{satisfiesCondition:function(e){if(!e.condition)return!0;var t=this.getConditionFunction(e.condition.operator);return!!t&&t(e.condition.field,e.condition.value)},getConditionFunction:function(e){var t=this,o={"=":function(e,o){return t.model[e]===o}};return o[e]?o[e]:null}}},_=f,b=Object(c.a)(_,v,p,!1,null,null,null);b.options.__file="SerializedForm.vue";var h=b.exports,g=o(9),y=o.n(g),C=document.querySelector('[data-slug="wp-rss-aggregator"] .deactivate a'),P={components:{Modal:m,SerializedForm:h},data:function(){return{isDeactivating:!1,deactivateUrl:null,submitUrl:WrpaDisablePoll.url,model:WrpaDisablePoll.model,form:WrpaDisablePoll.form,audience:WrpaDisablePoll.audience||100,isModalVisible:!1}},watch:{"model.reason":function(){this.model.follow_up=null}},mounted:function(){this.getRandomInt(0,100)<this.audience&&C.addEventListener("click",this.handleDeactivateClick)},methods:{getRandomInt:function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e},image:function(e){return WrpaDisablePoll.image+e},handleDeactivateClick:function(e){this.isModalVisible||(e.preventDefault(),this.isModalVisible=!0)},closeModal:function(){this.isModalVisible=!1,this.deactivateUrl=null},submit:function(){var e=this;this.isDeactivating=!0,y.a.post(this.submitUrl,this.model,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(){e.deactivate()}).finally(function(){e.isDeactivating=!1})},deactivate:function(){C.click()}}},D=P,M=Object(c.a)(D,i,n,!1,null,null,null);M.options.__file="PluginDisablePoll.vue";var w=M.exports;o(22),new a.a({el:"#wpra-plugins-app",template:"<PluginDisablePoll/>",components:{PluginDisablePoll:w}})},22:function(e,t){}},[21])});
|
@@ -1 +0,0 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WPRA=t():e.WPRA=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([3],{4:function(e,t,i){"use strict";var n=i(2),o=i.n(n),s=i(5);t.a={data:function(){return{shouldBeVisible:!0}},props:{id:{type:String,required:!0},title:{type:String},body:{type:String},learnMore:{default:!1},okayText:{type:String,default:"Got it"},learnMoreText:{type:String,default:"Learn more"},visible:{type:Boolean,default:!0}},computed:{isVisible:function(){return this.visible&&this.shouldBeVisible&&JSON.parse(localStorage.getItem(this.getBlockKey())||"true")}},methods:{onOkayClick:function(){this.shouldBeVisible=!1,localStorage.setItem(this.getBlockKey(),JSON.stringify(!1))},onLearnMoreClick:function(){window.open(this.learnMore,"_blank").focus()},getBlockKey:function(){return"wpra-"+this.id+"-visible"}},render:function(){var e=arguments[0];if(!this.isVisible)return null;var t=this.learnMore?e(s.a,{class:"button-clear",nativeOn:{click:this.onLearnMoreClick}},[this.learnMoreText," ",e("span",{class:"dashicons dashicons-external"})]):null;return e("div",{class:"wpra-notice-block"},[e("div",{class:"wpra-notice-block__title"},[this.title]),e("div",o()([{class:"wpra-notice-block__body"},{domProps:{innerHTML:this.body}}])),e("div",{class:"wpra-notice-block__buttons"},[e(s.a,{class:"brand button-primary",nativeOn:{click:this.onOkayClick}},[this.okayText]),t])])}}},43:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(6),o=i(4);new n.a({el:"#wpra-settings-app",render:function(e){return e(o.a,{props:WpraSettings.notice})}})},5:function(e,t,i){"use strict";t.a={props:{loading:{type:Boolean,default:!1}},render:function(){return(0,arguments[0])("button",{attrs:{disabled:this.loading},class:{button:!0,"loading-button":this.loading}},[this.$slots.default])}}}},[43])});
|
|
@@ -1 +1 @@
|
|
1 |
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.WPRA=e():t.WPRA=e()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([1],{4:function(t,e,i){"use strict";var n=i(2),o=i.n(n),a=i(5);e.a={data:function(){return{shouldBeVisible:!0}},props:{id:{type:String,required:!0},title:{type:String},body:{type:String},learnMore:{default:!1},okayText:{type:String,default:"Got it"},learnMoreText:{type:String,default:"Learn more"},visible:{type:Boolean,default:!0}},computed:{isVisible:function(){return this.visible&&this.shouldBeVisible&&JSON.parse(localStorage.getItem(this.getBlockKey())||"true")}},methods:{onOkayClick:function(){this.shouldBeVisible=!1,localStorage.setItem(this.getBlockKey(),JSON.stringify(!1))},onLearnMoreClick:function(){window.open(this.learnMore,"_blank").focus()},getBlockKey:function(){return"wpra-"+this.id+"-visible"}},render:function(){var t=arguments[0];if(!this.isVisible)return null;var e=this.learnMore?t(a.a,{class:"button-clear",nativeOn:{click:this.onLearnMoreClick}},[this.learnMoreText," ",t("span",{class:"dashicons dashicons-external"})]):null;return t("div",{class:"wpra-notice-block"},[t("div",{class:"wpra-notice-block__title"},[this.title]),t("div",o()([{class:"wpra-notice-block__body"},{domProps:{innerHTML:this.body}}])),t("div",{class:"wpra-notice-block__buttons"},[t(a.a,{class:"brand button-primary",nativeOn:{click:this.onOkayClick}},[this.okayText]),e])])}}},44:function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){return new I(t)}function a(t){return t&&"object"===(void 0===t?"undefined":X(t))&&"[object RegExp]"!==Object.prototype.toString.call(t)&&"[object Date]"!==Object.prototype.toString.call(t)}function r(t){return Array.isArray(t)?[]:{}}function s(t,e){return e&&!0===e.clone&&a(t)?u(r(t),t,e):t}function l(t,e,i){var n=t.slice();return e.forEach(function(e,o){void 0===n[o]?n[o]=s(e,i):a(e)?n[o]=u(t[o],e,i):-1===t.indexOf(e)&&n.push(s(e,i))}),n}function p(t,e,i){var n={};return a(t)&&Object.keys(t).forEach(function(e){n[e]=s(t[e],i)}),Object.keys(e).forEach(function(o){a(e[o])&&t[o]?n[o]=u(t[o],e[o],i):n[o]=s(e[o],i)}),n}function u(t,e,i){var n=Array.isArray(e),o=i||{arrayMerge:l},a=o.arrayMerge||l;return n?Array.isArray(t)?a(t,e,i):s(e,i):p(t,e,i)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var h=i(46),f=i(47),m=i.n(f),y=i(11),b=i.n(y),v=i(49),g=i.n(v),_=i(50),w=i.n(_),k=i(51),x=i(2),T=i.n(x),A=i(52),S=i.n(A),P={props:{path:{},gate:{}},inject:["router"],methods:{getPath:function(){return this.router.buildRoute(this.path)},navigate:function(t){var e=!this.gate||this.gate();t.preventDefault(),e&&this.router.navigate(this.path)}},render:function(){var t=this,e=arguments[0],i=this.getPath();return e("a",T()([{attrs:{href:i}},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];t.navigate.apply(t,[e].concat(n))}}}]),[this.$slots.default])}},O={props:{id:{type:String,default:function(){return Math.random().toString(36).substr(0,12)}},label:{},description:{},type:{},value:{},placeholder:{},title:{},inputDisabled:{},options:{default:function(){return{}}}},methods:{inputNode:function(){var t=this,e=this.$createElement;return"checkbox"===this.type?e("input",T()([{attrs:{type:"checkbox",id:this.id,placeholder:this.placeholder,disabled:this.$attrs.disabled||this.inputDisabled},domProps:{checked:!!this.value}},{attrs:this.$attrs},{on:{change:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(){return t.$emit("input",!t.value)}).apply(void 0,[e].concat(n))}}}])):"select"!==this.type?e("input",T()([{attrs:{type:this.type,id:this.id,placeholder:this.placeholder,disabled:this.$attrs.disabled||this.inputDisabled},domProps:{value:this.value}},{attrs:this.$attrs},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.$emit("input",e.target.value)}).apply(void 0,[e].concat(n))}}}])):this.selectNode()},selectNode:function(){var t=this,e=this.$createElement,i=Object.keys(this.options).map(function(i){return e("option",{domProps:{value:i,selected:t.value===i}},[t.options[i]])});return e("select",T()([{attrs:this.$attrs},{attrs:{id:this.id,disabled:this.$attrs.disabled||this.inputDisabled}},{on:{change:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.$emit("input",e.target.value)}).apply(void 0,[e].concat(n))}}}]),[i])}},render:function(){var t=arguments[0],e=[];return this.title&&e.push({name:"tippy"}),t("div",{class:{"form-input":!0,"form-input--disabled":this.$attrs.disabled||!1}},[this.label?t("label",{class:"form-input__label",attrs:{for:this.id}},[t("div",[this.label,this.title?t("div",T()([{class:"form-input__tip"},{directives:e},{attrs:{title:this.title}}]),[t("span",{class:"dashicons dashicons-editor-help"})]):null]),this.description?t("div",T()([{class:"form-input__label-description"},{domProps:{innerHTML:this.description}}])):""]):null,t("div",{class:"form-input__field"},[this.inputNode()])])}},C=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"wpra-bottom-panel"},[t._t("default")],2)},j=[],W={},L=W,M=i(1),R=Object(M.a)(L,C,j,!1,null,null,null);R.options.__file="BottomPanel.vue";var $=R.exports,E=function(t){return JSON.parse(JSON.stringify(t))},D=i(4),N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id";return n(this,t),this.data=e,this.primaryField=i,this}return t.prototype.find=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("object"!==(void 0===t?"undefined":N(t))&&null!==t){var i;i={},i[this.primaryField]=t,t=i}for(var n in this.data)if(this._isMatching(this.data[n],t))return this.data[n];return e},t.prototype.pluck=function(t){return this.data.map(function(e){return e[t]})},t.prototype.remove=function(t){for(var e in this.data)this._isMatching(this.data[e],t)&&this.data.splice(e,1);return this},t.prototype.appendDiff=function(t){for(var e=t,i=Array.isArray(e),n=0,e=i?e:e[Symbol.iterator]();;){var o;if(i){if(n>=e.length)break;o=e[n++]}else{if(n=e.next(),n.done)break;o=n.value}var a=o;this.contains(a)||this.data.push(a)}},t.prototype.prependDiff=function(t){for(var e=t.slice().reverse(),i=Array.isArray(e),n=0,e=i?e:e[Symbol.iterator]();;){var o;if(i){if(n>=e.length)break;o=e[n++]}else{if(n=e.next(),n.done)break;o=n.value}var a=o;this.contains(a)||this.data.unshift(a)}},t.prototype.contains=function(t){for(var e=this.data,i=Array.isArray(e),n=0,e=i?e:e[Symbol.iterator]();;){var o;if(i){if(n>=e.length)break;o=e[n++]}else{if(n=e.next(),n.done)break;o=n.value}if(o.id==t.id)return!0}return!1},t.prototype.filterValues=function(t){var e=this;return Object.keys(this.data).filter(function(i){return t(e.data[i],i)}).reduce(function(t,i){return t[i]=e.data[i],t},{})},t.prototype.filter=function(t){var e=this;return this.data.filter(function(i){return e._isMatching(i,t)})},t.prototype.whereIn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",i=[],n={};n[e]=null;for(var o=t,a=Array.isArray(o),r=0,o=a?o:o[Symbol.iterator]();;){var s;if(a){if(r>=o.length)break;s=o[r++]}else{if(r=o.next(),r.done)break;s=r.value}var l=s;n[e]=l;var p=this.find(n);p&&i.push(p)}return i},t.prototype.key=function(e){return new t(this.data.slice().reduce(function(t,i){return t[i[e]]=i,t},{}))},t.prototype.mapValues=function(t){var e=this;return Object.keys(this.data).map(function(i){e.data[i]=t(e.data[i],i)}),this},t.prototype.values=function(){return this.data},t.prototype._isMatching=function(t,e){if(!(t instanceof Object||e instanceof Object))return t==e;for(var i=!0,n=Object.keys(e),o=Array.isArray(n),a=0,n=o?n:n[Symbol.iterator]();;){var r;if(o){if(a>=n.length)break;r=n[a++]}else{if(a=n.next(),a.done)break;r=a.value}var s=r,l=t.hasOwnProperty(s)&&t[s]==e[s];i=i&&l}return i},t}(),U=o,F={data:function(){return{loading:!1,columns:{name:{label:"Template Name",class:"column-primary"},style:{label:"Template Type"},previewTemplate:{label:"Preview"}},filters:WpraTemplates.options.type,checked:[],filter:{paged:parseInt(this.router.params.paged||1),type:this.router.params.type||"",s:this.router.params.s||""},baseUrl:WpraTemplates.base_url,total:0}},inject:["hooks","http","router"],computed:{totalPages:function(){return Math.ceil(this.total/20)},list:{get:function(){return this.$store.state.templates.items},set:function(t){this.$store.commit("templates/set",t)}}},methods:{navigated:function(){var t=this;Object.keys(this.filter).forEach(function(e){t.filter[e]=t.router.params[e]||""}),this.filter.paged=parseInt(this.filter.paged||1),this.fetchList()},fetchList:function(){var t=this;this.loading=!0;var e=this.getParams(),i=parseInt(e.paged);return delete e.paged,i&&1!==i&&(e.page=i),this.http.get(this.baseUrl,{params:e}).then(function(e){t.list=e.data.items,t.total=e.data.count}).finally(function(){t.loading=!1})},deleteTemplate:function(t){var e=this;if(confirm("Are you sure you want to delete this template? If this template is being used in a shortcode or Gutenberg block anywhere on your site, the default template will be used instead."))return this.loading=!0,this.http.delete(this.baseUrl+"/"+t).then(function(){return e.fetchList()}).then(function(){e.loading=!1})},bulkDelete:function(){var t=this;if(confirm("Are you sure you want to delete these templates? If a template is being used in a shortcode or Gutenberg block anywhere on your site, the default template will be used instead."))return this.loading=!0,this.http.delete(this.baseUrl,{params:{ids:this.checked}}).then(function(){return t.checked=[],t.$refs.table.checkedItems=[],t.fetchList()}).then(function(){t.loading=!1})},duplicateTemplate:function(t){var e=E(t);delete e.id,"__built_in"===e.type&&delete e.type,e.name=e.name+" (Copy)",this.$store.commit("templates/updatePreset",e),this.router.navigate({name:"templates",params:{action:"new"}})},getPreviewLink:function(t){return WpraGlobal.admin_base_url+"?wpra_preview_template="+t.id},createTemplate:function(){this.$store.commit("templates/updatePreset",{}),this.router.navigate({name:"templates",params:{action:"new"}})},setChecked:function(t){var e=this;this.checked=t.filter(function(t){return"__built_in"!==U(e.list).find(t,{}).type})},getParams:function(){var t=this;return Object.keys(this.filter).filter(function(e){return!!t.filter[e]&&"all"!==t.filter[e]}).reduce(function(e,i){return e[i]=t.filter[i],e},{})},setFilter:function(t,e){this.filter[t]=e},submitFilter:function(){this.router.mergeParams(this.getParams())},getRowClass:function(t){return"__built_in"===t.type?"built-in":""}},render:function(){var t=this,e=arguments[0],i=function(t){return{name:"templates",params:{action:"edit",id:t}}},n=this.hooks.apply("wpra-templates-list-cells",this,{name:function(n){var o=n.row;return[e("div",[e("strong",[e(P,{attrs:{path:i(o.id)}},[o.name])]),e("small",{style:{paddingLeft:"4px",opacity:"0.6"}},[o.slug]),"__built_in"===o.type?e("span",{style:{opacity:"0.6",display:"block"}},['This is the default feed template. To create your own, either duplicate it or click "Add New" above.']):null]),e("div",{class:"row-actions"},[e("span",{attrs:{className:"edit"}},[e(P,{attrs:{path:i(o.id)}},["Edit"])," |"]),e("span",{class:"inline",style:{paddingLeft:"4px"}},[e("a",T()([{attrs:{href:"#"}},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];(function(e){e.preventDefault(),t.duplicateTemplate(o)}).apply(void 0,[e].concat(n))}}}]),["Duplicate"])," ","__built_in"!==o.type?"|":""]),"__built_in"!==o.type?e("span",T()([{class:"trash",style:{paddingLeft:"4px"}},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];(function(e){e.preventDefault(),t.deleteTemplate(o.id)}).apply(void 0,[e].concat(n))}}}]),[e("a",{attrs:{href:"#","aria-label":"Delete Item"},class:"submitdelete"},["Delete"])]):null])]},style:function(i){var n=i.row;return[e("div",[t.filters[n.type]])]},previewTemplate:function(i){var n=i.row;return[e("div",[e("a",{attrs:{href:t.getPreviewLink(n),target:"wpra-preview-template"},class:"wpra-preview-link"},["Open preview ",e("span",{class:"dashicons dashicons-external"})])])]},filters:function(){var i=Object.keys(WpraTemplates.options.type).filter(function(t){return"_"!==t[0]}).reduce(function(t,e){return t[e]=WpraTemplates.options.type[e],t},{all:"Select Template Type"});return[e(O,T()([{attrs:{type:"select",options:i,value:t.filter.type},style:{margin:0}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){t.filter.type=e,t.submitFilter()}).apply(void 0,[e].concat(n))}}}]))]}}),o=e("div",[e("h1",{class:"wp-heading-inline"},["Templates"]),e("a",T()([{class:"page-title-action",attrs:{href:"#"}},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){e.preventDefault(),t.createTemplate()}).apply(void 0,[e].concat(n))}}}]),["Add New"]),e("p",{class:"search-box",style:{padding:"10px 0"}},[e("label",{class:"screen-reader-text",attrs:{for:"post-search-input"}},["Search Templates:"]),e("input",T()([{attrs:{type:"search",id:"post-search-input",name:"s"},domProps:{value:this.filter.s}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.filter.s=e.target.value}).apply(void 0,[e].concat(n))},keyup:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];if(!("button"in e)&&t._k(e.keyCode,"enter",13))return null;t.submitFilter.apply(t,[e].concat(n))}}}])),e("input",T()([{attrs:{type:"submit",id:"search-submit",value:"Search Templates"},class:"button"},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];t.submitFilter.apply(t,[e].concat(n))}}}]))]),e(D.a,{attrs:{id:"templates-introduction",title:"🎉 Welcome to Templates for WP RSS Aggregator!",body:'As of version 4.13, we have introduced the concept of templates to replace the display settings that were previously available in the WP RSS Aggregator settings. These templates provide you with much more flexibility and new designs. They also come with a revamped <a target="_blank" href="https://kb.wprssaggregator.com/article/54-displaying-imported-items-shortcode">TinyMCE shortcode button</a> for the Classic Editor and a <em><a href="https://kb.wprssaggregator.com/article/454-displaying-imported-items-block-gutenberg" target="_blank">brand new block</a></em> for those using WP 5.0+ with the Gutenberg block editor!<br/><br/>There are new template types coming your way in the coming weeks, but for now, the <em>list template type</em> replicates the previous options. Please note that the <em>Default</em> template below is set up using your pre-existing display options, nothing is lost or changed.',learnMore:"https://www.wprssaggregator.com/core-version-4-13-celebrating-one-million-downloads/",visible:!!WpraGlobal.is_existing_user}}),e("hr",{class:"wp-header-end"}),e(S.a,T()([{attrs:{columns:this.columns,rows:this.list,loading:this.loading,totalItems:this.total,perPage:20,totalPages:this.totalPages,currentPage:this.filter.paged,notFound:"No templates found.",rowClass:this.getRowClass},ref:"table",class:{"wpra-no-cb":0===this.list.length||1===this.list.length&&"__built_in"===this.list[0].type},scopedSlots:n},{on:{checked:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];t.setChecked.apply(t,[e].concat(n))},pagination:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){t.filter.paged=e,t.submitFilter()}).apply(void 0,[e].concat(n))}}}])),this.checked.length?e($,[e("div",{class:"flex-row"},[e("div",{class:"flex-col"},[e("div",{class:"wpra-bottom-panel__title"},["Bulk Actions"]),e("a",T()([{attrs:{href:"#"}},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){e.preventDefault(),t.bulkDelete()}).apply(void 0,[e].concat(n))}}}]),["Delete"])])])]):null]);return this.hooks.apply("wpra-templates-list",this,o)}},B={inject:["hooks"],data:function(){return{expanded:!0}},props:{title:{},id:{},submit:{type:Boolean,default:!1},context:{}},methods:{toggle:function(){this.expanded=!this.expanded}},render:function(t){var e=this;return this.hooks.apply("postbox-"+this.id,this.context||this,t("div",{class:"postbox wpra-postbox",attrs:{id:this.submit?"submitdiv":""}},[t("button",T()([{attrs:{type:"button","aria-expanded":"true"},class:"handlediv"},{on:{click:function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];e.toggle.apply(e,[t].concat(n))}}}]),[t("span",{class:"screen-reader-text"},["Toggle panel: ",this.title]),t("span",{class:"toggle-indicator",attrs:{"aria-hidden":"true"}})]),t("h2",T()([{class:"hndle ui-sortable-handle"},{on:{click:function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];e.toggle.apply(e,[t].concat(n))}}}]),[t("span",[this.title])]),t("div",{class:"inside"},[this.hooks.apply("postbox-content-"+this.id,this.context||this,[this.$slots.default],{h:t})])]),{h:t})}},G=B,V=Object(M.a)(G,void 0,void 0,!1,null,null,null);V.options.__file="Postbox.vue";var q=V.exports,H={render:function(){return(0,arguments[0])("div",{attrs:{id:"postbox-container-2"},class:"postbox-container"},[this.$slots.default])}},J={render:function(){return(0,arguments[0])("div",{attrs:{id:"postbox-container-1"},class:"wpra-postbox-container postbox-container"},[this.$slots.default])}},K={render:function(){return(0,arguments[0])("div",{attrs:{id:"post-body"}},[this.$slots.default])}},z=i(5),X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};u.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce(function(t,i){return u(t,i,e)})};var Y=u,Q=i(53),Z=i.n(Q),tt={data:function(){return{changes:{model:{}}}},methods:{isChanged:function(){return!Z()(this.model,this.changes.model)},rememberModel:function(){this.$set(this.changes,"model",E(this.model))},cancelChanges:function(){confirm("Are you sure you want to cancel your changes for this template? This action cannot be reverted and all changes made since your last save will be lost.")&&this.$set(this,"model",E(this.changes.model))}}},et=i(8),it={mixins:[tt],data:function(){return{typeOptions:Object.keys(WpraTemplates.options.type).filter(function(t){return"_"!==t[0]}).reduce(function(t,e){return t[e]=WpraTemplates.options.type[e],t},{}),model:E(WpraTemplates.model_schema),validation:E(WpraTemplates.model_schema),tooltips:E(WpraTemplates.model_tooltips),baseUrl:WpraTemplates.base_url,isSaving:!1,isLoading:!1}},inject:["hooks","http","router","notification"],mounted:function(){this.resolveEditingItem()},computed:{previewUrl:function(){return WpraGlobal.admin_base_url+"?wpra_preview_template="+this.router.params.id}},methods:{resolveEditingItem:function(){var t=this,e=Y(E(WpraTemplates.model_schema),this.$store.state.templates.preset);this.isLoading=!0,function(){var e=t.router.params.id;if(!e)return Promise.resolve(null);var i=t.$store.getters["templates/item"](e);return i?Promise.resolve(i):t.http.get(t.baseUrl+"/"+e).then(function(t){return t.data})}().then(function(i){if(t.isLoading=!1,!i)return t.$set(t,"model",e),void t.rememberModel();i=Object.assign({},i),t.model=Y(t.model,i),t.rememberModel()})},save:function(){var t=this,e=!this.model.id;this.isSaving=!0,this.runRequest().then(function(i){t.model=Y(t.model,i.data),t.rememberModel(),t.notification.show("Template saved!",{type:"success",icon:function(t){return t.classList.add("dashicons","dashicons-yes"),t}}),e&&t.router.navigate({name:"templates",params:{action:"edit",id:i.data.id}})},function(e){t.notification.show("Something went wrong. Template is not saved!",{type:"error",icon:function(t){return t.classList.add("dashicons","dashicons-warning"),t}})}).finally(function(){t.isSaving=!1})},runRequest:function(){var t=this.model.id?"put":"post",e=this.model.id?this.baseUrl+"/"+this.model.id:this.baseUrl;return this.http[t](e,this.prepareModel())},prepareModel:function(){var t=this,e=Object.keys(WpraTemplates.model_schema);return Object.keys(this.model).filter(function(i){return!(!e.includes(i)||"__built_in"===t.model.type&&["name","type"].includes(i)||["slug","id"].includes(i))}).reduce(function(e,i){return e[i]=t.model[i],e},{})},getShortcode:function(){return'[wp-rss-aggregator template="'+this.model.slug+'"]'},preventLoosingNotSavedData:function(){return!this.isChanged()||confirm("You have unsaved changes. All changes will be lost if you go back to the Template list before updating. Are you sure you want to continue?")},copyShortcode:function(t){Object(et.a)(this.getShortcode());var e=t.target.innerText;t.target.style.width=t.target.getBoundingClientRect().width+"px",t.target.disabled=!0,t.target.innerText="Copied!",setTimeout(function(){t.target.style.width=null,t.target.innerText=e,t.target.disabled=!1},5e3)}},render:function(){var t=this,e=arguments[0],i={name:"templates"},n=null,o=null,a=e(D.a,{class:"postbox",attrs:{id:"templates-usage",title:"Setting up your Templates",body:'Templates are used to display the items imported using WP RSS Aggregator. Choose the preferred options below and use them anywhere on your site via our <a href="https://kb.wprssaggregator.com/article/54-displaying-imported-items-shortcode#tinymce" target="_blank">shortcode</a> or our <a href="https://kb.wprssaggregator.com/article/454-displaying-imported-items-block-gutenberg" target="_blank">block</a>. <br/><br/>More template types and options will be made available soon. Have you got a template idea in mind? <a href="https://www.wprssaggregator.com/request-a-template/" target="_blank">Share it with us.</a>',learnMore:"https://kb.wprssaggregator.com/article/457-templates"}});this.router.params.id&&(n=e("div",{attrs:{id:""},style:{padding:"6px 0"}},[e("div",{class:"misc-pub-section misc-pub-visibility"},[e("a",{attrs:{href:this.previewUrl,role:"button",target:"wpra-preview-template"},class:"wpra-preview-link",style:{marginLeft:"4px",textDecoration:"none"}},["Open preview",e("span",{class:"dashicons dashicons-external"})])])])),this.model.id&&(o=e("div",{class:"wpra-shortcode-copy",attrs:{title:"Copy chortcode"}},[e("div",{class:"wpra-shortcode-copy__content"},[e("strong",["Shortcode: "]),e("code",[this.getShortcode()])]),e("div",{class:"wpra-shortcode-copy__icon"},[e("button",T()([{class:"button"},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];t.copyShortcode.apply(t,[e].concat(n))}}}]),["Copy Shortcode"])])]));var r=e("div",[e("div",{class:"page-title"},[e(P,{class:"back-button",attrs:{path:i,gate:this.preventLoosingNotSavedData}},[e("span",{class:"dashicons dashicons-arrow-left-alt"}),"Templates"]),e("h1",{class:"wp-heading-inline"},[this.router.params.id?this.changes.model.name||this.changes.model.slug:"Create a New Template"]),o]),e("div",{attrs:{id:"poststuff"}},[this.isLoading?e("div",{class:"loading-container"}):e(K,{class:"metabox-holder columns-2"},[e(H,[a,e(q,{attrs:{id:"template-details",title:"Template Details",context:this}},[e(O,T()([{attrs:{type:"text",label:"Template name",value:this.model.name,disabled:"__built_in"===this.model.type}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.name=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"select",label:"Template type",value:this.model.type,options:this.typeOptions,disabled:"__built_in"===this.model.type,inputDisabled:!WpraTemplates.options.is_type_enabled,description:WpraTemplates.options.is_type_enabled?null:'<div class="disable-ignored"><strong class="disable-ignored">🎉 More template types coming soon!</strong> Have you got a template idea in mind? <a target="_blank" href="https://www.wprssaggregator.com/request-a-template/" class="disable-ignored">Share it with us.</a></div>'}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.type=e}).apply(void 0,[e].concat(n))}}}])),"__built_in"===this.model.type?e("div",{class:"wpra-info-box"},[e("div",{class:"wpra-info-box__icon"},[e("span",{class:"dashicons dashicons-info"})]),e("div",{class:"wpra-info-box__text"},["This is the default template for WP RSS Aggregator. It is used as the fallback template when one is not selected via the shortcode or block. To create a new one, please go back to the Templates List."])]):null]),e(q,{attrs:{id:"template-options",title:"Template Options",context:this}},[e(O,T()([{attrs:{type:"checkbox",label:"Link title to original article",value:this.model.options.title_is_link,title:this.tooltips.options.title_is_link}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.title_is_link=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"number",label:"Title maximum length",value:this.model.options.title_max_length||"",placeholder:"No limit",title:this.tooltips.options.title_max_length}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.title_max_length=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"number",label:"Number of items to show",value:this.model.options.limit||"",title:this.tooltips.options.limit}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.limit=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"checkbox",label:"Show publish date",value:this.model.options.date_enabled,title:this.tooltips.options.date_enabled},style:{paddingTop:"20px",fontWeight:"bold"}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.date_enabled=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"text",label:"Date prefix",value:this.model.options.date_prefix,disabled:!this.model.options.date_enabled,title:this.tooltips.options.date_prefix}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.date_prefix=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"text",label:"Date format",value:this.model.options.date_format,disabled:this.model.options.date_use_time_ago||!this.model.options.date_enabled,title:this.tooltips.options.date_format}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.date_format=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"checkbox",label:'Use "time ago" format',description:"Example: 20 minutes ago",value:this.model.options.date_use_time_ago,disabled:!this.model.options.date_enabled,title:this.tooltips.options.date_use_time_ago}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.date_use_time_ago=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"checkbox",label:"Show source name",value:this.model.options.source_enabled,title:this.tooltips.options.source_enabled},style:{paddingTop:"20px",fontWeight:"bold"}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.source_enabled=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"text",label:"Source prefix",value:this.model.options.source_prefix,disabled:!this.model.options.source_enabled,title:this.tooltips.options.source_prefix}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.source_prefix=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"checkbox",label:"Link source name",value:this.model.options.source_is_link,disabled:!this.model.options.source_enabled,title:this.tooltips.options.source_is_link}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.source_is_link=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"checkbox",label:"Show author name",value:this.model.options.author_enabled,title:this.tooltips.options.author_enabled},style:{paddingTop:"20px",fontWeight:"bold"}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.author_enabled=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"text",label:"Author prefix",value:this.model.options.author_prefix,disabled:!this.model.options.author_enabled,title:this.tooltips.options.author_prefix}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.author_prefix=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"checkbox",label:"Pagination",value:this.model.options.pagination,title:this.tooltips.options.pagination},style:{paddingTop:"20px",fontWeight:"bold"}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.pagination=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"select",label:"Pagination style",options:WpraTemplates.options.pagination_type,value:this.model.options.pagination_type,disabled:!this.model.options.pagination,title:this.tooltips.options.pagination_type}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.pagination_type=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"checkbox",label:"Show bullets",value:this.model.options.bullets_enabled,title:this.tooltips.options.bullets_enabled},style:{paddingTop:"20px",fontWeight:"bold"}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.bullets_enabled=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"select",label:"Bullet style",options:WpraTemplates.options.bullet_type,value:this.model.options.bullet_type,disabled:!this.model.options.bullets_enabled,title:this.tooltips.options.bullet_type}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.bullet_type=e}).apply(void 0,[e].concat(n))}}}]))])]),e(J,[e(q,{attrs:{id:"template-create",title:this.model.id?"Update Template":"Create Template",submit:!0,context:this},class:"wpra-postbox-last"},[e("div",{class:"submitbox",attrs:{id:"submitpost"}},[n,e("div",{attrs:{id:"major-publishing-actions"}},[e("div",{attrs:{id:"delete-action"}},[this.isChanged()?e("a",T()([{attrs:{href:"#"},class:"submitdelete"},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){e.preventDefault(),t.cancelChanges()}).apply(void 0,[e].concat(n))}}}]),["Cancel Changes"]):null]),e("div",{attrs:{id:"publishing-action"}},[e(z.a,{class:"button-primary button-large",attrs:{loading:this.isSaving},nativeOn:{click:this.save}},[this.model.id?"Save":"Publish"])]),e("div",{class:"clear"})])])]),e(q,{attrs:{id:"template-link-preferences",title:"Link Preferences",context:this}},[e("p",{style:{opacity:.65}},["These options apply to all links within this template."]),e(O,T()([{attrs:{type:"checkbox",label:"Set links as nofollow",value:this.model.options.links_nofollow,title:this.tooltips.options.links_nofollow}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.links_nofollow=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"select",label:"Open links behaviour",value:this.model.options.links_behavior,options:WpraTemplates.options.links_behavior,title:this.tooltips.options.links_behavior},class:"form-input--vertical"},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.links_behavior=e}).apply(void 0,[e].concat(n))}}}])),e(O,T()([{attrs:{type:"select",label:"Video embed link type",description:"This will not affect already imported feed items.",value:this.model.options.links_video_embed_page,options:WpraTemplates.options.links_video_embed_page,title:this.tooltips.options.links_video_embed_page},class:"form-input--vertical"},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.links_video_embed_page=e}).apply(void 0,[e].concat(n))}}}]))]),e(q,{attrs:{id:"template-custom-css",title:"Custom Style",context:this}},[e(O,T()([{attrs:{type:"text",label:"Custom CSS class name",value:this.model.options.custom_css_classname,title:this.tooltips.options.custom_css_classname},class:"form-input--vertical"},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.custom_css_classname=e}).apply(void 0,[e].concat(n))}}}]))])])])])]);return this.hooks.apply("wpra-templates-form",this,r)}},nt=function(t){var e=t.store,i=t.router;return{store:e,data:function(){return{afterNavigate:function(){},params:{},currentRoute:null}},created:function(){i.setApp(this),this.currentRoute=i.parseLocation(window.location),this.navigated()},mounted:function(){var t=this;window.addEventListener("popstate",function(){t.currentRoute=i.parseLocation(window.location),t.navigated()})},methods:{ViewComponent:function(){return i.findRoute(this.currentRoute).component},navigated:function(){var t=this;this.$nextTick(function(){var e=t.$refs.main;e&&e.navigated&&e.navigated({route:i.findRoute(t.currentRoute)})})}},render:function(t){var e=t(this.ViewComponent(),{ref:"main"});return this.afterNavigate(),e}}},ot=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),at=function(t){t||(t=location.href);var e=t.indexOf("?"),i=t.indexOf("#");if(-1==i&&-1==e)return{};-1==i&&(i=t.length);var n=-1==e||i==e+1?t.substring(i):t.substring(e+1,i),o={};return n.split("&").forEach(function(t){if(t){t=t.split("+").join(" ");var e=t.indexOf("="),i=e>-1?t.substr(0,e):t,n=e>-1?decodeURIComponent(t.substr(e+1)):"",a=i.indexOf("[");if(-1==a)o[decodeURIComponent(i)]=n;else{var r=i.indexOf("]",a),s=decodeURIComponent(i.substring(a+1,r));i=decodeURIComponent(i.substring(0,a)),o[i]||(o[i]=[]),s?o[i][s]=n:o[i].push(n)}}}),o},rt=function(){function t(e,i){c(this,t),this.routes=e,this.options=i,this.baseParams=i.baseParams||["post_type","page","action","id"]}return t.prototype.setApp=function(t){this.app=t,this.app.afterNavigate=this.options.afterNavigating||function(){}},t.prototype.findRoute=function(t){return this.routes.find(function(e){var i=e.route;return-1!==t.indexOf(i)})},t.prototype.updateParams=function(t){this.app.$set(this.app,"params",t)},t.prototype.mergeParams=function(t){var e=this,i=Object.keys(this.params).filter(function(i){return-1!==e.baseParams.indexOf(i)||t.hasOwnProperty(i)}).reduce(function(t,i){return t[i]=e.params[i],t},{}),n=Object.assign({},i,t);this.updateParams(n),window.history.pushState(null,null,this.routeFromParams()),this.app.navigated()},t.prototype.routeFromParams=function(){var t=!!Object.keys(this.params).length;return location.pathname+(t?"?"+this.buildParams(this.params):"")},t.prototype.buildRoute=function(t){if(t.name){var e=this.routes.find(function(e){return e.name===t.name});if(!e)return null;var i=e.route,n=-1!==i.indexOf("?")?"&":"?";return i+(t.params?n+this.buildParams(t.params?t.params:{}):"")}},t.prototype.buildParams=function(t){return Object.keys(t).map(function(e){return e+"="+t[e]}).join("&")},t.prototype.parseLocation=function(t){return this.updateParams(at(t.search)),at(t.search),t.pathname+t.search},t.prototype.navigate=function(t){this.app&&(this.app.currentRoute=this.buildRoute(t)),this.updateParams(Object.assign({},t.params||{},at(this.buildRoute(t)))),window.history.pushState(null,null,this.buildRoute(t)),this.app.navigated()},ot(t,[{key:"params",get:function(){return this.app?this.app.params:{}}}]),t}(),st=rt,lt={set:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.isInitialized=!0,t.items=e},updatePreset:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t.preset=e}},pt={},ut={isInitialized:!1,items:[],preset:{}},ct={item:function(t){return function(e){return U(t.items).find(e)}}},dt={namespaced:!0,mutations:lt,actions:pt,state:ut,getters:ct},ht=function(){function t(e,i){d(this,t),this.showMethod=e,this.errorMethod=i}return t.prototype.show=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.showMethod(t,e)},t.prototype.error=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.errorMethod(t,e)},t}(),ft=ht,mt=i(7),yt={Input:O,NoticeBlock:D.a,Postbox:q,RouteLink:P,TransitionExpand:mt.a,Button:z.a},bt={register:function(t){t.TemplateEdit=function(){return it},t.TemplateList=function(){return F},t.router=function(t){var e=t.document,i=t.TemplateEdit,n=t.TemplateList;return new st([{route:WpraGlobal.templates_url_base+"&action",name:"templates-form",component:i},{route:WpraGlobal.templates_url_base,name:"templates",component:n}],{afterNavigating:function(){e.querySelector("html").scrollTop=0}})},t.App=function(t){return nt(t)},t.vuex=function(t){return t.vue.use(k.a),k.a},t.notification=function(t){var e=t.vue;return e.use(g.a,{position:"top-center",duration:4e3,iconPack:"callback"}),new ft(e.toasted.show,e.toasted.error)},t.store=function(t){return new t.vuex.Store({modules:{templates:dt},state:{}})},t.http=function(){var t=WpraGlobal&&WpraGlobal.nonce?{headers:{"X-WP-Nonce":WpraGlobal.nonce}}:{};return b.a.create(t)};for(var e=Object.entries(yt),i=Array.isArray(e),n=0,e=i?e:e[Symbol.iterator]();;){var o;if("break"===function(){if(i){if(n>=e.length)return"break";o=e[n++]}else{if(n=e.next(),n.done)return"break";o=n.value}var a=o,r=a[0],s=a[1];t[r]=function(){return s}}())break}return t},run:function(t){t.container.vue.use(w.a,{theme:"light",animation:"fade",arrow:!0,arrowTransform:"scale(0)",placement:"right"})}},vt=i(6);i(45);var gt=h.Container,_t=h.Core,wt=h.Services;window.UiFramework&&(window.UiFramework=Object.assign({},window.UiFramework,_t.UiFramework));var kt={uiFramework:h,hooks:new wt.HookService,document:document,vue:function(t){return vt.a.use(t.uiFramework.Core.InjectedComponents,{container:t}),vt.a}},xt=new gt.ContainerFactory(m.a),Tt=new _t.UiFramework.App(xt,kt);window.UiFramework.registerPlugin("templates-app",bt),Tt.use(WpraTemplates.modules||["templates-app"]),Tt.init({"#wpra-templates-app":"App"})},45:function(t,e){},5:function(t,e,i){"use strict";e.a={props:{loading:{type:Boolean,default:!1}},render:function(){return(0,arguments[0])("button",{attrs:{disabled:this.loading},class:{button:!0,"loading-button":this.loading}},[this.$slots.default])}}},7:function(t,e,i){"use strict";var n={name:"TransitionExpand",functional:!0,render:function(t,e){return t("transition",{props:{name:"expand"},on:{afterEnter:function(t){t.style.height="auto"},enter:function(t){var e=getComputedStyle(t),i=e.width;t.style.width=i,t.style.position="absolute",t.style.visibility="hidden",t.style.height="auto";var n=getComputedStyle(t),o=n.height;t.style.width=null,t.style.position=null,t.style.visibility=null,t.style.height=0,getComputedStyle(t).height,setTimeout(function(){t.style.height=o})},leave:function(t){var e=getComputedStyle(t),i=e.height;t.style.height=i,getComputedStyle(t).height,setTimeout(function(){t.style.height=0})}}},e.children)}},o=n,a=i(1),r=Object(a.a)(o,void 0,void 0,!1,null,null,null);r.options.__file="TransitionExpand.vue",e.a=r.exports},8:function(t,e,i){"use strict";function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!navigator.clipboard)return void o(t,e);navigator.clipboard.writeText(t).then(function(){},function(t){console.error("Async: Could not copy text: ",t)})}e.a=n;var o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e=e||document.body.parentElement;var i=document.createElement("textarea");i.value=t;var n=e.scrollTop;document.body.appendChild(i),i.focus(),i.select();try{document.execCommand("copy")}catch(t){console.error("Fallback: Oops, unable to copy",t)}document.body.removeChild(i),e.scrollTop=n}}},[44])});
|
1 |
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.WPRA=e():t.WPRA=e()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([1],{41:function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){return new I(t)}function a(t){return t&&"object"===(void 0===t?"undefined":Z(t))&&"[object RegExp]"!==Object.prototype.toString.call(t)&&"[object Date]"!==Object.prototype.toString.call(t)}function r(t){return Array.isArray(t)?[]:{}}function s(t,e){return e&&!0===e.clone&&a(t)?u(r(t),t,e):t}function l(t,e,i){var n=t.slice();return e.forEach(function(e,o){void 0===n[o]?n[o]=s(e,i):a(e)?n[o]=u(t[o],e,i):-1===t.indexOf(e)&&n.push(s(e,i))}),n}function p(t,e,i){var n={};return a(t)&&Object.keys(t).forEach(function(e){n[e]=s(t[e],i)}),Object.keys(e).forEach(function(o){a(e[o])&&t[o]?n[o]=u(t[o],e[o],i):n[o]=s(e[o],i)}),n}function u(t,e,i){var n=Array.isArray(e),o=i||{arrayMerge:l},a=o.arrayMerge||l;return n?Array.isArray(t)?a(t,e,i):s(e,i):p(t,e,i)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var h=i(43),f=i(44),m=i.n(f),y=i(9),v=i.n(y),b=i(46),g=i.n(b),_=i(47),w=i.n(_),k=i(48),x=i(2),S=i.n(x),A=i(49),T=i.n(A),C={props:{path:{},gate:{}},inject:["router"],methods:{getPath:function(){return this.router.buildRoute(this.path)},navigate:function(t){var e=!this.gate||this.gate();t.preventDefault(),e&&this.router.navigate(this.path)}},render:function(){var t=this,e=arguments[0],i=this.getPath();return e("a",S()([{attrs:{href:i}},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];t.navigate.apply(t,[e].concat(n))}}}]),[this.$slots.default])}},O=null,P={props:{mediaType:{type:String,default:"image"},mediaTitle:{type:String,default:"Select Media"},mediaValueProperty:{type:String,default:"id"}},methods:{mediaNode:function(){var t=this,e=this.$createElement;return this.assertMediaLoaded(),e("div",[e("input",{attrs:{type:"text"},domProps:{value:this.value}}),e("button",S()([{class:"button"},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];t.openFrame.apply(t,[e].concat(n))}}}]),["Choose image"])])},openFrame:function(){O||(O=this.createFrame()),O.open()},createFrame:function(){var t=this;return O=wp.media({title:this.mediaTitle,multiple:!1,library:{type:this.mediaType}}),O.on("close",function(){var e=O.state().get("selection"),i=null;e.each(function(t){i=t}),i&&i.id&&t.$emit("input",{id:i.id,url:i.attributes.url}[t.mediaValueProperty])}),O.on("open",function(){var e=O.state().get("selection");if("id"===t.mediaValueProperty&&t.value){var i=wp.media.attachment(t.value);i.fetch(),e.add(i?[i]:[])}}),O},assertMediaLoaded:function(){if(!window.wp.media)throw Error("[MediaInput] wp.media dependency is not loaded")}}},j={mixins:[P],props:{id:{type:String,default:function(){return Math.random().toString(36).substr(0,12)}},label:{},description:{},after:{},type:{},value:{},placeholder:{},title:{},inputDisabled:{},options:{default:function(){return{}}}},methods:{inputNode:function(){var t=this,e=this.$createElement;return"media"===this.type?this.mediaNode():"checkbox"===this.type?e("input",S()([{attrs:{type:"checkbox",id:this.id,placeholder:this.placeholder,disabled:this.$attrs.disabled||this.inputDisabled},domProps:{checked:!!this.value}},{attrs:this.$attrs},{on:{change:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(){return t.$emit("input",!t.value)}).apply(void 0,[e].concat(n))}}}])):"select"!==this.type?e("input",S()([{attrs:{type:this.type,id:this.id,placeholder:this.placeholder,disabled:this.$attrs.disabled||this.inputDisabled},domProps:{value:this.value}},{attrs:this.$attrs},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.$emit("input",e.target.value)}).apply(void 0,[e].concat(n))}}}])):this.selectNode()},selectNode:function(){var t=this,e=this.$createElement,i=Object.keys(this.options).map(function(i){return e("option",{domProps:{value:i,selected:t.value===i}},[t.options[i]])});return e("select",S()([{attrs:this.$attrs},{attrs:{id:this.id,disabled:this.$attrs.disabled||this.inputDisabled}},{on:{change:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.$emit("input",e.target.value)}).apply(void 0,[e].concat(n))}}}]),[i])}},render:function(){var t=arguments[0],e=[];return this.title&&e.push({name:"tippy"}),t("div",{class:{"form-input":!0,"form-input--disabled":this.$attrs.disabled||!1}},[this.label?t("label",{class:"form-input__label",attrs:{for:this.id}},[t("div",[this.label,this.title?t("div",S()([{class:"form-input__tip"},{directives:e},{attrs:{title:this.title}}]),[t("span",{class:"dashicons dashicons-editor-help"})]):null]),this.description?t("div",S()([{class:"form-input__label-description"},{domProps:{innerHTML:this.description}}])):""]):null,t("div",{class:"form-input__field"},[this.inputNode(),this.after])])}},L=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"wpra-bottom-panel"},[t._t("default")],2)},W=[],M={},$=M,N=i(1),R=Object(N.a)($,L,W,!1,null,null,null);R.options.__file="BottomPanel.vue";var E=R.exports,D=function(t){return JSON.parse(JSON.stringify(t))},F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id";return n(this,t),this.data=e,this.primaryField=i,this}return t.prototype.find=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("object"!==(void 0===t?"undefined":F(t))&&null!==t){var i;i={},i[this.primaryField]=t,t=i}for(var n in this.data)if(this._isMatching(this.data[n],t))return this.data[n];return e},t.prototype.pluck=function(t){return this.data.map(function(e){return e[t]})},t.prototype.remove=function(t){for(var e in this.data)this._isMatching(this.data[e],t)&&this.data.splice(e,1);return this},t.prototype.appendDiff=function(t){for(var e=t,i=Array.isArray(e),n=0,e=i?e:e[Symbol.iterator]();;){var o;if(i){if(n>=e.length)break;o=e[n++]}else{if(n=e.next(),n.done)break;o=n.value}var a=o;this.contains(a)||this.data.push(a)}},t.prototype.prependDiff=function(t){for(var e=t.slice().reverse(),i=Array.isArray(e),n=0,e=i?e:e[Symbol.iterator]();;){var o;if(i){if(n>=e.length)break;o=e[n++]}else{if(n=e.next(),n.done)break;o=n.value}var a=o;this.contains(a)||this.data.unshift(a)}},t.prototype.contains=function(t){for(var e=this.data,i=Array.isArray(e),n=0,e=i?e:e[Symbol.iterator]();;){var o;if(i){if(n>=e.length)break;o=e[n++]}else{if(n=e.next(),n.done)break;o=n.value}if(o.id==t.id)return!0}return!1},t.prototype.filterValues=function(t){var e=this;return Object.keys(this.data).filter(function(i){return t(e.data[i],i)}).reduce(function(t,i){return t[i]=e.data[i],t},{})},t.prototype.filter=function(t){var e=this;return this.data.filter(function(i){return e._isMatching(i,t)})},t.prototype.whereIn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",i=[],n={};n[e]=null;for(var o=t,a=Array.isArray(o),r=0,o=a?o:o[Symbol.iterator]();;){var s;if(a){if(r>=o.length)break;s=o[r++]}else{if(r=o.next(),r.done)break;s=r.value}var l=s;n[e]=l;var p=this.find(n);p&&i.push(p)}return i},t.prototype.key=function(e){return new t(this.data.slice().reduce(function(t,i){return t[i[e]]=i,t},{}))},t.prototype.mapValues=function(t){var e=this;return Object.keys(this.data).map(function(i){e.data[i]=t(e.data[i],i)}),this},t.prototype.values=function(){return this.data},t.prototype._isMatching=function(t,e){if(!(t instanceof Object||e instanceof Object))return t==e;for(var i=!0,n=Object.keys(e),o=Array.isArray(n),a=0,n=o?n:n[Symbol.iterator]();;){var r;if(o){if(a>=n.length)break;r=n[a++]}else{if(a=n.next(),a.done)break;r=a.value}var s=r,l=t.hasOwnProperty(s)&&t[s]==e[s];i=i&&l}return i},t}(),U=o,B={data:function(){return{loading:!1,columns:{name:{label:"Template Name",class:"column-primary"},style:{label:"Template Type"},previewTemplate:{label:"Preview"}},filters:WpraTemplates.options.type,checked:[],filter:{paged:parseInt(this.router.params.paged||1),type:this.router.params.type||"",s:this.router.params.s||""},baseUrl:WpraTemplates.base_url,total:0}},inject:["hooks","http","router"],computed:{totalPages:function(){return Math.ceil(this.total/20)},list:{get:function(){return this.$store.state.templates.items},set:function(t){this.$store.commit("templates/set",t)}}},methods:{navigated:function(){var t=this;Object.keys(this.filter).forEach(function(e){t.filter[e]=t.router.params[e]||""}),this.filter.paged=parseInt(this.filter.paged||1),this.fetchList()},fetchList:function(){var t=this;this.loading=!0;var e=this.getParams(),i=parseInt(e.paged);return delete e.paged,i&&1!==i&&(e.page=i),this.http.get(this.baseUrl,{params:e}).then(function(e){t.list=e.data.items,t.total=e.data.count}).finally(function(){t.loading=!1})},deleteTemplate:function(t){var e=this;if(confirm("Are you sure you want to delete this template? If this template is being used in a shortcode or Gutenberg block anywhere on your site, the default template will be used instead."))return this.loading=!0,this.http.delete(this.baseUrl+"/"+t).then(function(){return e.fetchList()}).then(function(){e.loading=!1})},bulkDelete:function(){var t=this;if(confirm("Are you sure you want to delete these templates? If a template is being used in a shortcode or Gutenberg block anywhere on your site, the default template will be used instead."))return this.loading=!0,this.http.delete(this.baseUrl,{params:{ids:this.checked}}).then(function(){return t.checked=[],t.$refs.table.checkedItems=[],t.fetchList()}).then(function(){t.loading=!1})},duplicateTemplate:function(t){var e=D(t);delete e.id,"__built_in"===e.type&&delete e.type,e.name=e.name+" (Copy)",this.$store.commit("templates/updatePreset",e),this.router.navigate({name:"templates",params:{action:"new"}})},getPreviewLink:function(t){return WpraGlobal.admin_base_url+"?wpra_preview_template="+t.id},createTemplate:function(){this.$store.commit("templates/updatePreset",{}),this.router.navigate({name:"templates",params:{action:"new"}})},setChecked:function(t){var e=this;this.checked=t.filter(function(t){return"__built_in"!==U(e.list).find(t,{}).type})},getParams:function(){var t=this;return Object.keys(this.filter).filter(function(e){return!!t.filter[e]&&"all"!==t.filter[e]}).reduce(function(e,i){return e[i]=t.filter[i],e},{})},setFilter:function(t,e){this.filter[t]=e},submitFilter:function(){this.router.mergeParams(this.getParams())},getRowClass:function(t){return"__built_in"===t.type?"built-in":""}},render:function(){var t=this,e=arguments[0],i=function(t){return{name:"templates",params:{action:"edit",id:t}}},n=this.hooks.apply("wpra-templates-list-cells",this,{name:function(n){var o=n.row;return[e("div",[e("strong",[e(C,{attrs:{path:i(o.id)}},[o.name])]),e("small",{style:{paddingLeft:"4px",opacity:"0.6"}},[o.slug]),"__built_in"===o.type?e("span",{style:{opacity:"0.6",display:"block"}},['This is the default feed template. To create your own, either duplicate it or click "Add New" above.']):null]),e("div",{class:"row-actions"},[e("span",{attrs:{className:"edit"}},[e(C,{attrs:{path:i(o.id)}},["Edit"])," |"]),e("span",{class:"inline",style:{paddingLeft:"4px"}},[e("a",S()([{attrs:{href:"#"}},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];(function(e){e.preventDefault(),t.duplicateTemplate(o)}).apply(void 0,[e].concat(n))}}}]),["Duplicate"])," ","__built_in"!==o.type?"|":""]),"__built_in"!==o.type?e("span",S()([{class:"trash",style:{paddingLeft:"4px"}},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];(function(e){e.preventDefault(),t.deleteTemplate(o.id)}).apply(void 0,[e].concat(n))}}}]),[e("a",{attrs:{href:"#","aria-label":"Delete Item"},class:"submitdelete"},["Delete"])]):null])]},style:function(i){var n=i.row;return t.filters[n.type]?[e("div",[t.filters[n.type]])]:[e("div",[t.filters.list," ",e("span",{style:{opacity:.7,fontSize:"90%"}},["(Missing type: ",e("code",[n.type]),")"])])]},previewTemplate:function(i){var n=i.row;return[e("div",[e("a",{attrs:{href:t.getPreviewLink(n),target:"wpra-preview-template"},class:"wpra-preview-link"},["Open preview ",e("span",{class:"dashicons dashicons-external"})])])]},filters:function(){var i=Object.keys(WpraTemplates.options.type).filter(function(t){return"_"!==t[0]}).reduce(function(t,e){return t[e]=WpraTemplates.options.type[e],t},{all:"Select Template Type"});return[e(j,S()([{attrs:{type:"select",options:i,value:t.filter.type},style:{margin:0}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){t.filter.type=e,t.submitFilter()}).apply(void 0,[e].concat(n))}}}]))]}}),o=e("div",[e("h1",{class:"wp-heading-inline"},["Templates"]),e("a",S()([{class:"page-title-action",attrs:{href:"#"}},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){e.preventDefault(),t.createTemplate()}).apply(void 0,[e].concat(n))}}}]),["Add New"]),e("p",{class:"search-box",style:{padding:"10px 0"}},[e("label",{class:"screen-reader-text",attrs:{for:"post-search-input"}},["Search Templates:"]),e("input",S()([{attrs:{type:"search",id:"post-search-input",name:"s"},domProps:{value:this.filter.s}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.filter.s=e.target.value}).apply(void 0,[e].concat(n))},keyup:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];if(!("button"in e)&&t._k(e.keyCode,"enter",13))return null;t.submitFilter.apply(t,[e].concat(n))}}}])),e("input",S()([{attrs:{type:"submit",id:"search-submit",value:"Search Templates"},class:"button"},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];t.submitFilter.apply(t,[e].concat(n))}}}]))]),e("hr",{class:"wp-header-end"}),e(T.a,S()([{attrs:{columns:this.columns,rows:this.list,loading:this.loading,totalItems:this.total,perPage:20,totalPages:this.totalPages,currentPage:this.filter.paged,notFound:"No templates found.",rowClass:this.getRowClass},ref:"table",class:{"wpra-no-cb":0===this.list.length||1===this.list.length&&"__built_in"===this.list[0].type},scopedSlots:n},{on:{checked:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];t.setChecked.apply(t,[e].concat(n))},pagination:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){t.filter.paged=e,t.submitFilter()}).apply(void 0,[e].concat(n))}}}])),this.checked.length?e(E,[e("div",{class:"flex-row"},[e("div",{class:"flex-col"},[e("div",{class:"wpra-bottom-panel__title"},["Bulk Actions"]),e("a",S()([{attrs:{href:"#"}},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){e.preventDefault(),t.bulkDelete()}).apply(void 0,[e].concat(n))}}}]),["Delete"])])])]):null]);return this.hooks.apply("wpra-templates-list",this,o)}},V={inject:["hooks"],data:function(){return{expanded:!0}},props:{title:{},id:{},submit:{type:Boolean,default:!1},context:{}},methods:{toggle:function(){this.expanded=!this.expanded}},render:function(t){var e=this;return this.hooks.apply("postbox-"+this.id,this.context||this,t("div",{class:"postbox wpra-postbox",attrs:{id:this.submit?"submitdiv":""}},[t("button",S()([{attrs:{type:"button","aria-expanded":"true"},class:"handlediv"},{on:{click:function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];e.toggle.apply(e,[t].concat(n))}}}]),[t("span",{class:"screen-reader-text"},["Toggle panel: ",this.title]),t("span",{class:"toggle-indicator",attrs:{"aria-hidden":"true"}})]),t("h2",S()([{class:"hndle ui-sortable-handle"},{on:{click:function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];e.toggle.apply(e,[t].concat(n))}}}]),[t("span",[this.title])]),t("div",{class:"inside"},[this.hooks.apply("postbox-content-"+this.id,this.context||this,[this.$slots.default],{h:t})])]),{h:t})}},G=V,J=Object(N.a)(G,void 0,void 0,!1,null,null,null);J.options.__file="Postbox.vue";var q=J.exports,z={render:function(){return(0,arguments[0])("div",{attrs:{id:"postbox-container-2"},class:"postbox-container"},[this.$slots.default])}},H={render:function(){return(0,arguments[0])("div",{attrs:{id:"postbox-container-1"},class:"wpra-postbox-container postbox-container"},[this.$slots.default])}},K={render:function(){return(0,arguments[0])("div",{attrs:{id:"post-body"}},[this.$slots.default])}},X={props:{loading:{type:Boolean,default:!1}},render:function(){return(0,arguments[0])("button",{attrs:{disabled:this.loading},class:{button:!0,"loading-button":this.loading}},[this.$slots.default])}},Y={data:function(){return{shouldBeVisible:!0}},props:{id:{type:String,required:!0},title:{type:String},body:{type:String},learnMore:{default:!1},okayText:{type:String,default:"Got it"},learnMoreText:{type:String,default:"Learn more"},visible:{type:Boolean,default:!0}},computed:{isVisible:function(){return this.visible&&this.shouldBeVisible&&JSON.parse(localStorage.getItem(this.getBlockKey())||"true")}},methods:{onOkayClick:function(){this.shouldBeVisible=!1,localStorage.setItem(this.getBlockKey(),JSON.stringify(!1))},onLearnMoreClick:function(){window.open(this.learnMore,"_blank").focus()},getBlockKey:function(){return"wpra-"+this.id+"-visible"}},render:function(){var t=arguments[0];if(!this.isVisible)return null;var e=this.learnMore?t(X,{class:"button-clear",nativeOn:{click:this.onLearnMoreClick}},[this.learnMoreText," ",t("span",{class:"dashicons dashicons-external"})]):null;return t("div",{class:"wpra-notice-block"},[t("div",{class:"wpra-notice-block__title"},[this.title]),t("div",S()([{class:"wpra-notice-block__body"},{domProps:{innerHTML:this.body}}])),t("div",{class:"wpra-notice-block__buttons"},[t(X,{class:"brand button-primary",nativeOn:{click:this.onOkayClick}},[this.okayText]),e])])}},Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};u.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce(function(t,i){return u(t,i,e)})};var Q=u,tt=i(50),et=i.n(tt),it={data:function(){return{changes:{model:{}}}},methods:{isChanged:function(){return!et()(this.model,this.changes.model)},rememberModel:function(){this.$set(this.changes,"model",D(this.model))},cancelChanges:function(){confirm("Are you sure you want to cancel your changes for this template? This action cannot be reverted and all changes made since your last save will be lost.")&&this.$set(this,"model",D(this.changes.model))}}},nt={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t){var e,i,n,o,a,r,s,l="",p=0;for(t=nt._utf8_encode(t);p<t.length;)e=t.charCodeAt(p++),i=t.charCodeAt(p++),n=t.charCodeAt(p++),o=e>>2,a=(3&e)<<4|i>>4,r=(15&i)<<2|n>>6,s=63&n,isNaN(i)?r=s=64:isNaN(n)&&(s=64),l=l+this._keyStr.charAt(o)+this._keyStr.charAt(a)+this._keyStr.charAt(r)+this._keyStr.charAt(s);return l},decode:function(t){var e,i,n,o,a,r,s,l="",p=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");p<t.length;)o=this._keyStr.indexOf(t.charAt(p++)),a=this._keyStr.indexOf(t.charAt(p++)),r=this._keyStr.indexOf(t.charAt(p++)),s=this._keyStr.indexOf(t.charAt(p++)),e=o<<2|a>>4,i=(15&a)<<4|r>>2,n=(3&r)<<6|s,l+=String.fromCharCode(e),64!=r&&(l+=String.fromCharCode(i)),64!=s&&(l+=String.fromCharCode(n));return l=nt._utf8_decode(l)},_utf8_encode:function(t){t=t.replace(/\r\n/g,"\n");for(var e="",i=0;i<t.length;i++){var n=t.charCodeAt(i);n<128?e+=String.fromCharCode(n):n>127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e},_utf8_decode:function(t){for(var e="",i=0,n=0,o=0;i<t.length;)n=t.charCodeAt(i),n<128?(e+=String.fromCharCode(n),i++):n>191&&n<224?(o=t.charCodeAt(i+1),e+=String.fromCharCode((31&n)<<6|63&o),i+=2):(o=t.charCodeAt(i+1),c3=t.charCodeAt(i+2),e+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&c3),i+=3);return e}},ot=nt,at=i(6),rt={mixins:[it],data:function(){return{typeOptions:Object.keys(WpraTemplates.options.type).filter(function(t){return"_"!==t[0]}).reduce(function(t,e){return t[e]=WpraTemplates.options.type[e],t},{}),model:D(WpraTemplates.model_schema),validation:D(WpraTemplates.model_schema),tooltips:D(WpraTemplates.model_tooltips),baseUrl:WpraTemplates.base_url,isSaving:!1,isLoading:!1}},inject:["hooks","http","router","notification"],mounted:function(){this.resolveEditingItem()},computed:{previewUrl:function(){var t=ot.encode(JSON.stringify(this.model.options));return WpraGlobal.admin_base_url+"?wpra_preview_template="+this.router.params.id+"&wpra_template_options="+t}},methods:{resolveEditingItem:function(){var t=this,e=Q(D(WpraTemplates.model_schema),this.$store.state.templates.preset);this.isLoading=!0,function(){var e=t.router.params.id;if(!e)return Promise.resolve(null);var i=t.$store.getters["templates/item"](e);return i?Promise.resolve(i):t.http.get(t.baseUrl+"/"+e).then(function(t){return t.data})}().then(function(i){if(t.isLoading=!1,!i)return t.$set(t,"model",e),void t.rememberModel();i=Object.assign({},i),t.model=Q(t.model,i),t.rememberModel()})},save:function(){var t=this,e=!this.model.id;this.isSaving=!0,this.runRequest().then(function(i){t.model=Q(t.model,i.data),t.rememberModel(),t.notification.show("Template saved!",{type:"success",icon:function(t){return t.classList.add("dashicons","dashicons-yes"),t}}),e&&t.router.navigate({name:"templates",params:{action:"edit",id:i.data.id}})},function(e){t.notification.show("Something went wrong. Template is not saved!",{type:"error",icon:function(t){return t.classList.add("dashicons","dashicons-warning"),t}})}).finally(function(){t.isSaving=!1})},runRequest:function(){var t=this.model.id?"put":"post",e=this.model.id?this.baseUrl+"/"+this.model.id:this.baseUrl;return this.http[t](e,this.prepareModel())},prepareModel:function(){var t=this,e=Object.keys(WpraTemplates.model_schema);return Object.keys(this.model).filter(function(i){return!(!e.includes(i)||"__built_in"===t.model.type&&["name","type"].includes(i)||["slug","id"].includes(i))}).reduce(function(e,i){return e[i]=t.model[i],e},{})},getShortcode:function(){return'[wp-rss-aggregator template="'+this.model.slug+'"]'},preventLoosingNotSavedData:function(){return!this.isChanged()||confirm("You have unsaved changes. All changes will be lost if you go back to the Template list before updating. Are you sure you want to continue?")},copyShortcode:function(t){Object(at.a)(this.getShortcode());var e=t.target.innerText;t.target.style.width=t.target.getBoundingClientRect().width+"px",t.target.disabled=!0,t.target.innerText="Copied!",setTimeout(function(){t.target.style.width=null,t.target.innerText=e,t.target.disabled=!1},5e3)}},render:function(){var t=this,e=arguments[0],i={name:"templates"},n=null,o=null,a=e(Y,{class:"postbox",attrs:{id:"templates-usage",title:"Setting up your Templates",body:'Templates are used to display the items imported using WP RSS Aggregator. Choose the preferred options below and use them anywhere on your site via our <a href="https://kb.wprssaggregator.com/article/54-displaying-imported-items-shortcode#tinymce" target="_blank">shortcode</a> or our <a href="https://kb.wprssaggregator.com/article/454-displaying-imported-items-block-gutenberg" target="_blank">block</a>.',learnMore:"https://kb.wprssaggregator.com/article/457-templates"}});this.router.params.id&&(n=e("div",{attrs:{id:""},style:{padding:"6px 0"}},[e("div",{class:"misc-pub-section misc-pub-visibility"},[e("a",{attrs:{href:this.previewUrl,role:"button",target:"wpra-preview-template"},class:"wpra-preview-link",style:{marginLeft:"4px",textDecoration:"none"}},["Open preview",e("span",{class:"dashicons dashicons-external"})])])])),this.model.id&&(o=e("div",{class:"wpra-shortcode-copy",attrs:{title:"Copy chortcode"}},[e("div",{class:"wpra-shortcode-copy__content"},[e("strong",["Shortcode: "]),e("code",[this.getShortcode()])]),e("div",{class:"wpra-shortcode-copy__icon"},[e("button",S()([{class:"button"},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];t.copyShortcode.apply(t,[e].concat(n))}}}]),["Copy Shortcode"])])]));var r=e("div",[e("div",{class:"page-title"},[e(C,{class:"back-button",attrs:{path:i,gate:this.preventLoosingNotSavedData}},[e("span",{class:"dashicons dashicons-arrow-left-alt"}),"Templates"]),e("h1",{class:"wp-heading-inline"},[this.router.params.id?this.changes.model.name||this.changes.model.slug:"Create a New Template"]),o]),e("div",{attrs:{id:"poststuff"}},[this.isLoading?e("div",{class:"loading-container"}):e(K,{class:"metabox-holder columns-2"},[e(z,[a,e(q,{attrs:{id:"template-details",title:"Template Details",context:this}},[e(j,S()([{attrs:{type:"text",label:"Template name",value:this.model.name,disabled:"__built_in"===this.model.type}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.name=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"select",label:"Template type",value:this.model.type,options:this.typeOptions,disabled:"__built_in"===this.model.type,inputDisabled:!WpraTemplates.options.is_type_enabled,description:WpraTemplates.options.is_type_enabled?null:'<div class="disable-ignored"><strong class="disable-ignored">Get more template types, including a customisable grid template.</strong> <a target="_blank" href="https://www.wprssaggregator.com/extensions/templates/" class="disable-ignored">Learn more.</a></div>'}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.type=e}).apply(void 0,[e].concat(n))}}}])),"__built_in"===this.model.type?e("div",{class:"wpra-info-box"},[e("div",{class:"wpra-info-box__icon"},[e("span",{class:"dashicons dashicons-info"})]),e("div",{class:"wpra-info-box__text"},["This is the default template for WP RSS Aggregator. It is used as the fallback template when one is not selected via the shortcode or block. To create a new one, please go back to the Templates List."])]):null]),e(q,{attrs:{id:"template-options",title:"Template Options",context:this}},[e(j,S()([{attrs:{type:"checkbox",label:"Link title to original article",value:this.model.options.title_is_link,title:this.tooltips.options.title_is_link}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.title_is_link=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"number",label:"Title maximum length",value:this.model.options.title_max_length||"",placeholder:"No limit",title:this.tooltips.options.title_max_length}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.title_max_length=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"number",label:"Number of items to show",value:this.model.options.limit||"",title:this.tooltips.options.limit,placeholder:"Show all items",min:"0"}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.limit=""===e?0:e}).apply(void 0,[e].concat(n))}}}])),e("div",{attrs:{id:"wpra-list-template-publish-date"},style:{paddingTop:"10px"}},[e(j,S()([{attrs:{type:"checkbox",label:"Show publish date",value:this.model.options.date_enabled,title:this.tooltips.options.date_enabled},style:{fontWeight:"bold"}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.date_enabled=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"text",label:"Date prefix",value:this.model.options.date_prefix,disabled:!this.model.options.date_enabled,title:this.tooltips.options.date_prefix}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.date_prefix=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"text",label:"Date format",value:this.model.options.date_format,disabled:this.model.options.date_use_time_ago||!this.model.options.date_enabled,title:this.tooltips.options.date_format}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.date_format=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"checkbox",label:'Use "time ago" format',description:"Example: 20 minutes ago",value:this.model.options.date_use_time_ago,disabled:!this.model.options.date_enabled,title:this.tooltips.options.date_use_time_ago}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.date_use_time_ago=e}).apply(void 0,[e].concat(n))}}}]))]),e("div",{attrs:{id:"wpra-list-template-source"},style:{paddingTop:"10px"}},[e(j,S()([{attrs:{type:"checkbox",label:"Show source name",value:this.model.options.source_enabled,title:this.tooltips.options.source_enabled},style:{fontWeight:"bold"}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.source_enabled=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"text",label:"Source prefix",value:this.model.options.source_prefix,disabled:!this.model.options.source_enabled,title:this.tooltips.options.source_prefix}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.source_prefix=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"checkbox",label:"Link source name",value:this.model.options.source_is_link,disabled:!this.model.options.source_enabled,title:this.tooltips.options.source_is_link}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.source_is_link=e}).apply(void 0,[e].concat(n))}}}]))]),e("div",{attrs:{id:"wpra-list-template-author"},style:{paddingTop:"10px"}},[e(j,S()([{attrs:{type:"checkbox",label:"Show author name",value:this.model.options.author_enabled,title:this.tooltips.options.author_enabled},style:{fontWeight:"bold"}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.author_enabled=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"text",label:"Author prefix",value:this.model.options.author_prefix,disabled:!this.model.options.author_enabled,title:this.tooltips.options.author_prefix}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.author_prefix=e}).apply(void 0,[e].concat(n))}}}]))]),e("div",{attrs:{id:"wpra-list-template-pagination"},style:{paddingTop:"10px"}},[e(j,S()([{attrs:{type:"checkbox",label:"Pagination",value:this.model.options.pagination,title:this.tooltips.options.pagination,disabled:parseInt(this.model.options.limit)<1||!this.model.options.limit},style:{fontWeight:"bold"}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.pagination=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"select",label:"Pagination style",options:WpraTemplates.options.pagination_type,value:this.model.options.pagination_type,disabled:!this.model.options.pagination||parseInt(this.model.options.limit)<1||!this.model.options.limit,title:this.tooltips.options.pagination_type}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.pagination_type=e}).apply(void 0,[e].concat(n))}}}]))]),e("div",{attrs:{id:"wpra-list-template-bullets"},style:{paddingTop:"10px"}},[e(j,S()([{attrs:{type:"checkbox",label:"Show bullets",value:this.model.options.bullets_enabled,title:this.tooltips.options.bullets_enabled},style:{fontWeight:"bold"}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.bullets_enabled=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"select",label:"Bullet style",options:WpraTemplates.options.bullet_type,value:this.model.options.bullet_type,disabled:!this.model.options.bullets_enabled,title:this.tooltips.options.bullet_type}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.bullet_type=e}).apply(void 0,[e].concat(n))}}}]))])])]),e(H,[e(q,{attrs:{id:"template-create",title:this.model.id?"Update Template":"Create Template",submit:!0,context:this},class:"wpra-postbox-last"},[e("div",{class:"submitbox",attrs:{id:"submitpost"}},[n,e("div",{attrs:{id:"major-publishing-actions"}},[e("div",{attrs:{id:"delete-action"}},[this.isChanged()?e("a",S()([{attrs:{href:"#"},class:"submitdelete"},{on:{click:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){e.preventDefault(),t.cancelChanges()}).apply(void 0,[e].concat(n))}}}]),["Cancel Changes"]):null]),e("div",{attrs:{id:"publishing-action"}},[e(X,{class:"button-primary button-large",attrs:{loading:this.isSaving},nativeOn:{click:this.save}},[this.model.id?"Save":"Publish"])]),e("div",{class:"clear"})])])]),e(q,{attrs:{id:"template-link-preferences",title:"Link Preferences",context:this}},[e("p",{style:{opacity:.65}},["These options apply to all links within this template."]),e(j,S()([{attrs:{type:"checkbox",label:"Set links as nofollow",value:this.model.options.links_nofollow,title:this.tooltips.options.links_nofollow}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.links_nofollow=e}).apply(void 0,[e].concat(n))}}}])),e(j,S()([{attrs:{type:"select",label:"Open links behaviour",value:this.model.options.links_behavior,options:WpraTemplates.options.links_behavior,title:this.tooltips.options.links_behavior},class:"form-input--vertical"},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.links_behavior=e}).apply(void 0,[e].concat(n))}}}])),"lightbox"===this.model.options.links_behavior?e("div",{class:"notice notice-info notice-alt"},[e("p",["Some sites may not allow their content to be shown in a lightbox."]),e("p",["Embedded content usually works. Try ticking the below checkbox."]),e("p",[e("a",{attrs:{href:"https://kb.wprssaggregator.com/article/471-q-why-wont-some-of-my-feed-items-work-with-the-lightbox-link-behaviour-for-templates",target:"_blank"}},["Learn more"])])]):null,e(j,S()([{attrs:{type:"checkbox",label:"Set links to open embeds",value:this.model.options.link_to_embed,title:this.tooltips.options.link_to_embed}},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.link_to_embed=e}).apply(void 0,[e].concat(n))}}}]))]),e(q,{attrs:{id:"template-custom-css",title:"Custom Style",context:this}},[e(j,S()([{attrs:{type:"text",label:"Custom HTML class name",value:this.model.options.custom_css_classname,title:this.tooltips.options.custom_css_classname},class:"form-input--vertical"},{on:{input:function(e){for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];(function(e){return t.model.options.custom_css_classname=e}).apply(void 0,[e].concat(n))}}}]))])])])])]);return this.hooks.apply("wpra-templates-form",this,r)}},st=function(t){var e=t.store,i=t.router;return{store:e,data:function(){return{afterNavigate:function(){},params:{},currentRoute:null}},created:function(){i.setApp(this),this.currentRoute=i.parseLocation(window.location),this.navigated()},mounted:function(){var t=this;window.addEventListener("popstate",function(){t.currentRoute=i.parseLocation(window.location),t.navigated()})},methods:{ViewComponent:function(){return i.findRoute(this.currentRoute).component},navigated:function(){var t=this;this.$nextTick(function(){var e=t.$refs.main;e&&e.navigated&&e.navigated({route:i.findRoute(t.currentRoute)})})}},render:function(t){var e=t(this.ViewComponent(),{ref:"main"});return this.afterNavigate(),e}}},lt=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),pt=function(t){t||(t=location.href);var e=t.indexOf("?"),i=t.indexOf("#");if(-1==i&&-1==e)return{};-1==i&&(i=t.length);var n=-1==e||i==e+1?t.substring(i):t.substring(e+1,i),o={};return n.split("&").forEach(function(t){if(t){t=t.split("+").join(" ");var e=t.indexOf("="),i=e>-1?t.substr(0,e):t,n=e>-1?decodeURIComponent(t.substr(e+1)):"",a=i.indexOf("[");if(-1==a)o[decodeURIComponent(i)]=n;else{var r=i.indexOf("]",a),s=decodeURIComponent(i.substring(a+1,r));i=decodeURIComponent(i.substring(0,a)),o[i]||(o[i]=[]),s?o[i][s]=n:o[i].push(n)}}}),o},ut=function(){function t(e,i){c(this,t),this.routes=e,this.options=i,this.baseParams=i.baseParams||["post_type","page","action","id"]}return t.prototype.setApp=function(t){this.app=t,this.app.afterNavigate=this.options.afterNavigating||function(){}},t.prototype.findRoute=function(t){return this.routes.find(function(e){var i=e.route;return-1!==t.indexOf(i)})},t.prototype.updateParams=function(t){this.app.$set(this.app,"params",t)},t.prototype.mergeParams=function(t){var e=this,i=Object.keys(this.params).filter(function(i){return-1!==e.baseParams.indexOf(i)||t.hasOwnProperty(i)}).reduce(function(t,i){return t[i]=e.params[i],t},{}),n=Object.assign({},i,t);this.updateParams(n),window.history.pushState(null,null,this.routeFromParams()),this.app.navigated()},t.prototype.routeFromParams=function(){var t=!!Object.keys(this.params).length;return location.pathname+(t?"?"+this.buildParams(this.params):"")},t.prototype.buildRoute=function(t){if(t.name){var e=this.routes.find(function(e){return e.name===t.name});if(!e)return null;var i=e.route,n=-1!==i.indexOf("?")?"&":"?";return i+(t.params?n+this.buildParams(t.params?t.params:{}):"")}},t.prototype.buildParams=function(t){return Object.keys(t).map(function(e){return e+"="+t[e]}).join("&")},t.prototype.parseLocation=function(t){return this.updateParams(pt(t.search)),pt(t.search),t.pathname+t.search},t.prototype.navigate=function(t){this.app&&(this.app.currentRoute=this.buildRoute(t)),this.updateParams(Object.assign({},t.params||{},pt(this.buildRoute(t)))),window.history.pushState(null,null,this.buildRoute(t)),this.app.navigated()},lt(t,[{key:"params",get:function(){return this.app?this.app.params:{}}}]),t}(),ct=ut,dt={set:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.isInitialized=!0,t.items=e},updatePreset:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t.preset=e}},ht={},ft={isInitialized:!1,items:[],preset:{}},mt={item:function(t){return function(e){return U(t.items).find(e)}}},yt={namespaced:!0,mutations:dt,actions:ht,state:ft,getters:mt},vt=function(){function t(e,i){d(this,t),this.showMethod=e,this.errorMethod=i}return t.prototype.show=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.showMethod(t,e)},t.prototype.error=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.errorMethod(t,e)},t}(),bt=vt,gt=i(5),_t={Input:j,NoticeBlock:Y,Postbox:q,RouteLink:C,TransitionExpand:gt.a,Button:X},wt={register:function(t){t.TemplateEdit=function(){return rt},t.TemplateList=function(){return B},t.router=function(t){var e=t.document,i=t.TemplateEdit,n=t.TemplateList;return new ct([{route:WpraGlobal.templates_url_base+"&action",name:"templates-form",component:i},{route:WpraGlobal.templates_url_base,name:"templates",component:n}],{afterNavigating:function(){e.querySelector("html").scrollTop=0}})},t.App=function(t){return st(t)},t.vuex=function(t){return t.vue.use(k.a),k.a},t.notification=function(t){var e=t.vue;return e.use(g.a,{position:"top-center",duration:4e3,iconPack:"callback"}),new bt(e.toasted.show,e.toasted.error)},t.store=function(t){return new t.vuex.Store({modules:{templates:yt},state:{}})},t.http=function(){var t=WpraGlobal&&WpraGlobal.nonce?{headers:{"X-WP-Nonce":WpraGlobal.nonce}}:{};return v.a.create(t)};for(var e=Object.entries(_t),i=Array.isArray(e),n=0,e=i?e:e[Symbol.iterator]();;){var o;if("break"===function(){if(i){if(n>=e.length)return"break";o=e[n++]}else{if(n=e.next(),n.done)return"break";o=n.value}var a=o,r=a[0],s=a[1];t[r]=function(){return s}}())break}return t},run:function(t){t.container.vue.use(w.a,{theme:"light",animation:"fade",arrow:!0,arrowTransform:"scale(0)",placement:"right"})}},kt=i(4);i(42);var xt=h.Container,St=h.Core,At=h.Services;window.UiFramework&&(window.UiFramework=Object.assign({},window.UiFramework,St.UiFramework));var Tt={uiFramework:h,hooks:new At.HookService,document:document,vue:function(t){return kt.a.use(t.uiFramework.Core.InjectedComponents,{container:t}),kt.a}},Ct=new xt.ContainerFactory(m.a),Ot=new St.UiFramework.App(Ct,Tt);window.UiFramework.registerPlugin("templates-app",wt),Ot.use(WpraTemplates.modules||["templates-app"]),Ot.init({"#wpra-templates-app":"App"})},42:function(t,e){},5:function(t,e,i){"use strict";var n={name:"TransitionExpand",functional:!0,render:function(t,e){return t("transition",{props:{name:"expand"},on:{afterEnter:function(t){t.style.height="auto"},enter:function(t){var e=getComputedStyle(t),i=e.width;t.style.width=i,t.style.position="absolute",t.style.visibility="hidden",t.style.height="auto";var n=getComputedStyle(t),o=n.height;t.style.width=null,t.style.position=null,t.style.visibility=null,t.style.height=0,getComputedStyle(t).height,setTimeout(function(){t.style.height=o})},leave:function(t){var e=getComputedStyle(t),i=e.height;t.style.height=i,getComputedStyle(t).height,setTimeout(function(){t.style.height=0})}}},e.children)}},o=n,a=i(1),r=Object(a.a)(o,void 0,void 0,!1,null,null,null);r.options.__file="TransitionExpand.vue",e.a=r.exports},6:function(t,e,i){"use strict";function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!navigator.clipboard)return void o(t,e);navigator.clipboard.writeText(t).then(function(){},function(t){console.error("Async: Could not copy text: ",t)})}e.a=n;var o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e=e||document.body.parentElement;var i=document.createElement("textarea");i.value=t;var n=e.scrollTop;document.body.appendChild(i),i.focus(),i.select();try{document.execCommand("copy")}catch(t){console.error("Fallback: Oops, unable to copy",t)}document.body.removeChild(i),e.scrollTop=n}}},[41])});
|
@@ -1 +1 @@
|
|
1 |
-
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.WPRA=o():e.WPRA=o()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([
|
1 |
+
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.WPRA=o():e.WPRA=o()}("undefined"!=typeof self?self:this,function(){return webpackJsonpWPRA([5],{54:function(e,o){}},[54])});
|
@@ -1 +1 @@
|
|
1 |
-
!function(r){function n(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var e=window.webpackJsonpWPRA;window.webpackJsonpWPRA=function(o,u,c){for(var f,i,p,a=0,l=[];a<o.length;a++)i=o[a],t[i]&&l.push(t[i][0]),t[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(e&&e(o,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=n(n.s=c[a]);return p};var o={},t={
|
1 |
+
!function(r){function n(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var e=window.webpackJsonpWPRA;window.webpackJsonpWPRA=function(o,u,c){for(var f,i,p,a=0,l=[];a<o.length;a++)i=o[a],t[i]&&l.push(t[i][0]),t[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(e&&e(o,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=n(n.s=c[a]);return p};var o={},t={7:0};n.m=r,n.c=o,n.d=function(r,e,o){n.o(r,e)||Object.defineProperty(r,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(e,"a",e),e},n.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},n.p="",n.oe=function(r){throw console.error(r),r}}([]);
|
@@ -1,15 +1,15 @@
|
|
1 |
-
webpackJsonpWPRA([0],[function(t,e,n){"use strict";function r(t){return"[object Array]"===T.call(t)}function i(t){return"[object ArrayBuffer]"===T.call(t)}function o(t){return"undefined"!=typeof FormData&&t instanceof FormData}function a(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer}function s(t){return"string"==typeof t}function c(t){return"number"==typeof t}function u(t){return void 0===t}function l(t){return null!==t&&"object"==typeof t}function p(t){return"[object Date]"===T.call(t)}function f(t){return"[object File]"===T.call(t)}function d(t){return"[object Blob]"===T.call(t)}function h(t){return"[object Function]"===T.call(t)}function v(t){return l(t)&&h(t.pipe)}function m(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams}function y(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function g(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document}function b(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),r(t))for(var n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}function w(){function t(t,n){"object"==typeof e[n]&&"object"==typeof t?e[n]=w(e[n],t):e[n]=t}for(var e={},n=0,r=arguments.length;n<r;n++)b(arguments[n],t);return e}function x(t,e,n){return b(e,function(e,r){t[r]=n&&"function"==typeof e?_(e,n):e}),t}var _=n(12),k=n(26),T=Object.prototype.toString;t.exports={isArray:r,isArrayBuffer:i,isBuffer:k,isFormData:o,isArrayBufferView:a,isString:s,isNumber:c,isObject:l,isUndefined:u,isDate:p,isFile:f,isBlob:d,isFunction:h,isStream:v,isURLSearchParams:m,isStandardBrowserEnv:g,forEach:b,merge:w,extend:x,trim:y}},function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){var c="function"==typeof t?t.options:t;e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o);var u;if(a?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=u):i&&(u=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),u)if(c.functional){c._injectStyles=u;var l=c.render;c.render=function(t,e){return u.call(e),l(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,u):[u]}return{exports:t,options:c}}e.a=r},function(t,e){function n(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}}var r=/^(attrs|props|on|nativeOn|class|style|hook)$/;t.exports=function(t){return t.reduce(function(t,e){var i,o,a,s,c;for(a in e)if(i=t[a],o=e[a],i&&r.test(a))if("class"===a&&("string"==typeof i&&(c=i,t[a]=i={},i[c]=!0),"string"==typeof o&&(c=o,e[a]=o={},o[c]=!0)),"on"===a||"nativeOn"===a||"hook"===a)for(s in o)i[s]=n(i[s],o[s]);else if(Array.isArray(i))t[a]=i.concat(o);else if(Array.isArray(o))t[a]=[i].concat(o);else for(s in o)i[s]=o[s];else t[a]=e[a];return t},{})}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},,,function(t,e,n){"use strict";(function(t,n){function r(t){return void 0===t||null===t}function i(t){return void 0!==t&&null!==t}function o(t){return!0===t}function a(t){return!1===t}function s(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function c(t){return null!==t&&"object"==typeof t}function u(t){return"[object Object]"===po.call(t)}function l(t){return"[object RegExp]"===po.call(t)}function p(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function d(t){var e=parseFloat(t);return isNaN(e)?t:e}function h(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}function v(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function m(t,e){return vo.call(t,e)}function y(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function g(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function b(t,e){return t.bind(e)}function w(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function x(t,e){for(var n in e)t[n]=e[n];return t}function _(t){for(var e={},n=0;n<t.length;n++)t[n]&&x(e,t[n]);return e}function k(t,e,n){}function T(t,e){if(t===e)return!0;var n=c(t),r=c(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var i=Array.isArray(t),o=Array.isArray(e);if(i&&o)return t.length===e.length&&t.every(function(t,n){return T(t,e[n])});if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(i||o)return!1;var a=Object.keys(t),s=Object.keys(e);return a.length===s.length&&a.every(function(n){return T(t[n],e[n])})}catch(t){return!1}}function O(t,e){for(var n=0;n<t.length;n++)if(T(t[n],e))return n;return-1}function E(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function C(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function A(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function S(t){if(!Ao.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}function P(t){return"function"==typeof t&&/native code/.test(t.toString())}function j(t){Go.push(t),Wo.target=t}function L(){Go.pop(),Wo.target=Go[Go.length-1]}function M(t){return new Ko(void 0,void 0,void 0,String(t))}function $(t){var e=new Ko(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}function I(t){na=t}function N(t,e){t.__proto__=e}function D(t,e,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];A(t,o,e[o])}}function R(t,e){if(c(t)&&!(t instanceof Ko)){var n;return m(t,"__ob__")&&t.__ob__ instanceof ra?n=t.__ob__:na&&!Xo()&&(Array.isArray(t)||u(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new ra(t)),e&&n&&n.vmCount++,n}}function F(t,e,n,r,i){var o=new Wo,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=t[e]);var u=!i&&R(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=s?s.call(t):n;return Wo.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(e)&&H(e))),e},set:function(e){var r=s?s.call(t):n;e===r||e!==e&&r!==r||s&&!c||(c?c.call(t,e):n=e,u=!i&&R(e),o.notify())}})}}function B(t,e,n){if(Array.isArray(t)&&p(e))return t.length=Math.max(t.length,e),t.splice(e,1,n),n;if(e in t&&!(e in Object.prototype))return t[e]=n,n;var r=t.__ob__;return t._isVue||r&&r.vmCount?n:r?(F(r.value,e,n),r.dep.notify(),n):(t[e]=n,n)}function U(t,e){if(Array.isArray(t)&&p(e))return void t.splice(e,1);var n=t.__ob__;t._isVue||n&&n.vmCount||m(t,e)&&(delete t[e],n&&n.dep.notify())}function H(t){for(var e=void 0,n=0,r=t.length;n<r;n++)e=t[n],e&&e.__ob__&&e.__ob__.dep.depend(),Array.isArray(e)&&H(e)}function X(t,e){if(!e)return t;for(var n,r,i,o=Object.keys(e),a=0;a<o.length;a++)n=o[a],r=t[n],i=e[n],m(t,n)?r!==i&&u(r)&&u(i)&&X(r,i):B(t,n,i);return t}function z(t,e,n){return n?function(){var r="function"==typeof e?e.call(n,n):e,i="function"==typeof t?t.call(n,n):t;return r?X(r,i):i}:e?t?function(){return X("function"==typeof e?e.call(this,this):e,"function"==typeof t?t.call(this,this):t)}:e:t}function Y(t,e){var n=e?t?t.concat(e):Array.isArray(e)?e:[e]:t;return n?q(n):n}function q(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}function V(t,e,n,r){var i=Object.create(t||null);return e?x(i,e):i}function W(t,e){var n=t.props;if(n){var r,i,o,a={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o=yo(i),a[o]={type:null});else if(u(n))for(var s in n)i=n[s],o=yo(s),a[o]=u(i)?i:{type:i};t.props=a}}function G(t,e){var n=t.inject;if(n){var r=t.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(u(n))for(var o in n){var a=n[o];r[o]=u(a)?x({from:o},a):{from:a}}}}function K(t){var e=t.directives;if(e)for(var n in e){var r=e[n];"function"==typeof r&&(e[n]={bind:r,update:r})}}function J(t,e,n){function r(r){var i=ia[r]||sa;s[r]=i(t[r],e[r],n,r)}if("function"==typeof e&&(e=e.options),W(e,n),G(e,n),K(e),!e._base&&(e.extends&&(t=J(t,e.extends,n)),e.mixins))for(var i=0,o=e.mixins.length;i<o;i++)t=J(t,e.mixins[i],n);var a,s={};for(a in t)r(a);for(a in e)m(t,a)||r(a);return s}function Q(t,e,n,r){if("string"==typeof n){var i=t[e];if(m(i,n))return i[n];var o=yo(n);if(m(i,o))return i[o];var a=go(o);return m(i,a)?i[a]:i[n]||i[o]||i[a]}}function Z(t,e,n,r){var i=e[t],o=!m(n,t),a=n[t],s=rt(Boolean,i.type);if(s>-1)if(o&&!m(i,"default"))a=!1;else if(""===a||a===wo(t)){var c=rt(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=tt(r,i,t);var u=na;I(!0),R(a),I(u)}return a}function tt(t,e,n){if(m(e,"default")){var r=e.default;return t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n]?t._props[n]:"function"==typeof r&&"Function"!==et(e.type)?r.call(t):r}}function et(t){var e=t&&t.toString().match(/^\s*function (\w+)/);return e?e[1]:""}function nt(t,e){return et(t)===et(e)}function rt(t,e){if(!Array.isArray(e))return nt(e,t)?0:-1;for(var n=0,r=e.length;n<r;n++)if(nt(e[n],t))return n;return-1}function it(t,e,n){if(e)for(var r=e;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{var a=!1===i[o].call(r,t,e,n);if(a)return}catch(t){ot(t,r,"errorCaptured hook")}}ot(t,e,n)}function ot(t,e,n){if(Co.errorHandler)try{return Co.errorHandler.call(null,t,e,n)}catch(t){at(t,null,"config.errorHandler")}at(t,e,n)}function at(t,e,n){if(!Po&&!jo||"undefined"==typeof console)throw t;console.error(t)}function st(){ua=!1;var t=ca.slice(0);ca.length=0;for(var e=0;e<t.length;e++)t[e]()}function ct(t){return t._withTask||(t._withTask=function(){la=!0;try{return t.apply(null,arguments)}finally{la=!1}})}function ut(t,e){var n;if(ca.push(function(){if(t)try{t.call(e)}catch(t){it(t,e,"nextTick")}else n&&n(e)}),ua||(ua=!0,la?aa():oa()),!t&&"undefined"!=typeof Promise)return new Promise(function(t){n=t})}function lt(t){pt(t,va),va.clear()}function pt(t,e){var n,r,i=Array.isArray(t);if(!(!i&&!c(t)||Object.isFrozen(t)||t instanceof Ko)){if(t.__ob__){var o=t.__ob__.dep.id;if(e.has(o))return;e.add(o)}if(i)for(n=t.length;n--;)pt(t[n],e);else for(r=Object.keys(t),n=r.length;n--;)pt(t[r[n]],e)}}function ft(t){function e(){var t=arguments,n=e.fns;if(!Array.isArray(n))return n.apply(null,arguments);for(var r=n.slice(),i=0;i<r.length;i++)r[i].apply(null,t)}return e.fns=t,e}function dt(t,e,n,i,a,s){var c,u,l,p;for(c in t)u=t[c],l=e[c],p=ma(c),r(u)||(r(l)?(r(u.fns)&&(u=t[c]=ft(u)),o(p.once)&&(u=t[c]=a(p.name,u,p.capture)),n(p.name,u,p.capture,p.passive,p.params)):u!==l&&(l.fns=u,t[c]=l));for(c in e)r(t[c])&&(p=ma(c),i(p.name,e[c],p.capture))}function ht(t,e,n){function a(){n.apply(this,arguments),v(s.fns,a)}t instanceof Ko&&(t=t.data.hook||(t.data.hook={}));var s,c=t[e];r(c)?s=ft([a]):i(c.fns)&&o(c.merged)?(s=c,s.fns.push(a)):s=ft([c,a]),s.merged=!0,t[e]=s}function vt(t,e,n){var o=e.options.props;if(!r(o)){var a={},s=t.attrs,c=t.props;if(i(s)||i(c))for(var u in o){var l=wo(u);mt(a,c,u,l,!0)||mt(a,s,u,l,!1)}return a}}function mt(t,e,n,r,o){if(i(e)){if(m(e,n))return t[n]=e[n],o||delete e[n],!0;if(m(e,r))return t[n]=e[r],o||delete e[r],!0}return!1}function yt(t){for(var e=0;e<t.length;e++)if(Array.isArray(t[e]))return Array.prototype.concat.apply([],t);return t}function gt(t){return s(t)?[M(t)]:Array.isArray(t)?wt(t):void 0}function bt(t){return i(t)&&i(t.text)&&a(t.isComment)}function wt(t,e){var n,a,c,u,l=[];for(n=0;n<t.length;n++)a=t[n],r(a)||"boolean"==typeof a||(c=l.length-1,u=l[c],Array.isArray(a)?a.length>0&&(a=wt(a,(e||"")+"_"+n),bt(a[0])&&bt(u)&&(l[c]=M(u.text+a[0].text),a.shift()),l.push.apply(l,a)):s(a)?bt(u)?l[c]=M(u.text+a):""!==a&&l.push(M(a)):bt(a)&&bt(u)?l[c]=M(u.text+a.text):(o(t._isVList)&&i(a.tag)&&r(a.key)&&i(e)&&(a.key="__vlist"+e+"_"+n+"__"),l.push(a)));return l}function xt(t,e){return(t.__esModule||Yo&&"Module"===t[Symbol.toStringTag])&&(t=t.default),c(t)?e.extend(t):t}function _t(t,e,n,r,i){var o=Qo();return o.asyncFactory=t,o.asyncMeta={data:e,context:n,children:r,tag:i},o}function kt(t,e,n){if(o(t.error)&&i(t.errorComp))return t.errorComp;if(i(t.resolved))return t.resolved;if(o(t.loading)&&i(t.loadingComp))return t.loadingComp;if(!i(t.contexts)){var a=t.contexts=[n],s=!0,u=function(t){for(var e=0,n=a.length;e<n;e++)a[e].$forceUpdate();t&&(a.length=0)},l=E(function(n){t.resolved=xt(n,e),s?a.length=0:u(!0)}),p=E(function(e){i(t.errorComp)&&(t.error=!0,u(!0))}),f=t(l,p);return c(f)&&("function"==typeof f.then?r(t.resolved)&&f.then(l,p):i(f.component)&&"function"==typeof f.component.then&&(f.component.then(l,p),i(f.error)&&(t.errorComp=xt(f.error,e)),i(f.loading)&&(t.loadingComp=xt(f.loading,e),0===f.delay?t.loading=!0:setTimeout(function(){r(t.resolved)&&r(t.error)&&(t.loading=!0,u(!1))},f.delay||200)),i(f.timeout)&&setTimeout(function(){r(t.resolved)&&p(null)},f.timeout))),s=!1,t.loading?t.loadingComp:t.resolved}t.contexts.push(n)}function Tt(t){return t.isComment&&t.asyncFactory}function Ot(t){if(Array.isArray(t))for(var e=0;e<t.length;e++){var n=t[e];if(i(n)&&(i(n.componentOptions)||Tt(n)))return n}}function Et(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Pt(t,e)}function Ct(t,e){ha.$on(t,e)}function At(t,e){ha.$off(t,e)}function St(t,e){var n=ha;return function r(){null!==e.apply(null,arguments)&&n.$off(t,r)}}function Pt(t,e,n){ha=t,dt(e,n||{},Ct,At,St,t),ha=void 0}function jt(t,e){var n={};if(!t)return n;for(var r=0,i=t.length;r<i;r++){var o=t[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==e&&o.fnContext!==e||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(Lt)&&delete n[u];return n}function Lt(t){return t.isComment&&!t.asyncFactory||" "===t.text}function Mt(t,e){e=e||{};for(var n=0;n<t.length;n++)Array.isArray(t[n])?Mt(t[n],e):e[t[n].key]=t[n].fn;return e}function $t(t){var e=ya;return ya=t,function(){ya=e}}function It(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}function Nt(t,e,n){t.$el=e,t.$options.render||(t.$options.render=Qo),Ut(t,"beforeMount");var r;return r=function(){t._update(t._render(),n)},new Oa(t,r,k,{before:function(){t._isMounted&&!t._isDestroyed&&Ut(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,Ut(t,"mounted")),t}function Dt(t,e,n,r,i){var o=!!(i||t.$options._renderChildren||r.data.scopedSlots||t.$scopedSlots!==lo);if(t.$options._parentVnode=r,t.$vnode=r,t._vnode&&(t._vnode.parent=r),t.$options._renderChildren=i,t.$attrs=r.data.attrs||lo,t.$listeners=n||lo,e&&t.$options.props){I(!1);for(var a=t._props,s=t.$options._propKeys||[],c=0;c<s.length;c++){var u=s[c],l=t.$options.props;a[u]=Z(u,l,e,t)}I(!0),t.$options.propsData=e}n=n||lo;var p=t.$options._parentListeners;t.$options._parentListeners=n,Pt(t,n,p),o&&(t.$slots=jt(i,r.context),t.$forceUpdate())}function Rt(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function Ft(t,e){if(e){if(t._directInactive=!1,Rt(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)Ft(t.$children[n]);Ut(t,"activated")}}function Bt(t,e){if(!(e&&(t._directInactive=!0,Rt(t))||t._inactive)){t._inactive=!0;for(var n=0;n<t.$children.length;n++)Bt(t.$children[n]);Ut(t,"deactivated")}}function Ut(t,e){j();var n=t.$options[e];if(n)for(var r=0,i=n.length;r<i;r++)try{n[r].call(t)}catch(n){it(n,t,e+" hook")}t._hasHookEvent&&t.$emit("hook:"+e),L()}function Ht(){ka=ga.length=ba.length=0,wa={},xa=_a=!1}function Xt(){_a=!0;var t,e;for(ga.sort(function(t,e){return t.id-e.id}),ka=0;ka<ga.length;ka++)t=ga[ka],t.before&&t.before(),e=t.id,wa[e]=null,t.run();var n=ba.slice(),r=ga.slice();Ht(),qt(n),zt(r),zo&&Co.devtools&&zo.emit("flush")}function zt(t){for(var e=t.length;e--;){var n=t[e],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&Ut(r,"updated")}}function Yt(t){t._inactive=!1,ba.push(t)}function qt(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,Ft(t[e],!0)}function Vt(t){var e=t.id;if(null==wa[e]){if(wa[e]=!0,_a){for(var n=ga.length-1;n>ka&&ga[n].id>t.id;)n--;ga.splice(n+1,0,t)}else ga.push(t);xa||(xa=!0,ut(Xt))}}function Wt(t,e,n){Ea.get=function(){return this[e][n]},Ea.set=function(t){this[e][n]=t},Object.defineProperty(t,n,Ea)}function Gt(t){t._watchers=[];var e=t.$options;e.props&&Kt(t,e.props),e.methods&&re(t,e.methods),e.data?Jt(t):R(t._data={},!0),e.computed&&Zt(t,e.computed),e.watch&&e.watch!==Ro&&ie(t,e.watch)}function Kt(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[];!t.$parent||I(!1);for(var o in e)!function(o){i.push(o);var a=Z(o,e,n,t);F(r,o,a),o in t||Wt(t,"_props",o)}(o);I(!0)}function Jt(t){var e=t.$options.data;e=t._data="function"==typeof e?Qt(e,t):e||{},u(e)||(e={});for(var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);i--;){var o=n[i];r&&m(r,o)||C(o)||Wt(t,"_data",o)}R(e,!0)}function Qt(t,e){j();try{return t.call(e,e)}catch(t){return it(t,e,"data()"),{}}finally{L()}}function Zt(t,e){var n=t._computedWatchers=Object.create(null),r=Xo();for(var i in e){var o=e[i],a="function"==typeof o?o:o.get;r||(n[i]=new Oa(t,a||k,k,Ca)),i in t||te(t,i,o)}}function te(t,e,n){var r=!Xo();"function"==typeof n?(Ea.get=r?ee(e):ne(n),Ea.set=k):(Ea.get=n.get?r&&!1!==n.cache?ee(e):ne(n.get):k,Ea.set=n.set||k),Object.defineProperty(t,e,Ea)}function ee(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),Wo.target&&e.depend(),e.value}}function ne(t){return function(){return t.call(this,this)}}function re(t,e){t.$options.props;for(var n in e)t[n]="function"!=typeof e[n]?k:xo(e[n],t)}function ie(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)oe(t,n,r[i]);else oe(t,n,r)}}function oe(t,e,n,r){return u(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}function ae(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}function se(t){var e=ce(t.$options.inject,t);e&&(I(!1),Object.keys(e).forEach(function(n){F(t,n,e[n])}),I(!0))}function ce(t,e){if(t){for(var n=Object.create(null),r=Yo?Reflect.ownKeys(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}):Object.keys(t),i=0;i<r.length;i++){for(var o=r[i],a=t[o].from,s=e;s;){if(s._provided&&m(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s&&"default"in t[o]){var c=t[o].default;n[o]="function"==typeof c?c.call(e):c}}return n}}function ue(t,e){var n,r,o,a,s;if(Array.isArray(t)||"string"==typeof t)for(n=new Array(t.length),r=0,o=t.length;r<o;r++)n[r]=e(t[r],r);else if("number"==typeof t)for(n=new Array(t),r=0;r<t;r++)n[r]=e(r+1,r);else if(c(t))for(a=Object.keys(t),n=new Array(a.length),r=0,o=a.length;r<o;r++)s=a[r],n[r]=e(t[s],s,r);return i(n)||(n=[]),n._isVList=!0,n}function le(t,e,n,r){var i,o=this.$scopedSlots[t];o?(n=n||{},r&&(n=x(x({},r),n)),i=o(n)||e):i=this.$slots[t]||e;var a=n&&n.slot;return a?this.$createElement("template",{slot:a},i):i}function pe(t){return Q(this.$options,"filters",t,!0)||ko}function fe(t,e){return Array.isArray(t)?-1===t.indexOf(e):t!==e}function de(t,e,n,r,i){var o=Co.keyCodes[e]||n;return i&&r&&!Co.keyCodes[e]?fe(i,r):o?fe(o,t):r?wo(r)!==e:void 0}function he(t,e,n,r,i){if(n&&c(n)){Array.isArray(n)&&(n=_(n));var o;for(var a in n)!function(a){if("class"===a||"style"===a||ho(a))o=t;else{var s=t.attrs&&t.attrs.type;o=r||Co.mustUseProp(e,s,a)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var c=yo(a);a in o||c in o||(o[a]=n[a],!i)||((t.on||(t.on={}))["update:"+c]=function(t){n[a]=t})}(a)}return t}function ve(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e?r:(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,null,this),ye(r,"__static__"+t,!1),r)}function me(t,e,n){return ye(t,"__once__"+e+(n?"_"+n:""),!0),t}function ye(t,e,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]&&"string"!=typeof t[r]&&ge(t[r],e+"_"+r,n);else ge(t,e,n)}function ge(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function be(t,e){if(e&&u(e)){var n=t.on=t.on?x({},t.on):{};for(var r in e){var i=n[r],o=e[r];n[r]=i?[].concat(i,o):o}}return t}function we(t){t._o=me,t._n=d,t._s=f,t._l=ue,t._t=le,t._q=T,t._i=O,t._m=ve,t._f=pe,t._k=de,t._b=he,t._v=M,t._e=Qo,t._u=Mt,t._g=be}function xe(t,e,n,r,i){var a,s=i.options;m(r,"_uid")?(a=Object.create(r),a._original=r):(a=r,r=r._original);var c=o(s._compiled),u=!c;this.data=t,this.props=e,this.children=n,this.parent=r,this.listeners=t.on||lo,this.injections=ce(s.inject,r),this.slots=function(){return jt(n,r)},c&&(this.$options=s,this.$slots=this.slots(),this.$scopedSlots=t.scopedSlots||lo),s._scopeId?this._c=function(t,e,n,i){var o=Pe(a,t,e,n,i,u);return o&&!Array.isArray(o)&&(o.fnScopeId=s._scopeId,o.fnContext=r),o}:this._c=function(t,e,n,r){return Pe(a,t,e,n,r,u)}}function _e(t,e,n,r,o){var a=t.options,s={},c=a.props;if(i(c))for(var u in c)s[u]=Z(u,c,e||lo);else i(n.attrs)&&Te(s,n.attrs),i(n.props)&&Te(s,n.props);var l=new xe(n,s,o,r,t),p=a.render.call(null,l._c,l);if(p instanceof Ko)return ke(p,n,l.parent,a,l);if(Array.isArray(p)){for(var f=gt(p)||[],d=new Array(f.length),h=0;h<f.length;h++)d[h]=ke(f[h],n,l.parent,a,l);return d}}function ke(t,e,n,r,i){var o=$(t);return o.fnContext=n,o.fnOptions=r,e.slot&&((o.data||(o.data={})).slot=e.slot),o}function Te(t,e){for(var n in e)t[yo(n)]=e[n]}function Oe(t,e,n,a,s){if(!r(t)){var u=n.$options._base;if(c(t)&&(t=u.extend(t)),"function"==typeof t){var l;if(r(t.cid)&&(l=t,void 0===(t=kt(l,u,n))))return _t(l,e,n,a,s);e=e||{},Ne(t),i(e.model)&&Se(t.options,e);var p=vt(e,t,s);if(o(t.options.functional))return _e(t,p,e,n,a);var f=e.on;if(e.on=e.nativeOn,o(t.options.abstract)){var d=e.slot;e={},d&&(e.slot=d)}Ce(e);var h=t.options.name||s;return new Ko("vue-component-"+t.cid+(h?"-"+h:""),e,void 0,void 0,void 0,n,{Ctor:t,propsData:p,listeners:f,tag:s,children:a},l)}}}function Ee(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;return i(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns),new t.componentOptions.Ctor(n)}function Ce(t){for(var e=t.hook||(t.hook={}),n=0;n<Sa.length;n++){var r=Sa[n],i=e[r],o=Aa[r];i===o||i&&i._merged||(e[r]=i?Ae(o,i):o)}}function Ae(t,e){var n=function(n,r){t(n,r),e(n,r)};return n._merged=!0,n}function Se(t,e){var n=t.model&&t.model.prop||"value",r=t.model&&t.model.event||"input";(e.props||(e.props={}))[n]=e.model.value;var o=e.on||(e.on={}),a=o[r],s=e.model.callback;i(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[r]=[s].concat(a)):o[r]=s}function Pe(t,e,n,r,i,a){return(Array.isArray(n)||s(n))&&(i=r,r=n,n=void 0),o(a)&&(i=ja),je(t,e,n,r,i)}function je(t,e,n,r,o){if(i(n)&&i(n.__ob__))return Qo();if(i(n)&&i(n.is)&&(e=n.is),!e)return Qo();Array.isArray(r)&&"function"==typeof r[0]&&(n=n||{},n.scopedSlots={default:r[0]},r.length=0),o===ja?r=gt(r):o===Pa&&(r=yt(r));var a,s;if("string"==typeof e){var c;s=t.$vnode&&t.$vnode.ns||Co.getTagNamespace(e),a=Co.isReservedTag(e)?new Ko(Co.parsePlatformTagName(e),n,r,void 0,void 0,t):n&&n.pre||!i(c=Q(t.$options,"components",e))?new Ko(e,n,r,void 0,void 0,t):Oe(c,n,t,r,e)}else a=Oe(e,n,t,r);return Array.isArray(a)?a:i(a)?(i(s)&&Le(a,s),i(n)&&Me(n),a):Qo()}function Le(t,e,n){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,n=!0),i(t.children))for(var a=0,s=t.children.length;a<s;a++){var c=t.children[a];i(c.tag)&&(r(c.ns)||o(n)&&"svg"!==c.tag)&&Le(c,e,n)}}function Me(t){c(t.style)&<(t.style),c(t.class)&<(t.class)}function $e(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,r=n&&n.context;t.$slots=jt(e._renderChildren,r),t.$scopedSlots=lo,t._c=function(e,n,r,i){return Pe(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Pe(t,e,n,r,i,!0)};var i=n&&n.data;F(t,"$attrs",i&&i.attrs||lo,null,!0),F(t,"$listeners",e._parentListeners||lo,null,!0)}function Ie(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}function Ne(t){var e=t.options;if(t.super){var n=Ne(t.super);if(n!==t.superOptions){t.superOptions=n;var r=De(t);r&&x(t.extendOptions,r),e=t.options=J(n,t.extendOptions),e.name&&(e.components[e.name]=t)}}return e}function De(t){var e,n=t.options,r=t.sealedOptions;for(var i in n)n[i]!==r[i]&&(e||(e={}),e[i]=n[i]);return e}function Re(t){this._init(t)}function Fe(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=w(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}function Be(t){t.mixin=function(t){return this.options=J(this.options,t),this}}function Ue(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name,a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=J(n.options,t),a.super=n,a.options.props&&He(a),a.options.computed&&Xe(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,Oo.forEach(function(t){a[t]=n[t]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=x({},a.options),i[r]=a,a}}function He(t){var e=t.options.props;for(var n in e)Wt(t.prototype,"_props",n)}function Xe(t){var e=t.options.computed;for(var n in e)te(t.prototype,n,e[n])}function ze(t){Oo.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function Ye(t){return t&&(t.Ctor.options.name||t.tag)}function qe(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!l(t)&&t.test(e)}function Ve(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=Ye(a.componentOptions);s&&!e(s)&&We(n,o,r,i)}}}function We(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,v(n,e)}function Ge(t){for(var e=t.data,n=t,r=t;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Ke(r.data,e));for(;i(n=n.parent);)n&&n.data&&(e=Ke(e,n.data));return Je(e.staticClass,e.class)}function Ke(t,e){return{staticClass:Qe(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Je(t,e){return i(t)||i(e)?Qe(t,Ze(e)):""}function Qe(t,e){return t?e?t+" "+e:t:e||""}function Ze(t){return Array.isArray(t)?tn(t):c(t)?en(t):"string"==typeof t?t:""}function tn(t){for(var e,n="",r=0,o=t.length;r<o;r++)i(e=Ze(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}function en(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}function nn(t){return ns(t)?"svg":"math"===t?"math":void 0}function rn(t){if(!Po)return!0;if(is(t))return!1;if(t=t.toLowerCase(),null!=os[t])return os[t];var e=document.createElement(t);return t.indexOf("-")>-1?os[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:os[t]=/HTMLUnknownElement/.test(e.toString())}function on(t){if("string"==typeof t){return document.querySelector(t)||document.createElement("div")}return t}function an(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function sn(t,e){return document.createElementNS(ts[t],e)}function cn(t){return document.createTextNode(t)}function un(t){return document.createComment(t)}function ln(t,e,n){t.insertBefore(e,n)}function pn(t,e){t.removeChild(e)}function fn(t,e){t.appendChild(e)}function dn(t){return t.parentNode}function hn(t){return t.nextSibling}function vn(t){return t.tagName}function mn(t,e){t.textContent=e}function yn(t,e){t.setAttribute(e,"")}function gn(t,e){var n=t.data.ref;if(i(n)){var r=t.context,o=t.componentInstance||t.elm,a=r.$refs;e?Array.isArray(a[n])?v(a[n],o):a[n]===o&&(a[n]=void 0):t.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}function bn(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&i(t.data)===i(e.data)&&wn(t,e)||o(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&r(e.asyncFactory.error))}function wn(t,e){if("input"!==t.tag)return!0;var n,r=i(n=t.data)&&i(n=n.attrs)&&n.type,o=i(n=e.data)&&i(n=n.attrs)&&n.type;return r===o||as(r)&&as(o)}function xn(t,e,n){var r,o,a={};for(r=e;r<=n;++r)o=t[r].key,i(o)&&(a[o]=r);return a}function _n(t,e){(t.data.directives||e.data.directives)&&kn(t,e)}function kn(t,e){var n,r,i,o=t===us,a=e===us,s=Tn(t.data.directives,t.context),c=Tn(e.data.directives,e.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,En(i,"update",e,t),i.def&&i.def.componentUpdated&&l.push(i)):(En(i,"bind",e,t),i.def&&i.def.inserted&&u.push(i));if(u.length){var p=function(){for(var n=0;n<u.length;n++)En(u[n],"inserted",e,t)};o?ht(e,"insert",p):p()}if(l.length&&ht(e,"postpatch",function(){for(var n=0;n<l.length;n++)En(l[n],"componentUpdated",e,t)}),!o)for(n in s)c[n]||En(s[n],"unbind",t,t,a)}function Tn(t,e){var n=Object.create(null);if(!t)return n;var r,i;for(r=0;r<t.length;r++)i=t[r],i.modifiers||(i.modifiers=fs),n[On(i)]=i,i.def=Q(e.$options,"directives",i.name,!0);return n}function On(t){return t.rawName||t.name+"."+Object.keys(t.modifiers||{}).join(".")}function En(t,e,n,r,i){var o=t.def&&t.def[e];if(o)try{o(n.elm,t,n,r,i)}catch(r){it(r,n.context,"directive "+t.name+" "+e+" hook")}}function Cn(t,e){var n=e.componentOptions;if(!(i(n)&&!1===n.Ctor.options.inheritAttrs||r(t.data.attrs)&&r(e.data.attrs))){var o,a,s=e.elm,c=t.data.attrs||{},u=e.data.attrs||{};i(u.__ob__)&&(u=e.data.attrs=x({},u));for(o in u)a=u[o],c[o]!==a&&An(s,o,a);($o||No)&&u.value!==c.value&&An(s,"value",u.value);for(o in c)r(u[o])&&(Ja(o)?s.removeAttributeNS(Ka,Qa(o)):Wa(o)||s.removeAttribute(o))}}function An(t,e,n){t.tagName.indexOf("-")>-1?Sn(t,e,n):Ga(e)?Za(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Wa(e)?t.setAttribute(e,Za(n)||"false"===n?"false":"true"):Ja(e)?Za(n)?t.removeAttributeNS(Ka,Qa(e)):t.setAttributeNS(Ka,e,n):Sn(t,e,n)}function Sn(t,e,n){if(Za(n))t.removeAttribute(e);else{if($o&&!Io&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)&&"placeholder"===e&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}function Pn(t,e){var n=e.elm,o=e.data,a=t.data;if(!(r(o.staticClass)&&r(o.class)&&(r(a)||r(a.staticClass)&&r(a.class)))){var s=Ge(e),c=n._transitionClasses;i(c)&&(s=Qe(s,Ze(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}function jn(t){function e(){(a||(a=[])).push(t.slice(h,i).trim()),h=i+1}var n,r,i,o,a,s=!1,c=!1,u=!1,l=!1,p=0,f=0,d=0,h=0;for(i=0;i<t.length;i++)if(r=n,n=t.charCodeAt(i),s)39===n&&92!==r&&(s=!1);else if(c)34===n&&92!==r&&(c=!1);else if(u)96===n&&92!==r&&(u=!1);else if(l)47===n&&92!==r&&(l=!1);else if(124!==n||124===t.charCodeAt(i+1)||124===t.charCodeAt(i-1)||p||f||d){switch(n){case 34:c=!0;break;case 39:s=!0;break;case 96:u=!0;break;case 40:d++;break;case 41:d--;break;case 91:f++;break;case 93:f--;break;case 123:p++;break;case 125:p--}if(47===n){for(var v=i-1,m=void 0;v>=0&&" "===(m=t.charAt(v));v--);m&&ms.test(m)||(l=!0)}}else void 0===o?(h=i+1,o=t.slice(0,i).trim()):e();if(void 0===o?o=t.slice(0,i).trim():0!==h&&e(),a)for(i=0;i<a.length;i++)o=Ln(o,a[i]);return o}function Ln(t,e){var n=e.indexOf("(");if(n<0)return'_f("'+e+'")('+t+")";var r=e.slice(0,n),i=e.slice(n+1);return'_f("'+r+'")('+t+(")"!==i?","+i:i)}function Mn(t){console.error("[Vue compiler]: "+t)}function $n(t,e){return t?t.map(function(t){return t[e]}).filter(function(t){return t}):[]}function In(t,e,n){(t.props||(t.props=[])).push({name:e,value:n}),t.plain=!1}function Nn(t,e,n){(t.attrs||(t.attrs=[])).push({name:e,value:n}),t.plain=!1}function Dn(t,e,n){t.attrsMap[e]=n,t.attrsList.push({name:e,value:n})}function Rn(t,e,n,r,i,o){(t.directives||(t.directives=[])).push({name:e,rawName:n,value:r,arg:i,modifiers:o}),t.plain=!1}function Fn(t,e,n,r,i,o){r=r||lo,"click"===e&&(r.right?(e="contextmenu",delete r.right):r.middle&&(e="mouseup")),r.capture&&(delete r.capture,e="!"+e),r.once&&(delete r.once,e="~"+e),r.passive&&(delete r.passive,e="&"+e);var a;r.native?(delete r.native,a=t.nativeEvents||(t.nativeEvents={})):a=t.events||(t.events={});var s={value:n.trim()};r!==lo&&(s.modifiers=r);var c=a[e];Array.isArray(c)?i?c.unshift(s):c.push(s):a[e]=c?i?[s,c]:[c,s]:s,t.plain=!1}function Bn(t,e,n){var r=Un(t,":"+e)||Un(t,"v-bind:"+e);if(null!=r)return jn(r);if(!1!==n){var i=Un(t,e);if(null!=i)return JSON.stringify(i)}}function Un(t,e,n){var r;if(null!=(r=t.attrsMap[e]))for(var i=t.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===e){i.splice(o,1);break}return n&&delete t.attrsMap[e],r}function Hn(t,e,n){var r=n||{},i=r.number,o=r.trim,a="$$v";o&&(a="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(a="_n("+a+")");var s=Xn(e,a);t.model={value:"("+e+")",expression:JSON.stringify(e),callback:"function ($$v) {"+s+"}"}}function Xn(t,e){var n=zn(t);return null===n.key?t+"="+e:"$set("+n.exp+", "+n.key+", "+e+")"}function zn(t){if(t=t.trim(),Na=t.length,t.indexOf("[")<0||t.lastIndexOf("]")<Na-1)return Fa=t.lastIndexOf("."),Fa>-1?{exp:t.slice(0,Fa),key:'"'+t.slice(Fa+1)+'"'}:{exp:t,key:null};for(Da=t,Fa=Ba=Ua=0;!qn();)Ra=Yn(),Vn(Ra)?Gn(Ra):91===Ra&&Wn(Ra);return{exp:t.slice(0,Ba),key:t.slice(Ba+1,Ua)}}function Yn(){return Da.charCodeAt(++Fa)}function qn(){return Fa>=Na}function Vn(t){return 34===t||39===t}function Wn(t){var e=1;for(Ba=Fa;!qn();)if(t=Yn(),Vn(t))Gn(t);else if(91===t&&e++,93===t&&e--,0===e){Ua=Fa;break}}function Gn(t){for(var e=t;!qn()&&(t=Yn())!==e;);}function Kn(t,e,n){Ha=n;var r=e.value,i=e.modifiers,o=t.tag,a=t.attrsMap.type;if(t.component)return Hn(t,r,i),!1;if("select"===o)Zn(t,r,i);else if("input"===o&&"checkbox"===a)Jn(t,r,i);else if("input"===o&&"radio"===a)Qn(t,r,i);else if("input"===o||"textarea"===o)tr(t,r,i);else if(!Co.isReservedTag(o))return Hn(t,r,i),!1;return!0}function Jn(t,e,n){var r=n&&n.number,i=Bn(t,"value")||"null",o=Bn(t,"true-value")||"true",a=Bn(t,"false-value")||"false";In(t,"checked","Array.isArray("+e+")?_i("+e+","+i+")>-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),Fn(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Xn(e,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Xn(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Xn(e,"$$c")+"}",null,!0)}function Qn(t,e,n){var r=n&&n.number,i=Bn(t,"value")||"null";i=r?"_n("+i+")":i,In(t,"checked","_q("+e+","+i+")"),Fn(t,"change",Xn(e,i),null,!0)}function Zn(t,e,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})",o="var $$selectedVal = "+i+";";o=o+" "+Xn(e,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),Fn(t,"change",o,null,!0)}function tr(t,e,n){var r=t.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?ys:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var p=Xn(e,l);c&&(p="if($event.target.composing)return;"+p),In(t,"value","("+e+")"),Fn(t,u,p,null,!0),(s||a)&&Fn(t,"blur","$forceUpdate()")}function er(t){if(i(t[ys])){var e=$o?"change":"input";t[e]=[].concat(t[ys],t[e]||[]),delete t[ys]}i(t[gs])&&(t.change=[].concat(t[gs],t.change||[]),delete t[gs])}function nr(t,e,n){var r=Xa;return function i(){null!==e.apply(null,arguments)&&ir(t,i,n,r)}}function rr(t,e,n,r){e=ct(e),Xa.addEventListener(t,e,Fo?{capture:n,passive:r}:n)}function ir(t,e,n,r){(r||Xa).removeEventListener(t,e._withTask||e,n)}function or(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},i=t.data.on||{};Xa=e.elm,er(n),dt(n,i,rr,ir,nr,e.context),Xa=void 0}}function ar(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,a=e.elm,s=t.data.domProps||{},c=e.data.domProps||{};i(c.__ob__)&&(c=e.data.domProps=x({},c));for(n in s)r(c[n])&&(a[n]="");for(n in c){if(o=c[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n){a._value=o;var u=r(o)?"":String(o);sr(a,u)&&(a.value=u)}else a[n]=o}}}function sr(t,e){return!t.composing&&("OPTION"===t.tagName||cr(t,e)||ur(t,e))}function cr(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}function ur(t,e){var n=t.value,r=t._vModifiers;if(i(r)){if(r.lazy)return!1;if(r.number)return d(n)!==d(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}function lr(t){var e=pr(t.style);return t.staticStyle?x(t.staticStyle,e):e}function pr(t){return Array.isArray(t)?_(t):"string"==typeof t?xs(t):t}function fr(t,e){var n,r={};if(e)for(var i=t;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=lr(i.data))&&x(r,n);(n=lr(t.data))&&x(r,n);for(var o=t;o=o.parent;)o.data&&(n=lr(o.data))&&x(r,n);return r}function dr(t,e){var n=e.data,o=t.data;if(!(r(n.staticStyle)&&r(n.style)&&r(o.staticStyle)&&r(o.style))){var a,s,c=e.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},p=u||l,f=pr(e.data.style)||{};e.data.normalizedStyle=i(f.__ob__)?x({},f):f;var d=fr(e,!0);for(s in p)r(d[s])&&Ts(c,s,"");for(s in d)(a=d[s])!==p[s]&&Ts(c,s,null==a?"":a)}}function hr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(As).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function vr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(As).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function mr(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&x(e,Ss(t.name||"v")),x(e,t),e}return"string"==typeof t?Ss(t):void 0}}function yr(t){Ds(function(){Ds(t)})}function gr(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),hr(t,e))}function br(t,e){t._transitionClasses&&v(t._transitionClasses,e),vr(t,e)}function wr(t,e,n){var r=xr(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===js?$s:Ns,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),t.addEventListener(s,l)}function xr(t,e){var n,r=window.getComputedStyle(t),i=(r[Ms+"Delay"]||"").split(", "),o=(r[Ms+"Duration"]||"").split(", "),a=_r(i,o),s=(r[Is+"Delay"]||"").split(", "),c=(r[Is+"Duration"]||"").split(", "),u=_r(s,c),l=0,p=0;return e===js?a>0&&(n=js,l=a,p=o.length):e===Ls?u>0&&(n=Ls,l=u,p=c.length):(l=Math.max(a,u),n=l>0?a>u?js:Ls:null,p=n?n===js?o.length:c.length:0),{type:n,timeout:l,propCount:p,hasTransform:n===js&&Rs.test(r[Ms+"Property"])}}function _r(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map(function(e,n){return kr(e)+kr(t[n])}))}function kr(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function Tr(t,e){var n=t.elm;i(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var o=mr(t.data.transition);if(!r(o)&&!i(n._enterCb)&&1===n.nodeType){for(var a=o.css,s=o.type,u=o.enterClass,l=o.enterToClass,p=o.enterActiveClass,f=o.appearClass,h=o.appearToClass,v=o.appearActiveClass,m=o.beforeEnter,y=o.enter,g=o.afterEnter,b=o.enterCancelled,w=o.beforeAppear,x=o.appear,_=o.afterAppear,k=o.appearCancelled,T=o.duration,O=ya,C=ya.$vnode;C&&C.parent;)C=C.parent,O=C.context;var A=!O._isMounted||!t.isRootInsert;if(!A||x||""===x){var S=A&&f?f:u,P=A&&v?v:p,j=A&&h?h:l,L=A?w||m:m,M=A&&"function"==typeof x?x:y,$=A?_||g:g,I=A?k||b:b,N=d(c(T)?T.enter:T),D=!1!==a&&!Io,R=Cr(M),F=n._enterCb=E(function(){D&&(br(n,j),br(n,P)),F.cancelled?(D&&br(n,S),I&&I(n)):$&&$(n),n._enterCb=null});t.data.show||ht(t,"insert",function(){var e=n.parentNode,r=e&&e._pending&&e._pending[t.key];r&&r.tag===t.tag&&r.elm._leaveCb&&r.elm._leaveCb(),M&&M(n,F)}),L&&L(n),D&&(gr(n,S),gr(n,P),yr(function(){br(n,S),F.cancelled||(gr(n,j),R||(Er(N)?setTimeout(F,N):wr(n,s,F)))})),t.data.show&&(e&&e(),M&&M(n,F)),D||R||F()}}}function Or(t,e){function n(){k.cancelled||(!t.data.show&&o.parentNode&&((o.parentNode._pending||(o.parentNode._pending={}))[t.key]=t),h&&h(o),w&&(gr(o,l),gr(o,f),yr(function(){br(o,l),k.cancelled||(gr(o,p),x||(Er(_)?setTimeout(k,_):wr(o,u,k)))})),v&&v(o,k),w||x||k())}var o=t.elm;i(o._enterCb)&&(o._enterCb.cancelled=!0,o._enterCb());var a=mr(t.data.transition);if(r(a)||1!==o.nodeType)return e();if(!i(o._leaveCb)){var s=a.css,u=a.type,l=a.leaveClass,p=a.leaveToClass,f=a.leaveActiveClass,h=a.beforeLeave,v=a.leave,m=a.afterLeave,y=a.leaveCancelled,g=a.delayLeave,b=a.duration,w=!1!==s&&!Io,x=Cr(v),_=d(c(b)?b.leave:b),k=o._leaveCb=E(function(){o.parentNode&&o.parentNode._pending&&(o.parentNode._pending[t.key]=null),w&&(br(o,p),br(o,f)),k.cancelled?(w&&br(o,l),y&&y(o)):(e(),m&&m(o)),o._leaveCb=null});g?g(n):n()}}function Er(t){return"number"==typeof t&&!isNaN(t)}function Cr(t){if(r(t))return!1;var e=t.fns;return i(e)?Cr(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function Ar(t,e){!0!==e.data.show&&Tr(e)}function Sr(t,e,n){Pr(t,e,n),($o||No)&&setTimeout(function(){Pr(t,e,n)},0)}function Pr(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=t.options.length;s<c;s++)if(a=t.options[s],i)o=O(r,Lr(a))>-1,a.selected!==o&&(a.selected=o);else if(T(Lr(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function jr(t,e){return e.every(function(e){return!T(e,t)})}function Lr(t){return"_value"in t?t._value:t.value}function Mr(t){t.target.composing=!0}function $r(t){t.target.composing&&(t.target.composing=!1,Ir(t.target,"input"))}function Ir(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Nr(t){return!t.componentInstance||t.data&&t.data.transition?t:Nr(t.componentInstance._vnode)}function Dr(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Dr(Ot(e.children)):t}function Rr(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[yo(o)]=i[o];return e}function Fr(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function Br(t){for(;t=t.parent;)if(t.data.transition)return!0}function Ur(t,e){return e.key===t.key&&e.tag===t.tag}function Hr(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Xr(t){t.data.newPos=t.elm.getBoundingClientRect()}function zr(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function Yr(t,e){var n=e?dc(e):pc;if(n.test(t)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(t);){(i=r.index)>c&&(s.push(o=t.slice(c,i)),a.push(JSON.stringify(o)));var u=jn(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c<t.length&&(s.push(o=t.slice(c)),a.push(JSON.stringify(o))),{expression:a.join("+"),tokens:s}}}function qr(t,e){var n=(e.warn,Un(t,"class"));n&&(t.staticClass=JSON.stringify(n));var r=Bn(t,"class",!1);r&&(t.classBinding=r)}function Vr(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}function Wr(t,e){var n=(e.warn,Un(t,"style"));n&&(t.staticStyle=JSON.stringify(xs(n)));var r=Bn(t,"style",!1);r&&(t.styleBinding=r)}function Gr(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}function Kr(t,e){var n=e?Mc:Lc;return t.replace(n,function(t){return jc[t]})}function Jr(t,e){function n(e){l+=e,t=t.substring(e)}function r(t,n,r){var i,s;if(null==n&&(n=l),null==r&&(r=l),t)for(s=t.toLowerCase(),i=a.length-1;i>=0&&a[i].lowerCasedTag!==s;i--);else i=0;if(i>=0){for(var c=a.length-1;c>=i;c--)e.end&&e.end(a[c].tag,n,r);a.length=i,o=i&&a[i-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,r):"p"===s&&(e.start&&e.start(t,[],!1,n,r),e.end&&e.end(t,n,r))}for(var i,o,a=[],s=e.expectHTML,c=e.isUnaryTag||_o,u=e.canBeLeftOpenTag||_o,l=0;t;){if(i=t,o&&Sc(o)){var p=0,f=o.toLowerCase(),d=Pc[f]||(Pc[f]=new RegExp("([\\s\\S]*?)(</"+f+"[^>]*>)","i")),h=t.replace(d,function(t,n,r){return p=r.length,Sc(f)||"noscript"===f||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),Ic(f,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""});l+=t.length-h.length,t=h,r(f,l-p,l)}else{var v=t.indexOf("<");if(0===v){if(Cc.test(t)){var m=t.indexOf("--\x3e");if(m>=0){e.shouldKeepComment&&e.comment(t.substring(4,m)),n(m+3);continue}}if(Ac.test(t)){var y=t.indexOf("]>");if(y>=0){n(y+2);continue}}var g=t.match(Ec);if(g){n(g[0].length);continue}var b=t.match(Oc);if(b){var w=l;n(b[0].length),r(b[1],w,l);continue}var x=function(){var e=t.match(kc);if(e){var r={tagName:e[1],attrs:[],start:l};n(e[0].length);for(var i,o;!(i=t.match(Tc))&&(o=t.match(wc));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=l,r}}();if(x){!function(t){var n=t.tagName,i=t.unarySlash;s&&("p"===o&&bc(n)&&r(o),u(n)&&o===n&&r(n));for(var l=c(n)||!!i,p=t.attrs.length,f=new Array(p),d=0;d<p;d++){var h=t.attrs[d],v=h[3]||h[4]||h[5]||"",m="a"===n&&"href"===h[1]?e.shouldDecodeNewlinesForHref:e.shouldDecodeNewlines;f[d]={name:h[1],value:Kr(v,m)}}l||(a.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f}),o=n),e.start&&e.start(n,f,l,t.start,t.end)}(x),Ic(x.tagName,t)&&n(1);continue}}var _=void 0,k=void 0,T=void 0;if(v>=0){for(k=t.slice(v);!(Oc.test(k)||kc.test(k)||Cc.test(k)||Ac.test(k)||(T=k.indexOf("<",1))<0);)v+=T,k=t.slice(v);_=t.substring(0,v),n(v)}v<0&&(_=t,t=""),e.chars&&_&&e.chars(_)}if(t===i){e.chars&&e.chars(t);break}}r()}function Qr(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:yi(e),parent:n,children:[]}}function Zr(t,e){function n(t){t.pre&&(s=!1),oc(t.tag)&&(c=!1);for(var n=0;n<ic.length;n++)ic[n](t,e)}tc=e.warn||Mn,oc=e.isPreTag||_o,ac=e.mustUseProp||_o,sc=e.getTagNamespace||_o,nc=$n(e.modules,"transformNode"),rc=$n(e.modules,"preTransformNode"),ic=$n(e.modules,"postTransformNode"),ec=e.delimiters;var r,i,o=[],a=!1!==e.preserveWhitespace,s=!1,c=!1;return Jr(t,{warn:tc,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,start:function(t,a,u){var l=i&&i.ns||sc(t);$o&&"svg"===l&&(a=wi(a));var p=Qr(t,a,i);l&&(p.ns=l),bi(p)&&!Xo()&&(p.forbidden=!0);for(var f=0;f<rc.length;f++)p=rc[f](p,e)||p;if(s||(ti(p),p.pre&&(s=!0)),oc(p.tag)&&(c=!0),s?ei(p):p.processed||(oi(p),si(p),pi(p),ni(p,e)),r?o.length||r.if&&(p.elseif||p.else)&&li(r,{exp:p.elseif,block:p}):r=p,i&&!p.forbidden)if(p.elseif||p.else)ci(p,i);else if(p.slotScope){i.plain=!1;var d=p.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[d]=p}else i.children.push(p),p.parent=i;u?n(p):(i=p,o.push(p))},end:function(){var t=o[o.length-1],e=t.children[t.children.length-1];e&&3===e.type&&" "===e.text&&!c&&t.children.pop(),o.length-=1,i=o[o.length-1],n(t)},chars:function(t){if(i&&(!$o||"textarea"!==i.tag||i.attrsMap.placeholder!==t)){var e=i.children;if(t=c||t.trim()?gi(i)?t:zc(t):a&&e.length?" ":""){var n;!s&&" "!==t&&(n=Yr(t,ec))?e.push({type:2,expression:n.expression,tokens:n.tokens,text:t}):" "===t&&e.length&&" "===e[e.length-1].text||e.push({type:3,text:t})}}},comment:function(t){i.children.push({type:3,text:t,isComment:!0})}}),r}function ti(t){null!=Un(t,"v-pre")&&(t.pre=!0)}function ei(t){var e=t.attrsList.length;if(e)for(var n=t.attrs=new Array(e),r=0;r<e;r++)n[r]={name:t.attrsList[r].name,value:JSON.stringify(t.attrsList[r].value)};else t.pre||(t.plain=!0)}function ni(t,e){ri(t),t.plain=!t.key&&!t.attrsList.length,ii(t),fi(t),di(t);for(var n=0;n<nc.length;n++)t=nc[n](t,e)||t;hi(t)}function ri(t){var e=Bn(t,"key");e&&(t.key=e)}function ii(t){var e=Bn(t,"ref");e&&(t.ref=e,t.refInFor=vi(t))}function oi(t){var e;if(e=Un(t,"v-for")){var n=ai(e);n&&x(t,n)}}function ai(t){var e=t.match(Rc);if(e){var n={};n.for=e[2].trim();var r=e[1].trim().replace(Bc,""),i=r.match(Fc);return i?(n.alias=r.replace(Fc,"").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r,n}}function si(t){var e=Un(t,"v-if");if(e)t.if=e,li(t,{exp:e,block:t});else{null!=Un(t,"v-else")&&(t.else=!0);var n=Un(t,"v-else-if");n&&(t.elseif=n)}}function ci(t,e){var n=ui(e.children);n&&n.if&&li(n,{exp:t.elseif,block:t})}function ui(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];t.pop()}}function li(t,e){t.ifConditions||(t.ifConditions=[]),t.ifConditions.push(e)}function pi(t){null!=Un(t,"v-once")&&(t.once=!0)}function fi(t){if("slot"===t.tag)t.slotName=Bn(t,"name");else{var e;"template"===t.tag?(e=Un(t,"scope"),t.slotScope=e||Un(t,"slot-scope")):(e=Un(t,"slot-scope"))&&(t.slotScope=e);var n=Bn(t,"slot");n&&(t.slotTarget='""'===n?'"default"':n,"template"===t.tag||t.slotScope||Nn(t,"slot",n))}}function di(t){var e;(e=Bn(t,"is"))&&(t.component=e),null!=Un(t,"inline-template")&&(t.inlineTemplate=!0)}function hi(t){var e,n,r,i,o,a,s,c=t.attrsList;for(e=0,n=c.length;e<n;e++)if(r=i=c[e].name,o=c[e].value,Dc.test(r))if(t.hasBindings=!0,a=mi(r),a&&(r=r.replace(Xc,"")),Hc.test(r))r=r.replace(Hc,""),o=jn(o),s=!1,a&&(a.prop&&(s=!0,"innerHtml"===(r=yo(r))&&(r="innerHTML")),a.camel&&(r=yo(r)),a.sync&&Fn(t,"update:"+yo(r),Xn(o,"$event"))),s||!t.component&&ac(t.tag,t.attrsMap.type,r)?In(t,r,o):Nn(t,r,o);else if(Nc.test(r))r=r.replace(Nc,""),Fn(t,r,o,a,!1,tc);else{r=r.replace(Dc,"");var u=r.match(Uc),l=u&&u[1];l&&(r=r.slice(0,-(l.length+1))),Rn(t,r,i,o,l,a)}else Nn(t,r,JSON.stringify(o)),!t.component&&"muted"===r&&ac(t.tag,t.attrsMap.type,r)&&In(t,r,"true")}function vi(t){for(var e=t;e;){if(void 0!==e.for)return!0;e=e.parent}return!1}function mi(t){var e=t.match(Xc);if(e){var n={};return e.forEach(function(t){n[t.slice(1)]=!0}),n}}function yi(t){for(var e={},n=0,r=t.length;n<r;n++)e[t[n].name]=t[n].value;return e}function gi(t){return"script"===t.tag||"style"===t.tag}function bi(t){return"style"===t.tag||"script"===t.tag&&(!t.attrsMap.type||"text/javascript"===t.attrsMap.type)}function wi(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];Yc.test(r.name)||(r.name=r.name.replace(qc,""),e.push(r))}return e}function xi(t,e){if("input"===t.tag){var n=t.attrsMap;if(!n["v-model"])return;var r;if((n[":type"]||n["v-bind:type"])&&(r=Bn(t,"type")),n.type||r||!n["v-bind"]||(r="("+n["v-bind"]+").type"),r){var i=Un(t,"v-if",!0),o=i?"&&("+i+")":"",a=null!=Un(t,"v-else",!0),s=Un(t,"v-else-if",!0),c=_i(t);oi(c),Dn(c,"type","checkbox"),ni(c,e),c.processed=!0,c.if="("+r+")==='checkbox'"+o,li(c,{exp:c.if,block:c});var u=_i(t);Un(u,"v-for",!0),Dn(u,"type","radio"),ni(u,e),li(c,{exp:"("+r+")==='radio'"+o,block:u});var l=_i(t);return Un(l,"v-for",!0),Dn(l,":type",r),ni(l,e),li(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}function _i(t){return Qr(t.tag,t.attrsList.slice(),t.parent)}function ki(t,e){e.value&&In(t,"textContent","_s("+e.value+")")}function Ti(t,e){e.value&&In(t,"innerHTML","_s("+e.value+")")}function Oi(t,e){t&&(cc=Jc(e.staticKeys||""),uc=e.isReservedTag||_o,Ci(t),Ai(t,!1))}function Ei(t){return h("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(t?","+t:""))}function Ci(t){if(t.static=Si(t),1===t.type){if(!uc(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var e=0,n=t.children.length;e<n;e++){var r=t.children[e];Ci(r),r.static||(t.static=!1)}if(t.ifConditions)for(var i=1,o=t.ifConditions.length;i<o;i++){var a=t.ifConditions[i].block;Ci(a),a.static||(t.static=!1)}}}function Ai(t,e){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=e),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var n=0,r=t.children.length;n<r;n++)Ai(t.children[n],e||!!t.for);if(t.ifConditions)for(var i=1,o=t.ifConditions.length;i<o;i++)Ai(t.ifConditions[i].block,e)}}function Si(t){return 2!==t.type&&(3===t.type||!(!t.pre&&(t.hasBindings||t.if||t.for||fo(t.tag)||!uc(t.tag)||Pi(t)||!Object.keys(t).every(cc))))}function Pi(t){for(;t.parent;){if(t=t.parent,"template"!==t.tag)return!1;if(t.for)return!0}return!1}function ji(t,e){var n=e?"nativeOn:{":"on:{";for(var r in t)n+='"'+r+'":'+Li(r,t[r])+",";return n.slice(0,-1)+"}"}function Li(t,e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Li(t,e)}).join(",")+"]";var n=Zc.test(e.value),r=Qc.test(e.value);if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(ru[s])o+=ru[s],tu[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=nu(["ctrl","shift","alt","meta"].filter(function(t){return!c[t]}).map(function(t){return"$event."+t+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=Mi(a)),o&&(i+=o),"function($event){"+i+(n?"return "+e.value+"($event)":r?"return ("+e.value+")($event)":e.value)+"}"}return n||r?e.value:"function($event){"+e.value+"}"}function Mi(t){return"if(!('button' in $event)&&"+t.map($i).join("&&")+")return null;"}function $i(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var n=tu[t],r=eu[t];return"_k($event.keyCode,"+JSON.stringify(t)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}function Ii(t,e){t.wrapListeners=function(t){return"_g("+t+","+e.value+")"}}function Ni(t,e){t.wrapData=function(n){return"_b("+n+",'"+t.tag+"',"+e.value+","+(e.modifiers&&e.modifiers.prop?"true":"false")+(e.modifiers&&e.modifiers.sync?",true":"")+")"}}function Di(t,e){var n=new ou(e);return{render:"with(this){return "+(t?Ri(t,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ri(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return Fi(t,e);if(t.once&&!t.onceProcessed)return Bi(t,e);if(t.for&&!t.forProcessed)return Xi(t,e);if(t.if&&!t.ifProcessed)return Ui(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return no(t,e);var n;if(t.component)n=ro(t.component,t,e);else{var r;(!t.plain||t.pre&&e.maybeComponent(t))&&(r=zi(t,e));var i=t.inlineTemplate?null:Ki(t,e,!0);n="_c('"+t.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<e.transforms.length;o++)n=e.transforms[o](t,n);return n}return Ki(t,e)||"void 0"}function Fi(t,e){t.staticProcessed=!0;var n=e.pre;return t.pre&&(e.pre=t.pre),e.staticRenderFns.push("with(this){return "+Ri(t,e)+"}"),e.pre=n,"_m("+(e.staticRenderFns.length-1)+(t.staticInFor?",true":"")+")"}function Bi(t,e){if(t.onceProcessed=!0,t.if&&!t.ifProcessed)return Ui(t,e);if(t.staticInFor){for(var n="",r=t.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+Ri(t,e)+","+e.onceId+++","+n+")":Ri(t,e)}return Fi(t,e)}function Ui(t,e,n,r){return t.ifProcessed=!0,Hi(t.ifConditions.slice(),e,n,r)}function Hi(t,e,n,r){function i(t){return n?n(t,e):t.once?Bi(t,e):Ri(t,e)}if(!t.length)return r||"_e()";var o=t.shift();return o.exp?"("+o.exp+")?"+i(o.block)+":"+Hi(t,e,n,r):""+i(o.block)}function Xi(t,e,n,r){var i=t.for,o=t.alias,a=t.iterator1?","+t.iterator1:"",s=t.iterator2?","+t.iterator2:"";return t.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||Ri)(t,e)+"})"}function zi(t,e){var n="{",r=Yi(t,e);r&&(n+=r+","),t.key&&(n+="key:"+t.key+","),t.ref&&(n+="ref:"+t.ref+","),t.refInFor&&(n+="refInFor:true,"),t.pre&&(n+="pre:true,"),t.component&&(n+='tag:"'+t.tag+'",');for(var i=0;i<e.dataGenFns.length;i++)n+=e.dataGenFns[i](t);if(t.attrs&&(n+="attrs:{"+io(t.attrs)+"},"),t.props&&(n+="domProps:{"+io(t.props)+"},"),t.events&&(n+=ji(t.events,!1)+","),t.nativeEvents&&(n+=ji(t.nativeEvents,!0)+","),t.slotTarget&&!t.slotScope&&(n+="slot:"+t.slotTarget+","),t.scopedSlots&&(n+=Vi(t.scopedSlots,e)+","),t.model&&(n+="model:{value:"+t.model.value+",callback:"+t.model.callback+",expression:"+t.model.expression+"},"),t.inlineTemplate){var o=qi(t,e);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",t.wrapData&&(n=t.wrapData(n)),t.wrapListeners&&(n=t.wrapListeners(n)),n}function Yi(t,e){var n=t.directives;if(n){var r,i,o,a,s="directives:[",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=e.directives[o.name];u&&(a=!!u(t,o,e.warn)),a&&(c=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?',arg:"'+o.arg+'"':"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}return c?s.slice(0,-1)+"]":void 0}}function qi(t,e){var n=t.children[0];if(1===n.type){var r=Di(n,e.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(t){return"function(){"+t+"}"}).join(",")+"]}"}}function Vi(t,e){return"scopedSlots:_u(["+Object.keys(t).map(function(n){return Wi(n,t[n],e)}).join(",")+"])"}function Wi(t,e,n){return e.for&&!e.forProcessed?Gi(t,e,n):"{key:"+t+",fn:function("+String(e.slotScope)+"){return "+("template"===e.tag?e.if?"("+e.if+")?"+(Ki(e,n)||"undefined")+":undefined":Ki(e,n)||"undefined":Ri(e,n))+"}}"}function Gi(t,e,n){var r=e.for,i=e.alias,o=e.iterator1?","+e.iterator1:"",a=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,"_l(("+r+"),function("+i+o+a+"){return "+Wi(t,e,n)+"})"}function Ki(t,e,n,r,i){var o=t.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?e.maybeComponent(a)?",1":",0":"";return""+(r||Ri)(a,e)+s}var c=n?Ji(o,e.maybeComponent):0,u=i||Zi;return"["+o.map(function(t){return u(t,e)}).join(",")+"]"+(c?","+c:"")}}function Ji(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(1===i.type){if(Qi(i)||i.ifConditions&&i.ifConditions.some(function(t){return Qi(t.block)})){n=2;break}(e(i)||i.ifConditions&&i.ifConditions.some(function(t){return e(t.block)}))&&(n=1)}}return n}function Qi(t){return void 0!==t.for||"template"===t.tag||"slot"===t.tag}function Zi(t,e){return 1===t.type?Ri(t,e):3===t.type&&t.isComment?eo(t):to(t)}function to(t){return"_v("+(2===t.type?t.expression:oo(JSON.stringify(t.text)))+")"}function eo(t){return"_e("+JSON.stringify(t.text)+")"}function no(t,e){var n=t.slotName||'"default"',r=Ki(t,e),i="_t("+n+(r?","+r:""),o=t.attrs&&"{"+t.attrs.map(function(t){return yo(t.name)+":"+t.value}).join(",")+"}",a=t.attrsMap["v-bind"];return!o&&!a||r||(i+=",null"),o&&(i+=","+o),a&&(i+=(o?"":",null")+","+a),i+")"}function ro(t,e,n){var r=e.inlineTemplate?null:Ki(e,n,!0);return"_c("+t+","+zi(e,n)+(r?","+r:"")+")"}function io(t){for(var e="",n=0;n<t.length;n++){var r=t[n];e+='"'+r.name+'":'+oo(r.value)+","}return e.slice(0,-1)}function oo(t){return t.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function ao(t,e){try{return new Function(t)}catch(n){return e.push({err:n,code:t}),k}}function so(t){var e=Object.create(null);return function(n,r,i){r=x({},r),r.warn,delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(e[o])return e[o];var a=t(n,r),s={},c=[];return s.render=ao(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(t){return ao(t,c)}),e[o]=s}}function co(t){return lc=lc||document.createElement("div"),lc.innerHTML=t?'<a href="\n"/>':'<div a="\n"/>',lc.innerHTML.indexOf(" ")>0}function uo(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}/*!
|
2 |
* Vue.js v2.5.22
|
3 |
* (c) 2014-2019 Evan You
|
4 |
* Released under the MIT License.
|
5 |
*/
|
6 |
-
var lo=Object.freeze({}),po=Object.prototype.toString,fo=h("slot,component",!0),ho=h("key,ref,slot,slot-scope,is"),vo=Object.prototype.hasOwnProperty,mo=/-(\w)/g,yo=y(function(t){return t.replace(mo,function(t,e){return e?e.toUpperCase():""})}),go=y(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),bo=/\B([A-Z])/g,wo=y(function(t){return t.replace(bo,"-$1").toLowerCase()}),xo=Function.prototype.bind?b:g,_o=function(t,e,n){return!1},ko=function(t){return t},To="data-server-rendered",Oo=["component","directive","filter"],Eo=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],Co={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:_o,isReservedAttr:_o,isUnknownElement:_o,getTagNamespace:k,parsePlatformTagName:ko,mustUseProp:_o,async:!0,_lifecycleHooks:Eo},Ao=/[^\w.$]/,So="__proto__"in{},Po="undefined"!=typeof window,jo="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,Lo=jo&&WXEnvironment.platform.toLowerCase(),Mo=Po&&window.navigator.userAgent.toLowerCase(),$o=Mo&&/msie|trident/.test(Mo),Io=Mo&&Mo.indexOf("msie 9.0")>0,No=Mo&&Mo.indexOf("edge/")>0,Do=(Mo&&Mo.indexOf("android"),Mo&&/iphone|ipad|ipod|ios/.test(Mo)||"ios"===Lo),Ro=(Mo&&/chrome\/\d+/.test(Mo),{}.watch),Fo=!1;if(Po)try{var Bo={};Object.defineProperty(Bo,"passive",{get:function(){Fo=!0}}),window.addEventListener("test-passive",null,Bo)}catch(t){}var Uo,Ho,Xo=function(){return void 0===Uo&&(Uo=!Po&&!jo&&void 0!==t&&t.process&&"server"===t.process.env.VUE_ENV),Uo},zo=Po&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Yo="undefined"!=typeof Symbol&&P(Symbol)&&"undefined"!=typeof Reflect&&P(Reflect.ownKeys);Ho="undefined"!=typeof Set&&P(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var qo=k,Vo=0,Wo=function(){this.id=Vo++,this.subs=[]};Wo.prototype.addSub=function(t){this.subs.push(t)},Wo.prototype.removeSub=function(t){v(this.subs,t)},Wo.prototype.depend=function(){Wo.target&&Wo.target.addDep(this)},Wo.prototype.notify=function(){for(var t=this.subs.slice(),e=0,n=t.length;e<n;e++)t[e].update()},Wo.target=null;var Go=[],Ko=function(t,e,n,r,i,o,a,s){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},Jo={child:{configurable:!0}};Jo.child.get=function(){return this.componentInstance},Object.defineProperties(Ko.prototype,Jo);var Qo=function(t){void 0===t&&(t="");var e=new Ko;return e.text=t,e.isComment=!0,e},Zo=Array.prototype,ta=Object.create(Zo);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(t){var e=Zo[t];A(ta,t,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=e.apply(this,n),a=this.__ob__;switch(t){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var ea=Object.getOwnPropertyNames(ta),na=!0,ra=function(t){this.value=t,this.dep=new Wo,this.vmCount=0,A(t,"__ob__",this),Array.isArray(t)?(So?N(t,ta):D(t,ta,ea),this.observeArray(t)):this.walk(t)};ra.prototype.walk=function(t){for(var e=Object.keys(t),n=0;n<e.length;n++)F(t,e[n])},ra.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)R(t[e])};var ia=Co.optionMergeStrategies;ia.data=function(t,e,n){return n?z(t,e,n):e&&"function"!=typeof e?t:z(t,e)},Eo.forEach(function(t){ia[t]=Y}),Oo.forEach(function(t){ia[t+"s"]=V}),ia.watch=function(t,e,n,r){if(t===Ro&&(t=void 0),e===Ro&&(e=void 0),!e)return Object.create(t||null);if(!t)return e;var i={};x(i,t);for(var o in e){var a=i[o],s=e[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},ia.props=ia.methods=ia.inject=ia.computed=function(t,e,n,r){if(!t)return e;var i=Object.create(null);return x(i,t),e&&x(i,e),i},ia.provide=z;var oa,aa,sa=function(t,e){return void 0===e?t:e},ca=[],ua=!1,la=!1;if(void 0!==n&&P(n))aa=function(){n(st)};else if("undefined"==typeof MessageChannel||!P(MessageChannel)&&"[object MessageChannelConstructor]"!==MessageChannel.toString())aa=function(){setTimeout(st,0)};else{var pa=new MessageChannel,fa=pa.port2;pa.port1.onmessage=st,aa=function(){fa.postMessage(1)}}if("undefined"!=typeof Promise&&P(Promise)){var da=Promise.resolve();oa=function(){da.then(st),Do&&setTimeout(k)}}else oa=aa;var ha,va=new Ho,ma=y(function(t){var e="&"===t.charAt(0);t=e?t.slice(1):t;var n="~"===t.charAt(0);t=n?t.slice(1):t;var r="!"===t.charAt(0);return t=r?t.slice(1):t,{name:t,once:n,capture:r,passive:e}}),ya=null,ga=[],ba=[],wa={},xa=!1,_a=!1,ka=0,Ta=0,Oa=function(t,e,n,r,i){this.vm=t,i&&(t._watcher=this),t._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Ta,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new Ho,this.newDepIds=new Ho,this.expression="","function"==typeof e?this.getter=e:(this.getter=S(e),this.getter||(this.getter=k)),this.value=this.lazy?void 0:this.get()};Oa.prototype.get=function(){j(this);var t,e=this.vm;try{t=this.getter.call(e,e)}catch(t){if(!this.user)throw t;it(t,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&<(t),L(),this.cleanupDeps()}return t},Oa.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},Oa.prototype.cleanupDeps=function(){for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},Oa.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Vt(this)},Oa.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||c(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){it(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},Oa.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Oa.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},Oa.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var Ea={enumerable:!0,configurable:!0,get:k,set:k},Ca={lazy:!0};we(xe.prototype);var Aa={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;Aa.prepatch(n,n)}else(t.componentInstance=Ee(t,ya)).$mount(e?t.elm:void 0,e)},prepatch:function(t,e){var n=e.componentOptions;Dt(e.componentInstance=t.componentInstance,n.propsData,n.listeners,e,n.children)},insert:function(t){var e=t.context,n=t.componentInstance;n._isMounted||(n._isMounted=!0,Ut(n,"mounted")),t.data.keepAlive&&(e._isMounted?Yt(n):Ft(n,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?Bt(e,!0):e.$destroy())}},Sa=Object.keys(Aa),Pa=1,ja=2,La=0;!function(t){t.prototype._init=function(t){var e=this;e._uid=La++,e._isVue=!0,t&&t._isComponent?Ie(e,t):e.$options=J(Ne(e.constructor),t||{},e),e._renderProxy=e,e._self=e,It(e),Et(e),$e(e),Ut(e,"beforeCreate"),se(e),Gt(e),ae(e),Ut(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(Re),function(t){var e={};e.get=function(){return this._data};var n={};n.get=function(){return this._props},Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=B,t.prototype.$delete=U,t.prototype.$watch=function(t,e,n){var r=this;if(u(e))return oe(r,t,e,n);n=n||{},n.user=!0;var i=new Oa(r,t,e,n);if(n.immediate)try{e.call(r,i.value)}catch(t){it(t,r,'callback for immediate watcher "'+i.expression+'"')}return function(){i.teardown()}}}(Re),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(Array.isArray(t))for(var i=0,o=t.length;i<o;i++)r.$on(t[i],n);else(r._events[t]||(r._events[t]=[])).push(n),e.test(t)&&(r._hasHookEvent=!0);return r},t.prototype.$once=function(t,e){function n(){r.$off(t,n),e.apply(r,arguments)}var r=this;return n.fn=e,r.$on(t,n),r},t.prototype.$off=function(t,e){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(t)){for(var r=0,i=t.length;r<i;r++)n.$off(t[r],e);return n}var o=n._events[t];if(!o)return n;if(!e)return n._events[t]=null,n;for(var a,s=o.length;s--;)if((a=o[s])===e||a.fn===e){o.splice(s,1);break}return n},t.prototype.$emit=function(t){var e=this,n=e._events[t];if(n){n=n.length>1?w(n):n;for(var r=w(arguments,1),i=0,o=n.length;i<o;i++)try{n[i].apply(e,r)}catch(n){it(n,e,'event handler for "'+t+'"')}}return e}}(Re),function(t){t.prototype._update=function(t,e){var n=this,r=n.$el,i=n._vnode,o=$t(n);n._vnode=t,n.$el=i?n.__patch__(i,t):n.__patch__(n.$el,t,e,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},t.prototype.$forceUpdate=function(){var t=this;t._watcher&&t._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){Ut(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||v(e.$children,t),t._watcher&&t._watcher.teardown();for(var n=t._watchers.length;n--;)t._watchers[n].teardown();t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),Ut(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}(Re),function(t){we(t.prototype),t.prototype.$nextTick=function(t){return ut(t,this)},t.prototype._render=function(){var t=this,e=t.$options,n=e.render,r=e._parentVnode;r&&(t.$scopedSlots=r.data.scopedSlots||lo),t.$vnode=r;var i;try{i=n.call(t._renderProxy,t.$createElement)}catch(e){it(e,t,"render"),i=t._vnode}return i instanceof Ko||(i=Qo()),i.parent=r,i}}(Re);var Ma=[String,RegExp,Array],$a={name:"keep-alive",abstract:!0,props:{include:Ma,exclude:Ma,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)We(this.cache,t,this.keys)},mounted:function(){var t=this;this.$watch("include",function(e){Ve(t,function(t){return qe(e,t)})}),this.$watch("exclude",function(e){Ve(t,function(t){return!qe(e,t)})})},render:function(){var t=this.$slots.default,e=Ot(t),n=e&&e.componentOptions;if(n){var r=Ye(n),i=this,o=i.include,a=i.exclude;if(o&&(!r||!qe(o,r))||a&&r&&qe(a,r))return e;var s=this,c=s.cache,u=s.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;c[l]?(e.componentInstance=c[l].componentInstance,v(u,l),u.push(l)):(c[l]=e,u.push(l),this.max&&u.length>parseInt(this.max)&&We(c,u[0],u,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}},Ia={KeepAlive:$a};!function(t){var e={};e.get=function(){return Co},Object.defineProperty(t,"config",e),t.util={warn:qo,extend:x,mergeOptions:J,defineReactive:F},t.set=B,t.delete=U,t.nextTick=ut,t.options=Object.create(null),Oo.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,x(t.options.components,Ia),Fe(t),Be(t),Ue(t),ze(t)}(Re),Object.defineProperty(Re.prototype,"$isServer",{get:Xo}),Object.defineProperty(Re.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Re,"FunctionalRenderContext",{value:xe}),Re.version="2.5.22";var Na,Da,Ra,Fa,Ba,Ua,Ha,Xa,za,Ya=h("style,class"),qa=h("input,textarea,option,select,progress"),Va=function(t,e,n){return"value"===n&&qa(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Wa=h("contenteditable,draggable,spellcheck"),Ga=h("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Ka="http://www.w3.org/1999/xlink",Ja=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Qa=function(t){return Ja(t)?t.slice(6,t.length):""},Za=function(t){return null==t||!1===t},ts={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},es=h("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),ns=h("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),rs=function(t){return"pre"===t},is=function(t){return es(t)||ns(t)},os=Object.create(null),as=h("text,number,password,search,email,tel,url"),ss=Object.freeze({createElement:an,createElementNS:sn,createTextNode:cn,createComment:un,insertBefore:ln,removeChild:pn,appendChild:fn,parentNode:dn,nextSibling:hn,tagName:vn,setTextContent:mn,setStyleScope:yn}),cs={create:function(t,e){gn(e)},update:function(t,e){t.data.ref!==e.data.ref&&(gn(t,!0),gn(e))},destroy:function(t){gn(t,!0)}},us=new Ko("",{},[]),ls=["create","activate","update","remove","destroy"],ps={create:_n,update:_n,destroy:function(t){_n(t,us)}},fs=Object.create(null),ds=[cs,ps],hs={create:Cn,update:Cn},vs={create:Pn,update:Pn},ms=/[\w).+\-_$\]]/,ys="__r",gs="__c",bs={create:or,update:or},ws={create:ar,update:ar},xs=y(function(t){var e={},n=/;(?![^(]*\))/g,r=/:(.+)/;return t.split(n).forEach(function(t){if(t){var n=t.split(r);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}),_s=/^--/,ks=/\s*!important$/,Ts=function(t,e,n){if(_s.test(e))t.style.setProperty(e,n);else if(ks.test(n))t.style.setProperty(e,n.replace(ks,""),"important");else{var r=Es(e);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)t.style[r]=n[i];else t.style[r]=n}},Os=["Webkit","Moz","ms"],Es=y(function(t){if(za=za||document.createElement("div").style,"filter"!==(t=yo(t))&&t in za)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<Os.length;n++){var r=Os[n]+e;if(r in za)return r}}),Cs={create:dr,update:dr},As=/\s+/,Ss=y(function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}}),Ps=Po&&!Io,js="transition",Ls="animation",Ms="transition",$s="transitionend",Is="animation",Ns="animationend";Ps&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ms="WebkitTransition",$s="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Is="WebkitAnimation",Ns="webkitAnimationEnd"));var Ds=Po?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()},Rs=/\b(transform|all)(,|$)/,Fs=Po?{create:Ar,activate:Ar,remove:function(t,e){!0!==t.data.show?Or(t,e):e()}}:{},Bs=[hs,vs,bs,ws,Cs,Fs],Us=Bs.concat(ds),Hs=function(t){function e(t){return new Ko(j.tagName(t).toLowerCase(),{},[],void 0,t)}function n(t,e){function n(){0==--n.listeners&&a(t)}return n.listeners=e,n}function a(t){var e=j.parentNode(t);i(e)&&j.removeChild(e,t)}function c(t,e,n,r,a,s,c){if(i(t.elm)&&i(s)&&(t=s[c]=$(t)),t.isRootInsert=!a,!u(t,e,n,r)){var l=t.data,p=t.children,h=t.tag;i(h)?(t.elm=t.ns?j.createElementNS(t.ns,h):j.createElement(h,t),y(t),d(t,p,e),i(l)&&m(t,e),f(n,t.elm,r)):o(t.isComment)?(t.elm=j.createComment(t.text),f(n,t.elm,r)):(t.elm=j.createTextNode(t.text),f(n,t.elm,r))}}function u(t,e,n,r){var a=t.data;if(i(a)){var s=i(t.componentInstance)&&a.keepAlive;if(i(a=a.hook)&&i(a=a.init)&&a(t,!1),i(t.componentInstance))return l(t,e),f(n,t.elm,r),o(s)&&p(t,e,n,r),!0}}function l(t,e){i(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,v(t)?(m(t,e),y(t)):(gn(t),e.push(t))}function p(t,e,n,r){for(var o,a=t;a.componentInstance;)if(a=a.componentInstance._vnode,i(o=a.data)&&i(o=o.transition)){for(o=0;o<S.activate.length;++o)S.activate[o](us,a);e.push(a);break}f(n,t.elm,r)}function f(t,e,n){i(t)&&(i(n)?j.parentNode(n)===t&&j.insertBefore(t,e,n):j.appendChild(t,e))}function d(t,e,n){if(Array.isArray(e))for(var r=0;r<e.length;++r)c(e[r],n,t.elm,null,!0,e,r);else s(t.text)&&j.appendChild(t.elm,j.createTextNode(String(t.text)))}function v(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return i(t.tag)}function m(t,e){for(var n=0;n<S.create.length;++n)S.create[n](us,t);C=t.data.hook,i(C)&&(i(C.create)&&C.create(us,t),i(C.insert)&&e.push(t))}function y(t){var e;if(i(e=t.fnScopeId))j.setStyleScope(t.elm,e);else for(var n=t;n;)i(e=n.context)&&i(e=e.$options._scopeId)&&j.setStyleScope(t.elm,e),n=n.parent;i(e=ya)&&e!==t.context&&e!==t.fnContext&&i(e=e.$options._scopeId)&&j.setStyleScope(t.elm,e)}function g(t,e,n,r,i,o){for(;r<=i;++r)c(n[r],o,t,e,!1,n,r)}function b(t){var e,n,r=t.data;if(i(r))for(i(e=r.hook)&&i(e=e.destroy)&&e(t),e=0;e<S.destroy.length;++e)S.destroy[e](t);if(i(e=t.children))for(n=0;n<t.children.length;++n)b(t.children[n])}function w(t,e,n,r){for(;n<=r;++n){var o=e[n];i(o)&&(i(o.tag)?(x(o),b(o)):a(o.elm))}}function x(t,e){if(i(e)||i(t.data)){var r,o=S.remove.length+1;for(i(e)?e.listeners+=o:e=n(t.elm,o),i(r=t.componentInstance)&&i(r=r._vnode)&&i(r.data)&&x(r,e),r=0;r<S.remove.length;++r)S.remove[r](t,e);i(r=t.data.hook)&&i(r=r.remove)?r(t,e):e()}else a(t.elm)}function _(t,e,n,o,a){for(var s,u,l,p,f=0,d=0,h=e.length-1,v=e[0],m=e[h],y=n.length-1,b=n[0],x=n[y],_=!a;f<=h&&d<=y;)r(v)?v=e[++f]:r(m)?m=e[--h]:bn(v,b)?(T(v,b,o,n,d),v=e[++f],b=n[++d]):bn(m,x)?(T(m,x,o,n,y),m=e[--h],x=n[--y]):bn(v,x)?(T(v,x,o,n,y),_&&j.insertBefore(t,v.elm,j.nextSibling(m.elm)),v=e[++f],x=n[--y]):bn(m,b)?(T(m,b,o,n,d),_&&j.insertBefore(t,m.elm,v.elm),m=e[--h],b=n[++d]):(r(s)&&(s=xn(e,f,h)),u=i(b.key)?s[b.key]:k(b,e,f,h),r(u)?c(b,o,t,v.elm,!1,n,d):(l=e[u],bn(l,b)?(T(l,b,o,n,d),e[u]=void 0,_&&j.insertBefore(t,l.elm,v.elm)):c(b,o,t,v.elm,!1,n,d)),b=n[++d]);f>h?(p=r(n[y+1])?null:n[y+1].elm,g(t,p,n,d,y,o)):d>y&&w(t,e,f,h)}function k(t,e,n,r){for(var o=n;o<r;o++){var a=e[o];if(i(a)&&bn(t,a))return o}}function T(t,e,n,a,s,c){if(t!==e){i(e.elm)&&i(a)&&(e=a[s]=$(e));var u=e.elm=t.elm;if(o(t.isAsyncPlaceholder))return void(i(e.asyncFactory.resolved)?E(t.elm,e,n):e.isAsyncPlaceholder=!0);if(o(e.isStatic)&&o(t.isStatic)&&e.key===t.key&&(o(e.isCloned)||o(e.isOnce)))return void(e.componentInstance=t.componentInstance);var l,p=e.data;i(p)&&i(l=p.hook)&&i(l=l.prepatch)&&l(t,e);var f=t.children,d=e.children;if(i(p)&&v(e)){for(l=0;l<S.update.length;++l)S.update[l](t,e);i(l=p.hook)&&i(l=l.update)&&l(t,e)}r(e.text)?i(f)&&i(d)?f!==d&&_(u,f,d,n,c):i(d)?(i(t.text)&&j.setTextContent(u,""),g(u,null,d,0,d.length-1,n)):i(f)?w(u,f,0,f.length-1):i(t.text)&&j.setTextContent(u,""):t.text!==e.text&&j.setTextContent(u,e.text),i(p)&&i(l=p.hook)&&i(l=l.postpatch)&&l(t,e)}}function O(t,e,n){if(o(n)&&i(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r<e.length;++r)e[r].data.hook.insert(e[r])}function E(t,e,n,r){var a,s=e.tag,c=e.data,u=e.children;if(r=r||c&&c.pre,e.elm=t,o(e.isComment)&&i(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if(i(c)&&(i(a=c.hook)&&i(a=a.init)&&a(e,!0),i(a=e.componentInstance)))return l(e,n),!0;if(i(s)){if(i(u))if(t.hasChildNodes())if(i(a=c)&&i(a=a.domProps)&&i(a=a.innerHTML)){if(a!==t.innerHTML)return!1}else{for(var p=!0,f=t.firstChild,h=0;h<u.length;h++){if(!f||!E(f,u[h],n,r)){p=!1;break}f=f.nextSibling}if(!p||f)return!1}else d(e,u,n);if(i(c)){var v=!1;for(var y in c)if(!L(y)){v=!0,m(e,n);break}!v&&c.class&<(c.class)}}else t.data!==e.text&&(t.data=e.text);return!0}var C,A,S={},P=t.modules,j=t.nodeOps;for(C=0;C<ls.length;++C)for(S[ls[C]]=[],A=0;A<P.length;++A)i(P[A][ls[C]])&&S[ls[C]].push(P[A][ls[C]]);var L=h("attrs,class,staticClass,staticStyle,key");return function(t,n,a,s){if(r(n))return void(i(t)&&b(t));var u=!1,l=[];if(r(t))u=!0,c(n,l);else{var p=i(t.nodeType);if(!p&&bn(t,n))T(t,n,l,null,null,s);else{if(p){if(1===t.nodeType&&t.hasAttribute(To)&&(t.removeAttribute(To),a=!0),o(a)&&E(t,n,l))return O(n,l,!0),t;t=e(t)}var f=t.elm,d=j.parentNode(f);if(c(n,l,f._leaveCb?null:d,j.nextSibling(f)),i(n.parent))for(var h=n.parent,m=v(n);h;){for(var y=0;y<S.destroy.length;++y)S.destroy[y](h);if(h.elm=n.elm,m){for(var g=0;g<S.create.length;++g)S.create[g](us,h);var x=h.data.hook.insert;if(x.merged)for(var _=1;_<x.fns.length;_++)x.fns[_]()}else gn(h);h=h.parent}i(d)?w(d,[t],0,0):i(t.tag)&&b(t)}}return O(n,l,u),n.elm}}({nodeOps:ss,modules:Us});Io&&document.addEventListener("selectionchange",function(){var t=document.activeElement;t&&t.vmodel&&Ir(t,"input")});var Xs={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?ht(n,"postpatch",function(){Xs.componentUpdated(t,e,n)}):Sr(t,e,n.context),t._vOptions=[].map.call(t.options,Lr)):("textarea"===n.tag||as(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",Mr),t.addEventListener("compositionend",$r),t.addEventListener("change",$r),Io&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Sr(t,e,n.context);var r=t._vOptions,i=t._vOptions=[].map.call(t.options,Lr);i.some(function(t,e){return!T(t,r[e])})&&(t.multiple?e.value.some(function(t){return jr(t,i)}):e.value!==e.oldValue&&jr(e.value,i))&&Ir(t,"change")}}},zs={bind:function(t,e,n){var r=e.value;n=Nr(n);var i=n.data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,Tr(n,function(){t.style.display=o})):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&(n=Nr(n),n.data&&n.data.transition?(n.data.show=!0,r?Tr(n,function(){t.style.display=t.__vOriginalDisplay}):Or(n,function(){t.style.display="none"})):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}},Ys={model:Xs,show:zs},qs={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]},Vs=function(t){return t.tag||Tt(t)},Ws=function(t){return"show"===t.name},Gs={name:"transition",props:qs,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Vs),n.length)){var r=this.mode,i=n[0];if(Br(this.$vnode))return i;var o=Dr(i);if(!o)return i;if(this._leaving)return Fr(t,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:s(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var c=(o.data||(o.data={})).transition=Rr(this),u=this._vnode,l=Dr(u);if(o.data.directives&&o.data.directives.some(Ws)&&(o.data.show=!0),l&&l.data&&!Ur(o,l)&&!Tt(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var p=l.data.transition=x({},c);if("out-in"===r)return this._leaving=!0,ht(p,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),Fr(t,i);if("in-out"===r){if(Tt(o))return u;var f,d=function(){f()};ht(c,"afterEnter",d),ht(c,"enterCancelled",d),ht(p,"delayLeave",function(t){f=t})}}return i}}},Ks=x({tag:String,moveClass:String},qs);delete Ks.mode;var Js={props:Ks,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=$t(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Rr(this),s=0;s<i.length;s++){var c=i[s];c.tag&&null!=c.key&&0!==String(c.key).indexOf("__vlist")&&(o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a)}if(r){for(var u=[],l=[],p=0;p<r.length;p++){var f=r[p];f.data.transition=a,f.data.pos=f.elm.getBoundingClientRect(),n[f.key]?u.push(f):l.push(f)}this.kept=t(e,null,u),this.removed=l}return t(e,null,o)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(Hr),t.forEach(Xr),t.forEach(zr),this._reflow=document.body.offsetHeight,t.forEach(function(t){if(t.data.moved){var n=t.elm,r=n.style;gr(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener($s,n._moveCb=function t(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener($s,t),n._moveCb=null,br(n,e))})}}))},methods:{hasMove:function(t,e){if(!Ps)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach(function(t){vr(n,t)}),hr(n,e),n.style.display="none",this.$el.appendChild(n);var r=xr(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}},Qs={Transition:Gs,TransitionGroup:Js};Re.config.mustUseProp=Va,Re.config.isReservedTag=is,Re.config.isReservedAttr=Ya,Re.config.getTagNamespace=nn,Re.config.isUnknownElement=rn,x(Re.options.directives,Ys),x(Re.options.components,Qs),Re.prototype.__patch__=Po?Hs:k,Re.prototype.$mount=function(t,e){return t=t&&Po?on(t):void 0,Nt(this,t,e)},Po&&setTimeout(function(){Co.devtools&&zo&&zo.emit("init",Re)},0);var Zs,tc,ec,nc,rc,ic,oc,ac,sc,cc,uc,lc,pc=/\{\{((?:.|\r?\n)+?)\}\}/g,fc=/[-.*+?^${}()|[\]\/\\]/g,dc=y(function(t){var e=t[0].replace(fc,"\\$&"),n=t[1].replace(fc,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+n,"g")}),hc={staticKeys:["staticClass"],transformNode:qr,genData:Vr},vc={staticKeys:["staticStyle"],transformNode:Wr,genData:Gr},mc={decode:function(t){return Zs=Zs||document.createElement("div"),Zs.innerHTML=t,Zs.textContent}},yc=h("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),gc=h("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),bc=h("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),wc=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,xc="[a-zA-Z_][\\w\\-\\.]*",_c="((?:"+xc+"\\:)?"+xc+")",kc=new RegExp("^<"+_c),Tc=/^\s*(\/?)>/,Oc=new RegExp("^<\\/"+_c+"[^>]*>"),Ec=/^<!DOCTYPE [^>]+>/i,Cc=/^<!\--/,Ac=/^<!\[/,Sc=h("script,style,textarea",!0),Pc={},jc={"<":"<",">":">",""":'"',"&":"&"," ":"\n","	":"\t"},Lc=/&(?:lt|gt|quot|amp);/g,Mc=/&(?:lt|gt|quot|amp|#10|#9);/g,$c=h("pre,textarea",!0),Ic=function(t,e){return t&&$c(t)&&"\n"===e[0]},Nc=/^@|^v-on:/,Dc=/^v-|^@|^:/,Rc=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Fc=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Bc=/^\(|\)$/g,Uc=/:(.*)$/,Hc=/^:|^v-bind:/,Xc=/\.[^.]+/g,zc=y(mc.decode),Yc=/^xmlns:NS\d+/,qc=/^NS\d+:/,Vc={preTransformNode:xi},Wc=[hc,vc,Vc],Gc={model:Kn,text:ki,html:Ti},Kc={expectHTML:!0,modules:Wc,directives:Gc,isPreTag:rs,isUnaryTag:yc,mustUseProp:Va,canBeLeftOpenTag:gc,isReservedTag:is,getTagNamespace:nn,staticKeys:function(t){return t.reduce(function(t,e){return t.concat(e.staticKeys||[])},[]).join(",")}(Wc)},Jc=y(Ei),Qc=/^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/,Zc=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,tu={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},eu={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},nu=function(t){return"if("+t+")return null;"},ru={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:nu("$event.target !== $event.currentTarget"),ctrl:nu("!$event.ctrlKey"),shift:nu("!$event.shiftKey"),alt:nu("!$event.altKey"),meta:nu("!$event.metaKey"),left:nu("'button' in $event && $event.button !== 0"),middle:nu("'button' in $event && $event.button !== 1"),right:nu("'button' in $event && $event.button !== 2")},iu={on:Ii,bind:Ni,cloak:k},ou=function(t){this.options=t,this.warn=t.warn||Mn,this.transforms=$n(t.modules,"transformCode"),this.dataGenFns=$n(t.modules,"genData"),this.directives=x(x({},iu),t.directives);var e=t.isReservedTag||_o;this.maybeComponent=function(t){return!(e(t.tag)&&!t.component)},this.onceId=0,this.staticRenderFns=[],this.pre=!1},au=(new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)"),function(t){return function(e){function n(n,r){var i=Object.create(e),o=[],a=[];if(i.warn=function(t,e){(e?a:o).push(t)},r){r.modules&&(i.modules=(e.modules||[]).concat(r.modules)),r.directives&&(i.directives=x(Object.create(e.directives||null),r.directives));for(var s in r)"modules"!==s&&"directives"!==s&&(i[s]=r[s])}var c=t(n,i);return c.errors=o,c.tips=a,c}return{compile:n,compileToFunctions:so(n)}}}(function(t,e){var n=Zr(t.trim(),e);!1!==e.optimize&&Oi(n,e);var r=Di(n,e);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}})),su=au(Kc),cu=(su.compile,su.compileToFunctions),uu=!!Po&&co(!1),lu=!!Po&&co(!0),pu=y(function(t){var e=on(t);return e&&e.innerHTML}),fu=Re.prototype.$mount;Re.prototype.$mount=function(t,e){if((t=t&&on(t))===document.body||t===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=pu(r));else{if(!r.nodeType)return this;r=r.innerHTML}else t&&(r=uo(t));if(r){var i=cu(r,{shouldDecodeNewlines:uu,shouldDecodeNewlinesForHref:lu,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return fu.call(this,t,e)},Re.compile=cu,e.a=Re}).call(e,n(3),n(20).setImmediate)},,,function(t,e,n){"use strict";(function(e){function r(t,e){!i.isUndefined(t)&&i.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var i=n(0),o=n(28),a={"Content-Type":"application/x-www-form-urlencoded"},s={adapter:function(){var t;return"undefined"!=typeof XMLHttpRequest?t=n(13):void 0!==e&&(t=n(13)),t}(),transformRequest:[function(t,e){return o(e,"Content-Type"),i.isFormData(t)||i.isArrayBuffer(t)||i.isBuffer(t)||i.isStream(t)||i.isFile(t)||i.isBlob(t)?t:i.isArrayBufferView(t)?t.buffer:i.isURLSearchParams(t)?(r(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):i.isObject(t)?(r(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(t){s.headers[t]={}}),i.forEach(["post","put","patch"],function(t){s.headers[t]=i.merge(a)}),t.exports=s}).call(e,n(10))},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(p===clearTimeout)return clearTimeout(t);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function a(){v&&d&&(v=!1,d.length?h=d.concat(h):m=-1,h.length&&s())}function s(){if(!v){var t=i(a);v=!0;for(var e=h.length;e;){for(d=h,h=[];++m<e;)d&&d[m].run();m=-1,e=h.length}d=null,v=!1,o(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var l,p,f=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(t){p=r}}();var d,h=[],v=!1,m=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];h.push(new c(t,e)),1!==h.length||v||i(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(t){return[]},f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e,n){t.exports=n(25)},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(0),i=n(29),o=n(31),a=n(32),s=n(33),c=n(14),u="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(34);t.exports=function(t){return new Promise(function(e,l){var p=t.data,f=t.headers;r.isFormData(p)&&delete f["Content-Type"];var d=new XMLHttpRequest,h="onreadystatechange",v=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in d||s(t.url)||(d=new window.XDomainRequest,h="onload",v=!0,d.onprogress=function(){},d.ontimeout=function(){}),t.auth){var m=t.auth.username||"",y=t.auth.password||"";f.Authorization="Basic "+u(m+":"+y)}if(d.open(t.method.toUpperCase(),o(t.url,t.params,t.paramsSerializer),!0),d.timeout=t.timeout,d[h]=function(){if(d&&(4===d.readyState||v)&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?a(d.getAllResponseHeaders()):null,r=t.responseType&&"text"!==t.responseType?d.response:d.responseText,o={data:r,status:1223===d.status?204:d.status,statusText:1223===d.status?"No Content":d.statusText,headers:n,config:t,request:d};i(e,l,o),d=null}},d.onerror=function(){l(c("Network Error",t,null,d)),d=null},d.ontimeout=function(){l(c("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var g=n(35),b=(t.withCredentials||s(t.url))&&t.xsrfCookieName?g.read(t.xsrfCookieName):void 0;b&&(f[t.xsrfHeaderName]=b)}if("setRequestHeader"in d&&r.forEach(f,function(t,e){void 0===p&&"content-type"===e.toLowerCase()?delete f[e]:d.setRequestHeader(e,t)}),t.withCredentials&&(d.withCredentials=!0),t.responseType)try{d.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&d.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){d&&(d.abort(),l(t),d=null)}),void 0===p&&(p=null),d.send(p)})}},function(t,e,n){"use strict";var r=n(30);t.exports=function(t,e,n,i,o){var a=new Error(t);return r(a,e,n,i,o)}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e){(function(e){t.exports=e}).call(e,{})},,,function(t,e,n){(function(t){function r(t,e){this._id=t,this._clearFn=e}var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;e.setTimeout=function(){return new r(o.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new r(o.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(21),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(e,n(3))},function(t,e,n){(function(t,e){!function(t,n){"use strict";function r(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return u[c]=r,s(c),c++}function i(t){delete u[t]}function o(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}function a(t){if(l)setTimeout(a,0,t);else{var e=u[t];if(e){l=!0;try{o(e)}finally{i(t),l=!1}}}}if(!t.setImmediate){var s,c=1,u={},l=!1,p=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?function(){s=function(t){e.nextTick(function(){a(t)})}}():function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&a(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),s=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){a(t.data)},s=function(e){t.port2.postMessage(e)}}():p&&"onreadystatechange"in p.createElement("script")?function(){var t=p.documentElement;s=function(e){var n=p.createElement("script");n.onreadystatechange=function(){a(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():function(){s=function(t){setTimeout(a,0,t)}}(),f.setImmediate=r,f.clearImmediate=i}}("undefined"==typeof self?void 0===t?this:t:self)}).call(e,n(3),n(10))},function(t,e,n){"use strict";function r(t){return t&&DataView.prototype.isPrototypeOf(t)}function i(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function o(t){return"string"!=typeof t&&(t=String(t)),t}function a(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return x.iterable&&(e[Symbol.iterator]=function(){return e}),e}function s(t){this.map={},t instanceof s?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function u(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function l(t){var e=new FileReader,n=u(e);return e.readAsArrayBuffer(t),n}function p(t){var e=new FileReader,n=u(e);return e.readAsText(t),n}function f(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}function d(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(t){this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:x.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:x.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:x.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():x.arrayBuffer&&x.blob&&r(t)?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):x.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||k(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):x.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},x.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return p(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(f(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},x.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function v(t){var e=t.toUpperCase();return T.indexOf(e)>-1?e:t}function m(t,e){e=e||{};var n=e.body;if(t instanceof m){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new s(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new s(e.headers)),this.method=v(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function y(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function g(t){var e=new s;return t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}}),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new s(e.headers),this.url=e.url||"",this._initBody(t)}function w(t,e){return new Promise(function(n,r){function i(){a.abort()}var o=new m(t,e);if(o.signal&&o.signal.aborted)return r(new E("Aborted","AbortError"));var a=new XMLHttpRequest;a.onload=function(){var t={status:a.status,statusText:a.statusText,headers:g(a.getAllResponseHeaders()||"")};t.url="responseURL"in a?a.responseURL:t.headers.get("X-Request-URL");var e="response"in a?a.response:a.responseText;n(new b(e,t))},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request failed"))},a.onabort=function(){r(new E("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&x.blob&&(a.responseType="blob"),o.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),o.signal&&(o.signal.addEventListener("abort",i),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",i)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})}var x={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(x.arrayBuffer)var _=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],k=ArrayBuffer.isView||function(t){return t&&_.indexOf(Object.prototype.toString.call(t))>-1};s.prototype.append=function(t,e){t=i(t),e=o(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},s.prototype.delete=function(t){delete this.map[i(t)]},s.prototype.get=function(t){return t=i(t),this.has(t)?this.map[t]:null},s.prototype.has=function(t){return this.map.hasOwnProperty(i(t))},s.prototype.set=function(t,e){this.map[i(t)]=o(e)},s.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},s.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),a(t)},s.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),a(t)},s.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),a(t)},x.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);var T=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},h.call(m.prototype),h.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var O=[301,302,303,307,308];b.redirect=function(t,e){if(-1===O.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})};var E=self.DOMException;try{new E}catch(t){E=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},E.prototype=Object.create(Error.prototype),E.prototype.constructor=E}w.polyfill=!0,self.fetch||(self.fetch=w,self.Headers=s,self.Request=m,self.Response=b)},,,function(t,e,n){"use strict";function r(t){var e=new a(t),n=o(a.prototype.request,e);return i.extend(n,a.prototype,e),i.extend(n,e),n}var i=n(0),o=n(12),a=n(27),s=n(9),c=r(s);c.Axios=a,c.create=function(t){return r(i.merge(s,t))},c.Cancel=n(16),c.CancelToken=n(41),c.isCancel=n(15),c.all=function(t){return Promise.all(t)},c.spread=n(42),t.exports=c,t.exports.default=c},function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function r(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}/*!
|
7 |
* Determine if an object is a Buffer
|
8 |
*
|
9 |
* @author Feross Aboukhadijeh <https://feross.org>
|
10 |
* @license MIT
|
11 |
*/
|
12 |
-
t.exports=function(t){return null!=t&&(n(t)||r(t)||!!t._isBuffer)}},function(t,e,n){"use strict";function r(t){this.defaults=t,this.interceptors={request:new a,response:new a}}var i=n(9),o=n(0),a=n(36),s=n(37);r.prototype.request=function(t){"string"==typeof t&&(t=o.merge({url:arguments[0]},arguments[1])),t=o.merge(i,{method:"get"},this.defaults,t),t.method=t.method.toLowerCase();var e=[s,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},o.forEach(["delete","get","head","options"],function(t){r.prototype[t]=function(e,n){return this.request(o.merge(n||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){r.prototype[t]=function(e,n,r){return this.request(o.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=r},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(14);t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t}},function(t,e,n){"use strict";function r(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var i=n(0);t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(i.isURLSearchParams(e))o=e.toString();else{var a=[];i.forEach(e,function(t,e){null!==t&&void 0!==t&&(i.isArray(t)?e+="[]":t=[t],i.forEach(t,function(t){i.isDate(t)?t=t.toISOString():i.isObject(t)&&(t=JSON.stringify(t)),a.push(r(e)+"="+r(t))}))}),o=a.join("&")}return o&&(t+=(-1===t.indexOf("?")?"?":"&")+o),t}},function(t,e,n){"use strict";var r=n(0),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,o,a={};return t?(r.forEach(t.split("\n"),function(t){if(o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e){if(a[e]&&i.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}}),a):a}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){function t(t){var e=t;return n&&(i.setAttribute("href",e),e=i.href),i.setAttribute("href",e),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}var e,n=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");return e=t(window.location.href),function(n){var i=r.isString(n)?t(n):n;return i.protocol===e.protocol&&i.host===e.host}}():function(){return function(){return!0}}()},function(t,e,n){"use strict";function r(){this.message="String contains an invalid character"}function i(t){for(var e,n,i=String(t),a="",s=0,c=o;i.charAt(0|s)||(c="=",s%1);a+=c.charAt(63&e>>8-s%1*8)){if((n=i.charCodeAt(s+=.75))>255)throw new r;e=e<<8|n}return a}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.prototype=new Error,r.prototype.code=5,r.prototype.name="InvalidCharacterError",t.exports=i},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){return{write:function(t,e,n,i,o,a){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(t,e,n){"use strict";function r(){this.handlers=[]}var i=n(0);r.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},r.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},r.prototype.forEach=function(t){i.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=r},function(t,e,n){"use strict";function r(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var i=n(0),o=n(38),a=n(15),s=n(9),c=n(39),u=n(40);t.exports=function(t){return r(t),t.baseURL&&!c(t.url)&&(t.url=u(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||s.adapter)(t).then(function(e){return r(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return a(e)||(r(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";function r(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new i(t),e(n.reason))})}var i=n(16);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var t;return{token:new r(function(e){t=e}),cancel:t}},t.exports=r},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},,,,function(t,e,n){!function(e,n){t.exports=function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s="NHnr")}({"+E39":function(t,e,n){t.exports=!n("S82l")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"+ZMJ":function(t,e,n){var r=n("lOnJ");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},"+tPU":function(t,e,n){n("xGkn");for(var r=n("7KvD"),i=n("hJx8"),o=n("/bQp"),a=n("dSzd")("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),c=0;c<s.length;c++){var u=s[c],l=r[u],p=l&&l.prototype;p&&!p[a]&&i(p,a,u),o[u]=o.Array}},"//Fk":function(t,e,n){t.exports={default:n("U5ju"),__esModule:!0}},"/bQp":function(t,e){t.exports={}},"/n6Q":function(t,e,n){n("zQR9"),n("+tPU"),t.exports=n("Kh4W").f("iterator")},"06OY":function(t,e,n){var r=n("3Eo+")("meta"),i=n("EqjI"),o=n("D2L2"),a=n("evD5").f,s=0,c=Object.isExtensible||function(){return!0},u=!n("S82l")(function(){return c(Object.preventExtensions({}))}),l=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},p=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!c(t))return"F";if(!e)return"E";l(t)}return t[r].i},f=function(t,e){if(!o(t,r)){if(!c(t))return!0;if(!e)return!1;l(t)}return t[r].w},d=function(t){return u&&h.NEED&&c(t)&&!o(t,r)&&l(t),t},h=t.exports={KEY:r,NEED:!1,fastKey:p,getWeak:f,onFreeze:d}},"1kS7":function(t,e){e.f=Object.getOwnPropertySymbols},"2KxR":function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},"3Eo+":function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},"3fs2":function(t,e,n){var r=n("RY/4"),i=n("dSzd")("iterator"),o=n("/bQp");t.exports=n("FeBl").getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},"4mcu":function(t,e){t.exports=function(){}},"52gC":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"5QVw":function(t,e,n){t.exports={default:n("BwfY"),__esModule:!0}},"5zde":function(t,e,n){n("zQR9"),n("qyJz"),t.exports=n("FeBl").Array.from},"6cjq":function(t,e){},"77Pl":function(t,e,n){var r=n("EqjI");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},"7KvD":function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"7UMu":function(t,e,n){var r=n("R9M2");t.exports=Array.isArray||function(t){return"Array"==r(t)}},"82Mu":function(t,e,n){var r=n("7KvD"),i=n("L42u").set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,c="process"==n("R9M2")(a);t.exports=function(){var t,e,n,u=function(){var r,i;for(c&&(r=a.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(u)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve();n=function(){l.then(u)}}else n=function(){i.call(r,u)};else{var p=!0,f=document.createTextNode("");new o(u).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},"880/":function(t,e,n){t.exports=n("hJx8")},"94VQ":function(t,e,n){"use strict";var r=n("Yobk"),i=n("X8DO"),o=n("e6n0"),a={};n("hJx8")(a,n("dSzd")("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},"9bBU":function(t,e,n){n("mClu");var r=n("FeBl").Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},"A/PA":function(t,e){},BO1k:function(t,e,n){t.exports={default:n("fxRn"),__esModule:!0}},BwfY:function(t,e,n){n("fWfb"),n("M6a0"),n("OYls"),n("QWe/"),t.exports=n("FeBl").Symbol},C4MV:function(t,e,n){t.exports={default:n("9bBU"),__esModule:!0}},CXw9:function(t,e,n){"use strict";var r,i,o,a,s=n("O4g8"),c=n("7KvD"),u=n("+ZMJ"),l=n("RY/4"),p=n("kM2E"),f=n("EqjI"),d=n("lOnJ"),h=n("2KxR"),v=n("NWt+"),m=n("t8x9"),y=n("L42u").set,g=n("82Mu")(),b=n("qARP"),w=n("dNDb"),x=n("fJUb"),_=c.TypeError,k=c.process,T=c.Promise,O="process"==l(k),E=function(){},C=i=b.f,A=!!function(){try{var t=T.resolve(1),e=(t.constructor={})[n("dSzd")("species")]=function(t){t(E,E)};return(O||"function"==typeof PromiseRejectionEvent)&&t.then(E)instanceof e}catch(t){}}(),S=function(t){var e;return!(!f(t)||"function"!=typeof(e=t.then))&&e},P=function(t,e){if(!t._n){t._n=!0;var n=t._c;g(function(){for(var r=t._v,i=1==t._s,o=0;n.length>o;)!function(e){var n,o,a=i?e.ok:e.fail,s=e.resolve,c=e.reject,u=e.domain;try{a?(i||(2==t._h&&M(t),t._h=1),!0===a?n=r:(u&&u.enter(),n=a(r),u&&u.exit()),n===e.promise?c(_("Promise-chain cycle")):(o=S(n))?o.call(n,s,c):s(n)):c(r)}catch(t){c(t)}}(n[o++]);t._c=[],t._n=!1,e&&!t._h&&j(t)})}},j=function(t){y.call(c,function(){var e,n,r,i=t._v,o=L(t);if(o&&(e=w(function(){O?k.emit("unhandledRejection",i,t):(n=c.onunhandledrejection)?n({promise:t,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)}),t._h=O||L(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},L=function(t){return 1!==t._h&&0===(t._a||t._c).length},M=function(t){y.call(c,function(){var e;O?k.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})})},$=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),P(e,!0))},I=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw _("Promise can't be resolved itself");(e=S(t))?g(function(){var r={_w:n,_d:!1};try{e.call(t,u(I,r,1),u($,r,1))}catch(t){$.call(r,t)}}):(n._v=t,n._s=1,P(n,!1))}catch(t){$.call({_w:n,_d:!1},t)}}};A||(T=function(t){h(this,T,"Promise","_h"),d(t),r.call(this);try{t(u(I,this,1),u($,this,1))}catch(t){$.call(this,t)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n("xH/j")(T.prototype,{then:function(t,e){var n=C(m(this,T));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=O?k.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&P(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=u(I,t,1),this.reject=u($,t,1)},b.f=C=function(t){return t===T||t===a?new o(t):i(t)}),p(p.G+p.W+p.F*!A,{Promise:T}),n("e6n0")(T,"Promise"),n("bRrM")("Promise"),a=n("FeBl").Promise,p(p.S+p.F*!A,"Promise",{reject:function(t){var e=C(this);return(0,e.reject)(t),e.promise}}),p(p.S+p.F*(s||!A),"Promise",{resolve:function(t){return x(s&&this===a?T:this,t)}}),p(p.S+p.F*!(A&&n("dY0y")(function(t){T.all(t).catch(E)})),"Promise",{all:function(t){var e=this,n=C(e),r=n.resolve,i=n.reject,o=w(function(){var n=[],o=0,a=1;v(t,!1,function(t){var s=o++,c=!1;n.push(void 0),a++,e.resolve(t).then(function(t){c||(c=!0,n[s]=t,--a||r(n))},i)}),--a||r(n)});return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=C(e),r=n.reject,i=w(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},Cdx3:function(t,e,n){var r=n("sB3e"),i=n("lktj");n("uqUo")("keys",function(){return function(t){return i(r(t))}})},D2L2:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},EGZi:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},EqBC:function(t,e,n){"use strict";var r=n("kM2E"),i=n("FeBl"),o=n("7KvD"),a=n("t8x9"),s=n("fJUb");r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return s(e,t()).then(function(){return n})}:t,n?function(n){return s(e,t()).then(function(){throw n})}:t)}})},EqjI:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},FeBl:function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},Gu7T:function(t,e,n){"use strict";e.__esModule=!0;var r=n("c/Tr"),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return(0,i.default)(t)}},Ibhu:function(t,e,n){var r=n("D2L2"),i=n("TcQ7"),o=n("vFc/")(!1),a=n("ax3d")("IE_PROTO");t.exports=function(t,e){var n,s=i(t),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;e.length>c;)r(s,n=e[c++])&&(~o(u,n)||u.push(n));return u}},Kh4W:function(t,e,n){e.f=n("dSzd")},L42u:function(t,e,n){var r,i,o,a=n("+ZMJ"),s=n("knuC"),c=n("RPLV"),u=n("ON07"),l=n("7KvD"),p=l.process,f=l.setImmediate,d=l.clearImmediate,h=l.MessageChannel,v=l.Dispatch,m=0,y={},g=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){g.call(t.data)};f&&d||(f=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++m]=function(){s("function"==typeof t?t:Function(t),e)},r(m),m},d=function(t){delete y[t]},"process"==n("R9M2")(p)?r=function(t){p.nextTick(a(g,t,1))}:v&&v.now?r=function(t){v.now(a(g,t,1))}:h?(i=new h,o=i.port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(t){l.postMessage(t+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in u("script")?function(t){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),g.call(t)}}:function(t){setTimeout(a(g,t,1),0)}),t.exports={set:f,clear:d}},LKZe:function(t,e,n){var r=n("NpIQ"),i=n("X8DO"),o=n("TcQ7"),a=n("MmMw"),s=n("D2L2"),c=n("SfB7"),u=Object.getOwnPropertyDescriptor;e.f=n("+E39")?u:function(t,e){if(t=o(t),e=a(e,!0),c)try{return u(t,e)}catch(t){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},M6a0:function(t,e){},MU5D:function(t,e,n){var r=n("R9M2");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},Mhyx:function(t,e,n){var r=n("/bQp"),i=n("dSzd")("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},MmMw:function(t,e,n){var r=n("EqjI");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},NHnr:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("woOf"),i=n.n(r),o=n("bOdI"),a=n.n(o),s=n("fZjL"),c=n.n(s),u=n("//Fk"),l=n.n(u),p=n("Zrlr"),f=n.n(p),d=n("wxAW"),h=n.n(d),v=(n("Yo6p"),function(){function t(e){if(f()(this,t),this.document={},void 0===e)throw new Error("The document object does not exist!");this.document=e}return h()(t,[{key:"getElements",value:function(t){var e=this.document.querySelectorAll(t);return e&&e.length>0?[].slice.call(e):[]}},{key:"getElement",value:function(t){return this.document.querySelector(t)}}]),t}()),m=v,y={Dom:m},g=(n("A/PA"),n("Gu7T")),b=n.n(g),w=n("BO1k"),x=n.n(w),_=(n("h1D1"),n("siA7"),function(){function t(e){f()(this,t),this.bottle={},this.container={},this.bottle=e,this.container=e.container}return h()(t,[{key:"get",value:function(t){var e=this.container[t];if(!e)throw new Error(t+" service does not exists!");return e}},{key:"export",value:function(){return this.container}}]),t}()),k=_,T=n("pFYg"),O=n.n(T),E=function(){function t(){f()(this,t)}return h()(t,null,[{key:"getArguments",value:function(t){if(!this.isFunction(t))return!1;var e=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,n=/([^\s,]+)/g,r=t.toString().replace(e,""),i=r.slice(r.indexOf("(")+1,r.indexOf(")")).match(n);return null===i&&(i=[]),i}},{key:"isFunction",value:function(t){return t&&"[object Function]"==={}.toString.call(t)}},{key:"isClass",value:function(t){if("function"!=typeof t)return!1;try{return t(),!1}catch(t){return t.message,/constructor/.test(t.message)||/class as/.test(t.message)}}},{key:"log",value:function(e){t.getArguments(e),void 0===e||O()(e),e.toString(),t.isClass(e)}},{key:"isAnonymous",value:function(t){var e=t.toString().match(/^function ([^\s]+) \(\)/);return!e||!e[1]}}]),t}(),C=E,A=function(){function t(e){f()(this,t),this.Bottle=e}return h()(t,[{key:"make",value:function(t){var e=new this.Bottle,n=function(t,e,n){var r=e.split("."),i=n,o=!0,a=!1,s=void 0;try{for(var c,u=x()(r);!(o=(c=u.next()).done);o=!0){var l=c.value;if(!t.hasOwnProperty(l))return n;if(!(i=t[l]))return n}}catch(t){a=!0,s=t}finally{try{!o&&u.return&&u.return()}finally{if(a)throw s}}return i},r=!0,i=!1,o=void 0;try{for(var a,s=x()(c()(t));!(r=(a=s.next()).done);r=!0){var u=a.value;!function(r){if(e.provider(r,function(){if(!C.isFunction(t[r]))return void(this.$get=function(){return t[r]});if(!t[r].$injectable)return void(this.$get=t[r]);var e=c()(t[r].$injectParams);this.$get=function(i){var o=e.reduce(function(e,o){var a=t[r].$injectParams[o].from,s=t[r].$injectParams[o].default;return e.push(n(i,a,s)),e},[]);return t[r].apply(t,b()(o))}}),t[r].$injectNewInstance){var i=c()(t[r].$injectParams),o=t[r].$injectAs||function(t){return t.charAt(0).toLowerCase()+t.slice(1)}(r);e.provider(o,function(){this.$get=function(e){var o=i.reduce(function(i,o){var a=t[r].$injectParams[o].from,s=t[r].$injectParams[o].default;return i.push(n(e,a,s)),i},[]);return new(Function.prototype.bind.apply(t[r],[null].concat(b()(o))))}})}}(u)}}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return new k(e)}}]),t}(),S=A,P=function(){function t(e,n){f()(this,t),this.containerFactory=e,this.services=n,this.plugins=[]}return h()(t,[{key:"use",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.plugins=t}},{key:"init",value:function(t){var e=this;return this._loadPlugins().then(function(n){e._runApplication(t,n)})}},{key:"_loadPlugins",value:function(){var t=this;return new l.a(function(e){t._allPluginsLoaded(t.plugins)?e(t._getLoadedPlugins(t.plugins)):window.UiFramework.subscribe("plugin-loaded",function(){t._allPluginsLoaded(t.plugins)&&e(t._getLoadedPlugins(t.plugins))})})}},{key:"_runApplication",value:function(t,e){var n=this;return this.services=e.reduce(function(t,e){return t=e.register(t)},this.services),this.container=this.containerFactory.make(this.services),e.forEach(function(t){return t.run(n.container)}),this._registerVues(t)}},{key:"_allPluginsLoaded",value:function(t){return t.reduce(function(t,e){return t&&!!window.UiFramework.plugins[e]},!0)}},{key:"_getLoadedPlugins",value:function(t){return t.map(function(t){return window.UiFramework.plugins[t]}).filter(function(t){return!!t}).sort(function(t,e){return t.priority-e.piority}).map(function(t){return t.plugin})}},{key:"_registerVues",value:function(t){var e=this,n=this.container.get("vue");if(!n.isInjectedComponentsInstalled)throw new Error("Injected Components plugin must be installed for UI Framework application");var r={},i=this.container.get("document"),o=new y.Dom(i),a=n.extend();return c()(t).map(function(n){r[n]=o.getElements(n).map(e._handleElement.bind(e,a,t[n]))}),r}},{key:"_handleElement",value:function(t,e,n){var r=new t({components:a()({},e,this.container.get(e)),provide:this.container.export()});return r.$mount(n),r}}]),t}(),j=P,L={install:function(t,e){var n=e.container;t.isInjectedComponentsInstalled=!0,t.mixin({created:function(){var t=this.$options.components;for(var e in t)if(t[e]&&"string"==typeof t[e]){var r=n[e];if(!r)throw new Error(e+" service is not defined!");t[e]=r}}})}},M={App:j,events:{},emit:function(t,e){if(this.events[t]){var n=!0,r=!1,i=void 0;try{for(var o,a=x()(this.events[t]);!(n=(o=a.next()).done);n=!0)(0,o.value)(e)}catch(t){r=!0,i=t}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}}},subscribe:function(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)}},$={App:j,InjectedComponents:L,UiFramework:M},I=(n("6cjq"),function(){function t(e){f()(this,t),this.formatter=e}return h()(t,[{key:"translate",value:function(t,e,n){return this.formatter(t,e)}}]),t}()),N=I,D={FormatTranslator:N},R={Container:k,ContainerFactory:S},F=function(){function t(){f()(this,t),this.hooks={}}return h()(t,[{key:"register",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;this.hooks[t]=this.hooks[t]?this.hooks[t]:[],this.hooks[t].push({callback:e,priority:n})}},{key:"apply",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=this.hooks[t]?this.hooks[t]:[];return i=i.sort(function(t,e){return t.priority-e.priority}),i.reduce(function(t,n){return n.callback.call(e,t,r)},n)}}]),t}(),B=F,U={HookService:B};n.d(e,"Core",function(){return $}),n.d(e,"I18n",function(){return D}),n.d(e,"Container",function(){return R}),n.d(e,"Dom",function(){return y}),n.d(e,"Services",function(){return U}),window.UiFramework&&(window.UiFramework=i()({},window.UiFramework,$.UiFramework))},"NWt+":function(t,e,n){var r=n("+ZMJ"),i=n("msXi"),o=n("Mhyx"),a=n("77Pl"),s=n("QRG4"),c=n("3fs2"),u={},l={},e=t.exports=function(t,e,n,p,f){var d,h,v,m,y=f?function(){return t}:c(t),g=r(n,p,e?2:1),b=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(d=s(t.length);d>b;b++)if((m=e?g(a(h=t[b])[0],h[1]):g(t[b]))===u||m===l)return m}else for(v=y.call(t);!(h=v.next()).done;)if((m=i(v,g,h.value,e))===u||m===l)return m};e.BREAK=u,e.RETURN=l},NpIQ:function(t,e){e.f={}.propertyIsEnumerable},O4g8:function(t,e){t.exports=!0},ON07:function(t,e,n){var r=n("EqjI"),i=n("7KvD").document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},OYls:function(t,e,n){n("crlp")("asyncIterator")},PzxK:function(t,e,n){var r=n("D2L2"),i=n("sB3e"),o=n("ax3d")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},QRG4:function(t,e,n){var r=n("UuGF"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},"QWe/":function(t,e,n){n("crlp")("observable")},R4wc:function(t,e,n){var r=n("kM2E");r(r.S+r.F,"Object",{assign:n("To3L")})},R9M2:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},RPLV:function(t,e,n){var r=n("7KvD").document;t.exports=r&&r.documentElement},"RY/4":function(t,e,n){var r=n("R9M2"),i=n("dSzd")("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),i))?n:o?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},Rrel:function(t,e,n){var r=n("TcQ7"),i=n("n0T6").f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return i(t)}catch(t){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?s(t):i(r(t))}},S82l:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},SfB7:function(t,e,n){t.exports=!n("+E39")&&!n("S82l")(function(){return 7!=Object.defineProperty(n("ON07")("div"),"a",{get:function(){return 7}}).a})},TcQ7:function(t,e,n){var r=n("MU5D"),i=n("52gC");t.exports=function(t){return r(i(t))}},To3L:function(t,e,n){"use strict";var r=n("lktj"),i=n("1kS7"),o=n("NpIQ"),a=n("sB3e"),s=n("MU5D"),c=Object.assign;t.exports=!c||n("S82l")(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r})?function(t,e){for(var n=a(t),c=arguments.length,u=1,l=i.f,p=o.f;c>u;)for(var f,d=s(arguments[u++]),h=l?r(d).concat(l(d)):r(d),v=h.length,m=0;v>m;)p.call(d,f=h[m++])&&(n[f]=d[f]);return n}:c},U5ju:function(t,e,n){n("M6a0"),n("zQR9"),n("+tPU"),n("CXw9"),n("EqBC"),n("jKW+"),t.exports=n("FeBl").Promise},UuGF:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},V3tA:function(t,e,n){n("R4wc"),t.exports=n("FeBl").Object.assign},X8DO:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},Xc4G:function(t,e,n){var r=n("lktj"),i=n("1kS7"),o=n("NpIQ");t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,s=n(t),c=o.f,u=0;s.length>u;)c.call(t,a=s[u++])&&e.push(a);return e}},Yo6p:function(t,e){},Yobk:function(t,e,n){var r=n("77Pl"),i=n("qio6"),o=n("xnc9"),a=n("ax3d")("IE_PROTO"),s=function(){},c=function(){var t,e=n("ON07")("iframe"),r=o.length;for(e.style.display="none",n("RPLV").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c.prototype[o[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[a]=t):n=c(),void 0===e?n:i(n,e)}},Zrlr:function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},Zzip:function(t,e,n){t.exports={default:n("/n6Q"),__esModule:!0}},ax3d:function(t,e,n){var r=n("e8AB")("keys"),i=n("3Eo+");t.exports=function(t){return r[t]||(r[t]=i(t))}},bOdI:function(t,e,n){"use strict";e.__esModule=!0;var r=n("C4MV"),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t,e,n){return e in t?(0,i.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},bRrM:function(t,e,n){"use strict";var r=n("7KvD"),i=n("FeBl"),o=n("evD5"),a=n("+E39"),s=n("dSzd")("species");t.exports=function(t){var e="function"==typeof i[t]?i[t]:r[t];a&&e&&!e[s]&&o.f(e,s,{configurable:!0,get:function(){return this}})}},"c/Tr":function(t,e,n){t.exports={default:n("5zde"),__esModule:!0}},crlp:function(t,e,n){var r=n("7KvD"),i=n("FeBl"),o=n("O4g8"),a=n("Kh4W"),s=n("evD5").f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},dNDb:function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},dSzd:function(t,e,n){var r=n("e8AB")("wks"),i=n("3Eo+"),o=n("7KvD").Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},dY0y:function(t,e,n){var r=n("dSzd")("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},t(o)}catch(t){}return n}},e6n0:function(t,e,n){var r=n("evD5").f,i=n("D2L2"),o=n("dSzd")("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},e8AB:function(t,e,n){var r=n("7KvD"),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},evD5:function(t,e,n){var r=n("77Pl"),i=n("SfB7"),o=n("MmMw"),a=Object.defineProperty;e.f=n("+E39")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},fBQ2:function(t,e,n){"use strict";var r=n("evD5"),i=n("X8DO");t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},fJUb:function(t,e,n){var r=n("77Pl"),i=n("EqjI"),o=n("qARP");t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},fWfb:function(t,e,n){"use strict";var r=n("7KvD"),i=n("D2L2"),o=n("+E39"),a=n("kM2E"),s=n("880/"),c=n("06OY").KEY,u=n("S82l"),l=n("e8AB"),p=n("e6n0"),f=n("3Eo+"),d=n("dSzd"),h=n("Kh4W"),v=n("crlp"),m=n("Xc4G"),y=n("7UMu"),g=n("77Pl"),b=n("EqjI"),w=n("TcQ7"),x=n("MmMw"),_=n("X8DO"),k=n("Yobk"),T=n("Rrel"),O=n("LKZe"),E=n("evD5"),C=n("lktj"),A=O.f,S=E.f,P=T.f,j=r.Symbol,L=r.JSON,M=L&&L.stringify,$=d("_hidden"),I=d("toPrimitive"),N={}.propertyIsEnumerable,D=l("symbol-registry"),R=l("symbols"),F=l("op-symbols"),B=Object.prototype,U="function"==typeof j,H=r.QObject,X=!H||!H.prototype||!H.prototype.findChild,z=o&&u(function(){return 7!=k(S({},"a",{get:function(){return S(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=A(B,e);r&&delete B[e],S(t,e,n),r&&t!==B&&S(B,e,r)}:S,Y=function(t){var e=R[t]=k(j.prototype);return e._k=t,e},q=U&&"symbol"==typeof j.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof j},V=function(t,e,n){return t===B&&V(F,e,n),g(t),e=x(e,!0),g(n),i(R,e)?(n.enumerable?(i(t,$)&&t[$][e]&&(t[$][e]=!1),n=k(n,{enumerable:_(0,!1)})):(i(t,$)||S(t,$,_(1,{})),t[$][e]=!0),z(t,e,n)):S(t,e,n)},W=function(t,e){g(t);for(var n,r=m(e=w(e)),i=0,o=r.length;o>i;)V(t,n=r[i++],e[n]);return t},G=function(t,e){return void 0===e?k(t):W(k(t),e)},K=function(t){var e=N.call(this,t=x(t,!0));return!(this===B&&i(R,t)&&!i(F,t))&&(!(e||!i(this,t)||!i(R,t)||i(this,$)&&this[$][t])||e)},J=function(t,e){if(t=w(t),e=x(e,!0),t!==B||!i(R,e)||i(F,e)){var n=A(t,e);return!n||!i(R,e)||i(t,$)&&t[$][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=P(w(t)),r=[],o=0;n.length>o;)i(R,e=n[o++])||e==$||e==c||r.push(e);return r},Z=function(t){for(var e,n=t===B,r=P(n?F:w(t)),o=[],a=0;r.length>a;)!i(R,e=r[a++])||n&&!i(B,e)||o.push(R[e]);return o};U||(j=function(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(n){this===B&&e.call(F,n),i(this,$)&&i(this[$],t)&&(this[$][t]=!1),z(this,t,_(1,n))};return o&&X&&z(B,t,{configurable:!0,set:e}),Y(t)},s(j.prototype,"toString",function(){return this._k}),O.f=J,E.f=V,n("n0T6").f=T.f=Q,n("NpIQ").f=K,n("1kS7").f=Z,o&&!n("O4g8")&&s(B,"propertyIsEnumerable",K,!0),h.f=function(t){return Y(d(t))}),a(a.G+a.W+a.F*!U,{Symbol:j});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)d(tt[et++]);for(var nt=C(d.store),rt=0;nt.length>rt;)v(nt[rt++]);a(a.S+a.F*!U,"Symbol",{for:function(t){return i(D,t+="")?D[t]:D[t]=j(t)},keyFor:function(t){if(!q(t))throw TypeError(t+" is not a symbol!");for(var e in D)if(D[e]===t)return e},useSetter:function(){X=!0},useSimple:function(){X=!1}}),a(a.S+a.F*!U,"Object",{create:G,defineProperty:V,defineProperties:W,getOwnPropertyDescriptor:J,getOwnPropertyNames:Q,getOwnPropertySymbols:Z}),L&&a(a.S+a.F*(!U||u(function(){var t=j();return"[null]"!=M([t])||"{}"!=M({a:t})||"{}"!=M(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(b(e)||void 0!==t)&&!q(t))return y(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!q(e))return e}),r[1]=e,M.apply(L,r)}}),j.prototype[I]||n("hJx8")(j.prototype,I,j.prototype.valueOf),p(j,"Symbol"),p(Math,"Math",!0),p(r.JSON,"JSON",!0)},fZjL:function(t,e,n){t.exports={default:n("jFbC"),__esModule:!0}},fkB2:function(t,e,n){var r=n("UuGF"),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},fxRn:function(t,e,n){n("+tPU"),n("zQR9"),t.exports=n("g8Ux")},g8Ux:function(t,e,n){var r=n("77Pl"),i=n("3fs2");t.exports=n("FeBl").getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return r(e.call(t))}},h1D1:function(t,e){},h65t:function(t,e,n){var r=n("UuGF"),i=n("52gC");t.exports=function(t){return function(e,n){var o,a,s=String(i(e)),c=r(n),u=s.length;return c<0||c>=u?t?"":void 0:(o=s.charCodeAt(c),o<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?t?s.charAt(c):o:t?s.slice(c,c+2):a-56320+(o-55296<<10)+65536)}}},hJx8:function(t,e,n){var r=n("evD5"),i=n("X8DO");t.exports=n("+E39")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},jFbC:function(t,e,n){n("Cdx3"),t.exports=n("FeBl").Object.keys},"jKW+":function(t,e,n){"use strict";var r=n("kM2E"),i=n("qARP"),o=n("dNDb");r(r.S,"Promise",{try:function(t){var e=i.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},kM2E:function(t,e,n){var r=n("7KvD"),i=n("FeBl"),o=n("+ZMJ"),a=n("hJx8"),s=function(t,e,n){var c,u,l,p=t&s.F,f=t&s.G,d=t&s.S,h=t&s.P,v=t&s.B,m=t&s.W,y=f?i:i[e]||(i[e]={}),g=y.prototype,b=f?r:d?r[e]:(r[e]||{}).prototype;f&&(n=e);for(c in n)(u=!p&&b&&void 0!==b[c])&&c in y||(l=u?b[c]:n[c],y[c]=f&&"function"!=typeof b[c]?n[c]:v&&u?o(l,r):m&&b[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):h&&"function"==typeof l?o(Function.call,l):l,h&&((y.virtual||(y.virtual={}))[c]=l,t&s.R&&g&&!g[c]&&a(g,c,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},knuC:function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},lOnJ:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},lktj:function(t,e,n){var r=n("Ibhu"),i=n("xnc9");t.exports=Object.keys||function(t){return r(t,i)}},mClu:function(t,e,n){var r=n("kM2E");r(r.S+r.F*!n("+E39"),"Object",{defineProperty:n("evD5").f})},msXi:function(t,e,n){var r=n("77Pl");t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},n0T6:function(t,e,n){var r=n("Ibhu"),i=n("xnc9").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},pFYg:function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n("Zzip"),o=r(i),a=n("5QVw"),s=r(a),c="function"==typeof s.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":typeof t};e.default="function"==typeof s.default&&"symbol"===c(o.default)?function(t){return void 0===t?"undefined":c(t)}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":void 0===t?"undefined":c(t)}},qARP:function(t,e,n){"use strict";function r(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=i(e),this.reject=i(n)}var i=n("lOnJ");t.exports.f=function(t){return new r(t)}},qio6:function(t,e,n){var r=n("evD5"),i=n("77Pl"),o=n("lktj");t.exports=n("+E39")?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),s=a.length,c=0;s>c;)r.f(t,n=a[c++],e[n]);return t}},qyJz:function(t,e,n){"use strict";var r=n("+ZMJ"),i=n("kM2E"),o=n("sB3e"),a=n("msXi"),s=n("Mhyx"),c=n("QRG4"),u=n("fBQ2"),l=n("3fs2");i(i.S+i.F*!n("dY0y")(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,i,p,f=o(t),d="function"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,m=void 0!==v,y=0,g=l(f);if(m&&(v=r(v,h>2?arguments[2]:void 0,2)),void 0==g||d==Array&&s(g))for(e=c(f.length),n=new d(e);e>y;y++)u(n,y,m?v(f[y],y):f[y]);else for(p=g.call(f),n=new d;!(i=p.next()).done;y++)u(n,y,m?a(p,v,[i.value,y],!0):i.value);return n.length=y,n}})},sB3e:function(t,e,n){var r=n("52gC");t.exports=function(t){return Object(r(t))}},siA7:function(t,e){},t8x9:function(t,e,n){var r=n("77Pl"),i=n("lOnJ"),o=n("dSzd")("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[o])?e:i(n)}},uqUo:function(t,e,n){var r=n("kM2E"),i=n("FeBl"),o=n("S82l");t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},"vFc/":function(t,e,n){var r=n("TcQ7"),i=n("QRG4"),o=n("fkB2");t.exports=function(t){return function(e,n,a){var s,c=r(e),u=i(c.length),l=o(a,u);if(t&&n!=n){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}}},"vIB/":function(t,e,n){"use strict";var r=n("O4g8"),i=n("kM2E"),o=n("880/"),a=n("hJx8"),s=n("D2L2"),c=n("/bQp"),u=n("94VQ"),l=n("e6n0"),p=n("PzxK"),f=n("dSzd")("iterator"),d=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,n,v,m,y,g){u(n,e,v);var b,w,x,_=function(t){if(!d&&t in E)return E[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},k=e+" Iterator",T="values"==m,O=!1,E=t.prototype,C=E[f]||E["@@iterator"]||m&&E[m],A=!d&&C||_(m),S=m?T?_("entries"):A:void 0,P="Array"==e?E.entries||C:C;if(P&&(x=p(P.call(new t)))!==Object.prototype&&x.next&&(l(x,k,!0),r||s(x,f)||a(x,f,h)),T&&C&&"values"!==C.name&&(O=!0,A=function(){return C.call(this)}),r&&!g||!d&&!O&&E[f]||a(E,f,A),c[e]=A,c[k]=h,m)if(b={values:T?A:_("values"),keys:y?A:_("keys"),entries:S},g)for(w in b)w in E||o(E,w,b[w]);else i(i.P+i.F*(d||O),e,b);return b}},woOf:function(t,e,n){t.exports={default:n("V3tA"),__esModule:!0}},wxAW:function(t,e,n){"use strict";e.__esModule=!0;var r=n("C4MV"),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},xGkn:function(t,e,n){"use strict";var r=n("4mcu"),i=n("EGZi"),o=n("/bQp"),a=n("TcQ7");t.exports=n("vIB/")(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,n):"values"==e?i(0,t[n]):i(0,[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},"xH/j":function(t,e,n){var r=n("hJx8");t.exports=function(t,e,n){for(var i in e)n&&t[i]?t[i]=e[i]:r(t,i,e[i]);return t}},xnc9:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},zQR9:function(t,e,n){"use strict";var r=n("h65t")(!0);n("vIB/")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})}})}()}("undefined"!=typeof self&&self)},function(t,e,n){(function(t,r){var i;(function(o){"use strict";var a,s=0,c=Array.prototype.slice,u=function(t,e){var n=t[e];if(n===o&&a.config.strict)throw new Error("Bottle was unable to resolve a service. `"+e+"` is undefined.");return n},l=function(t){var e;return this.nested[t]||(e=a.pop(),this.nested[t]=e,this.factory(t,function(){return e.container})),this.nested[t]},p=function(t){return t.split(".").reduce(u,this)},f=function(t,e,n,r){var i={configurable:!0,enumerable:!0};return t.length?i.get=function(){var e=0,r=function(i){if(i)throw i;t[e]&&t[e++](n,r)};return r(),n}:(i.value=n,i.writable=!0),Object.defineProperty(r,e,i),r[e]},d=function(t,e){var n,r;return"function"==typeof t&&(e=t,t="__global__"),n=t.split("."),r=n.shift(),n.length?l.call(this,r).middleware(n.join("."),e):(this.middlewares[r]||(this.middlewares[r]=[]),this.middlewares[r].push(e)),this},h=function(t,e){return e(t)},v=function(t,e){return(t[e]||[]).concat(t.__global__||[])},m=function(t,e){var n,r,i,a,s;return this.id,i=this.container,a=this.decorators,s=this.middlewares,n=t+"Provider",r=Object.create(null),r[n]={configurable:!0,enumerable:!0,get:function(){var t=new e;return delete i[n],i[n]=t,t}},r[t]={configurable:!0,enumerable:!0,get:function(){var e,r=i[n];return r&&(e=v(a,t).reduce(h,r.$get(i)),delete i[n],delete i[t]),e===o?e:f(v(s,t),t,e,i)}},Object.defineProperties(i,r),this},y=function(t,e){var n,r;return n=t.split("."),this.providerMap[t]&&1===n.length&&!this.container[t+"Provider"]?console.error(t+" provider already instantiated."):(this.originalProviders[t]=e,this.providerMap[t]=!0,r=n.shift(),n.length?(l.call(this,r).provider(n.join("."),e),this):m.call(this,r,e))},g=function(t,e){return y.call(this,t,function(){this.$get=e})},b=function(t,e,n){var r=arguments.length>3?c.call(arguments,3):[],i=this;return g.call(this,t,function(){var t=e,o=r.map(p,i.container);return n?new(e.bind.apply(e,[null].concat(o))):t.apply(null,o)})},w=function(t,e){return b.apply(this,[t,e,!0].concat(c.call(arguments,2)))},x=function(t,e){return b.apply(this,[t,e,!1].concat(c.call(arguments,2)))},_=function(t,e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})},k=function(t,e){var n=t[e];return n||(n={},_.call(t,e,n)),n},T=function(t,e){var n;return n=t.split("."),t=n.pop(),_.call(n.reduce(k,this.container),t,e),this},O=function(t,e){Object.defineProperty(this,t,{configurable:!1,enumerable:!0,value:e,writable:!1})},E=function(t,e){var n=t.split(".");return t=n.pop(),O.call(n.reduce(k,this.container),t,e),this},C=function(t,e){var n,r;return"function"==typeof t&&(e=t,t="__global__"),n=t.split("."),r=n.shift(),n.length?l.call(this,r).decorator(n.join("."),e):(this.decorators[r]||(this.decorators[r]=[]),this.decorators[r].push(e)),this},A=function(t){return this.deferred.push(t),this},S=function(t){return(t||[]).map(p,this.container)},P=function(t,e){return g.call(this,t,function(t){return{instance:e.bind(e,t)}})},j=function(t){return!/^\$(?:decorator|register|list)$|Provider$/.test(t)},L=function(t){return Object.keys(t||this.container||{}).filter(j)},M={},$=function(t){var e;return"string"==typeof t?(e=M[t],e||(M[t]=e=new a,e.constant("BOTTLE_NAME",t)),e):new a},I=function(t){"string"==typeof t?delete M[t]:M={}},N=function(t){var e=t.$value===o?t:t.$value;return this[t.$type||"service"].apply(this,[t.$name,e].concat(t.$inject||[]))},D=function(t){delete this.providerMap[t],delete this.container[t],delete this.container[t+"Provider"]},R=function(t){var e=this.originalProviders,n=Array.isArray(t);Object.keys(this.originalProviders).forEach(function(r){if(!n||-1!==t.indexOf(r)){var i=r.split(".");i.length>1&&i.forEach(D,l.call(this,i[0])),D.call(this,r),this.provider(r,e[r])}},this)},F=function(t){return this.deferred.forEach(function(e){e(t)}),this};a=function t(e){if(!(this instanceof t))return t.pop(e);this.id=s++,this.decorators={},this.middlewares={},this.nested={},this.providerMap={},this.originalProviders={},this.deferred=[],this.container={$decorator:C.bind(this),$register:N.bind(this),$list:L.bind(this)}},a.prototype={constant:E,decorator:C,defer:A,digest:S,factory:g,instanceFactory:P,list:L,middleware:d,provider:y,resetProviders:R,register:N,resolve:F,service:w,serviceFactory:x,value:T},a.pop=$,a.clear=I,a.list=L,a.config={strict:!1};var B={function:!0,object:!0};!function(s){var c=B[typeof e]&&e&&!e.nodeType&&e,u=B[typeof t]&&t&&!t.nodeType&&t,l=u&&u.exports===c&&c,p=B[typeof r]&&r;!p||p.global!==p&&p.window!==p||(s=p),"object"==typeof n(17)&&n(17)?(s.Bottle=a,(i=function(){return a}.call(e,n,e,t))!==o&&(t.exports=i)):c&&u?l?(u.exports=a).Bottle=a:c.Bottle=a:s.Bottle=a}(B[typeof window]&&window||this)}).call(this)}).call(e,n(48)(t),n(3))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){!function(e,n){t.exports=function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=6)}([function(t,e,n){"use strict";function r(){d=!1}function i(t){if(!t)return void(p!==v&&(p=v,r()));if(t!==p){if(t.length!==v.length)throw new Error("Custom alphabet for shortid must be "+v.length+" unique characters. You submitted "+t.length+" characters: "+t);var e=t.split("").filter(function(t,e,n){return e!==n.lastIndexOf(t)});if(e.length)throw new Error("Custom alphabet for shortid must be "+v.length+" unique characters. These characters were not unique: "+e.join(", "));p=t,r()}}function o(t){return i(t),p}function a(t){h.seed(t),f!==t&&(r(),f=t)}function s(){p||i(v);for(var t,e=p.split(""),n=[],r=h.nextValue();e.length>0;)r=h.nextValue(),t=Math.floor(r*e.length),n.push(e.splice(t,1)[0]);return n.join("")}function c(){return d||(d=s())}function u(t){return c()[t]}function l(){return p||v}var p,f,d,h=n(19),v="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";t.exports={get:l,characters:o,seed:a,lookup:u,shuffled:c}},function(t,e,n){"use strict";var r=n(5),i=n.n(r);e.a={animateIn:function(t){i()({targets:t,translateY:"-35px",opacity:1,duration:300,easing:"easeOutCubic"})},animateOut:function(t,e){i()({targets:t,opacity:0,marginTop:"-40px",duration:300,easing:"easeOutExpo",complete:e})},animateOutBottom:function(t,e){i()({targets:t,opacity:0,marginBottom:"-40px",duration:300,easing:"easeOutExpo",complete:e})},animateReset:function(t){i()({targets:t,left:0,opacity:1,duration:300,easing:"easeOutExpo"})},animatePanning:function(t,e,n){i()({targets:t,duration:10,easing:"easeOutQuad",left:e,opacity:n})},animatePanEnd:function(t,e){i()({targets:t,opacity:0,duration:300,easing:"easeOutExpo",complete:e})},clearAnimation:function(t){var e=i.a.timeline();t.forEach(function(t){e.add({targets:t.el,opacity:0,right:"-40px",duration:300,offset:"-=150",easing:"easeOutExpo",complete:function(){t.remove()}})})}}},function(t,e,n){"use strict";t.exports=n(16)},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(8),i=n(1),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=n(2);n(11).polyfill();var s=function t(e){var n=this;return this.id=a.generate(),this.options=e,this.cached_options={},this.global={},this.groups=[],this.toasts=[],u(this),this.group=function(e){e||(e={}),e.globalToasts||(e.globalToasts={}),Object.assign(e.globalToasts,n.global);var r=new t(e);return n.groups.push(r),r},this.register=function(t,e,r){return r=r||{},l(n,t,e,r)},this.show=function(t,e){return c(n,t,e)},this.success=function(t,e){return e=e||{},e.type="success",c(n,t,e)},this.info=function(t,e){return e=e||{},e.type="info",c(n,t,e)},this.error=function(t,e){return e=e||{},e.type="error",c(n,t,e)},this.remove=function(t){n.toasts=n.toasts.filter(function(e){return e.el.hash!==t.hash}),t.parentNode&&t.parentNode.removeChild(t)},this.clear=function(t){return i.a.clearAnimation(n.toasts,function(){t&&t()}),n.toasts=[],!0},this},c=function(t,e,i){i=i||{};var a=null;if("object"!==(void 0===i?"undefined":o(i)))return console.error("Options should be a type of object. given : "+i),null;t.options.singleton&&t.toasts.length>0&&(t.cached_options=i,t.toasts[t.toasts.length-1].goAway(0));var s=Object.assign({},t.options);return Object.assign(s,i),a=n.i(r.a)(t,e,s),t.toasts.push(a),a},u=function(t){var e=t.options.globalToasts,n=function(e,n){return"string"==typeof n&&t[n]?t[n].apply(t,[e,{}]):c(t,e,n)};e&&(t.global={},Object.keys(e).forEach(function(r){t.global[r]=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e[r].apply(null,[t,n])}}))},l=function(t,e,n,r){t.options.globalToasts||(t.options.globalToasts={}),t.options.globalToasts[e]=function(t,e){var i=null;return"string"==typeof n&&(i=n),"function"==typeof n&&(i=n(t)),e(i,r)},u(t)}},function(t,e,n){n(22);var r=n(21)(null,null,null,null);t.exports=r.exports},function(t,e,n){(function(n){var r,i,o,a={scope:{}};a.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){if(n.get||n.set)throw new TypeError("ES3 does not support getters and setters.");t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},a.getGlobal=function(t){return"undefined"!=typeof window&&window===t?t:void 0!==n&&null!=n?n:t},a.global=a.getGlobal(this),a.SYMBOL_PREFIX="jscomp_symbol_",a.initSymbol=function(){a.initSymbol=function(){},a.global.Symbol||(a.global.Symbol=a.Symbol)},a.symbolCounter_=0,a.Symbol=function(t){return a.SYMBOL_PREFIX+(t||"")+a.symbolCounter_++},a.initSymbolIterator=function(){a.initSymbol();var t=a.global.Symbol.iterator;t||(t=a.global.Symbol.iterator=a.global.Symbol("iterator")),"function"!=typeof Array.prototype[t]&&a.defineProperty(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return a.arrayIterator(this)}}),a.initSymbolIterator=function(){}},a.arrayIterator=function(t){var e=0;return a.iteratorPrototype(function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}})},a.iteratorPrototype=function(t){return a.initSymbolIterator(),t={next:t},t[a.global.Symbol.iterator]=function(){return this},t},a.array=a.array||{},a.iteratorFromArray=function(t,e){a.initSymbolIterator(),t instanceof String&&(t+="");var n=0,r={next:function(){if(n<t.length){var i=n++;return{value:e(i,t[i]),done:!1}}return r.next=function(){return{done:!0,value:void 0}},r.next()}};return r[Symbol.iterator]=function(){return r},r},a.polyfill=function(t,e,n,r){if(e){for(n=a.global,t=t.split("."),r=0;r<t.length-1;r++){var i=t[r];i in n||(n[i]={}),n=n[i]}t=t[t.length-1],r=n[t],(e=e(r))!=r&&null!=e&&a.defineProperty(n,t,{configurable:!0,writable:!0,value:e})}},a.polyfill("Array.prototype.keys",function(t){return t||function(){return a.iteratorFromArray(this,function(t){return t})}},"es6-impl","es3");var s=this;!function(n,a){i=[],r=a,void 0!==(o="function"==typeof r?r.apply(e,i):r)&&(t.exports=o)}(0,function(){function t(t){if(!R.col(t))try{return document.querySelectorAll(t)}catch(t){}}function e(t,e){for(var n=t.length,r=2<=arguments.length?arguments[1]:void 0,i=[],o=0;o<n;o++)if(o in t){var a=t[o];e.call(r,a,o,t)&&i.push(a)}return i}function n(t){return t.reduce(function(t,e){return t.concat(R.arr(e)?n(e):e)},[])}function r(e){return R.arr(e)?e:(R.str(e)&&(e=t(e)||e),e instanceof NodeList||e instanceof HTMLCollection?[].slice.call(e):[e])}function i(t,e){return t.some(function(t){return t===e})}function o(t){var e,n={};for(e in t)n[e]=t[e];return n}function a(t,e){var n,r=o(t);for(n in t)r[n]=e.hasOwnProperty(n)?e[n]:t[n];return r}function c(t,e){var n,r=o(t);for(n in e)r[n]=R.und(t[n])?e[n]:t[n];return r}function u(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,n,r){return e+e+n+n+r+r});var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);t=parseInt(e[1],16);var n=parseInt(e[2],16),e=parseInt(e[3],16);return"rgba("+t+","+n+","+e+",1)"}function l(t){function e(t,e,n){return 0>n&&(n+=1),1<n&&--n,n<1/6?t+6*(e-t)*n:.5>n?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var n=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t);t=parseInt(n[1])/360;var r=parseInt(n[2])/100,i=parseInt(n[3])/100,n=n[4]||1;if(0==r)i=r=t=i;else{var o=.5>i?i*(1+r):i+r-i*r,a=2*i-o,i=e(a,o,t+1/3),r=e(a,o,t);t=e(a,o,t-1/3)}return"rgba("+255*i+","+255*r+","+255*t+","+n+")"}function p(t){if(t=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t))return t[2]}function f(t){return-1<t.indexOf("translate")||"perspective"===t?"px":-1<t.indexOf("rotate")||-1<t.indexOf("skew")?"deg":void 0}function d(t,e){return R.fnc(t)?t(e.target,e.id,e.total):t}function h(t,e){if(e in t.style)return getComputedStyle(t).getPropertyValue(e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())||"0"}function v(t,e){return R.dom(t)&&i(D,e)?"transform":R.dom(t)&&(t.getAttribute(e)||R.svg(t)&&t[e])?"attribute":R.dom(t)&&"transform"!==e&&h(t,e)?"css":null!=t[e]?"object":void 0}function m(t,n){var r=f(n),r=-1<n.indexOf("scale")?1:0+r;if(!(t=t.style.transform))return r;for(var i=[],o=[],a=[],s=/(\w+)\((.+?)\)/g;i=s.exec(t);)o.push(i[1]),a.push(i[2]);return t=e(a,function(t,e){return o[e]===n}),t.length?t[0]:r}function y(t,e){switch(v(t,e)){case"transform":return m(t,e);case"css":return h(t,e);case"attribute":return t.getAttribute(e)}return t[e]||0}function g(t,e){var n=/^(\*=|\+=|-=)/.exec(t);if(!n)return t;var r=p(t)||0;switch(e=parseFloat(e),t=parseFloat(t.replace(n[0],"")),n[0][0]){case"+":return e+t+r;case"-":return e-t+r;case"*":return e*t+r}}function b(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function w(t){t=t.points;for(var e,n=0,r=0;r<t.numberOfItems;r++){var i=t.getItem(r);0<r&&(n+=b(e,i)),e=i}return n}function x(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return 2*Math.PI*t.getAttribute("r");case"rect":return 2*t.getAttribute("width")+2*t.getAttribute("height");case"line":return b({x:t.getAttribute("x1"),y:t.getAttribute("y1")},{x:t.getAttribute("x2"),y:t.getAttribute("y2")});case"polyline":return w(t);case"polygon":var e=t.points;return w(t)+b(e.getItem(e.numberOfItems-1),e.getItem(0))}}function _(t,e){function n(n){return n=void 0===n?0:n,t.el.getPointAtLength(1<=e+n?e+n:0)}var r=n(),i=n(-1),o=n(1);switch(t.property){case"x":return r.x;case"y":return r.y;case"angle":return 180*Math.atan2(o.y-i.y,o.x-i.x)/Math.PI}}function k(t,e){var n,r=/-?\d*\.?\d+/g;if(n=R.pth(t)?t.totalLength:t,R.col(n))if(R.rgb(n)){var i=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(n);n=i?"rgba("+i[1]+",1)":n}else n=R.hex(n)?u(n):R.hsl(n)?l(n):void 0;else i=(i=p(n))?n.substr(0,n.length-i.length):n,n=e&&!/\s/g.test(n)?i+e:i;return n+="",{original:n,numbers:n.match(r)?n.match(r).map(Number):[0],strings:R.str(t)||e?n.split(r):[]}}function T(t){return t=t?n(R.arr(t)?t.map(r):r(t)):[],e(t,function(t,e,n){return n.indexOf(t)===e})}function O(t){var e=T(t);return e.map(function(t,n){return{target:t,id:n,total:e.length}})}function E(t,e){var n=o(e);if(R.arr(t)){var i=t.length;2!==i||R.obj(t[0])?R.fnc(e.duration)||(n.duration=e.duration/i):t={value:t}}return r(t).map(function(t,n){return n=n?0:e.delay,t=R.obj(t)&&!R.pth(t)?t:{value:t},R.und(t.delay)&&(t.delay=n),t}).map(function(t){return c(t,n)})}function C(t,e){var n,r={};for(n in t){var i=d(t[n],e);R.arr(i)&&(i=i.map(function(t){return d(t,e)}),1===i.length&&(i=i[0])),r[n]=i}return r.duration=parseFloat(r.duration),r.delay=parseFloat(r.delay),r}function A(t){return R.arr(t)?F.apply(this,t):B[t]}function S(t,e){var n;return t.tweens.map(function(r){r=C(r,e);var i=r.value,o=y(e.target,t.name),a=n?n.to.original:o,a=R.arr(i)?i[0]:a,s=g(R.arr(i)?i[1]:i,a),o=p(s)||p(a)||p(o);return r.from=k(a,o),r.to=k(s,o),r.start=n?n.end:t.offset,r.end=r.start+r.delay+r.duration,r.easing=A(r.easing),r.elasticity=(1e3-Math.min(Math.max(r.elasticity,1),999))/1e3,r.isPath=R.pth(i),r.isColor=R.col(r.from.original),r.isColor&&(r.round=1),n=r})}function P(t,r){return e(n(t.map(function(t){return r.map(function(e){var n=v(t.target,e.name);if(n){var r=S(e,t);e={type:n,property:e.name,animatable:t,tweens:r,duration:r[r.length-1].end,delay:r[0].delay}}else e=void 0;return e})})),function(t){return!R.und(t)})}function j(t,e,n,r){var i="delay"===t;return e.length?(i?Math.min:Math.max).apply(Math,e.map(function(e){return e[t]})):i?r.delay:n.offset+r.delay+r.duration}function L(t){var e,n=a(I,t),r=a(N,t),i=O(t.targets),o=[],s=c(n,r);for(e in t)s.hasOwnProperty(e)||"targets"===e||o.push({name:e,offset:s.offset,tweens:E(t[e],r)});return t=P(i,o),c(n,{children:[],animatables:i,animations:t,duration:j("duration",t,n,r),delay:j("delay",t,n,r)})}function M(t){function n(){return window.Promise&&new Promise(function(t){return p=t})}function r(t){return d.reversed?d.duration-t:t}function i(t){for(var n=0,r={},i=d.animations,o=i.length;n<o;){var a=i[n],s=a.animatable,c=a.tweens,u=c.length-1,l=c[u];u&&(l=e(c,function(e){return t<e.end})[0]||l);for(var c=Math.min(Math.max(t-l.start-l.delay,0),l.duration)/l.duration,p=isNaN(c)?1:l.easing(c,l.elasticity),c=l.to.strings,f=l.round,u=[],v=void 0,v=l.to.numbers.length,m=0;m<v;m++){var y=void 0,y=l.to.numbers[m],g=l.from.numbers[m],y=l.isPath?_(l.value,p*y):g+p*(y-g);f&&(l.isColor&&2<m||(y=Math.round(y*f)/f)),u.push(y)}if(l=c.length)for(v=c[0],p=0;p<l;p++)f=c[p+1],m=u[p],isNaN(m)||(v=f?v+(m+f):v+(m+" "));else v=u[0];U[a.type](s.target,a.property,v,r,s.id),a.currentValue=v,n++}if(n=Object.keys(r).length)for(i=0;i<n;i++)$||($=h(document.body,"transform")?"transform":"-webkit-transform"),d.animatables[i].target.style[$]=r[i].join(" ");d.currentTime=t,d.progress=t/d.duration*100}function o(t){d[t]&&d[t](d)}function a(){d.remaining&&!0!==d.remaining&&d.remaining--}function s(t){var e=d.duration,s=d.offset,h=s+d.delay,v=d.currentTime,m=d.reversed,y=r(t);if(d.children.length){var g=d.children,b=g.length;if(y>=d.currentTime)for(var w=0;w<b;w++)g[w].seek(y);else for(;b--;)g[b].seek(y)}(y>=h||!e)&&(d.began||(d.began=!0,o("begin")),o("run")),y>s&&y<e?i(y):(y<=s&&0!==v&&(i(0),m&&a()),(y>=e&&v!==e||!e)&&(i(e),m||a())),o("update"),t>=e&&(d.remaining?(u=c,"alternate"===d.direction&&(d.reversed=!d.reversed)):(d.pause(),d.completed||(d.completed=!0,o("complete"),"Promise"in window&&(p(),f=n()))),l=0)}t=void 0===t?{}:t;var c,u,l=0,p=null,f=n(),d=L(t);return d.reset=function(){var t=d.direction,e=d.loop;for(d.currentTime=0,d.progress=0,d.paused=!0,d.began=!1,d.completed=!1,d.reversed="reverse"===t,d.remaining="alternate"===t&&1===e?2:e,i(0),t=d.children.length;t--;)d.children[t].reset()},d.tick=function(t){c=t,u||(u=c),s((l+c-u)*M.speed)},d.seek=function(t){s(r(t))},d.pause=function(){var t=H.indexOf(d);-1<t&&H.splice(t,1),d.paused=!0},d.play=function(){d.paused&&(d.paused=!1,u=0,l=r(d.currentTime),H.push(d),X||z())},d.reverse=function(){d.reversed=!d.reversed,u=0,l=r(d.currentTime)},d.restart=function(){d.pause(),d.reset(),d.play()},d.finished=f,d.reset(),d.autoplay&&d.play(),d}var $,I={update:void 0,begin:void 0,run:void 0,complete:void 0,loop:1,direction:"normal",autoplay:!0,offset:0},N={duration:1e3,delay:0,easing:"easeOutElastic",elasticity:500,round:0},D="translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY perspective".split(" "),R={arr:function(t){return Array.isArray(t)},obj:function(t){return-1<Object.prototype.toString.call(t).indexOf("Object")},pth:function(t){return R.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},dom:function(t){return t.nodeType||R.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return R.hex(t)||R.rgb(t)||R.hsl(t)}},F=function(){function t(t,e,n){return(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t}return function(e,n,r,i){if(0<=e&&1>=e&&0<=r&&1>=r){var o=new Float32Array(11);if(e!==n||r!==i)for(var a=0;11>a;++a)o[a]=t(.1*a,e,r);return function(a){if(e===n&&r===i)return a;if(0===a)return 0;if(1===a)return 1;for(var s=0,c=1;10!==c&&o[c]<=a;++c)s+=.1;--c;var c=s+(a-o[c])/(o[c+1]-o[c])*.1,u=3*(1-3*r+3*e)*c*c+2*(3*r-6*e)*c+3*e;if(.001<=u){for(s=0;4>s&&0!=(u=3*(1-3*r+3*e)*c*c+2*(3*r-6*e)*c+3*e);++s)var l=t(c,e,r)-a,c=c-l/u;a=c}else if(0===u)a=c;else{var c=s,s=s+.1,p=0;do{l=c+(s-c)/2,u=t(l,e,r)-a,0<u?s=l:c=l}while(1e-7<Math.abs(u)&&10>++p);a=l}return t(a,n,i)}}}}(),B=function(){function t(t,e){return 0===t||1===t?t:-Math.pow(2,10*(t-1))*Math.sin(2*(t-1-e/(2*Math.PI)*Math.asin(1))*Math.PI/e)}var e,n="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),r={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],t],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(e,n){return 1-t(1-e,n)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(e,n){return.5>e?t(2*e,n)/2:1-t(-2*e+2,n)/2}]},i={linear:F(.25,.25,.75,.75)},o={};for(e in r)o.type=e,r[o.type].forEach(function(t){return function(e,r){i["ease"+t.type+n[r]]=R.fnc(e)?e:F.apply(s,e)}}(o)),o={type:o.type};return i}(),U={css:function(t,e,n){return t.style[e]=n},attribute:function(t,e,n){return t.setAttribute(e,n)},object:function(t,e,n){return t[e]=n},transform:function(t,e,n,r,i){r[i]||(r[i]=[]),r[i].push(e+"("+n+")")}},H=[],X=0,z=function(){function t(){X=requestAnimationFrame(e)}function e(e){var n=H.length;if(n){for(var r=0;r<n;)H[r]&&H[r].tick(e),r++;t()}else cancelAnimationFrame(X),X=0}return t}();return M.version="2.2.0",M.speed=1,M.running=H,M.remove=function(t){t=T(t);for(var e=H.length;e--;)for(var n=H[e],r=n.animations,o=r.length;o--;)i(t,r[o].animatable.target)&&(r.splice(o,1),r.length||n.pause())},M.getValue=y,M.path=function(e,n){var r=R.str(e)?t(e)[0]:e,i=n||100;return function(t){return{el:r,property:t,totalLength:x(r)*(i/100)}}},M.setDashoffset=function(t){var e=x(t);return t.setAttribute("stroke-dasharray",e),e},M.bezier=F,M.easings=B,M.timeline=function(t){var e=M(t);return e.pause(),e.duration=0,e.add=function(n){return e.children.forEach(function(t){t.began=!0,t.completed=!0}),r(n).forEach(function(n){var r=c(n,a(N,t||{}));r.targets=r.targets||t.targets,n=e.duration;var i=r.offset;r.autoplay=!1,r.direction=e.direction,r.offset=R.und(i)?n:g(i,n),e.began=!0,e.completed=!0,e.seek(r.offset),r=M(r),r.began=!0,r.completed=!0,r.duration>n&&(e.duration=r.duration),e.children.push(r)}),e.seek(0),e.reset(),e.autoplay&&e.restart(),e},e},M.random=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},M})}).call(e,n(25))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=n(4),o=n.n(i),a={install:function(t,e){e||(e={});var n=new r.a(e);t.component("toasted",o.a),t.toasted=t.prototype.$toasted=n}};"undefined"!=typeof window&&window.Vue&&(window.Toasted=a),e.default=a},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(1),i=this,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(t,e,n){return setTimeout(function(){if(n.cached_options.position&&n.cached_options.position.includes("bottom"))return void r.a.animateOutBottom(t,function(){n.remove(t)});r.a.animateOut(t,function(){n.remove(t)})},e),!0},s=function(t,e){return("object"===("undefined"==typeof HTMLElement?"undefined":o(HTMLElement))?e instanceof HTMLElement:e&&"object"===(void 0===e?"undefined":o(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)?t.appendChild(e):t.innerHTML=e,i},c=function(t,e){var n=!1;return{el:t,text:function(e){return s(t,e),this},goAway:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:800;return n=!0,a(t,r,e)},remove:function(){e.remove(t)},disposed:function(){return n}}}},function(t,e,n){"use strict";var r=n(12),i=n.n(r),o=n(1),a=n(7),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c=n(2);String.prototype.includes||Object.defineProperty(String.prototype,"includes",{value:function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}});var u={},l=null,p=function(t){return t.className=t.className||null,t.onComplete=t.onComplete||null,t.position=t.position||"top-right",t.duration=t.duration||null,t.theme=t.theme||"toasted-primary",t.type=t.type||"default",t.containerClass=t.containerClass||null,t.fullWidth=t.fullWidth||!1,t.icon=t.icon||null,t.action=t.action||null,t.fitToScreen=t.fitToScreen||null,t.closeOnSwipe=void 0===t.closeOnSwipe||t.closeOnSwipe,t.iconPack=t.iconPack||"material",t.className&&"string"==typeof t.className&&(t.className=t.className.split(" ")),t.className||(t.className=[]),t.theme&&t.className.push(t.theme.trim()),t.type&&t.className.push(t.type),t.containerClass&&"string"==typeof t.containerClass&&(t.containerClass=t.containerClass.split(" ")),t.containerClass||(t.containerClass=[]),t.position&&t.containerClass.push(t.position.trim()),t.fullWidth&&t.containerClass.push("full-width"),t.fitToScreen&&t.containerClass.push("fit-to-screen"),u=t,t},f=function(t,e){var r=document.createElement("div");if(r.classList.add("toasted"),r.hash=c.generate(),e.className&&e.className.forEach(function(t){r.classList.add(t)}),("object"===("undefined"==typeof HTMLElement?"undefined":s(HTMLElement))?t instanceof HTMLElement:t&&"object"===(void 0===t?"undefined":s(t))&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName)?r.appendChild(t):r.innerHTML=t,d(e,r),e.closeOnSwipe){var u=new i.a(r,{prevent_default:!1});u.on("pan",function(t){var e=t.deltaX;r.classList.contains("panning")||r.classList.add("panning");var n=1-Math.abs(e/80);n<0&&(n=0),o.a.animatePanning(r,e,n)}),u.on("panend",function(t){var n=t.deltaX;Math.abs(n)>80?o.a.animatePanEnd(r,function(){"function"==typeof e.onComplete&&e.onComplete(),r.parentNode&&l.remove(r)}):(r.classList.remove("panning"),o.a.animateReset(r))})}if(Array.isArray(e.action))e.action.forEach(function(t){var e=v(t,n.i(a.a)(r,l));e&&r.appendChild(e)});else if("object"===s(e.action)){var p=v(e.action,n.i(a.a)(r,l));p&&r.appendChild(p)}return r},d=function(t,e){if(t.icon){var n=document.createElement("i");switch(t.iconPack){case"fontawesome":n.classList.add("fa");var r=t.icon.name?t.icon.name:t.icon;r.includes("fa-")?n.classList.add(r.trim()):n.classList.add("fa-"+r.trim());break;case"mdi":n.classList.add("mdi");var i=t.icon.name?t.icon.name:t.icon;i.includes("mdi-")?n.classList.add(i.trim()):n.classList.add("mdi-"+i.trim());break;case"custom-class":var o=t.icon.name?t.icon.name:t.icon;"string"==typeof o?o.split(" ").forEach(function(t){n.classList.add(t)}):Array.isArray(o)&&o.forEach(function(t){n.classList.add(t.trim())});break;case"callback":var a=t.icon&&t.icon instanceof Function?t.icon:null;a&&(n=a(n));break;default:n.classList.add("material-icons"),n.textContent=t.icon.name?t.icon.name:t.icon}t.icon.after&&n.classList.add("after"),h(t,n,e)}},h=function(t,e,n){t.icon&&(t.icon.after&&t.icon.name?n.appendChild(e):(t.icon.name,n.insertBefore(e,n.firstChild)))},v=function(t,e){if(!t)return null;var n=document.createElement("a");if(n.classList.add("action"),n.classList.add("ripple"),t.text&&(n.text=t.text),t.href&&(n.href=t.href),t.target&&(n.target=t.target),t.icon){n.classList.add("icon");var r=document.createElement("i");switch(u.iconPack){case"fontawesome":r.classList.add("fa"),t.icon.includes("fa-")?r.classList.add(t.icon.trim()):r.classList.add("fa-"+t.icon.trim());break;case"mdi":r.classList.add("mdi"),t.icon.includes("mdi-")?r.classList.add(t.icon.trim()):r.classList.add("mdi-"+t.icon.trim());break;case"custom-class":"string"==typeof t.icon?t.icon.split(" ").forEach(function(t){n.classList.add(t)}):Array.isArray(t.icon)&&t.icon.forEach(function(t){n.classList.add(t.trim())});break;default:r.classList.add("material-icons"),r.textContent=t.icon}n.appendChild(r)}return t.class&&("string"==typeof t.class?t.class.split(" ").forEach(function(t){n.classList.add(t)}):Array.isArray(t.class)&&t.class.forEach(function(t){n.classList.add(t.trim())})),t.push&&n.addEventListener("click",function(n){n.preventDefault(),u.router&&(u.router.push(t.push),t.push.dontClose||e.goAway(0))}),t.onClick&&"function"==typeof t.onClick&&n.addEventListener("click",function(n){t.onClick&&(n.preventDefault(),t.onClick(n,e))}),n};e.a=function(t,e,r){l=t,r=p(r);var i=document.getElementById(l.id);null===i&&(i=document.createElement("div"),i.id=l.id,document.body.appendChild(i)),r.containerClass.unshift("toasted-container"),i.className!==r.containerClass.join(" ")&&(i.className="",r.containerClass.forEach(function(t){i.classList.add(t)}));var s=f(e,r);e&&i.appendChild(s),s.style.opacity=0,o.a.animateIn(s);var c=r.duration,u=void 0;return null!==c&&(u=setInterval(function(){null===s.parentNode&&window.clearInterval(u),s.classList.contains("panning")||(c-=20),c<=0&&(o.a.animateOut(s,function(){"function"==typeof r.onComplete&&r.onComplete(),s.parentNode&&l.remove(s)}),window.clearInterval(u))},20)),n.i(a.a)(s,l)}},function(t,e,n){e=t.exports=n(10)(),e.push([t.i,".toasted{padding:0 20px}.toasted.rounded{border-radius:24px}.toasted .primary,.toasted.toasted-primary{border-radius:2px;min-height:38px;line-height:1.1em;background-color:#353535;padding:0 20px;font-size:15px;font-weight:300;color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}.toasted .primary.success,.toasted.toasted-primary.success{background:#4caf50}.toasted .primary.error,.toasted.toasted-primary.error{background:#f44336}.toasted .primary.info,.toasted.toasted-primary.info{background:#3f51b5}.toasted .primary .action,.toasted.toasted-primary .action{color:#a1c2fa}.toasted.bubble{border-radius:30px;min-height:38px;line-height:1.1em;background-color:#ff7043;padding:0 20px;font-size:15px;font-weight:300;color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}.toasted.bubble.success{background:#4caf50}.toasted.bubble.error{background:#f44336}.toasted.bubble.info{background:#3f51b5}.toasted.bubble .action{color:#8e2b0c}.toasted.outline{border-radius:30px;min-height:38px;line-height:1.1em;background-color:#fff;border:1px solid #676767;padding:0 20px;font-size:15px;color:#676767;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);font-weight:700}.toasted.outline.success{color:#4caf50;border-color:#4caf50}.toasted.outline.error{color:#f44336;border-color:#f44336}.toasted.outline.info{color:#3f51b5;border-color:#3f51b5}.toasted.outline .action{color:#607d8b}.toasted-container{position:fixed;z-index:10000}.toasted-container,.toasted-container.full-width{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.toasted-container.full-width{max-width:86%;width:100%}.toasted-container.full-width.fit-to-screen{min-width:100%}.toasted-container.full-width.fit-to-screen .toasted:first-child{margin-top:0}.toasted-container.full-width.fit-to-screen.top-right{top:0;right:0}.toasted-container.full-width.fit-to-screen.top-left{top:0;left:0}.toasted-container.full-width.fit-to-screen.top-center{top:0;left:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.full-width.fit-to-screen.bottom-right{right:0;bottom:0}.toasted-container.full-width.fit-to-screen.bottom-left{left:0;bottom:0}.toasted-container.full-width.fit-to-screen.bottom-center{left:0;bottom:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.top-right{top:10%;right:7%}.toasted-container.top-left{top:10%;left:7%}.toasted-container.top-center{top:10%;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.toasted-container.bottom-right{right:5%;bottom:7%}.toasted-container.bottom-left{left:5%;bottom:7%}.toasted-container.bottom-center{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);bottom:7%}.toasted-container.bottom-left .toasted,.toasted-container.top-left .toasted{float:left}.toasted-container.bottom-right .toasted,.toasted-container.top-right .toasted{float:right}.toasted-container .toasted{top:35px;width:auto;clear:both;margin-top:10px;position:relative;max-width:100%;height:auto;word-break:normal;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;box-sizing:inherit}.toasted-container .toasted .fa,.toasted-container .toasted .fab,.toasted-container .toasted .far,.toasted-container .toasted .fas,.toasted-container .toasted .material-icons,.toasted-container .toasted .mdi{margin-right:.5rem;margin-left:-.4rem}.toasted-container .toasted .fa.after,.toasted-container .toasted .fab.after,.toasted-container .toasted .far.after,.toasted-container .toasted .fas.after,.toasted-container .toasted .material-icons.after,.toasted-container .toasted .mdi.after{margin-left:.5rem;margin-right:-.4rem}.toasted-container .toasted .action{text-decoration:none;font-size:.8rem;padding:8px;margin:5px -7px 5px 7px;border-radius:3px;text-transform:uppercase;letter-spacing:.03em;font-weight:600;cursor:pointer}.toasted-container .toasted .action.icon{padding:4px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.toasted-container .toasted .action.icon .fa,.toasted-container .toasted .action.icon .material-icons,.toasted-container .toasted .action.icon .mdi{margin-right:0;margin-left:4px}.toasted-container .toasted .action.icon:hover{text-decoration:none}.toasted-container .toasted .action:hover{text-decoration:underline}@media only screen and (max-width:600px){#toasted-container{min-width:100%}#toasted-container .toasted:first-child{margin-top:0}#toasted-container.top-right{top:0;right:0}#toasted-container.top-left{top:0;left:0}#toasted-container.top-center{top:0;left:0;-webkit-transform:translateX(0);transform:translateX(0)}#toasted-container.bottom-right{right:0;bottom:0}#toasted-container.bottom-left{left:0;bottom:0}#toasted-container.bottom-center{left:0;bottom:0;-webkit-transform:translateX(0);transform:translateX(0)}#toasted-container.bottom-center,#toasted-container.top-center{-ms-flex-align:stretch!important;align-items:stretch!important}#toasted-container.bottom-left .toasted,#toasted-container.bottom-right .toasted,#toasted-container.top-left .toasted,#toasted-container.top-right .toasted{float:none}#toasted-container .toasted{border-radius:0}}",""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(t,e,n){"use strict";function r(t,e){if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var n=Object(t),r=1;r<arguments.length;r++){var i=arguments[r];if(void 0!==i&&null!==i)for(var o=Object.keys(Object(i)),a=0,s=o.length;a<s;a++){var c=o[a],u=Object.getOwnPropertyDescriptor(i,c);void 0!==u&&u.enumerable&&(n[c]=i[c])}}return n}function i(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:r})}t.exports={assign:r,polyfill:i}},function(t,e,n){var r;!function(i,o,a,s){"use strict";function c(t,e,n){return setTimeout(d(t,n),e)}function u(t,e,n){return!!Array.isArray(t)&&(l(t,n[e],n),!0)}function l(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==s)for(r=0;r<t.length;)e.call(n,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t)}function p(t,e,n){var r="DEPRECATED METHOD: "+e+"\n"+n+" AT \n";return function(){var e=new Error("get-stack-trace"),n=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),t.apply(this,arguments)}}function f(t,e,n){var r,i=e.prototype;r=t.prototype=Object.create(i),r.constructor=t,r._super=i,n&&ht(r,n)}function d(t,e){return function(){return t.apply(e,arguments)}}function h(t,e){return typeof t==yt?t.apply(e?e[0]||s:s,e):t}function v(t,e){return t===s?e:t}function m(t,e,n){l(w(e),function(e){t.addEventListener(e,n,!1)})}function y(t,e,n){l(w(e),function(e){t.removeEventListener(e,n,!1)})}function g(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return t.indexOf(e)>-1}function w(t){return t.trim().split(/\s+/g)}function x(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;r<t.length;){if(n&&t[r][n]==e||!n&&t[r]===e)return r;r++}return-1}function _(t){return Array.prototype.slice.call(t,0)}function k(t,e,n){for(var r=[],i=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];x(i,a)<0&&r.push(t[o]),i[o]=a,o++}return n&&(r=e?r.sort(function(t,n){return t[e]>n[e]}):r.sort()),r}function T(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o<vt.length;){if(n=vt[o],(r=n?n+i:e)in t)return r;o++}return s}function O(){return kt++}function E(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||i}function C(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){h(t.options.enable,[t])&&n.handler(e)},this.init()}function A(t){return new(t.options.inputClass||(Et?H:Ct?Y:Ot?V:U))(t,S)}function S(t,e,n){var r=n.pointers.length,i=n.changedPointers.length,o=e&St&&r-i==0,a=e&(jt|Lt)&&r-i==0;n.isFirst=!!o,n.isFinal=!!a,o&&(t.session={}),n.eventType=e,P(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function P(t,e){var n=t.session,r=e.pointers,i=r.length;n.firstInput||(n.firstInput=M(e)),i>1&&!n.firstMultiple?n.firstMultiple=M(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,c=e.center=$(r);e.timeStamp=wt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=R(s,c),e.distance=D(s,c),j(n,e),e.offsetDirection=N(e.deltaX,e.deltaY);var u=I(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=bt(u.x)>bt(u.y)?u.x:u.y,e.scale=a?B(a.pointers,r):1,e.rotation=a?F(a.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,L(n,e);var l=t.element;g(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function j(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};e.eventType!==St&&o.eventType!==jt||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}function L(t,e){var n,r,i,o,a=t.lastInterval||e,c=e.timeStamp-a.timeStamp;if(e.eventType!=Lt&&(c>At||a.velocity===s)){var u=e.deltaX-a.deltaX,l=e.deltaY-a.deltaY,p=I(c,u,l);r=p.x,i=p.y,n=bt(p.x)>bt(p.y)?p.x:p.y,o=N(u,l),t.lastInterval=e}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}function M(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:gt(t.pointers[n].clientX),clientY:gt(t.pointers[n].clientY)},n++;return{timeStamp:wt(),pointers:e,center:$(e),deltaX:t.deltaX,deltaY:t.deltaY}}function $(t){var e=t.length;if(1===e)return{x:gt(t[0].clientX),y:gt(t[0].clientY)};for(var n=0,r=0,i=0;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:gt(n/e),y:gt(r/e)}}function I(t,e,n){return{x:e/t||0,y:n/t||0}}function N(t,e){return t===e?Mt:bt(t)>=bt(e)?t<0?$t:It:e<0?Nt:Dt}function D(t,e,n){n||(n=Ut);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function R(t,e,n){n||(n=Ut);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}function F(t,e){return R(e[1],e[0],Ht)+R(t[1],t[0],Ht)}function B(t,e){return D(e[0],e[1],Ht)/D(t[0],t[1],Ht)}function U(){this.evEl=zt,this.evWin=Yt,this.pressed=!1,C.apply(this,arguments)}function H(){this.evEl=Wt,this.evWin=Gt,C.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function X(){this.evTarget=Jt,this.evWin=Qt,this.started=!1,C.apply(this,arguments)}function z(t,e){var n=_(t.touches),r=_(t.changedTouches);return e&(jt|Lt)&&(n=k(n.concat(r),"identifier",!0)),[n,r]}function Y(){this.evTarget=te,this.targetIds={},C.apply(this,arguments)}function q(t,e){var n=_(t.touches),r=this.targetIds;if(e&(St|Pt)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=_(t.changedTouches),s=[],c=this.target;if(o=n.filter(function(t){return g(t.target,c)}),e===St)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),e&(jt|Lt)&&delete r[a[i].identifier],i++;return s.length?[k(o.concat(s),"identifier",!0),s]:void 0}function V(){C.apply(this,arguments);var t=d(this.handler,this);this.touch=new Y(this.manager,t),this.mouse=new U(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function W(t,e){t&St?(this.primaryTouch=e.changedPointers[0].identifier,G.call(this,e)):t&(jt|Lt)&&G.call(this,e)}function G(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var r=this.lastTouches,i=function(){var t=r.indexOf(n);t>-1&&r.splice(t,1)};setTimeout(i,ee)}}function K(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(e-i.x),a=Math.abs(n-i.y);if(o<=ne&&a<=ne)return!0}return!1}function J(t,e){this.manager=t,this.set(e)}function Q(t){if(b(t,se))return se;var e=b(t,ce),n=b(t,ue);return e&&n?se:e||n?e?ce:ue:b(t,ae)?ae:oe}function Z(t){this.options=ht({},this.defaults,t||{}),this.id=O(),this.manager=null,this.options.enable=v(this.options.enable,!0),this.state=pe,this.simultaneous={},this.requireFail=[]}function tt(t){return t&me?"cancel":t&he?"end":t&de?"move":t&fe?"start":""}function et(t){return t==Dt?"down":t==Nt?"up":t==$t?"left":t==It?"right":""}function nt(t,e){var n=e.manager;return n?n.get(t):t}function rt(){Z.apply(this,arguments)}function it(){rt.apply(this,arguments),this.pX=null,this.pY=null}function ot(){rt.apply(this,arguments)}function at(){Z.apply(this,arguments),this._timer=null,this._input=null}function st(){rt.apply(this,arguments)}function ct(){rt.apply(this,arguments)}function ut(){Z.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function lt(t,e){return e=e||{},e.recognizers=v(e.recognizers,lt.defaults.preset),new pt(t,e)}function pt(t,e){this.options=ht({},lt.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=A(this),this.touchAction=new J(this,this.options.touchAction),ft(this,!0),l(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function ft(t,e){var n=t.element;if(n.style){var r;l(t.options.cssProps,function(i,o){r=T(n.style,o),e?(t.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=t.oldCssProps[r]||""}),e||(t.oldCssProps={})}}function dt(t,e){var n=o.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}var ht,vt=["","webkit","Moz","MS","ms","o"],mt=o.createElement("div"),yt="function",gt=Math.round,bt=Math.abs,wt=Date.now;ht="function"!=typeof Object.assign?function(t){if(t===s||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==s&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}:Object.assign;var xt=p(function(t,e,n){for(var r=Object.keys(e),i=0;i<r.length;)(!n||n&&t[r[i]]===s)&&(t[r[i]]=e[r[i]]),i++;return t},"extend","Use `assign`."),_t=p(function(t,e){return xt(t,e,!0)},"merge","Use `assign`."),kt=1,Tt=/mobile|tablet|ip(ad|hone|od)|android/i,Ot="ontouchstart"in i,Et=T(i,"PointerEvent")!==s,Ct=Ot&&Tt.test(navigator.userAgent),At=25,St=1,Pt=2,jt=4,Lt=8,Mt=1,$t=2,It=4,Nt=8,Dt=16,Rt=$t|It,Ft=Nt|Dt,Bt=Rt|Ft,Ut=["x","y"],Ht=["clientX","clientY"];C.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(E(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(E(this.element),this.evWin,this.domHandler)}};var Xt={mousedown:St,mousemove:Pt,mouseup:jt},zt="mousedown",Yt="mousemove mouseup";f(U,C,{handler:function(t){var e=Xt[t.type];e&St&&0===t.button&&(this.pressed=!0),e&Pt&&1!==t.which&&(e=jt),this.pressed&&(e&jt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var qt={pointerdown:St,pointermove:Pt,pointerup:jt,pointercancel:Lt,pointerout:Lt},Vt={2:"touch",3:"pen",4:"mouse",5:"kinect"},Wt="pointerdown",Gt="pointermove pointerup pointercancel";i.MSPointerEvent&&!i.PointerEvent&&(Wt="MSPointerDown",Gt="MSPointerMove MSPointerUp MSPointerCancel"),f(H,C,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=qt[r],o=Vt[t.pointerType]||t.pointerType,a="touch"==o,s=x(e,t.pointerId,"pointerId");i&St&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):i&(jt|Lt)&&(n=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}});var Kt={touchstart:St,touchmove:Pt,touchend:jt,touchcancel:Lt},Jt="touchstart",Qt="touchstart touchmove touchend touchcancel";f(X,C,{handler:function(t){var e=Kt[t.type];if(e===St&&(this.started=!0),this.started){var n=z.call(this,t,e);e&(jt|Lt)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var Zt={touchstart:St,touchmove:Pt,touchend:jt,touchcancel:Lt},te="touchstart touchmove touchend touchcancel";f(Y,C,{handler:function(t){var e=Zt[t.type],n=q.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}});var ee=2500,ne=25;f(V,C,{handler:function(t,e,n){var r="touch"==n.pointerType,i="mouse"==n.pointerType;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)W.call(this,e,n);else if(i&&K.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var re=T(mt.style,"touchAction"),ie=re!==s,oe="auto",ae="manipulation",se="none",ce="pan-x",ue="pan-y",le=function(){if(!ie)return!1;var t={},e=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(n){t[n]=!e||i.CSS.supports("touch-action",n)}),t}();J.prototype={set:function(t){"compute"==t&&(t=this.compute()),ie&&this.manager.element.style&&le[t]&&(this.manager.element.style[re]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){h(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),Q(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var r=this.actions,i=b(r,se)&&!le[se],o=b(r,ue)&&!le[ue],a=b(r,ce)&&!le[ce];if(i){var s=1===t.pointers.length,c=t.distance<2,u=t.deltaTime<250;if(s&&c&&u)return}return a&&o?void 0:i||o&&n&Rt||a&&n&Ft?this.preventSrc(e):void 0},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var pe=1,fe=2,de=4,he=8,ve=he,me=16;Z.prototype={defaults:{},set:function(t){return ht(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(u(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=nt(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return u(t,"dropRecognizeWith",this)?this:(t=nt(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(u(t,"requireFailure",this))return this;var e=this.requireFail;return t=nt(t,this),-1===x(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(u(t,"dropRequireFailure",this))return this;t=nt(t,this);var e=x(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,r=this.state;r<he&&e(n.options.event+tt(r)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),r>=he&&e(n.options.event+tt(r))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(32|pe)))return!1;t++}return!0},recognize:function(t){var e=ht({},t);if(!h(this.options.enable,[this,e]))return this.reset(),void(this.state=32);this.state&(ve|me|32)&&(this.state=pe),this.state=this.process(e),this.state&(fe|de|he|me)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},f(rt,Z,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,r=e&(fe|de),i=this.attrTest(t);return r&&(n&Lt||!i)?e|me:r||i?n&jt?e|he:e&fe?e|de:fe:32}}),f(it,rt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Bt},getTouchAction:function(){var t=this.options.direction,e=[];return t&Rt&&e.push(ue),t&Ft&&e.push(ce),e},directionTest:function(t){var e=this.options,n=!0,r=t.distance,i=t.direction,o=t.deltaX,a=t.deltaY;return i&e.direction||(e.direction&Rt?(i=0===o?Mt:o<0?$t:It,n=o!=this.pX,r=Math.abs(t.deltaX)):(i=0===a?Mt:a<0?Nt:Dt,n=a!=this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&e.direction},attrTest:function(t){return rt.prototype.attrTest.call(this,t)&&(this.state&fe||!(this.state&fe)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=et(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),f(ot,rt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[se]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&fe)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),f(at,Z,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[oe]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!r||!n||t.eventType&(jt|Lt)&&!i)this.reset();else if(t.eventType&St)this.reset(),this._timer=c(function(){this.state=ve,this.tryEmit()},e.time,this);else if(t.eventType&jt)return ve;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===ve&&(t&&t.eventType&jt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=wt(),this.manager.emit(this.options.event,this._input)))}}),f(st,rt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[se]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&fe)}}),f(ct,rt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Rt|Ft,pointers:1},getTouchAction:function(){return it.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Rt|Ft)?e=t.overallVelocity:n&Rt?e=t.overallVelocityX:n&Ft&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&bt(e)>this.options.velocity&&t.eventType&jt},emit:function(t){var e=et(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),f(ut,Z,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ae]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),t.eventType&St&&0===this.count)return this.failTimeout();if(r&&i&&n){if(t.eventType!=jt)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||D(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t,0==this.count%e.taps)return this.hasRequireFailures()?(this._timer=c(function(){this.state=ve,this.tryEmit()},e.interval,this),fe):ve}return 32},failTimeout:function(){return this._timer=c(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ve&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),lt.VERSION="2.0.7",lt.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[st,{enable:!1}],[ot,{enable:!1},["rotate"]],[ct,{direction:Rt}],[it,{direction:Rt},["swipe"]],[ut],[ut,{event:"doubletap",taps:2},["tap"]],[at]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},pt.prototype={set:function(t){return ht(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var n,r=this.recognizers,i=e.curRecognizer;(!i||i&&i.state&ve)&&(i=e.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===e.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&n.state&(fe|de|he)&&(i=e.curRecognizer=n),o++}},get:function(t){if(t instanceof Z)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(u(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(u(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=x(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==s&&e!==s){var n=this.handlers;return l(w(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this}},off:function(t,e){if(t!==s){var n=this.handlers;return l(w(t),function(t){e?n[t]&&n[t].splice(x(n[t],e),1):delete n[t]}),this}},emit:function(t,e){this.options.domEvents&&dt(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&ft(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ht(lt,{INPUT_START:St,INPUT_MOVE:Pt,INPUT_END:jt,INPUT_CANCEL:Lt,STATE_POSSIBLE:pe,STATE_BEGAN:fe,STATE_CHANGED:de,STATE_ENDED:he,STATE_RECOGNIZED:ve,STATE_CANCELLED:me,STATE_FAILED:32,DIRECTION_NONE:Mt,DIRECTION_LEFT:$t,DIRECTION_RIGHT:It,DIRECTION_UP:Nt,DIRECTION_DOWN:Dt,DIRECTION_HORIZONTAL:Rt,DIRECTION_VERTICAL:Ft,DIRECTION_ALL:Bt,Manager:pt,Input:C,TouchAction:J,TouchInput:Y,MouseInput:U,PointerEventInput:H,TouchMouseInput:V,SingleTouchInput:X,Recognizer:Z,AttrRecognizer:rt,Tap:ut,Pan:it,Swipe:ct,Pinch:ot,Rotate:st,Press:at,on:m,off:y,each:l,merge:_t,extend:xt,assign:ht,inherit:f,bindFn:d,prefixed:T}),(void 0!==i?i:"undefined"!=typeof self?self:{}).Hammer=lt,(r=function(){return lt}.call(e,n,e,t))!==s&&(t.exports=r)}(window,document)},function(t,e){t.exports=function(t,e,n){for(var r=(2<<Math.log(e.length-1)/Math.LN2)-1,i=Math.ceil(1.6*r*n/e.length),o="";;)for(var a=t(i),s=0;s<i;s++){var c=a[s]&r;if(e[c]&&(o+=e[c],o.length===n))return o}}},function(t,e,n){"use strict";function r(t){var e="",n=Math.floor(.001*(Date.now()-s));return n===o?i++:(i=0,o=n),e+=a(c),e+=a(t),i>0&&(e+=a(i)),e+=a(n)}var i,o,a=n(15),s=(n(0),1459707606518),c=6;t.exports=r},function(t,e,n){"use strict";function r(t){for(var e,n=0,r="";!e;)r+=a(o,i.get(),1),e=t<Math.pow(16,n+1),n++;return r}var i=n(0),o=n(18),a=n(13);t.exports=r},function(t,e,n){"use strict";function r(e){return s.seed(e),t.exports}function i(e){return l=e,t.exports}function o(t){return void 0!==t&&s.characters(t),s.shuffled()}function a(){return c(l)}var s=n(0),c=n(14),u=n(17),l=n(20)||0;t.exports=a,t.exports.generate=a,t.exports.seed=r,t.exports.worker=i,t.exports.characters=o,t.exports.isValid=u},function(t,e,n){"use strict";function r(t){return!(!t||"string"!=typeof t||t.length<6||new RegExp("[^"+i.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]").test(t))}var i=n(0);t.exports=r},function(t,e,n){"use strict";var r,i="object"==typeof window&&(window.crypto||window.msCrypto);r=i&&i.getRandomValues?function(t){return i.getRandomValues(new Uint8Array(t))}:function(t){for(var e=[],n=0;n<t;n++)e.push(Math.floor(256*Math.random()));return e},t.exports=r},function(t,e,n){"use strict";function r(){return(o=(9301*o+49297)%233280)/233280}function i(t){o=t}var o=1;t.exports={nextValue:r,seed:i}},function(t,e,n){"use strict";t.exports=0},function(t,e){t.exports=function(t,e,n,r){var i,o=t=t||{},a=typeof t.default;"object"!==a&&"function"!==a||(i=t,o=t.default);var s="function"==typeof o?o.options:o;if(e&&(s.render=e.render,s.staticRenderFns=e.staticRenderFns),n&&(s._scopeId=n),r){var c=Object.create(s.computed||null);Object.keys(r).forEach(function(t){var e=r[t];c[t]=function(){return e}}),s.computed=c}return{esModule:i,exports:o,options:s}}},function(t,e,n){var r=n(9);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(23)("02af2e15",r,!0,{})},function(t,e,n){function r(t){for(var e=0;e<t.length;e++){var n=t[e],r=l[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(o(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var a=[],i=0;i<n.parts.length;i++)a.push(o(n.parts[i]));l[n.id]={id:n.id,refs:1,parts:a}}}}function i(){var t=document.createElement("style");return t.type="text/css",p.appendChild(t),t}function o(t){var e,n,r=document.querySelector("style["+y+'~="'+t.id+'"]');if(r){if(h)return v;r.parentNode.removeChild(r)}if(g){var o=d++;r=f||(f=i()),e=a.bind(null,r,o,!1),n=a.bind(null,r,o,!0)}else r=i(),e=s.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}function a(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=b(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function s(t,e){var n=e.css,r=e.media,i=e.sourceMap;if(r&&t.setAttribute("media",r),m.ssrId&&t.setAttribute(y,e.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var c="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!c)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var u=n(24),l={},p=c&&(document.head||document.getElementsByTagName("head")[0]),f=null,d=0,h=!1,v=function(){},m=null,y="data-vue-ssr-id",g="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,n,i){h=n,m=i||{};var o=u(t,e);return r(o),function(e){for(var n=[],i=0;i<o.length;i++){var a=o[i],s=l[a.id];s.refs--,n.push(s)}e?(o=u(t,e),r(o)):o=[];for(var i=0;i<n.length;i++){var s=n[i];if(0===s.refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete l[s.id]}}}};var b=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){t.exports=function(t,e){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],a=o[0],s=o[1],c=o[2],u=o[3],l={id:t+":"+i,css:s,media:c,sourceMap:u};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n}])}()}()},function(t,e,n){/*!
|
13 |
* vue-tippy v2.1.2
|
14 |
* (c) 2019 Georges KABBOUCHI
|
15 |
* Released under the MIT License.
|
1 |
+
webpackJsonpWPRA([0],[function(t,e,n){"use strict";function r(t){return"[object Array]"===T.call(t)}function i(t){return"[object ArrayBuffer]"===T.call(t)}function o(t){return"undefined"!=typeof FormData&&t instanceof FormData}function a(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer}function s(t){return"string"==typeof t}function c(t){return"number"==typeof t}function u(t){return void 0===t}function l(t){return null!==t&&"object"==typeof t}function p(t){return"[object Date]"===T.call(t)}function f(t){return"[object File]"===T.call(t)}function d(t){return"[object Blob]"===T.call(t)}function h(t){return"[object Function]"===T.call(t)}function v(t){return l(t)&&h(t.pipe)}function m(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams}function y(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function g(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document}function b(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),r(t))for(var n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}function w(){function t(t,n){"object"==typeof e[n]&&"object"==typeof t?e[n]=w(e[n],t):e[n]=t}for(var e={},n=0,r=arguments.length;n<r;n++)b(arguments[n],t);return e}function x(t,e,n){return b(e,function(e,r){t[r]=n&&"function"==typeof e?_(e,n):e}),t}var _=n(10),k=n(24),T=Object.prototype.toString;t.exports={isArray:r,isArrayBuffer:i,isBuffer:k,isFormData:o,isArrayBufferView:a,isString:s,isNumber:c,isObject:l,isUndefined:u,isDate:p,isFile:f,isBlob:d,isFunction:h,isStream:v,isURLSearchParams:m,isStandardBrowserEnv:g,forEach:b,merge:w,extend:x,trim:y}},function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){var c="function"==typeof t?t.options:t;e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o);var u;if(a?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=u):i&&(u=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),u)if(c.functional){c._injectStyles=u;var l=c.render;c.render=function(t,e){return u.call(e),l(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,u):[u]}return{exports:t,options:c}}e.a=r},function(t,e){function n(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}}var r=/^(attrs|props|on|nativeOn|class|style|hook)$/;t.exports=function(t){return t.reduce(function(t,e){var i,o,a,s,c;for(a in e)if(i=t[a],o=e[a],i&&r.test(a))if("class"===a&&("string"==typeof i&&(c=i,t[a]=i={},i[c]=!0),"string"==typeof o&&(c=o,e[a]=o={},o[c]=!0)),"on"===a||"nativeOn"===a||"hook"===a)for(s in o)i[s]=n(i[s],o[s]);else if(Array.isArray(i))t[a]=i.concat(o);else if(Array.isArray(o))t[a]=[i].concat(o);else for(s in o)i[s]=o[s];else t[a]=e[a];return t},{})}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(t,n){function r(t){return void 0===t||null===t}function i(t){return void 0!==t&&null!==t}function o(t){return!0===t}function a(t){return!1===t}function s(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function c(t){return null!==t&&"object"==typeof t}function u(t){return"[object Object]"===po.call(t)}function l(t){return"[object RegExp]"===po.call(t)}function p(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function d(t){var e=parseFloat(t);return isNaN(e)?t:e}function h(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}function v(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function m(t,e){return vo.call(t,e)}function y(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function g(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function b(t,e){return t.bind(e)}function w(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function x(t,e){for(var n in e)t[n]=e[n];return t}function _(t){for(var e={},n=0;n<t.length;n++)t[n]&&x(e,t[n]);return e}function k(t,e,n){}function T(t,e){if(t===e)return!0;var n=c(t),r=c(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var i=Array.isArray(t),o=Array.isArray(e);if(i&&o)return t.length===e.length&&t.every(function(t,n){return T(t,e[n])});if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(i||o)return!1;var a=Object.keys(t),s=Object.keys(e);return a.length===s.length&&a.every(function(n){return T(t[n],e[n])})}catch(t){return!1}}function O(t,e){for(var n=0;n<t.length;n++)if(T(t[n],e))return n;return-1}function E(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function C(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function A(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function S(t){if(!Ao.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}function P(t){return"function"==typeof t&&/native code/.test(t.toString())}function j(t){Go.push(t),Wo.target=t}function L(){Go.pop(),Wo.target=Go[Go.length-1]}function M(t){return new Ko(void 0,void 0,void 0,String(t))}function $(t){var e=new Ko(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}function I(t){na=t}function N(t,e){t.__proto__=e}function D(t,e,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];A(t,o,e[o])}}function R(t,e){if(c(t)&&!(t instanceof Ko)){var n;return m(t,"__ob__")&&t.__ob__ instanceof ra?n=t.__ob__:na&&!Xo()&&(Array.isArray(t)||u(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new ra(t)),e&&n&&n.vmCount++,n}}function F(t,e,n,r,i){var o=new Wo,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=t[e]);var u=!i&&R(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=s?s.call(t):n;return Wo.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(e)&&H(e))),e},set:function(e){var r=s?s.call(t):n;e===r||e!==e&&r!==r||s&&!c||(c?c.call(t,e):n=e,u=!i&&R(e),o.notify())}})}}function B(t,e,n){if(Array.isArray(t)&&p(e))return t.length=Math.max(t.length,e),t.splice(e,1,n),n;if(e in t&&!(e in Object.prototype))return t[e]=n,n;var r=t.__ob__;return t._isVue||r&&r.vmCount?n:r?(F(r.value,e,n),r.dep.notify(),n):(t[e]=n,n)}function U(t,e){if(Array.isArray(t)&&p(e))return void t.splice(e,1);var n=t.__ob__;t._isVue||n&&n.vmCount||m(t,e)&&(delete t[e],n&&n.dep.notify())}function H(t){for(var e=void 0,n=0,r=t.length;n<r;n++)e=t[n],e&&e.__ob__&&e.__ob__.dep.depend(),Array.isArray(e)&&H(e)}function X(t,e){if(!e)return t;for(var n,r,i,o=Object.keys(e),a=0;a<o.length;a++)n=o[a],r=t[n],i=e[n],m(t,n)?r!==i&&u(r)&&u(i)&&X(r,i):B(t,n,i);return t}function z(t,e,n){return n?function(){var r="function"==typeof e?e.call(n,n):e,i="function"==typeof t?t.call(n,n):t;return r?X(r,i):i}:e?t?function(){return X("function"==typeof e?e.call(this,this):e,"function"==typeof t?t.call(this,this):t)}:e:t}function Y(t,e){var n=e?t?t.concat(e):Array.isArray(e)?e:[e]:t;return n?q(n):n}function q(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}function V(t,e,n,r){var i=Object.create(t||null);return e?x(i,e):i}function W(t,e){var n=t.props;if(n){var r,i,o,a={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o=yo(i),a[o]={type:null});else if(u(n))for(var s in n)i=n[s],o=yo(s),a[o]=u(i)?i:{type:i};t.props=a}}function G(t,e){var n=t.inject;if(n){var r=t.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(u(n))for(var o in n){var a=n[o];r[o]=u(a)?x({from:o},a):{from:a}}}}function K(t){var e=t.directives;if(e)for(var n in e){var r=e[n];"function"==typeof r&&(e[n]={bind:r,update:r})}}function J(t,e,n){function r(r){var i=ia[r]||sa;s[r]=i(t[r],e[r],n,r)}if("function"==typeof e&&(e=e.options),W(e,n),G(e,n),K(e),!e._base&&(e.extends&&(t=J(t,e.extends,n)),e.mixins))for(var i=0,o=e.mixins.length;i<o;i++)t=J(t,e.mixins[i],n);var a,s={};for(a in t)r(a);for(a in e)m(t,a)||r(a);return s}function Q(t,e,n,r){if("string"==typeof n){var i=t[e];if(m(i,n))return i[n];var o=yo(n);if(m(i,o))return i[o];var a=go(o);return m(i,a)?i[a]:i[n]||i[o]||i[a]}}function Z(t,e,n,r){var i=e[t],o=!m(n,t),a=n[t],s=rt(Boolean,i.type);if(s>-1)if(o&&!m(i,"default"))a=!1;else if(""===a||a===wo(t)){var c=rt(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=tt(r,i,t);var u=na;I(!0),R(a),I(u)}return a}function tt(t,e,n){if(m(e,"default")){var r=e.default;return t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n]?t._props[n]:"function"==typeof r&&"Function"!==et(e.type)?r.call(t):r}}function et(t){var e=t&&t.toString().match(/^\s*function (\w+)/);return e?e[1]:""}function nt(t,e){return et(t)===et(e)}function rt(t,e){if(!Array.isArray(e))return nt(e,t)?0:-1;for(var n=0,r=e.length;n<r;n++)if(nt(e[n],t))return n;return-1}function it(t,e,n){if(e)for(var r=e;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{var a=!1===i[o].call(r,t,e,n);if(a)return}catch(t){ot(t,r,"errorCaptured hook")}}ot(t,e,n)}function ot(t,e,n){if(Co.errorHandler)try{return Co.errorHandler.call(null,t,e,n)}catch(t){at(t,null,"config.errorHandler")}at(t,e,n)}function at(t,e,n){if(!Po&&!jo||"undefined"==typeof console)throw t;console.error(t)}function st(){ua=!1;var t=ca.slice(0);ca.length=0;for(var e=0;e<t.length;e++)t[e]()}function ct(t){return t._withTask||(t._withTask=function(){la=!0;try{return t.apply(null,arguments)}finally{la=!1}})}function ut(t,e){var n;if(ca.push(function(){if(t)try{t.call(e)}catch(t){it(t,e,"nextTick")}else n&&n(e)}),ua||(ua=!0,la?aa():oa()),!t&&"undefined"!=typeof Promise)return new Promise(function(t){n=t})}function lt(t){pt(t,va),va.clear()}function pt(t,e){var n,r,i=Array.isArray(t);if(!(!i&&!c(t)||Object.isFrozen(t)||t instanceof Ko)){if(t.__ob__){var o=t.__ob__.dep.id;if(e.has(o))return;e.add(o)}if(i)for(n=t.length;n--;)pt(t[n],e);else for(r=Object.keys(t),n=r.length;n--;)pt(t[r[n]],e)}}function ft(t){function e(){var t=arguments,n=e.fns;if(!Array.isArray(n))return n.apply(null,arguments);for(var r=n.slice(),i=0;i<r.length;i++)r[i].apply(null,t)}return e.fns=t,e}function dt(t,e,n,i,a,s){var c,u,l,p;for(c in t)u=t[c],l=e[c],p=ma(c),r(u)||(r(l)?(r(u.fns)&&(u=t[c]=ft(u)),o(p.once)&&(u=t[c]=a(p.name,u,p.capture)),n(p.name,u,p.capture,p.passive,p.params)):u!==l&&(l.fns=u,t[c]=l));for(c in e)r(t[c])&&(p=ma(c),i(p.name,e[c],p.capture))}function ht(t,e,n){function a(){n.apply(this,arguments),v(s.fns,a)}t instanceof Ko&&(t=t.data.hook||(t.data.hook={}));var s,c=t[e];r(c)?s=ft([a]):i(c.fns)&&o(c.merged)?(s=c,s.fns.push(a)):s=ft([c,a]),s.merged=!0,t[e]=s}function vt(t,e,n){var o=e.options.props;if(!r(o)){var a={},s=t.attrs,c=t.props;if(i(s)||i(c))for(var u in o){var l=wo(u);mt(a,c,u,l,!0)||mt(a,s,u,l,!1)}return a}}function mt(t,e,n,r,o){if(i(e)){if(m(e,n))return t[n]=e[n],o||delete e[n],!0;if(m(e,r))return t[n]=e[r],o||delete e[r],!0}return!1}function yt(t){for(var e=0;e<t.length;e++)if(Array.isArray(t[e]))return Array.prototype.concat.apply([],t);return t}function gt(t){return s(t)?[M(t)]:Array.isArray(t)?wt(t):void 0}function bt(t){return i(t)&&i(t.text)&&a(t.isComment)}function wt(t,e){var n,a,c,u,l=[];for(n=0;n<t.length;n++)a=t[n],r(a)||"boolean"==typeof a||(c=l.length-1,u=l[c],Array.isArray(a)?a.length>0&&(a=wt(a,(e||"")+"_"+n),bt(a[0])&&bt(u)&&(l[c]=M(u.text+a[0].text),a.shift()),l.push.apply(l,a)):s(a)?bt(u)?l[c]=M(u.text+a):""!==a&&l.push(M(a)):bt(a)&&bt(u)?l[c]=M(u.text+a.text):(o(t._isVList)&&i(a.tag)&&r(a.key)&&i(e)&&(a.key="__vlist"+e+"_"+n+"__"),l.push(a)));return l}function xt(t,e){return(t.__esModule||Yo&&"Module"===t[Symbol.toStringTag])&&(t=t.default),c(t)?e.extend(t):t}function _t(t,e,n,r,i){var o=Qo();return o.asyncFactory=t,o.asyncMeta={data:e,context:n,children:r,tag:i},o}function kt(t,e,n){if(o(t.error)&&i(t.errorComp))return t.errorComp;if(i(t.resolved))return t.resolved;if(o(t.loading)&&i(t.loadingComp))return t.loadingComp;if(!i(t.contexts)){var a=t.contexts=[n],s=!0,u=function(t){for(var e=0,n=a.length;e<n;e++)a[e].$forceUpdate();t&&(a.length=0)},l=E(function(n){t.resolved=xt(n,e),s?a.length=0:u(!0)}),p=E(function(e){i(t.errorComp)&&(t.error=!0,u(!0))}),f=t(l,p);return c(f)&&("function"==typeof f.then?r(t.resolved)&&f.then(l,p):i(f.component)&&"function"==typeof f.component.then&&(f.component.then(l,p),i(f.error)&&(t.errorComp=xt(f.error,e)),i(f.loading)&&(t.loadingComp=xt(f.loading,e),0===f.delay?t.loading=!0:setTimeout(function(){r(t.resolved)&&r(t.error)&&(t.loading=!0,u(!1))},f.delay||200)),i(f.timeout)&&setTimeout(function(){r(t.resolved)&&p(null)},f.timeout))),s=!1,t.loading?t.loadingComp:t.resolved}t.contexts.push(n)}function Tt(t){return t.isComment&&t.asyncFactory}function Ot(t){if(Array.isArray(t))for(var e=0;e<t.length;e++){var n=t[e];if(i(n)&&(i(n.componentOptions)||Tt(n)))return n}}function Et(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Pt(t,e)}function Ct(t,e){ha.$on(t,e)}function At(t,e){ha.$off(t,e)}function St(t,e){var n=ha;return function r(){null!==e.apply(null,arguments)&&n.$off(t,r)}}function Pt(t,e,n){ha=t,dt(e,n||{},Ct,At,St,t),ha=void 0}function jt(t,e){var n={};if(!t)return n;for(var r=0,i=t.length;r<i;r++){var o=t[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==e&&o.fnContext!==e||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(Lt)&&delete n[u];return n}function Lt(t){return t.isComment&&!t.asyncFactory||" "===t.text}function Mt(t,e){e=e||{};for(var n=0;n<t.length;n++)Array.isArray(t[n])?Mt(t[n],e):e[t[n].key]=t[n].fn;return e}function $t(t){var e=ya;return ya=t,function(){ya=e}}function It(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}function Nt(t,e,n){t.$el=e,t.$options.render||(t.$options.render=Qo),Ut(t,"beforeMount");var r;return r=function(){t._update(t._render(),n)},new Oa(t,r,k,{before:function(){t._isMounted&&!t._isDestroyed&&Ut(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,Ut(t,"mounted")),t}function Dt(t,e,n,r,i){var o=!!(i||t.$options._renderChildren||r.data.scopedSlots||t.$scopedSlots!==lo);if(t.$options._parentVnode=r,t.$vnode=r,t._vnode&&(t._vnode.parent=r),t.$options._renderChildren=i,t.$attrs=r.data.attrs||lo,t.$listeners=n||lo,e&&t.$options.props){I(!1);for(var a=t._props,s=t.$options._propKeys||[],c=0;c<s.length;c++){var u=s[c],l=t.$options.props;a[u]=Z(u,l,e,t)}I(!0),t.$options.propsData=e}n=n||lo;var p=t.$options._parentListeners;t.$options._parentListeners=n,Pt(t,n,p),o&&(t.$slots=jt(i,r.context),t.$forceUpdate())}function Rt(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function Ft(t,e){if(e){if(t._directInactive=!1,Rt(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)Ft(t.$children[n]);Ut(t,"activated")}}function Bt(t,e){if(!(e&&(t._directInactive=!0,Rt(t))||t._inactive)){t._inactive=!0;for(var n=0;n<t.$children.length;n++)Bt(t.$children[n]);Ut(t,"deactivated")}}function Ut(t,e){j();var n=t.$options[e];if(n)for(var r=0,i=n.length;r<i;r++)try{n[r].call(t)}catch(n){it(n,t,e+" hook")}t._hasHookEvent&&t.$emit("hook:"+e),L()}function Ht(){ka=ga.length=ba.length=0,wa={},xa=_a=!1}function Xt(){_a=!0;var t,e;for(ga.sort(function(t,e){return t.id-e.id}),ka=0;ka<ga.length;ka++)t=ga[ka],t.before&&t.before(),e=t.id,wa[e]=null,t.run();var n=ba.slice(),r=ga.slice();Ht(),qt(n),zt(r),zo&&Co.devtools&&zo.emit("flush")}function zt(t){for(var e=t.length;e--;){var n=t[e],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&Ut(r,"updated")}}function Yt(t){t._inactive=!1,ba.push(t)}function qt(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,Ft(t[e],!0)}function Vt(t){var e=t.id;if(null==wa[e]){if(wa[e]=!0,_a){for(var n=ga.length-1;n>ka&&ga[n].id>t.id;)n--;ga.splice(n+1,0,t)}else ga.push(t);xa||(xa=!0,ut(Xt))}}function Wt(t,e,n){Ea.get=function(){return this[e][n]},Ea.set=function(t){this[e][n]=t},Object.defineProperty(t,n,Ea)}function Gt(t){t._watchers=[];var e=t.$options;e.props&&Kt(t,e.props),e.methods&&re(t,e.methods),e.data?Jt(t):R(t._data={},!0),e.computed&&Zt(t,e.computed),e.watch&&e.watch!==Ro&&ie(t,e.watch)}function Kt(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[];!t.$parent||I(!1);for(var o in e)!function(o){i.push(o);var a=Z(o,e,n,t);F(r,o,a),o in t||Wt(t,"_props",o)}(o);I(!0)}function Jt(t){var e=t.$options.data;e=t._data="function"==typeof e?Qt(e,t):e||{},u(e)||(e={});for(var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);i--;){var o=n[i];r&&m(r,o)||C(o)||Wt(t,"_data",o)}R(e,!0)}function Qt(t,e){j();try{return t.call(e,e)}catch(t){return it(t,e,"data()"),{}}finally{L()}}function Zt(t,e){var n=t._computedWatchers=Object.create(null),r=Xo();for(var i in e){var o=e[i],a="function"==typeof o?o:o.get;r||(n[i]=new Oa(t,a||k,k,Ca)),i in t||te(t,i,o)}}function te(t,e,n){var r=!Xo();"function"==typeof n?(Ea.get=r?ee(e):ne(n),Ea.set=k):(Ea.get=n.get?r&&!1!==n.cache?ee(e):ne(n.get):k,Ea.set=n.set||k),Object.defineProperty(t,e,Ea)}function ee(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),Wo.target&&e.depend(),e.value}}function ne(t){return function(){return t.call(this,this)}}function re(t,e){t.$options.props;for(var n in e)t[n]="function"!=typeof e[n]?k:xo(e[n],t)}function ie(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)oe(t,n,r[i]);else oe(t,n,r)}}function oe(t,e,n,r){return u(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}function ae(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}function se(t){var e=ce(t.$options.inject,t);e&&(I(!1),Object.keys(e).forEach(function(n){F(t,n,e[n])}),I(!0))}function ce(t,e){if(t){for(var n=Object.create(null),r=Yo?Reflect.ownKeys(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}):Object.keys(t),i=0;i<r.length;i++){for(var o=r[i],a=t[o].from,s=e;s;){if(s._provided&&m(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s&&"default"in t[o]){var c=t[o].default;n[o]="function"==typeof c?c.call(e):c}}return n}}function ue(t,e){var n,r,o,a,s;if(Array.isArray(t)||"string"==typeof t)for(n=new Array(t.length),r=0,o=t.length;r<o;r++)n[r]=e(t[r],r);else if("number"==typeof t)for(n=new Array(t),r=0;r<t;r++)n[r]=e(r+1,r);else if(c(t))for(a=Object.keys(t),n=new Array(a.length),r=0,o=a.length;r<o;r++)s=a[r],n[r]=e(t[s],s,r);return i(n)||(n=[]),n._isVList=!0,n}function le(t,e,n,r){var i,o=this.$scopedSlots[t];o?(n=n||{},r&&(n=x(x({},r),n)),i=o(n)||e):i=this.$slots[t]||e;var a=n&&n.slot;return a?this.$createElement("template",{slot:a},i):i}function pe(t){return Q(this.$options,"filters",t,!0)||ko}function fe(t,e){return Array.isArray(t)?-1===t.indexOf(e):t!==e}function de(t,e,n,r,i){var o=Co.keyCodes[e]||n;return i&&r&&!Co.keyCodes[e]?fe(i,r):o?fe(o,t):r?wo(r)!==e:void 0}function he(t,e,n,r,i){if(n&&c(n)){Array.isArray(n)&&(n=_(n));var o;for(var a in n)!function(a){if("class"===a||"style"===a||ho(a))o=t;else{var s=t.attrs&&t.attrs.type;o=r||Co.mustUseProp(e,s,a)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var c=yo(a);a in o||c in o||(o[a]=n[a],!i)||((t.on||(t.on={}))["update:"+c]=function(t){n[a]=t})}(a)}return t}function ve(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e?r:(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,null,this),ye(r,"__static__"+t,!1),r)}function me(t,e,n){return ye(t,"__once__"+e+(n?"_"+n:""),!0),t}function ye(t,e,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]&&"string"!=typeof t[r]&&ge(t[r],e+"_"+r,n);else ge(t,e,n)}function ge(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function be(t,e){if(e&&u(e)){var n=t.on=t.on?x({},t.on):{};for(var r in e){var i=n[r],o=e[r];n[r]=i?[].concat(i,o):o}}return t}function we(t){t._o=me,t._n=d,t._s=f,t._l=ue,t._t=le,t._q=T,t._i=O,t._m=ve,t._f=pe,t._k=de,t._b=he,t._v=M,t._e=Qo,t._u=Mt,t._g=be}function xe(t,e,n,r,i){var a,s=i.options;m(r,"_uid")?(a=Object.create(r),a._original=r):(a=r,r=r._original);var c=o(s._compiled),u=!c;this.data=t,this.props=e,this.children=n,this.parent=r,this.listeners=t.on||lo,this.injections=ce(s.inject,r),this.slots=function(){return jt(n,r)},c&&(this.$options=s,this.$slots=this.slots(),this.$scopedSlots=t.scopedSlots||lo),s._scopeId?this._c=function(t,e,n,i){var o=Pe(a,t,e,n,i,u);return o&&!Array.isArray(o)&&(o.fnScopeId=s._scopeId,o.fnContext=r),o}:this._c=function(t,e,n,r){return Pe(a,t,e,n,r,u)}}function _e(t,e,n,r,o){var a=t.options,s={},c=a.props;if(i(c))for(var u in c)s[u]=Z(u,c,e||lo);else i(n.attrs)&&Te(s,n.attrs),i(n.props)&&Te(s,n.props);var l=new xe(n,s,o,r,t),p=a.render.call(null,l._c,l);if(p instanceof Ko)return ke(p,n,l.parent,a,l);if(Array.isArray(p)){for(var f=gt(p)||[],d=new Array(f.length),h=0;h<f.length;h++)d[h]=ke(f[h],n,l.parent,a,l);return d}}function ke(t,e,n,r,i){var o=$(t);return o.fnContext=n,o.fnOptions=r,e.slot&&((o.data||(o.data={})).slot=e.slot),o}function Te(t,e){for(var n in e)t[yo(n)]=e[n]}function Oe(t,e,n,a,s){if(!r(t)){var u=n.$options._base;if(c(t)&&(t=u.extend(t)),"function"==typeof t){var l;if(r(t.cid)&&(l=t,void 0===(t=kt(l,u,n))))return _t(l,e,n,a,s);e=e||{},Ne(t),i(e.model)&&Se(t.options,e);var p=vt(e,t,s);if(o(t.options.functional))return _e(t,p,e,n,a);var f=e.on;if(e.on=e.nativeOn,o(t.options.abstract)){var d=e.slot;e={},d&&(e.slot=d)}Ce(e);var h=t.options.name||s;return new Ko("vue-component-"+t.cid+(h?"-"+h:""),e,void 0,void 0,void 0,n,{Ctor:t,propsData:p,listeners:f,tag:s,children:a},l)}}}function Ee(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;return i(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns),new t.componentOptions.Ctor(n)}function Ce(t){for(var e=t.hook||(t.hook={}),n=0;n<Sa.length;n++){var r=Sa[n],i=e[r],o=Aa[r];i===o||i&&i._merged||(e[r]=i?Ae(o,i):o)}}function Ae(t,e){var n=function(n,r){t(n,r),e(n,r)};return n._merged=!0,n}function Se(t,e){var n=t.model&&t.model.prop||"value",r=t.model&&t.model.event||"input";(e.props||(e.props={}))[n]=e.model.value;var o=e.on||(e.on={}),a=o[r],s=e.model.callback;i(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[r]=[s].concat(a)):o[r]=s}function Pe(t,e,n,r,i,a){return(Array.isArray(n)||s(n))&&(i=r,r=n,n=void 0),o(a)&&(i=ja),je(t,e,n,r,i)}function je(t,e,n,r,o){if(i(n)&&i(n.__ob__))return Qo();if(i(n)&&i(n.is)&&(e=n.is),!e)return Qo();Array.isArray(r)&&"function"==typeof r[0]&&(n=n||{},n.scopedSlots={default:r[0]},r.length=0),o===ja?r=gt(r):o===Pa&&(r=yt(r));var a,s;if("string"==typeof e){var c;s=t.$vnode&&t.$vnode.ns||Co.getTagNamespace(e),a=Co.isReservedTag(e)?new Ko(Co.parsePlatformTagName(e),n,r,void 0,void 0,t):n&&n.pre||!i(c=Q(t.$options,"components",e))?new Ko(e,n,r,void 0,void 0,t):Oe(c,n,t,r,e)}else a=Oe(e,n,t,r);return Array.isArray(a)?a:i(a)?(i(s)&&Le(a,s),i(n)&&Me(n),a):Qo()}function Le(t,e,n){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,n=!0),i(t.children))for(var a=0,s=t.children.length;a<s;a++){var c=t.children[a];i(c.tag)&&(r(c.ns)||o(n)&&"svg"!==c.tag)&&Le(c,e,n)}}function Me(t){c(t.style)&<(t.style),c(t.class)&<(t.class)}function $e(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,r=n&&n.context;t.$slots=jt(e._renderChildren,r),t.$scopedSlots=lo,t._c=function(e,n,r,i){return Pe(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Pe(t,e,n,r,i,!0)};var i=n&&n.data;F(t,"$attrs",i&&i.attrs||lo,null,!0),F(t,"$listeners",e._parentListeners||lo,null,!0)}function Ie(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}function Ne(t){var e=t.options;if(t.super){var n=Ne(t.super);if(n!==t.superOptions){t.superOptions=n;var r=De(t);r&&x(t.extendOptions,r),e=t.options=J(n,t.extendOptions),e.name&&(e.components[e.name]=t)}}return e}function De(t){var e,n=t.options,r=t.sealedOptions;for(var i in n)n[i]!==r[i]&&(e||(e={}),e[i]=n[i]);return e}function Re(t){this._init(t)}function Fe(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=w(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}function Be(t){t.mixin=function(t){return this.options=J(this.options,t),this}}function Ue(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name,a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=J(n.options,t),a.super=n,a.options.props&&He(a),a.options.computed&&Xe(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,Oo.forEach(function(t){a[t]=n[t]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=x({},a.options),i[r]=a,a}}function He(t){var e=t.options.props;for(var n in e)Wt(t.prototype,"_props",n)}function Xe(t){var e=t.options.computed;for(var n in e)te(t.prototype,n,e[n])}function ze(t){Oo.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function Ye(t){return t&&(t.Ctor.options.name||t.tag)}function qe(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!l(t)&&t.test(e)}function Ve(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=Ye(a.componentOptions);s&&!e(s)&&We(n,o,r,i)}}}function We(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,v(n,e)}function Ge(t){for(var e=t.data,n=t,r=t;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Ke(r.data,e));for(;i(n=n.parent);)n&&n.data&&(e=Ke(e,n.data));return Je(e.staticClass,e.class)}function Ke(t,e){return{staticClass:Qe(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Je(t,e){return i(t)||i(e)?Qe(t,Ze(e)):""}function Qe(t,e){return t?e?t+" "+e:t:e||""}function Ze(t){return Array.isArray(t)?tn(t):c(t)?en(t):"string"==typeof t?t:""}function tn(t){for(var e,n="",r=0,o=t.length;r<o;r++)i(e=Ze(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}function en(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}function nn(t){return ns(t)?"svg":"math"===t?"math":void 0}function rn(t){if(!Po)return!0;if(is(t))return!1;if(t=t.toLowerCase(),null!=os[t])return os[t];var e=document.createElement(t);return t.indexOf("-")>-1?os[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:os[t]=/HTMLUnknownElement/.test(e.toString())}function on(t){if("string"==typeof t){return document.querySelector(t)||document.createElement("div")}return t}function an(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function sn(t,e){return document.createElementNS(ts[t],e)}function cn(t){return document.createTextNode(t)}function un(t){return document.createComment(t)}function ln(t,e,n){t.insertBefore(e,n)}function pn(t,e){t.removeChild(e)}function fn(t,e){t.appendChild(e)}function dn(t){return t.parentNode}function hn(t){return t.nextSibling}function vn(t){return t.tagName}function mn(t,e){t.textContent=e}function yn(t,e){t.setAttribute(e,"")}function gn(t,e){var n=t.data.ref;if(i(n)){var r=t.context,o=t.componentInstance||t.elm,a=r.$refs;e?Array.isArray(a[n])?v(a[n],o):a[n]===o&&(a[n]=void 0):t.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}function bn(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&i(t.data)===i(e.data)&&wn(t,e)||o(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&r(e.asyncFactory.error))}function wn(t,e){if("input"!==t.tag)return!0;var n,r=i(n=t.data)&&i(n=n.attrs)&&n.type,o=i(n=e.data)&&i(n=n.attrs)&&n.type;return r===o||as(r)&&as(o)}function xn(t,e,n){var r,o,a={};for(r=e;r<=n;++r)o=t[r].key,i(o)&&(a[o]=r);return a}function _n(t,e){(t.data.directives||e.data.directives)&&kn(t,e)}function kn(t,e){var n,r,i,o=t===us,a=e===us,s=Tn(t.data.directives,t.context),c=Tn(e.data.directives,e.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,En(i,"update",e,t),i.def&&i.def.componentUpdated&&l.push(i)):(En(i,"bind",e,t),i.def&&i.def.inserted&&u.push(i));if(u.length){var p=function(){for(var n=0;n<u.length;n++)En(u[n],"inserted",e,t)};o?ht(e,"insert",p):p()}if(l.length&&ht(e,"postpatch",function(){for(var n=0;n<l.length;n++)En(l[n],"componentUpdated",e,t)}),!o)for(n in s)c[n]||En(s[n],"unbind",t,t,a)}function Tn(t,e){var n=Object.create(null);if(!t)return n;var r,i;for(r=0;r<t.length;r++)i=t[r],i.modifiers||(i.modifiers=fs),n[On(i)]=i,i.def=Q(e.$options,"directives",i.name,!0);return n}function On(t){return t.rawName||t.name+"."+Object.keys(t.modifiers||{}).join(".")}function En(t,e,n,r,i){var o=t.def&&t.def[e];if(o)try{o(n.elm,t,n,r,i)}catch(r){it(r,n.context,"directive "+t.name+" "+e+" hook")}}function Cn(t,e){var n=e.componentOptions;if(!(i(n)&&!1===n.Ctor.options.inheritAttrs||r(t.data.attrs)&&r(e.data.attrs))){var o,a,s=e.elm,c=t.data.attrs||{},u=e.data.attrs||{};i(u.__ob__)&&(u=e.data.attrs=x({},u));for(o in u)a=u[o],c[o]!==a&&An(s,o,a);($o||No)&&u.value!==c.value&&An(s,"value",u.value);for(o in c)r(u[o])&&(Ja(o)?s.removeAttributeNS(Ka,Qa(o)):Wa(o)||s.removeAttribute(o))}}function An(t,e,n){t.tagName.indexOf("-")>-1?Sn(t,e,n):Ga(e)?Za(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Wa(e)?t.setAttribute(e,Za(n)||"false"===n?"false":"true"):Ja(e)?Za(n)?t.removeAttributeNS(Ka,Qa(e)):t.setAttributeNS(Ka,e,n):Sn(t,e,n)}function Sn(t,e,n){if(Za(n))t.removeAttribute(e);else{if($o&&!Io&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)&&"placeholder"===e&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}function Pn(t,e){var n=e.elm,o=e.data,a=t.data;if(!(r(o.staticClass)&&r(o.class)&&(r(a)||r(a.staticClass)&&r(a.class)))){var s=Ge(e),c=n._transitionClasses;i(c)&&(s=Qe(s,Ze(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}function jn(t){function e(){(a||(a=[])).push(t.slice(h,i).trim()),h=i+1}var n,r,i,o,a,s=!1,c=!1,u=!1,l=!1,p=0,f=0,d=0,h=0;for(i=0;i<t.length;i++)if(r=n,n=t.charCodeAt(i),s)39===n&&92!==r&&(s=!1);else if(c)34===n&&92!==r&&(c=!1);else if(u)96===n&&92!==r&&(u=!1);else if(l)47===n&&92!==r&&(l=!1);else if(124!==n||124===t.charCodeAt(i+1)||124===t.charCodeAt(i-1)||p||f||d){switch(n){case 34:c=!0;break;case 39:s=!0;break;case 96:u=!0;break;case 40:d++;break;case 41:d--;break;case 91:f++;break;case 93:f--;break;case 123:p++;break;case 125:p--}if(47===n){for(var v=i-1,m=void 0;v>=0&&" "===(m=t.charAt(v));v--);m&&ms.test(m)||(l=!0)}}else void 0===o?(h=i+1,o=t.slice(0,i).trim()):e();if(void 0===o?o=t.slice(0,i).trim():0!==h&&e(),a)for(i=0;i<a.length;i++)o=Ln(o,a[i]);return o}function Ln(t,e){var n=e.indexOf("(");if(n<0)return'_f("'+e+'")('+t+")";var r=e.slice(0,n),i=e.slice(n+1);return'_f("'+r+'")('+t+(")"!==i?","+i:i)}function Mn(t){console.error("[Vue compiler]: "+t)}function $n(t,e){return t?t.map(function(t){return t[e]}).filter(function(t){return t}):[]}function In(t,e,n){(t.props||(t.props=[])).push({name:e,value:n}),t.plain=!1}function Nn(t,e,n){(t.attrs||(t.attrs=[])).push({name:e,value:n}),t.plain=!1}function Dn(t,e,n){t.attrsMap[e]=n,t.attrsList.push({name:e,value:n})}function Rn(t,e,n,r,i,o){(t.directives||(t.directives=[])).push({name:e,rawName:n,value:r,arg:i,modifiers:o}),t.plain=!1}function Fn(t,e,n,r,i,o){r=r||lo,"click"===e&&(r.right?(e="contextmenu",delete r.right):r.middle&&(e="mouseup")),r.capture&&(delete r.capture,e="!"+e),r.once&&(delete r.once,e="~"+e),r.passive&&(delete r.passive,e="&"+e);var a;r.native?(delete r.native,a=t.nativeEvents||(t.nativeEvents={})):a=t.events||(t.events={});var s={value:n.trim()};r!==lo&&(s.modifiers=r);var c=a[e];Array.isArray(c)?i?c.unshift(s):c.push(s):a[e]=c?i?[s,c]:[c,s]:s,t.plain=!1}function Bn(t,e,n){var r=Un(t,":"+e)||Un(t,"v-bind:"+e);if(null!=r)return jn(r);if(!1!==n){var i=Un(t,e);if(null!=i)return JSON.stringify(i)}}function Un(t,e,n){var r;if(null!=(r=t.attrsMap[e]))for(var i=t.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===e){i.splice(o,1);break}return n&&delete t.attrsMap[e],r}function Hn(t,e,n){var r=n||{},i=r.number,o=r.trim,a="$$v";o&&(a="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(a="_n("+a+")");var s=Xn(e,a);t.model={value:"("+e+")",expression:JSON.stringify(e),callback:"function ($$v) {"+s+"}"}}function Xn(t,e){var n=zn(t);return null===n.key?t+"="+e:"$set("+n.exp+", "+n.key+", "+e+")"}function zn(t){if(t=t.trim(),Na=t.length,t.indexOf("[")<0||t.lastIndexOf("]")<Na-1)return Fa=t.lastIndexOf("."),Fa>-1?{exp:t.slice(0,Fa),key:'"'+t.slice(Fa+1)+'"'}:{exp:t,key:null};for(Da=t,Fa=Ba=Ua=0;!qn();)Ra=Yn(),Vn(Ra)?Gn(Ra):91===Ra&&Wn(Ra);return{exp:t.slice(0,Ba),key:t.slice(Ba+1,Ua)}}function Yn(){return Da.charCodeAt(++Fa)}function qn(){return Fa>=Na}function Vn(t){return 34===t||39===t}function Wn(t){var e=1;for(Ba=Fa;!qn();)if(t=Yn(),Vn(t))Gn(t);else if(91===t&&e++,93===t&&e--,0===e){Ua=Fa;break}}function Gn(t){for(var e=t;!qn()&&(t=Yn())!==e;);}function Kn(t,e,n){Ha=n;var r=e.value,i=e.modifiers,o=t.tag,a=t.attrsMap.type;if(t.component)return Hn(t,r,i),!1;if("select"===o)Zn(t,r,i);else if("input"===o&&"checkbox"===a)Jn(t,r,i);else if("input"===o&&"radio"===a)Qn(t,r,i);else if("input"===o||"textarea"===o)tr(t,r,i);else if(!Co.isReservedTag(o))return Hn(t,r,i),!1;return!0}function Jn(t,e,n){var r=n&&n.number,i=Bn(t,"value")||"null",o=Bn(t,"true-value")||"true",a=Bn(t,"false-value")||"false";In(t,"checked","Array.isArray("+e+")?_i("+e+","+i+")>-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),Fn(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Xn(e,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Xn(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Xn(e,"$$c")+"}",null,!0)}function Qn(t,e,n){var r=n&&n.number,i=Bn(t,"value")||"null";i=r?"_n("+i+")":i,In(t,"checked","_q("+e+","+i+")"),Fn(t,"change",Xn(e,i),null,!0)}function Zn(t,e,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})",o="var $$selectedVal = "+i+";";o=o+" "+Xn(e,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),Fn(t,"change",o,null,!0)}function tr(t,e,n){var r=t.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?ys:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var p=Xn(e,l);c&&(p="if($event.target.composing)return;"+p),In(t,"value","("+e+")"),Fn(t,u,p,null,!0),(s||a)&&Fn(t,"blur","$forceUpdate()")}function er(t){if(i(t[ys])){var e=$o?"change":"input";t[e]=[].concat(t[ys],t[e]||[]),delete t[ys]}i(t[gs])&&(t.change=[].concat(t[gs],t.change||[]),delete t[gs])}function nr(t,e,n){var r=Xa;return function i(){null!==e.apply(null,arguments)&&ir(t,i,n,r)}}function rr(t,e,n,r){e=ct(e),Xa.addEventListener(t,e,Fo?{capture:n,passive:r}:n)}function ir(t,e,n,r){(r||Xa).removeEventListener(t,e._withTask||e,n)}function or(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},i=t.data.on||{};Xa=e.elm,er(n),dt(n,i,rr,ir,nr,e.context),Xa=void 0}}function ar(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,a=e.elm,s=t.data.domProps||{},c=e.data.domProps||{};i(c.__ob__)&&(c=e.data.domProps=x({},c));for(n in s)r(c[n])&&(a[n]="");for(n in c){if(o=c[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n){a._value=o;var u=r(o)?"":String(o);sr(a,u)&&(a.value=u)}else a[n]=o}}}function sr(t,e){return!t.composing&&("OPTION"===t.tagName||cr(t,e)||ur(t,e))}function cr(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}function ur(t,e){var n=t.value,r=t._vModifiers;if(i(r)){if(r.lazy)return!1;if(r.number)return d(n)!==d(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}function lr(t){var e=pr(t.style);return t.staticStyle?x(t.staticStyle,e):e}function pr(t){return Array.isArray(t)?_(t):"string"==typeof t?xs(t):t}function fr(t,e){var n,r={};if(e)for(var i=t;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=lr(i.data))&&x(r,n);(n=lr(t.data))&&x(r,n);for(var o=t;o=o.parent;)o.data&&(n=lr(o.data))&&x(r,n);return r}function dr(t,e){var n=e.data,o=t.data;if(!(r(n.staticStyle)&&r(n.style)&&r(o.staticStyle)&&r(o.style))){var a,s,c=e.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},p=u||l,f=pr(e.data.style)||{};e.data.normalizedStyle=i(f.__ob__)?x({},f):f;var d=fr(e,!0);for(s in p)r(d[s])&&Ts(c,s,"");for(s in d)(a=d[s])!==p[s]&&Ts(c,s,null==a?"":a)}}function hr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(As).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function vr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(As).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function mr(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&x(e,Ss(t.name||"v")),x(e,t),e}return"string"==typeof t?Ss(t):void 0}}function yr(t){Ds(function(){Ds(t)})}function gr(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),hr(t,e))}function br(t,e){t._transitionClasses&&v(t._transitionClasses,e),vr(t,e)}function wr(t,e,n){var r=xr(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===js?$s:Ns,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),t.addEventListener(s,l)}function xr(t,e){var n,r=window.getComputedStyle(t),i=(r[Ms+"Delay"]||"").split(", "),o=(r[Ms+"Duration"]||"").split(", "),a=_r(i,o),s=(r[Is+"Delay"]||"").split(", "),c=(r[Is+"Duration"]||"").split(", "),u=_r(s,c),l=0,p=0;return e===js?a>0&&(n=js,l=a,p=o.length):e===Ls?u>0&&(n=Ls,l=u,p=c.length):(l=Math.max(a,u),n=l>0?a>u?js:Ls:null,p=n?n===js?o.length:c.length:0),{type:n,timeout:l,propCount:p,hasTransform:n===js&&Rs.test(r[Ms+"Property"])}}function _r(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map(function(e,n){return kr(e)+kr(t[n])}))}function kr(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function Tr(t,e){var n=t.elm;i(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var o=mr(t.data.transition);if(!r(o)&&!i(n._enterCb)&&1===n.nodeType){for(var a=o.css,s=o.type,u=o.enterClass,l=o.enterToClass,p=o.enterActiveClass,f=o.appearClass,h=o.appearToClass,v=o.appearActiveClass,m=o.beforeEnter,y=o.enter,g=o.afterEnter,b=o.enterCancelled,w=o.beforeAppear,x=o.appear,_=o.afterAppear,k=o.appearCancelled,T=o.duration,O=ya,C=ya.$vnode;C&&C.parent;)C=C.parent,O=C.context;var A=!O._isMounted||!t.isRootInsert;if(!A||x||""===x){var S=A&&f?f:u,P=A&&v?v:p,j=A&&h?h:l,L=A?w||m:m,M=A&&"function"==typeof x?x:y,$=A?_||g:g,I=A?k||b:b,N=d(c(T)?T.enter:T),D=!1!==a&&!Io,R=Cr(M),F=n._enterCb=E(function(){D&&(br(n,j),br(n,P)),F.cancelled?(D&&br(n,S),I&&I(n)):$&&$(n),n._enterCb=null});t.data.show||ht(t,"insert",function(){var e=n.parentNode,r=e&&e._pending&&e._pending[t.key];r&&r.tag===t.tag&&r.elm._leaveCb&&r.elm._leaveCb(),M&&M(n,F)}),L&&L(n),D&&(gr(n,S),gr(n,P),yr(function(){br(n,S),F.cancelled||(gr(n,j),R||(Er(N)?setTimeout(F,N):wr(n,s,F)))})),t.data.show&&(e&&e(),M&&M(n,F)),D||R||F()}}}function Or(t,e){function n(){k.cancelled||(!t.data.show&&o.parentNode&&((o.parentNode._pending||(o.parentNode._pending={}))[t.key]=t),h&&h(o),w&&(gr(o,l),gr(o,f),yr(function(){br(o,l),k.cancelled||(gr(o,p),x||(Er(_)?setTimeout(k,_):wr(o,u,k)))})),v&&v(o,k),w||x||k())}var o=t.elm;i(o._enterCb)&&(o._enterCb.cancelled=!0,o._enterCb());var a=mr(t.data.transition);if(r(a)||1!==o.nodeType)return e();if(!i(o._leaveCb)){var s=a.css,u=a.type,l=a.leaveClass,p=a.leaveToClass,f=a.leaveActiveClass,h=a.beforeLeave,v=a.leave,m=a.afterLeave,y=a.leaveCancelled,g=a.delayLeave,b=a.duration,w=!1!==s&&!Io,x=Cr(v),_=d(c(b)?b.leave:b),k=o._leaveCb=E(function(){o.parentNode&&o.parentNode._pending&&(o.parentNode._pending[t.key]=null),w&&(br(o,p),br(o,f)),k.cancelled?(w&&br(o,l),y&&y(o)):(e(),m&&m(o)),o._leaveCb=null});g?g(n):n()}}function Er(t){return"number"==typeof t&&!isNaN(t)}function Cr(t){if(r(t))return!1;var e=t.fns;return i(e)?Cr(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function Ar(t,e){!0!==e.data.show&&Tr(e)}function Sr(t,e,n){Pr(t,e,n),($o||No)&&setTimeout(function(){Pr(t,e,n)},0)}function Pr(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=t.options.length;s<c;s++)if(a=t.options[s],i)o=O(r,Lr(a))>-1,a.selected!==o&&(a.selected=o);else if(T(Lr(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function jr(t,e){return e.every(function(e){return!T(e,t)})}function Lr(t){return"_value"in t?t._value:t.value}function Mr(t){t.target.composing=!0}function $r(t){t.target.composing&&(t.target.composing=!1,Ir(t.target,"input"))}function Ir(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Nr(t){return!t.componentInstance||t.data&&t.data.transition?t:Nr(t.componentInstance._vnode)}function Dr(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Dr(Ot(e.children)):t}function Rr(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[yo(o)]=i[o];return e}function Fr(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function Br(t){for(;t=t.parent;)if(t.data.transition)return!0}function Ur(t,e){return e.key===t.key&&e.tag===t.tag}function Hr(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Xr(t){t.data.newPos=t.elm.getBoundingClientRect()}function zr(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function Yr(t,e){var n=e?dc(e):pc;if(n.test(t)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(t);){(i=r.index)>c&&(s.push(o=t.slice(c,i)),a.push(JSON.stringify(o)));var u=jn(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c<t.length&&(s.push(o=t.slice(c)),a.push(JSON.stringify(o))),{expression:a.join("+"),tokens:s}}}function qr(t,e){var n=(e.warn,Un(t,"class"));n&&(t.staticClass=JSON.stringify(n));var r=Bn(t,"class",!1);r&&(t.classBinding=r)}function Vr(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}function Wr(t,e){var n=(e.warn,Un(t,"style"));n&&(t.staticStyle=JSON.stringify(xs(n)));var r=Bn(t,"style",!1);r&&(t.styleBinding=r)}function Gr(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}function Kr(t,e){var n=e?Mc:Lc;return t.replace(n,function(t){return jc[t]})}function Jr(t,e){function n(e){l+=e,t=t.substring(e)}function r(t,n,r){var i,s;if(null==n&&(n=l),null==r&&(r=l),t)for(s=t.toLowerCase(),i=a.length-1;i>=0&&a[i].lowerCasedTag!==s;i--);else i=0;if(i>=0){for(var c=a.length-1;c>=i;c--)e.end&&e.end(a[c].tag,n,r);a.length=i,o=i&&a[i-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,r):"p"===s&&(e.start&&e.start(t,[],!1,n,r),e.end&&e.end(t,n,r))}for(var i,o,a=[],s=e.expectHTML,c=e.isUnaryTag||_o,u=e.canBeLeftOpenTag||_o,l=0;t;){if(i=t,o&&Sc(o)){var p=0,f=o.toLowerCase(),d=Pc[f]||(Pc[f]=new RegExp("([\\s\\S]*?)(</"+f+"[^>]*>)","i")),h=t.replace(d,function(t,n,r){return p=r.length,Sc(f)||"noscript"===f||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),Ic(f,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""});l+=t.length-h.length,t=h,r(f,l-p,l)}else{var v=t.indexOf("<");if(0===v){if(Cc.test(t)){var m=t.indexOf("--\x3e");if(m>=0){e.shouldKeepComment&&e.comment(t.substring(4,m)),n(m+3);continue}}if(Ac.test(t)){var y=t.indexOf("]>");if(y>=0){n(y+2);continue}}var g=t.match(Ec);if(g){n(g[0].length);continue}var b=t.match(Oc);if(b){var w=l;n(b[0].length),r(b[1],w,l);continue}var x=function(){var e=t.match(kc);if(e){var r={tagName:e[1],attrs:[],start:l};n(e[0].length);for(var i,o;!(i=t.match(Tc))&&(o=t.match(wc));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=l,r}}();if(x){!function(t){var n=t.tagName,i=t.unarySlash;s&&("p"===o&&bc(n)&&r(o),u(n)&&o===n&&r(n));for(var l=c(n)||!!i,p=t.attrs.length,f=new Array(p),d=0;d<p;d++){var h=t.attrs[d],v=h[3]||h[4]||h[5]||"",m="a"===n&&"href"===h[1]?e.shouldDecodeNewlinesForHref:e.shouldDecodeNewlines;f[d]={name:h[1],value:Kr(v,m)}}l||(a.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f}),o=n),e.start&&e.start(n,f,l,t.start,t.end)}(x),Ic(x.tagName,t)&&n(1);continue}}var _=void 0,k=void 0,T=void 0;if(v>=0){for(k=t.slice(v);!(Oc.test(k)||kc.test(k)||Cc.test(k)||Ac.test(k)||(T=k.indexOf("<",1))<0);)v+=T,k=t.slice(v);_=t.substring(0,v),n(v)}v<0&&(_=t,t=""),e.chars&&_&&e.chars(_)}if(t===i){e.chars&&e.chars(t);break}}r()}function Qr(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:yi(e),parent:n,children:[]}}function Zr(t,e){function n(t){t.pre&&(s=!1),oc(t.tag)&&(c=!1);for(var n=0;n<ic.length;n++)ic[n](t,e)}tc=e.warn||Mn,oc=e.isPreTag||_o,ac=e.mustUseProp||_o,sc=e.getTagNamespace||_o,nc=$n(e.modules,"transformNode"),rc=$n(e.modules,"preTransformNode"),ic=$n(e.modules,"postTransformNode"),ec=e.delimiters;var r,i,o=[],a=!1!==e.preserveWhitespace,s=!1,c=!1;return Jr(t,{warn:tc,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,start:function(t,a,u){var l=i&&i.ns||sc(t);$o&&"svg"===l&&(a=wi(a));var p=Qr(t,a,i);l&&(p.ns=l),bi(p)&&!Xo()&&(p.forbidden=!0);for(var f=0;f<rc.length;f++)p=rc[f](p,e)||p;if(s||(ti(p),p.pre&&(s=!0)),oc(p.tag)&&(c=!0),s?ei(p):p.processed||(oi(p),si(p),pi(p),ni(p,e)),r?o.length||r.if&&(p.elseif||p.else)&&li(r,{exp:p.elseif,block:p}):r=p,i&&!p.forbidden)if(p.elseif||p.else)ci(p,i);else if(p.slotScope){i.plain=!1;var d=p.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[d]=p}else i.children.push(p),p.parent=i;u?n(p):(i=p,o.push(p))},end:function(){var t=o[o.length-1],e=t.children[t.children.length-1];e&&3===e.type&&" "===e.text&&!c&&t.children.pop(),o.length-=1,i=o[o.length-1],n(t)},chars:function(t){if(i&&(!$o||"textarea"!==i.tag||i.attrsMap.placeholder!==t)){var e=i.children;if(t=c||t.trim()?gi(i)?t:zc(t):a&&e.length?" ":""){var n;!s&&" "!==t&&(n=Yr(t,ec))?e.push({type:2,expression:n.expression,tokens:n.tokens,text:t}):" "===t&&e.length&&" "===e[e.length-1].text||e.push({type:3,text:t})}}},comment:function(t){i.children.push({type:3,text:t,isComment:!0})}}),r}function ti(t){null!=Un(t,"v-pre")&&(t.pre=!0)}function ei(t){var e=t.attrsList.length;if(e)for(var n=t.attrs=new Array(e),r=0;r<e;r++)n[r]={name:t.attrsList[r].name,value:JSON.stringify(t.attrsList[r].value)};else t.pre||(t.plain=!0)}function ni(t,e){ri(t),t.plain=!t.key&&!t.attrsList.length,ii(t),fi(t),di(t);for(var n=0;n<nc.length;n++)t=nc[n](t,e)||t;hi(t)}function ri(t){var e=Bn(t,"key");e&&(t.key=e)}function ii(t){var e=Bn(t,"ref");e&&(t.ref=e,t.refInFor=vi(t))}function oi(t){var e;if(e=Un(t,"v-for")){var n=ai(e);n&&x(t,n)}}function ai(t){var e=t.match(Rc);if(e){var n={};n.for=e[2].trim();var r=e[1].trim().replace(Bc,""),i=r.match(Fc);return i?(n.alias=r.replace(Fc,"").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r,n}}function si(t){var e=Un(t,"v-if");if(e)t.if=e,li(t,{exp:e,block:t});else{null!=Un(t,"v-else")&&(t.else=!0);var n=Un(t,"v-else-if");n&&(t.elseif=n)}}function ci(t,e){var n=ui(e.children);n&&n.if&&li(n,{exp:t.elseif,block:t})}function ui(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];t.pop()}}function li(t,e){t.ifConditions||(t.ifConditions=[]),t.ifConditions.push(e)}function pi(t){null!=Un(t,"v-once")&&(t.once=!0)}function fi(t){if("slot"===t.tag)t.slotName=Bn(t,"name");else{var e;"template"===t.tag?(e=Un(t,"scope"),t.slotScope=e||Un(t,"slot-scope")):(e=Un(t,"slot-scope"))&&(t.slotScope=e);var n=Bn(t,"slot");n&&(t.slotTarget='""'===n?'"default"':n,"template"===t.tag||t.slotScope||Nn(t,"slot",n))}}function di(t){var e;(e=Bn(t,"is"))&&(t.component=e),null!=Un(t,"inline-template")&&(t.inlineTemplate=!0)}function hi(t){var e,n,r,i,o,a,s,c=t.attrsList;for(e=0,n=c.length;e<n;e++)if(r=i=c[e].name,o=c[e].value,Dc.test(r))if(t.hasBindings=!0,a=mi(r),a&&(r=r.replace(Xc,"")),Hc.test(r))r=r.replace(Hc,""),o=jn(o),s=!1,a&&(a.prop&&(s=!0,"innerHtml"===(r=yo(r))&&(r="innerHTML")),a.camel&&(r=yo(r)),a.sync&&Fn(t,"update:"+yo(r),Xn(o,"$event"))),s||!t.component&&ac(t.tag,t.attrsMap.type,r)?In(t,r,o):Nn(t,r,o);else if(Nc.test(r))r=r.replace(Nc,""),Fn(t,r,o,a,!1,tc);else{r=r.replace(Dc,"");var u=r.match(Uc),l=u&&u[1];l&&(r=r.slice(0,-(l.length+1))),Rn(t,r,i,o,l,a)}else Nn(t,r,JSON.stringify(o)),!t.component&&"muted"===r&&ac(t.tag,t.attrsMap.type,r)&&In(t,r,"true")}function vi(t){for(var e=t;e;){if(void 0!==e.for)return!0;e=e.parent}return!1}function mi(t){var e=t.match(Xc);if(e){var n={};return e.forEach(function(t){n[t.slice(1)]=!0}),n}}function yi(t){for(var e={},n=0,r=t.length;n<r;n++)e[t[n].name]=t[n].value;return e}function gi(t){return"script"===t.tag||"style"===t.tag}function bi(t){return"style"===t.tag||"script"===t.tag&&(!t.attrsMap.type||"text/javascript"===t.attrsMap.type)}function wi(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];Yc.test(r.name)||(r.name=r.name.replace(qc,""),e.push(r))}return e}function xi(t,e){if("input"===t.tag){var n=t.attrsMap;if(!n["v-model"])return;var r;if((n[":type"]||n["v-bind:type"])&&(r=Bn(t,"type")),n.type||r||!n["v-bind"]||(r="("+n["v-bind"]+").type"),r){var i=Un(t,"v-if",!0),o=i?"&&("+i+")":"",a=null!=Un(t,"v-else",!0),s=Un(t,"v-else-if",!0),c=_i(t);oi(c),Dn(c,"type","checkbox"),ni(c,e),c.processed=!0,c.if="("+r+")==='checkbox'"+o,li(c,{exp:c.if,block:c});var u=_i(t);Un(u,"v-for",!0),Dn(u,"type","radio"),ni(u,e),li(c,{exp:"("+r+")==='radio'"+o,block:u});var l=_i(t);return Un(l,"v-for",!0),Dn(l,":type",r),ni(l,e),li(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}function _i(t){return Qr(t.tag,t.attrsList.slice(),t.parent)}function ki(t,e){e.value&&In(t,"textContent","_s("+e.value+")")}function Ti(t,e){e.value&&In(t,"innerHTML","_s("+e.value+")")}function Oi(t,e){t&&(cc=Jc(e.staticKeys||""),uc=e.isReservedTag||_o,Ci(t),Ai(t,!1))}function Ei(t){return h("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(t?","+t:""))}function Ci(t){if(t.static=Si(t),1===t.type){if(!uc(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var e=0,n=t.children.length;e<n;e++){var r=t.children[e];Ci(r),r.static||(t.static=!1)}if(t.ifConditions)for(var i=1,o=t.ifConditions.length;i<o;i++){var a=t.ifConditions[i].block;Ci(a),a.static||(t.static=!1)}}}function Ai(t,e){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=e),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var n=0,r=t.children.length;n<r;n++)Ai(t.children[n],e||!!t.for);if(t.ifConditions)for(var i=1,o=t.ifConditions.length;i<o;i++)Ai(t.ifConditions[i].block,e)}}function Si(t){return 2!==t.type&&(3===t.type||!(!t.pre&&(t.hasBindings||t.if||t.for||fo(t.tag)||!uc(t.tag)||Pi(t)||!Object.keys(t).every(cc))))}function Pi(t){for(;t.parent;){if(t=t.parent,"template"!==t.tag)return!1;if(t.for)return!0}return!1}function ji(t,e){var n=e?"nativeOn:{":"on:{";for(var r in t)n+='"'+r+'":'+Li(r,t[r])+",";return n.slice(0,-1)+"}"}function Li(t,e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Li(t,e)}).join(",")+"]";var n=Zc.test(e.value),r=Qc.test(e.value);if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(ru[s])o+=ru[s],tu[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=nu(["ctrl","shift","alt","meta"].filter(function(t){return!c[t]}).map(function(t){return"$event."+t+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=Mi(a)),o&&(i+=o),"function($event){"+i+(n?"return "+e.value+"($event)":r?"return ("+e.value+")($event)":e.value)+"}"}return n||r?e.value:"function($event){"+e.value+"}"}function Mi(t){return"if(!('button' in $event)&&"+t.map($i).join("&&")+")return null;"}function $i(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var n=tu[t],r=eu[t];return"_k($event.keyCode,"+JSON.stringify(t)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}function Ii(t,e){t.wrapListeners=function(t){return"_g("+t+","+e.value+")"}}function Ni(t,e){t.wrapData=function(n){return"_b("+n+",'"+t.tag+"',"+e.value+","+(e.modifiers&&e.modifiers.prop?"true":"false")+(e.modifiers&&e.modifiers.sync?",true":"")+")"}}function Di(t,e){var n=new ou(e);return{render:"with(this){return "+(t?Ri(t,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ri(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return Fi(t,e);if(t.once&&!t.onceProcessed)return Bi(t,e);if(t.for&&!t.forProcessed)return Xi(t,e);if(t.if&&!t.ifProcessed)return Ui(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return no(t,e);var n;if(t.component)n=ro(t.component,t,e);else{var r;(!t.plain||t.pre&&e.maybeComponent(t))&&(r=zi(t,e));var i=t.inlineTemplate?null:Ki(t,e,!0);n="_c('"+t.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<e.transforms.length;o++)n=e.transforms[o](t,n);return n}return Ki(t,e)||"void 0"}function Fi(t,e){t.staticProcessed=!0;var n=e.pre;return t.pre&&(e.pre=t.pre),e.staticRenderFns.push("with(this){return "+Ri(t,e)+"}"),e.pre=n,"_m("+(e.staticRenderFns.length-1)+(t.staticInFor?",true":"")+")"}function Bi(t,e){if(t.onceProcessed=!0,t.if&&!t.ifProcessed)return Ui(t,e);if(t.staticInFor){for(var n="",r=t.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+Ri(t,e)+","+e.onceId+++","+n+")":Ri(t,e)}return Fi(t,e)}function Ui(t,e,n,r){return t.ifProcessed=!0,Hi(t.ifConditions.slice(),e,n,r)}function Hi(t,e,n,r){function i(t){return n?n(t,e):t.once?Bi(t,e):Ri(t,e)}if(!t.length)return r||"_e()";var o=t.shift();return o.exp?"("+o.exp+")?"+i(o.block)+":"+Hi(t,e,n,r):""+i(o.block)}function Xi(t,e,n,r){var i=t.for,o=t.alias,a=t.iterator1?","+t.iterator1:"",s=t.iterator2?","+t.iterator2:"";return t.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||Ri)(t,e)+"})"}function zi(t,e){var n="{",r=Yi(t,e);r&&(n+=r+","),t.key&&(n+="key:"+t.key+","),t.ref&&(n+="ref:"+t.ref+","),t.refInFor&&(n+="refInFor:true,"),t.pre&&(n+="pre:true,"),t.component&&(n+='tag:"'+t.tag+'",');for(var i=0;i<e.dataGenFns.length;i++)n+=e.dataGenFns[i](t);if(t.attrs&&(n+="attrs:{"+io(t.attrs)+"},"),t.props&&(n+="domProps:{"+io(t.props)+"},"),t.events&&(n+=ji(t.events,!1)+","),t.nativeEvents&&(n+=ji(t.nativeEvents,!0)+","),t.slotTarget&&!t.slotScope&&(n+="slot:"+t.slotTarget+","),t.scopedSlots&&(n+=Vi(t.scopedSlots,e)+","),t.model&&(n+="model:{value:"+t.model.value+",callback:"+t.model.callback+",expression:"+t.model.expression+"},"),t.inlineTemplate){var o=qi(t,e);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",t.wrapData&&(n=t.wrapData(n)),t.wrapListeners&&(n=t.wrapListeners(n)),n}function Yi(t,e){var n=t.directives;if(n){var r,i,o,a,s="directives:[",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=e.directives[o.name];u&&(a=!!u(t,o,e.warn)),a&&(c=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?',arg:"'+o.arg+'"':"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}return c?s.slice(0,-1)+"]":void 0}}function qi(t,e){var n=t.children[0];if(1===n.type){var r=Di(n,e.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(t){return"function(){"+t+"}"}).join(",")+"]}"}}function Vi(t,e){return"scopedSlots:_u(["+Object.keys(t).map(function(n){return Wi(n,t[n],e)}).join(",")+"])"}function Wi(t,e,n){return e.for&&!e.forProcessed?Gi(t,e,n):"{key:"+t+",fn:function("+String(e.slotScope)+"){return "+("template"===e.tag?e.if?"("+e.if+")?"+(Ki(e,n)||"undefined")+":undefined":Ki(e,n)||"undefined":Ri(e,n))+"}}"}function Gi(t,e,n){var r=e.for,i=e.alias,o=e.iterator1?","+e.iterator1:"",a=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,"_l(("+r+"),function("+i+o+a+"){return "+Wi(t,e,n)+"})"}function Ki(t,e,n,r,i){var o=t.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?e.maybeComponent(a)?",1":",0":"";return""+(r||Ri)(a,e)+s}var c=n?Ji(o,e.maybeComponent):0,u=i||Zi;return"["+o.map(function(t){return u(t,e)}).join(",")+"]"+(c?","+c:"")}}function Ji(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(1===i.type){if(Qi(i)||i.ifConditions&&i.ifConditions.some(function(t){return Qi(t.block)})){n=2;break}(e(i)||i.ifConditions&&i.ifConditions.some(function(t){return e(t.block)}))&&(n=1)}}return n}function Qi(t){return void 0!==t.for||"template"===t.tag||"slot"===t.tag}function Zi(t,e){return 1===t.type?Ri(t,e):3===t.type&&t.isComment?eo(t):to(t)}function to(t){return"_v("+(2===t.type?t.expression:oo(JSON.stringify(t.text)))+")"}function eo(t){return"_e("+JSON.stringify(t.text)+")"}function no(t,e){var n=t.slotName||'"default"',r=Ki(t,e),i="_t("+n+(r?","+r:""),o=t.attrs&&"{"+t.attrs.map(function(t){return yo(t.name)+":"+t.value}).join(",")+"}",a=t.attrsMap["v-bind"];return!o&&!a||r||(i+=",null"),o&&(i+=","+o),a&&(i+=(o?"":",null")+","+a),i+")"}function ro(t,e,n){var r=e.inlineTemplate?null:Ki(e,n,!0);return"_c("+t+","+zi(e,n)+(r?","+r:"")+")"}function io(t){for(var e="",n=0;n<t.length;n++){var r=t[n];e+='"'+r.name+'":'+oo(r.value)+","}return e.slice(0,-1)}function oo(t){return t.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function ao(t,e){try{return new Function(t)}catch(n){return e.push({err:n,code:t}),k}}function so(t){var e=Object.create(null);return function(n,r,i){r=x({},r),r.warn,delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(e[o])return e[o];var a=t(n,r),s={},c=[];return s.render=ao(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(t){return ao(t,c)}),e[o]=s}}function co(t){return lc=lc||document.createElement("div"),lc.innerHTML=t?'<a href="\n"/>':'<div a="\n"/>',lc.innerHTML.indexOf(" ")>0}function uo(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}/*!
|
2 |
* Vue.js v2.5.22
|
3 |
* (c) 2014-2019 Evan You
|
4 |
* Released under the MIT License.
|
5 |
*/
|
6 |
+
var lo=Object.freeze({}),po=Object.prototype.toString,fo=h("slot,component",!0),ho=h("key,ref,slot,slot-scope,is"),vo=Object.prototype.hasOwnProperty,mo=/-(\w)/g,yo=y(function(t){return t.replace(mo,function(t,e){return e?e.toUpperCase():""})}),go=y(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),bo=/\B([A-Z])/g,wo=y(function(t){return t.replace(bo,"-$1").toLowerCase()}),xo=Function.prototype.bind?b:g,_o=function(t,e,n){return!1},ko=function(t){return t},To="data-server-rendered",Oo=["component","directive","filter"],Eo=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],Co={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:_o,isReservedAttr:_o,isUnknownElement:_o,getTagNamespace:k,parsePlatformTagName:ko,mustUseProp:_o,async:!0,_lifecycleHooks:Eo},Ao=/[^\w.$]/,So="__proto__"in{},Po="undefined"!=typeof window,jo="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,Lo=jo&&WXEnvironment.platform.toLowerCase(),Mo=Po&&window.navigator.userAgent.toLowerCase(),$o=Mo&&/msie|trident/.test(Mo),Io=Mo&&Mo.indexOf("msie 9.0")>0,No=Mo&&Mo.indexOf("edge/")>0,Do=(Mo&&Mo.indexOf("android"),Mo&&/iphone|ipad|ipod|ios/.test(Mo)||"ios"===Lo),Ro=(Mo&&/chrome\/\d+/.test(Mo),{}.watch),Fo=!1;if(Po)try{var Bo={};Object.defineProperty(Bo,"passive",{get:function(){Fo=!0}}),window.addEventListener("test-passive",null,Bo)}catch(t){}var Uo,Ho,Xo=function(){return void 0===Uo&&(Uo=!Po&&!jo&&void 0!==t&&t.process&&"server"===t.process.env.VUE_ENV),Uo},zo=Po&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Yo="undefined"!=typeof Symbol&&P(Symbol)&&"undefined"!=typeof Reflect&&P(Reflect.ownKeys);Ho="undefined"!=typeof Set&&P(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var qo=k,Vo=0,Wo=function(){this.id=Vo++,this.subs=[]};Wo.prototype.addSub=function(t){this.subs.push(t)},Wo.prototype.removeSub=function(t){v(this.subs,t)},Wo.prototype.depend=function(){Wo.target&&Wo.target.addDep(this)},Wo.prototype.notify=function(){for(var t=this.subs.slice(),e=0,n=t.length;e<n;e++)t[e].update()},Wo.target=null;var Go=[],Ko=function(t,e,n,r,i,o,a,s){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},Jo={child:{configurable:!0}};Jo.child.get=function(){return this.componentInstance},Object.defineProperties(Ko.prototype,Jo);var Qo=function(t){void 0===t&&(t="");var e=new Ko;return e.text=t,e.isComment=!0,e},Zo=Array.prototype,ta=Object.create(Zo);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(t){var e=Zo[t];A(ta,t,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=e.apply(this,n),a=this.__ob__;switch(t){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var ea=Object.getOwnPropertyNames(ta),na=!0,ra=function(t){this.value=t,this.dep=new Wo,this.vmCount=0,A(t,"__ob__",this),Array.isArray(t)?(So?N(t,ta):D(t,ta,ea),this.observeArray(t)):this.walk(t)};ra.prototype.walk=function(t){for(var e=Object.keys(t),n=0;n<e.length;n++)F(t,e[n])},ra.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)R(t[e])};var ia=Co.optionMergeStrategies;ia.data=function(t,e,n){return n?z(t,e,n):e&&"function"!=typeof e?t:z(t,e)},Eo.forEach(function(t){ia[t]=Y}),Oo.forEach(function(t){ia[t+"s"]=V}),ia.watch=function(t,e,n,r){if(t===Ro&&(t=void 0),e===Ro&&(e=void 0),!e)return Object.create(t||null);if(!t)return e;var i={};x(i,t);for(var o in e){var a=i[o],s=e[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},ia.props=ia.methods=ia.inject=ia.computed=function(t,e,n,r){if(!t)return e;var i=Object.create(null);return x(i,t),e&&x(i,e),i},ia.provide=z;var oa,aa,sa=function(t,e){return void 0===e?t:e},ca=[],ua=!1,la=!1;if(void 0!==n&&P(n))aa=function(){n(st)};else if("undefined"==typeof MessageChannel||!P(MessageChannel)&&"[object MessageChannelConstructor]"!==MessageChannel.toString())aa=function(){setTimeout(st,0)};else{var pa=new MessageChannel,fa=pa.port2;pa.port1.onmessage=st,aa=function(){fa.postMessage(1)}}if("undefined"!=typeof Promise&&P(Promise)){var da=Promise.resolve();oa=function(){da.then(st),Do&&setTimeout(k)}}else oa=aa;var ha,va=new Ho,ma=y(function(t){var e="&"===t.charAt(0);t=e?t.slice(1):t;var n="~"===t.charAt(0);t=n?t.slice(1):t;var r="!"===t.charAt(0);return t=r?t.slice(1):t,{name:t,once:n,capture:r,passive:e}}),ya=null,ga=[],ba=[],wa={},xa=!1,_a=!1,ka=0,Ta=0,Oa=function(t,e,n,r,i){this.vm=t,i&&(t._watcher=this),t._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Ta,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new Ho,this.newDepIds=new Ho,this.expression="","function"==typeof e?this.getter=e:(this.getter=S(e),this.getter||(this.getter=k)),this.value=this.lazy?void 0:this.get()};Oa.prototype.get=function(){j(this);var t,e=this.vm;try{t=this.getter.call(e,e)}catch(t){if(!this.user)throw t;it(t,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&<(t),L(),this.cleanupDeps()}return t},Oa.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},Oa.prototype.cleanupDeps=function(){for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},Oa.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Vt(this)},Oa.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||c(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){it(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},Oa.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Oa.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},Oa.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var Ea={enumerable:!0,configurable:!0,get:k,set:k},Ca={lazy:!0};we(xe.prototype);var Aa={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;Aa.prepatch(n,n)}else(t.componentInstance=Ee(t,ya)).$mount(e?t.elm:void 0,e)},prepatch:function(t,e){var n=e.componentOptions;Dt(e.componentInstance=t.componentInstance,n.propsData,n.listeners,e,n.children)},insert:function(t){var e=t.context,n=t.componentInstance;n._isMounted||(n._isMounted=!0,Ut(n,"mounted")),t.data.keepAlive&&(e._isMounted?Yt(n):Ft(n,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?Bt(e,!0):e.$destroy())}},Sa=Object.keys(Aa),Pa=1,ja=2,La=0;!function(t){t.prototype._init=function(t){var e=this;e._uid=La++,e._isVue=!0,t&&t._isComponent?Ie(e,t):e.$options=J(Ne(e.constructor),t||{},e),e._renderProxy=e,e._self=e,It(e),Et(e),$e(e),Ut(e,"beforeCreate"),se(e),Gt(e),ae(e),Ut(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(Re),function(t){var e={};e.get=function(){return this._data};var n={};n.get=function(){return this._props},Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=B,t.prototype.$delete=U,t.prototype.$watch=function(t,e,n){var r=this;if(u(e))return oe(r,t,e,n);n=n||{},n.user=!0;var i=new Oa(r,t,e,n);if(n.immediate)try{e.call(r,i.value)}catch(t){it(t,r,'callback for immediate watcher "'+i.expression+'"')}return function(){i.teardown()}}}(Re),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(Array.isArray(t))for(var i=0,o=t.length;i<o;i++)r.$on(t[i],n);else(r._events[t]||(r._events[t]=[])).push(n),e.test(t)&&(r._hasHookEvent=!0);return r},t.prototype.$once=function(t,e){function n(){r.$off(t,n),e.apply(r,arguments)}var r=this;return n.fn=e,r.$on(t,n),r},t.prototype.$off=function(t,e){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(t)){for(var r=0,i=t.length;r<i;r++)n.$off(t[r],e);return n}var o=n._events[t];if(!o)return n;if(!e)return n._events[t]=null,n;for(var a,s=o.length;s--;)if((a=o[s])===e||a.fn===e){o.splice(s,1);break}return n},t.prototype.$emit=function(t){var e=this,n=e._events[t];if(n){n=n.length>1?w(n):n;for(var r=w(arguments,1),i=0,o=n.length;i<o;i++)try{n[i].apply(e,r)}catch(n){it(n,e,'event handler for "'+t+'"')}}return e}}(Re),function(t){t.prototype._update=function(t,e){var n=this,r=n.$el,i=n._vnode,o=$t(n);n._vnode=t,n.$el=i?n.__patch__(i,t):n.__patch__(n.$el,t,e,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},t.prototype.$forceUpdate=function(){var t=this;t._watcher&&t._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){Ut(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||v(e.$children,t),t._watcher&&t._watcher.teardown();for(var n=t._watchers.length;n--;)t._watchers[n].teardown();t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),Ut(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}(Re),function(t){we(t.prototype),t.prototype.$nextTick=function(t){return ut(t,this)},t.prototype._render=function(){var t=this,e=t.$options,n=e.render,r=e._parentVnode;r&&(t.$scopedSlots=r.data.scopedSlots||lo),t.$vnode=r;var i;try{i=n.call(t._renderProxy,t.$createElement)}catch(e){it(e,t,"render"),i=t._vnode}return i instanceof Ko||(i=Qo()),i.parent=r,i}}(Re);var Ma=[String,RegExp,Array],$a={name:"keep-alive",abstract:!0,props:{include:Ma,exclude:Ma,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)We(this.cache,t,this.keys)},mounted:function(){var t=this;this.$watch("include",function(e){Ve(t,function(t){return qe(e,t)})}),this.$watch("exclude",function(e){Ve(t,function(t){return!qe(e,t)})})},render:function(){var t=this.$slots.default,e=Ot(t),n=e&&e.componentOptions;if(n){var r=Ye(n),i=this,o=i.include,a=i.exclude;if(o&&(!r||!qe(o,r))||a&&r&&qe(a,r))return e;var s=this,c=s.cache,u=s.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;c[l]?(e.componentInstance=c[l].componentInstance,v(u,l),u.push(l)):(c[l]=e,u.push(l),this.max&&u.length>parseInt(this.max)&&We(c,u[0],u,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}},Ia={KeepAlive:$a};!function(t){var e={};e.get=function(){return Co},Object.defineProperty(t,"config",e),t.util={warn:qo,extend:x,mergeOptions:J,defineReactive:F},t.set=B,t.delete=U,t.nextTick=ut,t.options=Object.create(null),Oo.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,x(t.options.components,Ia),Fe(t),Be(t),Ue(t),ze(t)}(Re),Object.defineProperty(Re.prototype,"$isServer",{get:Xo}),Object.defineProperty(Re.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Re,"FunctionalRenderContext",{value:xe}),Re.version="2.5.22";var Na,Da,Ra,Fa,Ba,Ua,Ha,Xa,za,Ya=h("style,class"),qa=h("input,textarea,option,select,progress"),Va=function(t,e,n){return"value"===n&&qa(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Wa=h("contenteditable,draggable,spellcheck"),Ga=h("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Ka="http://www.w3.org/1999/xlink",Ja=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Qa=function(t){return Ja(t)?t.slice(6,t.length):""},Za=function(t){return null==t||!1===t},ts={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},es=h("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),ns=h("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),rs=function(t){return"pre"===t},is=function(t){return es(t)||ns(t)},os=Object.create(null),as=h("text,number,password,search,email,tel,url"),ss=Object.freeze({createElement:an,createElementNS:sn,createTextNode:cn,createComment:un,insertBefore:ln,removeChild:pn,appendChild:fn,parentNode:dn,nextSibling:hn,tagName:vn,setTextContent:mn,setStyleScope:yn}),cs={create:function(t,e){gn(e)},update:function(t,e){t.data.ref!==e.data.ref&&(gn(t,!0),gn(e))},destroy:function(t){gn(t,!0)}},us=new Ko("",{},[]),ls=["create","activate","update","remove","destroy"],ps={create:_n,update:_n,destroy:function(t){_n(t,us)}},fs=Object.create(null),ds=[cs,ps],hs={create:Cn,update:Cn},vs={create:Pn,update:Pn},ms=/[\w).+\-_$\]]/,ys="__r",gs="__c",bs={create:or,update:or},ws={create:ar,update:ar},xs=y(function(t){var e={},n=/;(?![^(]*\))/g,r=/:(.+)/;return t.split(n).forEach(function(t){if(t){var n=t.split(r);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}),_s=/^--/,ks=/\s*!important$/,Ts=function(t,e,n){if(_s.test(e))t.style.setProperty(e,n);else if(ks.test(n))t.style.setProperty(e,n.replace(ks,""),"important");else{var r=Es(e);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)t.style[r]=n[i];else t.style[r]=n}},Os=["Webkit","Moz","ms"],Es=y(function(t){if(za=za||document.createElement("div").style,"filter"!==(t=yo(t))&&t in za)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<Os.length;n++){var r=Os[n]+e;if(r in za)return r}}),Cs={create:dr,update:dr},As=/\s+/,Ss=y(function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}}),Ps=Po&&!Io,js="transition",Ls="animation",Ms="transition",$s="transitionend",Is="animation",Ns="animationend";Ps&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ms="WebkitTransition",$s="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Is="WebkitAnimation",Ns="webkitAnimationEnd"));var Ds=Po?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()},Rs=/\b(transform|all)(,|$)/,Fs=Po?{create:Ar,activate:Ar,remove:function(t,e){!0!==t.data.show?Or(t,e):e()}}:{},Bs=[hs,vs,bs,ws,Cs,Fs],Us=Bs.concat(ds),Hs=function(t){function e(t){return new Ko(j.tagName(t).toLowerCase(),{},[],void 0,t)}function n(t,e){function n(){0==--n.listeners&&a(t)}return n.listeners=e,n}function a(t){var e=j.parentNode(t);i(e)&&j.removeChild(e,t)}function c(t,e,n,r,a,s,c){if(i(t.elm)&&i(s)&&(t=s[c]=$(t)),t.isRootInsert=!a,!u(t,e,n,r)){var l=t.data,p=t.children,h=t.tag;i(h)?(t.elm=t.ns?j.createElementNS(t.ns,h):j.createElement(h,t),y(t),d(t,p,e),i(l)&&m(t,e),f(n,t.elm,r)):o(t.isComment)?(t.elm=j.createComment(t.text),f(n,t.elm,r)):(t.elm=j.createTextNode(t.text),f(n,t.elm,r))}}function u(t,e,n,r){var a=t.data;if(i(a)){var s=i(t.componentInstance)&&a.keepAlive;if(i(a=a.hook)&&i(a=a.init)&&a(t,!1),i(t.componentInstance))return l(t,e),f(n,t.elm,r),o(s)&&p(t,e,n,r),!0}}function l(t,e){i(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,v(t)?(m(t,e),y(t)):(gn(t),e.push(t))}function p(t,e,n,r){for(var o,a=t;a.componentInstance;)if(a=a.componentInstance._vnode,i(o=a.data)&&i(o=o.transition)){for(o=0;o<S.activate.length;++o)S.activate[o](us,a);e.push(a);break}f(n,t.elm,r)}function f(t,e,n){i(t)&&(i(n)?j.parentNode(n)===t&&j.insertBefore(t,e,n):j.appendChild(t,e))}function d(t,e,n){if(Array.isArray(e))for(var r=0;r<e.length;++r)c(e[r],n,t.elm,null,!0,e,r);else s(t.text)&&j.appendChild(t.elm,j.createTextNode(String(t.text)))}function v(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return i(t.tag)}function m(t,e){for(var n=0;n<S.create.length;++n)S.create[n](us,t);C=t.data.hook,i(C)&&(i(C.create)&&C.create(us,t),i(C.insert)&&e.push(t))}function y(t){var e;if(i(e=t.fnScopeId))j.setStyleScope(t.elm,e);else for(var n=t;n;)i(e=n.context)&&i(e=e.$options._scopeId)&&j.setStyleScope(t.elm,e),n=n.parent;i(e=ya)&&e!==t.context&&e!==t.fnContext&&i(e=e.$options._scopeId)&&j.setStyleScope(t.elm,e)}function g(t,e,n,r,i,o){for(;r<=i;++r)c(n[r],o,t,e,!1,n,r)}function b(t){var e,n,r=t.data;if(i(r))for(i(e=r.hook)&&i(e=e.destroy)&&e(t),e=0;e<S.destroy.length;++e)S.destroy[e](t);if(i(e=t.children))for(n=0;n<t.children.length;++n)b(t.children[n])}function w(t,e,n,r){for(;n<=r;++n){var o=e[n];i(o)&&(i(o.tag)?(x(o),b(o)):a(o.elm))}}function x(t,e){if(i(e)||i(t.data)){var r,o=S.remove.length+1;for(i(e)?e.listeners+=o:e=n(t.elm,o),i(r=t.componentInstance)&&i(r=r._vnode)&&i(r.data)&&x(r,e),r=0;r<S.remove.length;++r)S.remove[r](t,e);i(r=t.data.hook)&&i(r=r.remove)?r(t,e):e()}else a(t.elm)}function _(t,e,n,o,a){for(var s,u,l,p,f=0,d=0,h=e.length-1,v=e[0],m=e[h],y=n.length-1,b=n[0],x=n[y],_=!a;f<=h&&d<=y;)r(v)?v=e[++f]:r(m)?m=e[--h]:bn(v,b)?(T(v,b,o,n,d),v=e[++f],b=n[++d]):bn(m,x)?(T(m,x,o,n,y),m=e[--h],x=n[--y]):bn(v,x)?(T(v,x,o,n,y),_&&j.insertBefore(t,v.elm,j.nextSibling(m.elm)),v=e[++f],x=n[--y]):bn(m,b)?(T(m,b,o,n,d),_&&j.insertBefore(t,m.elm,v.elm),m=e[--h],b=n[++d]):(r(s)&&(s=xn(e,f,h)),u=i(b.key)?s[b.key]:k(b,e,f,h),r(u)?c(b,o,t,v.elm,!1,n,d):(l=e[u],bn(l,b)?(T(l,b,o,n,d),e[u]=void 0,_&&j.insertBefore(t,l.elm,v.elm)):c(b,o,t,v.elm,!1,n,d)),b=n[++d]);f>h?(p=r(n[y+1])?null:n[y+1].elm,g(t,p,n,d,y,o)):d>y&&w(t,e,f,h)}function k(t,e,n,r){for(var o=n;o<r;o++){var a=e[o];if(i(a)&&bn(t,a))return o}}function T(t,e,n,a,s,c){if(t!==e){i(e.elm)&&i(a)&&(e=a[s]=$(e));var u=e.elm=t.elm;if(o(t.isAsyncPlaceholder))return void(i(e.asyncFactory.resolved)?E(t.elm,e,n):e.isAsyncPlaceholder=!0);if(o(e.isStatic)&&o(t.isStatic)&&e.key===t.key&&(o(e.isCloned)||o(e.isOnce)))return void(e.componentInstance=t.componentInstance);var l,p=e.data;i(p)&&i(l=p.hook)&&i(l=l.prepatch)&&l(t,e);var f=t.children,d=e.children;if(i(p)&&v(e)){for(l=0;l<S.update.length;++l)S.update[l](t,e);i(l=p.hook)&&i(l=l.update)&&l(t,e)}r(e.text)?i(f)&&i(d)?f!==d&&_(u,f,d,n,c):i(d)?(i(t.text)&&j.setTextContent(u,""),g(u,null,d,0,d.length-1,n)):i(f)?w(u,f,0,f.length-1):i(t.text)&&j.setTextContent(u,""):t.text!==e.text&&j.setTextContent(u,e.text),i(p)&&i(l=p.hook)&&i(l=l.postpatch)&&l(t,e)}}function O(t,e,n){if(o(n)&&i(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r<e.length;++r)e[r].data.hook.insert(e[r])}function E(t,e,n,r){var a,s=e.tag,c=e.data,u=e.children;if(r=r||c&&c.pre,e.elm=t,o(e.isComment)&&i(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if(i(c)&&(i(a=c.hook)&&i(a=a.init)&&a(e,!0),i(a=e.componentInstance)))return l(e,n),!0;if(i(s)){if(i(u))if(t.hasChildNodes())if(i(a=c)&&i(a=a.domProps)&&i(a=a.innerHTML)){if(a!==t.innerHTML)return!1}else{for(var p=!0,f=t.firstChild,h=0;h<u.length;h++){if(!f||!E(f,u[h],n,r)){p=!1;break}f=f.nextSibling}if(!p||f)return!1}else d(e,u,n);if(i(c)){var v=!1;for(var y in c)if(!L(y)){v=!0,m(e,n);break}!v&&c.class&<(c.class)}}else t.data!==e.text&&(t.data=e.text);return!0}var C,A,S={},P=t.modules,j=t.nodeOps;for(C=0;C<ls.length;++C)for(S[ls[C]]=[],A=0;A<P.length;++A)i(P[A][ls[C]])&&S[ls[C]].push(P[A][ls[C]]);var L=h("attrs,class,staticClass,staticStyle,key");return function(t,n,a,s){if(r(n))return void(i(t)&&b(t));var u=!1,l=[];if(r(t))u=!0,c(n,l);else{var p=i(t.nodeType);if(!p&&bn(t,n))T(t,n,l,null,null,s);else{if(p){if(1===t.nodeType&&t.hasAttribute(To)&&(t.removeAttribute(To),a=!0),o(a)&&E(t,n,l))return O(n,l,!0),t;t=e(t)}var f=t.elm,d=j.parentNode(f);if(c(n,l,f._leaveCb?null:d,j.nextSibling(f)),i(n.parent))for(var h=n.parent,m=v(n);h;){for(var y=0;y<S.destroy.length;++y)S.destroy[y](h);if(h.elm=n.elm,m){for(var g=0;g<S.create.length;++g)S.create[g](us,h);var x=h.data.hook.insert;if(x.merged)for(var _=1;_<x.fns.length;_++)x.fns[_]()}else gn(h);h=h.parent}i(d)?w(d,[t],0,0):i(t.tag)&&b(t)}}return O(n,l,u),n.elm}}({nodeOps:ss,modules:Us});Io&&document.addEventListener("selectionchange",function(){var t=document.activeElement;t&&t.vmodel&&Ir(t,"input")});var Xs={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?ht(n,"postpatch",function(){Xs.componentUpdated(t,e,n)}):Sr(t,e,n.context),t._vOptions=[].map.call(t.options,Lr)):("textarea"===n.tag||as(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",Mr),t.addEventListener("compositionend",$r),t.addEventListener("change",$r),Io&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Sr(t,e,n.context);var r=t._vOptions,i=t._vOptions=[].map.call(t.options,Lr);i.some(function(t,e){return!T(t,r[e])})&&(t.multiple?e.value.some(function(t){return jr(t,i)}):e.value!==e.oldValue&&jr(e.value,i))&&Ir(t,"change")}}},zs={bind:function(t,e,n){var r=e.value;n=Nr(n);var i=n.data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,Tr(n,function(){t.style.display=o})):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&(n=Nr(n),n.data&&n.data.transition?(n.data.show=!0,r?Tr(n,function(){t.style.display=t.__vOriginalDisplay}):Or(n,function(){t.style.display="none"})):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}},Ys={model:Xs,show:zs},qs={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]},Vs=function(t){return t.tag||Tt(t)},Ws=function(t){return"show"===t.name},Gs={name:"transition",props:qs,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Vs),n.length)){var r=this.mode,i=n[0];if(Br(this.$vnode))return i;var o=Dr(i);if(!o)return i;if(this._leaving)return Fr(t,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:s(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var c=(o.data||(o.data={})).transition=Rr(this),u=this._vnode,l=Dr(u);if(o.data.directives&&o.data.directives.some(Ws)&&(o.data.show=!0),l&&l.data&&!Ur(o,l)&&!Tt(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var p=l.data.transition=x({},c);if("out-in"===r)return this._leaving=!0,ht(p,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),Fr(t,i);if("in-out"===r){if(Tt(o))return u;var f,d=function(){f()};ht(c,"afterEnter",d),ht(c,"enterCancelled",d),ht(p,"delayLeave",function(t){f=t})}}return i}}},Ks=x({tag:String,moveClass:String},qs);delete Ks.mode;var Js={props:Ks,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=$t(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Rr(this),s=0;s<i.length;s++){var c=i[s];c.tag&&null!=c.key&&0!==String(c.key).indexOf("__vlist")&&(o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a)}if(r){for(var u=[],l=[],p=0;p<r.length;p++){var f=r[p];f.data.transition=a,f.data.pos=f.elm.getBoundingClientRect(),n[f.key]?u.push(f):l.push(f)}this.kept=t(e,null,u),this.removed=l}return t(e,null,o)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(Hr),t.forEach(Xr),t.forEach(zr),this._reflow=document.body.offsetHeight,t.forEach(function(t){if(t.data.moved){var n=t.elm,r=n.style;gr(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener($s,n._moveCb=function t(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener($s,t),n._moveCb=null,br(n,e))})}}))},methods:{hasMove:function(t,e){if(!Ps)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach(function(t){vr(n,t)}),hr(n,e),n.style.display="none",this.$el.appendChild(n);var r=xr(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}},Qs={Transition:Gs,TransitionGroup:Js};Re.config.mustUseProp=Va,Re.config.isReservedTag=is,Re.config.isReservedAttr=Ya,Re.config.getTagNamespace=nn,Re.config.isUnknownElement=rn,x(Re.options.directives,Ys),x(Re.options.components,Qs),Re.prototype.__patch__=Po?Hs:k,Re.prototype.$mount=function(t,e){return t=t&&Po?on(t):void 0,Nt(this,t,e)},Po&&setTimeout(function(){Co.devtools&&zo&&zo.emit("init",Re)},0);var Zs,tc,ec,nc,rc,ic,oc,ac,sc,cc,uc,lc,pc=/\{\{((?:.|\r?\n)+?)\}\}/g,fc=/[-.*+?^${}()|[\]\/\\]/g,dc=y(function(t){var e=t[0].replace(fc,"\\$&"),n=t[1].replace(fc,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+n,"g")}),hc={staticKeys:["staticClass"],transformNode:qr,genData:Vr},vc={staticKeys:["staticStyle"],transformNode:Wr,genData:Gr},mc={decode:function(t){return Zs=Zs||document.createElement("div"),Zs.innerHTML=t,Zs.textContent}},yc=h("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),gc=h("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),bc=h("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),wc=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,xc="[a-zA-Z_][\\w\\-\\.]*",_c="((?:"+xc+"\\:)?"+xc+")",kc=new RegExp("^<"+_c),Tc=/^\s*(\/?)>/,Oc=new RegExp("^<\\/"+_c+"[^>]*>"),Ec=/^<!DOCTYPE [^>]+>/i,Cc=/^<!\--/,Ac=/^<!\[/,Sc=h("script,style,textarea",!0),Pc={},jc={"<":"<",">":">",""":'"',"&":"&"," ":"\n","	":"\t"},Lc=/&(?:lt|gt|quot|amp);/g,Mc=/&(?:lt|gt|quot|amp|#10|#9);/g,$c=h("pre,textarea",!0),Ic=function(t,e){return t&&$c(t)&&"\n"===e[0]},Nc=/^@|^v-on:/,Dc=/^v-|^@|^:/,Rc=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Fc=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Bc=/^\(|\)$/g,Uc=/:(.*)$/,Hc=/^:|^v-bind:/,Xc=/\.[^.]+/g,zc=y(mc.decode),Yc=/^xmlns:NS\d+/,qc=/^NS\d+:/,Vc={preTransformNode:xi},Wc=[hc,vc,Vc],Gc={model:Kn,text:ki,html:Ti},Kc={expectHTML:!0,modules:Wc,directives:Gc,isPreTag:rs,isUnaryTag:yc,mustUseProp:Va,canBeLeftOpenTag:gc,isReservedTag:is,getTagNamespace:nn,staticKeys:function(t){return t.reduce(function(t,e){return t.concat(e.staticKeys||[])},[]).join(",")}(Wc)},Jc=y(Ei),Qc=/^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/,Zc=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,tu={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},eu={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},nu=function(t){return"if("+t+")return null;"},ru={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:nu("$event.target !== $event.currentTarget"),ctrl:nu("!$event.ctrlKey"),shift:nu("!$event.shiftKey"),alt:nu("!$event.altKey"),meta:nu("!$event.metaKey"),left:nu("'button' in $event && $event.button !== 0"),middle:nu("'button' in $event && $event.button !== 1"),right:nu("'button' in $event && $event.button !== 2")},iu={on:Ii,bind:Ni,cloak:k},ou=function(t){this.options=t,this.warn=t.warn||Mn,this.transforms=$n(t.modules,"transformCode"),this.dataGenFns=$n(t.modules,"genData"),this.directives=x(x({},iu),t.directives);var e=t.isReservedTag||_o;this.maybeComponent=function(t){return!(e(t.tag)&&!t.component)},this.onceId=0,this.staticRenderFns=[],this.pre=!1},au=(new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)"),function(t){return function(e){function n(n,r){var i=Object.create(e),o=[],a=[];if(i.warn=function(t,e){(e?a:o).push(t)},r){r.modules&&(i.modules=(e.modules||[]).concat(r.modules)),r.directives&&(i.directives=x(Object.create(e.directives||null),r.directives));for(var s in r)"modules"!==s&&"directives"!==s&&(i[s]=r[s])}var c=t(n,i);return c.errors=o,c.tips=a,c}return{compile:n,compileToFunctions:so(n)}}}(function(t,e){var n=Zr(t.trim(),e);!1!==e.optimize&&Oi(n,e);var r=Di(n,e);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}})),su=au(Kc),cu=(su.compile,su.compileToFunctions),uu=!!Po&&co(!1),lu=!!Po&&co(!0),pu=y(function(t){var e=on(t);return e&&e.innerHTML}),fu=Re.prototype.$mount;Re.prototype.$mount=function(t,e){if((t=t&&on(t))===document.body||t===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=pu(r));else{if(!r.nodeType)return this;r=r.innerHTML}else t&&(r=uo(t));if(r){var i=cu(r,{shouldDecodeNewlines:uu,shouldDecodeNewlinesForHref:lu,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return fu.call(this,t,e)},Re.compile=cu,e.a=Re}).call(e,n(3),n(18).setImmediate)},,,function(t,e,n){"use strict";(function(e){function r(t,e){!i.isUndefined(t)&&i.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var i=n(0),o=n(26),a={"Content-Type":"application/x-www-form-urlencoded"},s={adapter:function(){var t;return"undefined"!=typeof XMLHttpRequest?t=n(11):void 0!==e&&(t=n(11)),t}(),transformRequest:[function(t,e){return o(e,"Content-Type"),i.isFormData(t)||i.isArrayBuffer(t)||i.isBuffer(t)||i.isStream(t)||i.isFile(t)||i.isBlob(t)?t:i.isArrayBufferView(t)?t.buffer:i.isURLSearchParams(t)?(r(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):i.isObject(t)?(r(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(t){s.headers[t]={}}),i.forEach(["post","put","patch"],function(t){s.headers[t]=i.merge(a)}),t.exports=s}).call(e,n(8))},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(p===clearTimeout)return clearTimeout(t);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function a(){v&&d&&(v=!1,d.length?h=d.concat(h):m=-1,h.length&&s())}function s(){if(!v){var t=i(a);v=!0;for(var e=h.length;e;){for(d=h,h=[];++m<e;)d&&d[m].run();m=-1,e=h.length}d=null,v=!1,o(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var l,p,f=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(t){p=r}}();var d,h=[],v=!1,m=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];h.push(new c(t,e)),1!==h.length||v||i(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(t){return[]},f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e,n){t.exports=n(23)},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(0),i=n(27),o=n(29),a=n(30),s=n(31),c=n(12),u="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(32);t.exports=function(t){return new Promise(function(e,l){var p=t.data,f=t.headers;r.isFormData(p)&&delete f["Content-Type"];var d=new XMLHttpRequest,h="onreadystatechange",v=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in d||s(t.url)||(d=new window.XDomainRequest,h="onload",v=!0,d.onprogress=function(){},d.ontimeout=function(){}),t.auth){var m=t.auth.username||"",y=t.auth.password||"";f.Authorization="Basic "+u(m+":"+y)}if(d.open(t.method.toUpperCase(),o(t.url,t.params,t.paramsSerializer),!0),d.timeout=t.timeout,d[h]=function(){if(d&&(4===d.readyState||v)&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?a(d.getAllResponseHeaders()):null,r=t.responseType&&"text"!==t.responseType?d.response:d.responseText,o={data:r,status:1223===d.status?204:d.status,statusText:1223===d.status?"No Content":d.statusText,headers:n,config:t,request:d};i(e,l,o),d=null}},d.onerror=function(){l(c("Network Error",t,null,d)),d=null},d.ontimeout=function(){l(c("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var g=n(33),b=(t.withCredentials||s(t.url))&&t.xsrfCookieName?g.read(t.xsrfCookieName):void 0;b&&(f[t.xsrfHeaderName]=b)}if("setRequestHeader"in d&&r.forEach(f,function(t,e){void 0===p&&"content-type"===e.toLowerCase()?delete f[e]:d.setRequestHeader(e,t)}),t.withCredentials&&(d.withCredentials=!0),t.responseType)try{d.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&d.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){d&&(d.abort(),l(t),d=null)}),void 0===p&&(p=null),d.send(p)})}},function(t,e,n){"use strict";var r=n(28);t.exports=function(t,e,n,i,o){var a=new Error(t);return r(a,e,n,i,o)}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e){(function(e){t.exports=e}).call(e,{})},,,function(t,e,n){(function(t){function r(t,e){this._id=t,this._clearFn=e}var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;e.setTimeout=function(){return new r(o.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new r(o.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(19),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(e,n(3))},function(t,e,n){(function(t,e){!function(t,n){"use strict";function r(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return u[c]=r,s(c),c++}function i(t){delete u[t]}function o(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}function a(t){if(l)setTimeout(a,0,t);else{var e=u[t];if(e){l=!0;try{o(e)}finally{i(t),l=!1}}}}if(!t.setImmediate){var s,c=1,u={},l=!1,p=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?function(){s=function(t){e.nextTick(function(){a(t)})}}():function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&a(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),s=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){a(t.data)},s=function(e){t.port2.postMessage(e)}}():p&&"onreadystatechange"in p.createElement("script")?function(){var t=p.documentElement;s=function(e){var n=p.createElement("script");n.onreadystatechange=function(){a(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():function(){s=function(t){setTimeout(a,0,t)}}(),f.setImmediate=r,f.clearImmediate=i}}("undefined"==typeof self?void 0===t?this:t:self)}).call(e,n(3),n(8))},function(t,e,n){"use strict";function r(t){return t&&DataView.prototype.isPrototypeOf(t)}function i(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function o(t){return"string"!=typeof t&&(t=String(t)),t}function a(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return x.iterable&&(e[Symbol.iterator]=function(){return e}),e}function s(t){this.map={},t instanceof s?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function u(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function l(t){var e=new FileReader,n=u(e);return e.readAsArrayBuffer(t),n}function p(t){var e=new FileReader,n=u(e);return e.readAsText(t),n}function f(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}function d(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(t){this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:x.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:x.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:x.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():x.arrayBuffer&&x.blob&&r(t)?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):x.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||k(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):x.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},x.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return p(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(f(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},x.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function v(t){var e=t.toUpperCase();return T.indexOf(e)>-1?e:t}function m(t,e){e=e||{};var n=e.body;if(t instanceof m){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new s(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new s(e.headers)),this.method=v(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function y(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function g(t){var e=new s;return t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}}),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new s(e.headers),this.url=e.url||"",this._initBody(t)}function w(t,e){return new Promise(function(n,r){function i(){a.abort()}var o=new m(t,e);if(o.signal&&o.signal.aborted)return r(new E("Aborted","AbortError"));var a=new XMLHttpRequest;a.onload=function(){var t={status:a.status,statusText:a.statusText,headers:g(a.getAllResponseHeaders()||"")};t.url="responseURL"in a?a.responseURL:t.headers.get("X-Request-URL");var e="response"in a?a.response:a.responseText;n(new b(e,t))},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request failed"))},a.onabort=function(){r(new E("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&x.blob&&(a.responseType="blob"),o.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),o.signal&&(o.signal.addEventListener("abort",i),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",i)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})}var x={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(x.arrayBuffer)var _=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],k=ArrayBuffer.isView||function(t){return t&&_.indexOf(Object.prototype.toString.call(t))>-1};s.prototype.append=function(t,e){t=i(t),e=o(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},s.prototype.delete=function(t){delete this.map[i(t)]},s.prototype.get=function(t){return t=i(t),this.has(t)?this.map[t]:null},s.prototype.has=function(t){return this.map.hasOwnProperty(i(t))},s.prototype.set=function(t,e){this.map[i(t)]=o(e)},s.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},s.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),a(t)},s.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),a(t)},s.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),a(t)},x.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);var T=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},h.call(m.prototype),h.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var O=[301,302,303,307,308];b.redirect=function(t,e){if(-1===O.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})};var E=self.DOMException;try{new E}catch(t){E=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},E.prototype=Object.create(Error.prototype),E.prototype.constructor=E}w.polyfill=!0,self.fetch||(self.fetch=w,self.Headers=s,self.Request=m,self.Response=b)},,,function(t,e,n){"use strict";function r(t){var e=new a(t),n=o(a.prototype.request,e);return i.extend(n,a.prototype,e),i.extend(n,e),n}var i=n(0),o=n(10),a=n(25),s=n(7),c=r(s);c.Axios=a,c.create=function(t){return r(i.merge(s,t))},c.Cancel=n(14),c.CancelToken=n(39),c.isCancel=n(13),c.all=function(t){return Promise.all(t)},c.spread=n(40),t.exports=c,t.exports.default=c},function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function r(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}/*!
|
7 |
* Determine if an object is a Buffer
|
8 |
*
|
9 |
* @author Feross Aboukhadijeh <https://feross.org>
|
10 |
* @license MIT
|
11 |
*/
|
12 |
+
t.exports=function(t){return null!=t&&(n(t)||r(t)||!!t._isBuffer)}},function(t,e,n){"use strict";function r(t){this.defaults=t,this.interceptors={request:new a,response:new a}}var i=n(7),o=n(0),a=n(34),s=n(35);r.prototype.request=function(t){"string"==typeof t&&(t=o.merge({url:arguments[0]},arguments[1])),t=o.merge(i,{method:"get"},this.defaults,t),t.method=t.method.toLowerCase();var e=[s,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},o.forEach(["delete","get","head","options"],function(t){r.prototype[t]=function(e,n){return this.request(o.merge(n||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){r.prototype[t]=function(e,n,r){return this.request(o.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=r},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(12);t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t}},function(t,e,n){"use strict";function r(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var i=n(0);t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(i.isURLSearchParams(e))o=e.toString();else{var a=[];i.forEach(e,function(t,e){null!==t&&void 0!==t&&(i.isArray(t)?e+="[]":t=[t],i.forEach(t,function(t){i.isDate(t)?t=t.toISOString():i.isObject(t)&&(t=JSON.stringify(t)),a.push(r(e)+"="+r(t))}))}),o=a.join("&")}return o&&(t+=(-1===t.indexOf("?")?"?":"&")+o),t}},function(t,e,n){"use strict";var r=n(0),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,o,a={};return t?(r.forEach(t.split("\n"),function(t){if(o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e){if(a[e]&&i.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}}),a):a}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){function t(t){var e=t;return n&&(i.setAttribute("href",e),e=i.href),i.setAttribute("href",e),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}var e,n=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");return e=t(window.location.href),function(n){var i=r.isString(n)?t(n):n;return i.protocol===e.protocol&&i.host===e.host}}():function(){return function(){return!0}}()},function(t,e,n){"use strict";function r(){this.message="String contains an invalid character"}function i(t){for(var e,n,i=String(t),a="",s=0,c=o;i.charAt(0|s)||(c="=",s%1);a+=c.charAt(63&e>>8-s%1*8)){if((n=i.charCodeAt(s+=.75))>255)throw new r;e=e<<8|n}return a}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.prototype=new Error,r.prototype.code=5,r.prototype.name="InvalidCharacterError",t.exports=i},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){return{write:function(t,e,n,i,o,a){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(t,e,n){"use strict";function r(){this.handlers=[]}var i=n(0);r.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},r.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},r.prototype.forEach=function(t){i.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=r},function(t,e,n){"use strict";function r(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var i=n(0),o=n(36),a=n(13),s=n(7),c=n(37),u=n(38);t.exports=function(t){return r(t),t.baseURL&&!c(t.url)&&(t.url=u(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||s.adapter)(t).then(function(e){return r(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return a(e)||(r(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";function r(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new i(t),e(n.reason))})}var i=n(14);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var t;return{token:new r(function(e){t=e}),cancel:t}},t.exports=r},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},,,function(t,e,n){!function(e,n){t.exports=function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s="NHnr")}({"+E39":function(t,e,n){t.exports=!n("S82l")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"+ZMJ":function(t,e,n){var r=n("lOnJ");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},"+tPU":function(t,e,n){n("xGkn");for(var r=n("7KvD"),i=n("hJx8"),o=n("/bQp"),a=n("dSzd")("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),c=0;c<s.length;c++){var u=s[c],l=r[u],p=l&&l.prototype;p&&!p[a]&&i(p,a,u),o[u]=o.Array}},"//Fk":function(t,e,n){t.exports={default:n("U5ju"),__esModule:!0}},"/bQp":function(t,e){t.exports={}},"/n6Q":function(t,e,n){n("zQR9"),n("+tPU"),t.exports=n("Kh4W").f("iterator")},"06OY":function(t,e,n){var r=n("3Eo+")("meta"),i=n("EqjI"),o=n("D2L2"),a=n("evD5").f,s=0,c=Object.isExtensible||function(){return!0},u=!n("S82l")(function(){return c(Object.preventExtensions({}))}),l=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},p=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!c(t))return"F";if(!e)return"E";l(t)}return t[r].i},f=function(t,e){if(!o(t,r)){if(!c(t))return!0;if(!e)return!1;l(t)}return t[r].w},d=function(t){return u&&h.NEED&&c(t)&&!o(t,r)&&l(t),t},h=t.exports={KEY:r,NEED:!1,fastKey:p,getWeak:f,onFreeze:d}},"1kS7":function(t,e){e.f=Object.getOwnPropertySymbols},"2KxR":function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},"3Eo+":function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},"3fs2":function(t,e,n){var r=n("RY/4"),i=n("dSzd")("iterator"),o=n("/bQp");t.exports=n("FeBl").getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},"4mcu":function(t,e){t.exports=function(){}},"52gC":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"5QVw":function(t,e,n){t.exports={default:n("BwfY"),__esModule:!0}},"5zde":function(t,e,n){n("zQR9"),n("qyJz"),t.exports=n("FeBl").Array.from},"6cjq":function(t,e){},"77Pl":function(t,e,n){var r=n("EqjI");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},"7KvD":function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"7UMu":function(t,e,n){var r=n("R9M2");t.exports=Array.isArray||function(t){return"Array"==r(t)}},"82Mu":function(t,e,n){var r=n("7KvD"),i=n("L42u").set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,c="process"==n("R9M2")(a);t.exports=function(){var t,e,n,u=function(){var r,i;for(c&&(r=a.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(u)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve();n=function(){l.then(u)}}else n=function(){i.call(r,u)};else{var p=!0,f=document.createTextNode("");new o(u).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},"880/":function(t,e,n){t.exports=n("hJx8")},"94VQ":function(t,e,n){"use strict";var r=n("Yobk"),i=n("X8DO"),o=n("e6n0"),a={};n("hJx8")(a,n("dSzd")("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},"9bBU":function(t,e,n){n("mClu");var r=n("FeBl").Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},"A/PA":function(t,e){},BO1k:function(t,e,n){t.exports={default:n("fxRn"),__esModule:!0}},BwfY:function(t,e,n){n("fWfb"),n("M6a0"),n("OYls"),n("QWe/"),t.exports=n("FeBl").Symbol},C4MV:function(t,e,n){t.exports={default:n("9bBU"),__esModule:!0}},CXw9:function(t,e,n){"use strict";var r,i,o,a,s=n("O4g8"),c=n("7KvD"),u=n("+ZMJ"),l=n("RY/4"),p=n("kM2E"),f=n("EqjI"),d=n("lOnJ"),h=n("2KxR"),v=n("NWt+"),m=n("t8x9"),y=n("L42u").set,g=n("82Mu")(),b=n("qARP"),w=n("dNDb"),x=n("fJUb"),_=c.TypeError,k=c.process,T=c.Promise,O="process"==l(k),E=function(){},C=i=b.f,A=!!function(){try{var t=T.resolve(1),e=(t.constructor={})[n("dSzd")("species")]=function(t){t(E,E)};return(O||"function"==typeof PromiseRejectionEvent)&&t.then(E)instanceof e}catch(t){}}(),S=function(t){var e;return!(!f(t)||"function"!=typeof(e=t.then))&&e},P=function(t,e){if(!t._n){t._n=!0;var n=t._c;g(function(){for(var r=t._v,i=1==t._s,o=0;n.length>o;)!function(e){var n,o,a=i?e.ok:e.fail,s=e.resolve,c=e.reject,u=e.domain;try{a?(i||(2==t._h&&M(t),t._h=1),!0===a?n=r:(u&&u.enter(),n=a(r),u&&u.exit()),n===e.promise?c(_("Promise-chain cycle")):(o=S(n))?o.call(n,s,c):s(n)):c(r)}catch(t){c(t)}}(n[o++]);t._c=[],t._n=!1,e&&!t._h&&j(t)})}},j=function(t){y.call(c,function(){var e,n,r,i=t._v,o=L(t);if(o&&(e=w(function(){O?k.emit("unhandledRejection",i,t):(n=c.onunhandledrejection)?n({promise:t,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)}),t._h=O||L(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},L=function(t){return 1!==t._h&&0===(t._a||t._c).length},M=function(t){y.call(c,function(){var e;O?k.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})})},$=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),P(e,!0))},I=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw _("Promise can't be resolved itself");(e=S(t))?g(function(){var r={_w:n,_d:!1};try{e.call(t,u(I,r,1),u($,r,1))}catch(t){$.call(r,t)}}):(n._v=t,n._s=1,P(n,!1))}catch(t){$.call({_w:n,_d:!1},t)}}};A||(T=function(t){h(this,T,"Promise","_h"),d(t),r.call(this);try{t(u(I,this,1),u($,this,1))}catch(t){$.call(this,t)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n("xH/j")(T.prototype,{then:function(t,e){var n=C(m(this,T));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=O?k.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&P(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=u(I,t,1),this.reject=u($,t,1)},b.f=C=function(t){return t===T||t===a?new o(t):i(t)}),p(p.G+p.W+p.F*!A,{Promise:T}),n("e6n0")(T,"Promise"),n("bRrM")("Promise"),a=n("FeBl").Promise,p(p.S+p.F*!A,"Promise",{reject:function(t){var e=C(this);return(0,e.reject)(t),e.promise}}),p(p.S+p.F*(s||!A),"Promise",{resolve:function(t){return x(s&&this===a?T:this,t)}}),p(p.S+p.F*!(A&&n("dY0y")(function(t){T.all(t).catch(E)})),"Promise",{all:function(t){var e=this,n=C(e),r=n.resolve,i=n.reject,o=w(function(){var n=[],o=0,a=1;v(t,!1,function(t){var s=o++,c=!1;n.push(void 0),a++,e.resolve(t).then(function(t){c||(c=!0,n[s]=t,--a||r(n))},i)}),--a||r(n)});return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=C(e),r=n.reject,i=w(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},Cdx3:function(t,e,n){var r=n("sB3e"),i=n("lktj");n("uqUo")("keys",function(){return function(t){return i(r(t))}})},D2L2:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},EGZi:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},EqBC:function(t,e,n){"use strict";var r=n("kM2E"),i=n("FeBl"),o=n("7KvD"),a=n("t8x9"),s=n("fJUb");r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return s(e,t()).then(function(){return n})}:t,n?function(n){return s(e,t()).then(function(){throw n})}:t)}})},EqjI:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},FeBl:function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},Gu7T:function(t,e,n){"use strict";e.__esModule=!0;var r=n("c/Tr"),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return(0,i.default)(t)}},Ibhu:function(t,e,n){var r=n("D2L2"),i=n("TcQ7"),o=n("vFc/")(!1),a=n("ax3d")("IE_PROTO");t.exports=function(t,e){var n,s=i(t),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;e.length>c;)r(s,n=e[c++])&&(~o(u,n)||u.push(n));return u}},Kh4W:function(t,e,n){e.f=n("dSzd")},L42u:function(t,e,n){var r,i,o,a=n("+ZMJ"),s=n("knuC"),c=n("RPLV"),u=n("ON07"),l=n("7KvD"),p=l.process,f=l.setImmediate,d=l.clearImmediate,h=l.MessageChannel,v=l.Dispatch,m=0,y={},g=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){g.call(t.data)};f&&d||(f=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++m]=function(){s("function"==typeof t?t:Function(t),e)},r(m),m},d=function(t){delete y[t]},"process"==n("R9M2")(p)?r=function(t){p.nextTick(a(g,t,1))}:v&&v.now?r=function(t){v.now(a(g,t,1))}:h?(i=new h,o=i.port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(t){l.postMessage(t+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in u("script")?function(t){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),g.call(t)}}:function(t){setTimeout(a(g,t,1),0)}),t.exports={set:f,clear:d}},LKZe:function(t,e,n){var r=n("NpIQ"),i=n("X8DO"),o=n("TcQ7"),a=n("MmMw"),s=n("D2L2"),c=n("SfB7"),u=Object.getOwnPropertyDescriptor;e.f=n("+E39")?u:function(t,e){if(t=o(t),e=a(e,!0),c)try{return u(t,e)}catch(t){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},M6a0:function(t,e){},MU5D:function(t,e,n){var r=n("R9M2");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},Mhyx:function(t,e,n){var r=n("/bQp"),i=n("dSzd")("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},MmMw:function(t,e,n){var r=n("EqjI");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},NHnr:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("woOf"),i=n.n(r),o=n("bOdI"),a=n.n(o),s=n("fZjL"),c=n.n(s),u=n("//Fk"),l=n.n(u),p=n("Zrlr"),f=n.n(p),d=n("wxAW"),h=n.n(d),v=(n("Yo6p"),function(){function t(e){if(f()(this,t),this.document={},void 0===e)throw new Error("The document object does not exist!");this.document=e}return h()(t,[{key:"getElements",value:function(t){var e=this.document.querySelectorAll(t);return e&&e.length>0?[].slice.call(e):[]}},{key:"getElement",value:function(t){return this.document.querySelector(t)}}]),t}()),m=v,y={Dom:m},g=(n("A/PA"),n("Gu7T")),b=n.n(g),w=n("BO1k"),x=n.n(w),_=(n("h1D1"),n("siA7"),function(){function t(e){f()(this,t),this.bottle={},this.container={},this.bottle=e,this.container=e.container}return h()(t,[{key:"get",value:function(t){var e=this.container[t];if(!e)throw new Error(t+" service does not exists!");return e}},{key:"export",value:function(){return this.container}}]),t}()),k=_,T=n("pFYg"),O=n.n(T),E=function(){function t(){f()(this,t)}return h()(t,null,[{key:"getArguments",value:function(t){if(!this.isFunction(t))return!1;var e=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,n=/([^\s,]+)/g,r=t.toString().replace(e,""),i=r.slice(r.indexOf("(")+1,r.indexOf(")")).match(n);return null===i&&(i=[]),i}},{key:"isFunction",value:function(t){return t&&"[object Function]"==={}.toString.call(t)}},{key:"isClass",value:function(t){if("function"!=typeof t)return!1;try{return t(),!1}catch(t){return t.message,/constructor/.test(t.message)||/class as/.test(t.message)}}},{key:"log",value:function(e){t.getArguments(e),void 0===e||O()(e),e.toString(),t.isClass(e)}},{key:"isAnonymous",value:function(t){var e=t.toString().match(/^function ([^\s]+) \(\)/);return!e||!e[1]}}]),t}(),C=E,A=function(){function t(e){f()(this,t),this.Bottle=e}return h()(t,[{key:"make",value:function(t){var e=new this.Bottle,n=function(t,e,n){var r=e.split("."),i=n,o=!0,a=!1,s=void 0;try{for(var c,u=x()(r);!(o=(c=u.next()).done);o=!0){var l=c.value;if(!t.hasOwnProperty(l))return n;if(!(i=t[l]))return n}}catch(t){a=!0,s=t}finally{try{!o&&u.return&&u.return()}finally{if(a)throw s}}return i},r=!0,i=!1,o=void 0;try{for(var a,s=x()(c()(t));!(r=(a=s.next()).done);r=!0){var u=a.value;!function(r){if(e.provider(r,function(){if(!C.isFunction(t[r]))return void(this.$get=function(){return t[r]});if(!t[r].$injectable)return void(this.$get=t[r]);var e=c()(t[r].$injectParams);this.$get=function(i){var o=e.reduce(function(e,o){var a=t[r].$injectParams[o].from,s=t[r].$injectParams[o].default;return e.push(n(i,a,s)),e},[]);return t[r].apply(t,b()(o))}}),t[r].$injectNewInstance){var i=c()(t[r].$injectParams),o=t[r].$injectAs||function(t){return t.charAt(0).toLowerCase()+t.slice(1)}(r);e.provider(o,function(){this.$get=function(e){var o=i.reduce(function(i,o){var a=t[r].$injectParams[o].from,s=t[r].$injectParams[o].default;return i.push(n(e,a,s)),i},[]);return new(Function.prototype.bind.apply(t[r],[null].concat(b()(o))))}})}}(u)}}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return new k(e)}}]),t}(),S=A,P=function(){function t(e,n){f()(this,t),this.containerFactory=e,this.services=n,this.plugins=[]}return h()(t,[{key:"use",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.plugins=t}},{key:"init",value:function(t){var e=this;return this._loadPlugins().then(function(n){e._runApplication(t,n)})}},{key:"_loadPlugins",value:function(){var t=this;return new l.a(function(e){t._allPluginsLoaded(t.plugins)?e(t._getLoadedPlugins(t.plugins)):window.UiFramework.subscribe("plugin-loaded",function(){t._allPluginsLoaded(t.plugins)&&e(t._getLoadedPlugins(t.plugins))})})}},{key:"_runApplication",value:function(t,e){var n=this;return this.services=e.reduce(function(t,e){return t=e.register(t)},this.services),this.container=this.containerFactory.make(this.services),e.forEach(function(t){return t.run(n.container)}),this._registerVues(t)}},{key:"_allPluginsLoaded",value:function(t){return t.reduce(function(t,e){return t&&!!window.UiFramework.plugins[e]},!0)}},{key:"_getLoadedPlugins",value:function(t){return t.map(function(t){return window.UiFramework.plugins[t]}).filter(function(t){return!!t}).sort(function(t,e){return t.priority-e.piority}).map(function(t){return t.plugin})}},{key:"_registerVues",value:function(t){var e=this,n=this.container.get("vue");if(!n.isInjectedComponentsInstalled)throw new Error("Injected Components plugin must be installed for UI Framework application");var r={},i=this.container.get("document"),o=new y.Dom(i),a=n.extend();return c()(t).map(function(n){r[n]=o.getElements(n).map(e._handleElement.bind(e,a,t[n]))}),r}},{key:"_handleElement",value:function(t,e,n){var r=new t({components:a()({},e,this.container.get(e)),provide:this.container.export()});return r.$mount(n),r}}]),t}(),j=P,L={install:function(t,e){var n=e.container;t.isInjectedComponentsInstalled=!0,t.mixin({created:function(){var t=this.$options.components;for(var e in t)if(t[e]&&"string"==typeof t[e]){var r=n[e];if(!r)throw new Error(e+" service is not defined!");t[e]=r}}})}},M={App:j,events:{},emit:function(t,e){if(this.events[t]){var n=!0,r=!1,i=void 0;try{for(var o,a=x()(this.events[t]);!(n=(o=a.next()).done);n=!0)(0,o.value)(e)}catch(t){r=!0,i=t}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}}},subscribe:function(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)}},$={App:j,InjectedComponents:L,UiFramework:M},I=(n("6cjq"),function(){function t(e){f()(this,t),this.formatter=e}return h()(t,[{key:"translate",value:function(t,e,n){return this.formatter(t,e)}}]),t}()),N=I,D={FormatTranslator:N},R={Container:k,ContainerFactory:S},F=function(){function t(){f()(this,t),this.hooks={}}return h()(t,[{key:"register",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;this.hooks[t]=this.hooks[t]?this.hooks[t]:[],this.hooks[t].push({callback:e,priority:n})}},{key:"apply",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=this.hooks[t]?this.hooks[t]:[];return i=i.sort(function(t,e){return t.priority-e.priority}),i.reduce(function(t,n){return n.callback.call(e,t,r)},n)}}]),t}(),B=F,U={HookService:B};n.d(e,"Core",function(){return $}),n.d(e,"I18n",function(){return D}),n.d(e,"Container",function(){return R}),n.d(e,"Dom",function(){return y}),n.d(e,"Services",function(){return U}),window.UiFramework&&(window.UiFramework=i()({},window.UiFramework,$.UiFramework))},"NWt+":function(t,e,n){var r=n("+ZMJ"),i=n("msXi"),o=n("Mhyx"),a=n("77Pl"),s=n("QRG4"),c=n("3fs2"),u={},l={},e=t.exports=function(t,e,n,p,f){var d,h,v,m,y=f?function(){return t}:c(t),g=r(n,p,e?2:1),b=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(d=s(t.length);d>b;b++)if((m=e?g(a(h=t[b])[0],h[1]):g(t[b]))===u||m===l)return m}else for(v=y.call(t);!(h=v.next()).done;)if((m=i(v,g,h.value,e))===u||m===l)return m};e.BREAK=u,e.RETURN=l},NpIQ:function(t,e){e.f={}.propertyIsEnumerable},O4g8:function(t,e){t.exports=!0},ON07:function(t,e,n){var r=n("EqjI"),i=n("7KvD").document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},OYls:function(t,e,n){n("crlp")("asyncIterator")},PzxK:function(t,e,n){var r=n("D2L2"),i=n("sB3e"),o=n("ax3d")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},QRG4:function(t,e,n){var r=n("UuGF"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},"QWe/":function(t,e,n){n("crlp")("observable")},R4wc:function(t,e,n){var r=n("kM2E");r(r.S+r.F,"Object",{assign:n("To3L")})},R9M2:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},RPLV:function(t,e,n){var r=n("7KvD").document;t.exports=r&&r.documentElement},"RY/4":function(t,e,n){var r=n("R9M2"),i=n("dSzd")("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),i))?n:o?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},Rrel:function(t,e,n){var r=n("TcQ7"),i=n("n0T6").f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return i(t)}catch(t){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?s(t):i(r(t))}},S82l:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},SfB7:function(t,e,n){t.exports=!n("+E39")&&!n("S82l")(function(){return 7!=Object.defineProperty(n("ON07")("div"),"a",{get:function(){return 7}}).a})},TcQ7:function(t,e,n){var r=n("MU5D"),i=n("52gC");t.exports=function(t){return r(i(t))}},To3L:function(t,e,n){"use strict";var r=n("lktj"),i=n("1kS7"),o=n("NpIQ"),a=n("sB3e"),s=n("MU5D"),c=Object.assign;t.exports=!c||n("S82l")(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r})?function(t,e){for(var n=a(t),c=arguments.length,u=1,l=i.f,p=o.f;c>u;)for(var f,d=s(arguments[u++]),h=l?r(d).concat(l(d)):r(d),v=h.length,m=0;v>m;)p.call(d,f=h[m++])&&(n[f]=d[f]);return n}:c},U5ju:function(t,e,n){n("M6a0"),n("zQR9"),n("+tPU"),n("CXw9"),n("EqBC"),n("jKW+"),t.exports=n("FeBl").Promise},UuGF:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},V3tA:function(t,e,n){n("R4wc"),t.exports=n("FeBl").Object.assign},X8DO:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},Xc4G:function(t,e,n){var r=n("lktj"),i=n("1kS7"),o=n("NpIQ");t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,s=n(t),c=o.f,u=0;s.length>u;)c.call(t,a=s[u++])&&e.push(a);return e}},Yo6p:function(t,e){},Yobk:function(t,e,n){var r=n("77Pl"),i=n("qio6"),o=n("xnc9"),a=n("ax3d")("IE_PROTO"),s=function(){},c=function(){var t,e=n("ON07")("iframe"),r=o.length;for(e.style.display="none",n("RPLV").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c.prototype[o[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[a]=t):n=c(),void 0===e?n:i(n,e)}},Zrlr:function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},Zzip:function(t,e,n){t.exports={default:n("/n6Q"),__esModule:!0}},ax3d:function(t,e,n){var r=n("e8AB")("keys"),i=n("3Eo+");t.exports=function(t){return r[t]||(r[t]=i(t))}},bOdI:function(t,e,n){"use strict";e.__esModule=!0;var r=n("C4MV"),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t,e,n){return e in t?(0,i.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},bRrM:function(t,e,n){"use strict";var r=n("7KvD"),i=n("FeBl"),o=n("evD5"),a=n("+E39"),s=n("dSzd")("species");t.exports=function(t){var e="function"==typeof i[t]?i[t]:r[t];a&&e&&!e[s]&&o.f(e,s,{configurable:!0,get:function(){return this}})}},"c/Tr":function(t,e,n){t.exports={default:n("5zde"),__esModule:!0}},crlp:function(t,e,n){var r=n("7KvD"),i=n("FeBl"),o=n("O4g8"),a=n("Kh4W"),s=n("evD5").f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},dNDb:function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},dSzd:function(t,e,n){var r=n("e8AB")("wks"),i=n("3Eo+"),o=n("7KvD").Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},dY0y:function(t,e,n){var r=n("dSzd")("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},t(o)}catch(t){}return n}},e6n0:function(t,e,n){var r=n("evD5").f,i=n("D2L2"),o=n("dSzd")("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},e8AB:function(t,e,n){var r=n("7KvD"),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},evD5:function(t,e,n){var r=n("77Pl"),i=n("SfB7"),o=n("MmMw"),a=Object.defineProperty;e.f=n("+E39")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},fBQ2:function(t,e,n){"use strict";var r=n("evD5"),i=n("X8DO");t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},fJUb:function(t,e,n){var r=n("77Pl"),i=n("EqjI"),o=n("qARP");t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},fWfb:function(t,e,n){"use strict";var r=n("7KvD"),i=n("D2L2"),o=n("+E39"),a=n("kM2E"),s=n("880/"),c=n("06OY").KEY,u=n("S82l"),l=n("e8AB"),p=n("e6n0"),f=n("3Eo+"),d=n("dSzd"),h=n("Kh4W"),v=n("crlp"),m=n("Xc4G"),y=n("7UMu"),g=n("77Pl"),b=n("EqjI"),w=n("TcQ7"),x=n("MmMw"),_=n("X8DO"),k=n("Yobk"),T=n("Rrel"),O=n("LKZe"),E=n("evD5"),C=n("lktj"),A=O.f,S=E.f,P=T.f,j=r.Symbol,L=r.JSON,M=L&&L.stringify,$=d("_hidden"),I=d("toPrimitive"),N={}.propertyIsEnumerable,D=l("symbol-registry"),R=l("symbols"),F=l("op-symbols"),B=Object.prototype,U="function"==typeof j,H=r.QObject,X=!H||!H.prototype||!H.prototype.findChild,z=o&&u(function(){return 7!=k(S({},"a",{get:function(){return S(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=A(B,e);r&&delete B[e],S(t,e,n),r&&t!==B&&S(B,e,r)}:S,Y=function(t){var e=R[t]=k(j.prototype);return e._k=t,e},q=U&&"symbol"==typeof j.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof j},V=function(t,e,n){return t===B&&V(F,e,n),g(t),e=x(e,!0),g(n),i(R,e)?(n.enumerable?(i(t,$)&&t[$][e]&&(t[$][e]=!1),n=k(n,{enumerable:_(0,!1)})):(i(t,$)||S(t,$,_(1,{})),t[$][e]=!0),z(t,e,n)):S(t,e,n)},W=function(t,e){g(t);for(var n,r=m(e=w(e)),i=0,o=r.length;o>i;)V(t,n=r[i++],e[n]);return t},G=function(t,e){return void 0===e?k(t):W(k(t),e)},K=function(t){var e=N.call(this,t=x(t,!0));return!(this===B&&i(R,t)&&!i(F,t))&&(!(e||!i(this,t)||!i(R,t)||i(this,$)&&this[$][t])||e)},J=function(t,e){if(t=w(t),e=x(e,!0),t!==B||!i(R,e)||i(F,e)){var n=A(t,e);return!n||!i(R,e)||i(t,$)&&t[$][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=P(w(t)),r=[],o=0;n.length>o;)i(R,e=n[o++])||e==$||e==c||r.push(e);return r},Z=function(t){for(var e,n=t===B,r=P(n?F:w(t)),o=[],a=0;r.length>a;)!i(R,e=r[a++])||n&&!i(B,e)||o.push(R[e]);return o};U||(j=function(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(n){this===B&&e.call(F,n),i(this,$)&&i(this[$],t)&&(this[$][t]=!1),z(this,t,_(1,n))};return o&&X&&z(B,t,{configurable:!0,set:e}),Y(t)},s(j.prototype,"toString",function(){return this._k}),O.f=J,E.f=V,n("n0T6").f=T.f=Q,n("NpIQ").f=K,n("1kS7").f=Z,o&&!n("O4g8")&&s(B,"propertyIsEnumerable",K,!0),h.f=function(t){return Y(d(t))}),a(a.G+a.W+a.F*!U,{Symbol:j});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)d(tt[et++]);for(var nt=C(d.store),rt=0;nt.length>rt;)v(nt[rt++]);a(a.S+a.F*!U,"Symbol",{for:function(t){return i(D,t+="")?D[t]:D[t]=j(t)},keyFor:function(t){if(!q(t))throw TypeError(t+" is not a symbol!");for(var e in D)if(D[e]===t)return e},useSetter:function(){X=!0},useSimple:function(){X=!1}}),a(a.S+a.F*!U,"Object",{create:G,defineProperty:V,defineProperties:W,getOwnPropertyDescriptor:J,getOwnPropertyNames:Q,getOwnPropertySymbols:Z}),L&&a(a.S+a.F*(!U||u(function(){var t=j();return"[null]"!=M([t])||"{}"!=M({a:t})||"{}"!=M(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(b(e)||void 0!==t)&&!q(t))return y(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!q(e))return e}),r[1]=e,M.apply(L,r)}}),j.prototype[I]||n("hJx8")(j.prototype,I,j.prototype.valueOf),p(j,"Symbol"),p(Math,"Math",!0),p(r.JSON,"JSON",!0)},fZjL:function(t,e,n){t.exports={default:n("jFbC"),__esModule:!0}},fkB2:function(t,e,n){var r=n("UuGF"),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},fxRn:function(t,e,n){n("+tPU"),n("zQR9"),t.exports=n("g8Ux")},g8Ux:function(t,e,n){var r=n("77Pl"),i=n("3fs2");t.exports=n("FeBl").getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return r(e.call(t))}},h1D1:function(t,e){},h65t:function(t,e,n){var r=n("UuGF"),i=n("52gC");t.exports=function(t){return function(e,n){var o,a,s=String(i(e)),c=r(n),u=s.length;return c<0||c>=u?t?"":void 0:(o=s.charCodeAt(c),o<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?t?s.charAt(c):o:t?s.slice(c,c+2):a-56320+(o-55296<<10)+65536)}}},hJx8:function(t,e,n){var r=n("evD5"),i=n("X8DO");t.exports=n("+E39")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},jFbC:function(t,e,n){n("Cdx3"),t.exports=n("FeBl").Object.keys},"jKW+":function(t,e,n){"use strict";var r=n("kM2E"),i=n("qARP"),o=n("dNDb");r(r.S,"Promise",{try:function(t){var e=i.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},kM2E:function(t,e,n){var r=n("7KvD"),i=n("FeBl"),o=n("+ZMJ"),a=n("hJx8"),s=function(t,e,n){var c,u,l,p=t&s.F,f=t&s.G,d=t&s.S,h=t&s.P,v=t&s.B,m=t&s.W,y=f?i:i[e]||(i[e]={}),g=y.prototype,b=f?r:d?r[e]:(r[e]||{}).prototype;f&&(n=e);for(c in n)(u=!p&&b&&void 0!==b[c])&&c in y||(l=u?b[c]:n[c],y[c]=f&&"function"!=typeof b[c]?n[c]:v&&u?o(l,r):m&&b[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):h&&"function"==typeof l?o(Function.call,l):l,h&&((y.virtual||(y.virtual={}))[c]=l,t&s.R&&g&&!g[c]&&a(g,c,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},knuC:function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},lOnJ:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},lktj:function(t,e,n){var r=n("Ibhu"),i=n("xnc9");t.exports=Object.keys||function(t){return r(t,i)}},mClu:function(t,e,n){var r=n("kM2E");r(r.S+r.F*!n("+E39"),"Object",{defineProperty:n("evD5").f})},msXi:function(t,e,n){var r=n("77Pl");t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},n0T6:function(t,e,n){var r=n("Ibhu"),i=n("xnc9").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},pFYg:function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n("Zzip"),o=r(i),a=n("5QVw"),s=r(a),c="function"==typeof s.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":typeof t};e.default="function"==typeof s.default&&"symbol"===c(o.default)?function(t){return void 0===t?"undefined":c(t)}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":void 0===t?"undefined":c(t)}},qARP:function(t,e,n){"use strict";function r(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=i(e),this.reject=i(n)}var i=n("lOnJ");t.exports.f=function(t){return new r(t)}},qio6:function(t,e,n){var r=n("evD5"),i=n("77Pl"),o=n("lktj");t.exports=n("+E39")?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),s=a.length,c=0;s>c;)r.f(t,n=a[c++],e[n]);return t}},qyJz:function(t,e,n){"use strict";var r=n("+ZMJ"),i=n("kM2E"),o=n("sB3e"),a=n("msXi"),s=n("Mhyx"),c=n("QRG4"),u=n("fBQ2"),l=n("3fs2");i(i.S+i.F*!n("dY0y")(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,i,p,f=o(t),d="function"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,m=void 0!==v,y=0,g=l(f);if(m&&(v=r(v,h>2?arguments[2]:void 0,2)),void 0==g||d==Array&&s(g))for(e=c(f.length),n=new d(e);e>y;y++)u(n,y,m?v(f[y],y):f[y]);else for(p=g.call(f),n=new d;!(i=p.next()).done;y++)u(n,y,m?a(p,v,[i.value,y],!0):i.value);return n.length=y,n}})},sB3e:function(t,e,n){var r=n("52gC");t.exports=function(t){return Object(r(t))}},siA7:function(t,e){},t8x9:function(t,e,n){var r=n("77Pl"),i=n("lOnJ"),o=n("dSzd")("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[o])?e:i(n)}},uqUo:function(t,e,n){var r=n("kM2E"),i=n("FeBl"),o=n("S82l");t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},"vFc/":function(t,e,n){var r=n("TcQ7"),i=n("QRG4"),o=n("fkB2");t.exports=function(t){return function(e,n,a){var s,c=r(e),u=i(c.length),l=o(a,u);if(t&&n!=n){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}}},"vIB/":function(t,e,n){"use strict";var r=n("O4g8"),i=n("kM2E"),o=n("880/"),a=n("hJx8"),s=n("D2L2"),c=n("/bQp"),u=n("94VQ"),l=n("e6n0"),p=n("PzxK"),f=n("dSzd")("iterator"),d=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,n,v,m,y,g){u(n,e,v);var b,w,x,_=function(t){if(!d&&t in E)return E[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},k=e+" Iterator",T="values"==m,O=!1,E=t.prototype,C=E[f]||E["@@iterator"]||m&&E[m],A=!d&&C||_(m),S=m?T?_("entries"):A:void 0,P="Array"==e?E.entries||C:C;if(P&&(x=p(P.call(new t)))!==Object.prototype&&x.next&&(l(x,k,!0),r||s(x,f)||a(x,f,h)),T&&C&&"values"!==C.name&&(O=!0,A=function(){return C.call(this)}),r&&!g||!d&&!O&&E[f]||a(E,f,A),c[e]=A,c[k]=h,m)if(b={values:T?A:_("values"),keys:y?A:_("keys"),entries:S},g)for(w in b)w in E||o(E,w,b[w]);else i(i.P+i.F*(d||O),e,b);return b}},woOf:function(t,e,n){t.exports={default:n("V3tA"),__esModule:!0}},wxAW:function(t,e,n){"use strict";e.__esModule=!0;var r=n("C4MV"),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},xGkn:function(t,e,n){"use strict";var r=n("4mcu"),i=n("EGZi"),o=n("/bQp"),a=n("TcQ7");t.exports=n("vIB/")(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,n):"values"==e?i(0,t[n]):i(0,[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},"xH/j":function(t,e,n){var r=n("hJx8");t.exports=function(t,e,n){for(var i in e)n&&t[i]?t[i]=e[i]:r(t,i,e[i]);return t}},xnc9:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},zQR9:function(t,e,n){"use strict";var r=n("h65t")(!0);n("vIB/")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})}})}()}("undefined"!=typeof self&&self)},function(t,e,n){(function(t,r){var i;(function(o){"use strict";var a,s=0,c=Array.prototype.slice,u=function(t,e){var n=t[e];if(n===o&&a.config.strict)throw new Error("Bottle was unable to resolve a service. `"+e+"` is undefined.");return n},l=function(t){var e;return this.nested[t]||(e=a.pop(),this.nested[t]=e,this.factory(t,function(){return e.container})),this.nested[t]},p=function(t){return t.split(".").reduce(u,this)},f=function(t,e,n,r){var i={configurable:!0,enumerable:!0};return t.length?i.get=function(){var e=0,r=function(i){if(i)throw i;t[e]&&t[e++](n,r)};return r(),n}:(i.value=n,i.writable=!0),Object.defineProperty(r,e,i),r[e]},d=function(t,e){var n,r;return"function"==typeof t&&(e=t,t="__global__"),n=t.split("."),r=n.shift(),n.length?l.call(this,r).middleware(n.join("."),e):(this.middlewares[r]||(this.middlewares[r]=[]),this.middlewares[r].push(e)),this},h=function(t,e){return e(t)},v=function(t,e){return(t[e]||[]).concat(t.__global__||[])},m=function(t,e){var n,r,i,a,s;return this.id,i=this.container,a=this.decorators,s=this.middlewares,n=t+"Provider",r=Object.create(null),r[n]={configurable:!0,enumerable:!0,get:function(){var t=new e;return delete i[n],i[n]=t,t}},r[t]={configurable:!0,enumerable:!0,get:function(){var e,r=i[n];return r&&(e=v(a,t).reduce(h,r.$get(i)),delete i[n],delete i[t]),e===o?e:f(v(s,t),t,e,i)}},Object.defineProperties(i,r),this},y=function(t,e){var n,r;return n=t.split("."),this.providerMap[t]&&1===n.length&&!this.container[t+"Provider"]?console.error(t+" provider already instantiated."):(this.originalProviders[t]=e,this.providerMap[t]=!0,r=n.shift(),n.length?(l.call(this,r).provider(n.join("."),e),this):m.call(this,r,e))},g=function(t,e){return y.call(this,t,function(){this.$get=e})},b=function(t,e,n){var r=arguments.length>3?c.call(arguments,3):[],i=this;return g.call(this,t,function(){var t=e,o=r.map(p,i.container);return n?new(e.bind.apply(e,[null].concat(o))):t.apply(null,o)})},w=function(t,e){return b.apply(this,[t,e,!0].concat(c.call(arguments,2)))},x=function(t,e){return b.apply(this,[t,e,!1].concat(c.call(arguments,2)))},_=function(t,e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})},k=function(t,e){var n=t[e];return n||(n={},_.call(t,e,n)),n},T=function(t,e){var n;return n=t.split("."),t=n.pop(),_.call(n.reduce(k,this.container),t,e),this},O=function(t,e){Object.defineProperty(this,t,{configurable:!1,enumerable:!0,value:e,writable:!1})},E=function(t,e){var n=t.split(".");return t=n.pop(),O.call(n.reduce(k,this.container),t,e),this},C=function(t,e){var n,r;return"function"==typeof t&&(e=t,t="__global__"),n=t.split("."),r=n.shift(),n.length?l.call(this,r).decorator(n.join("."),e):(this.decorators[r]||(this.decorators[r]=[]),this.decorators[r].push(e)),this},A=function(t){return this.deferred.push(t),this},S=function(t){return(t||[]).map(p,this.container)},P=function(t,e){return g.call(this,t,function(t){return{instance:e.bind(e,t)}})},j=function(t){return!/^\$(?:decorator|register|list)$|Provider$/.test(t)},L=function(t){return Object.keys(t||this.container||{}).filter(j)},M={},$=function(t){var e;return"string"==typeof t?(e=M[t],e||(M[t]=e=new a,e.constant("BOTTLE_NAME",t)),e):new a},I=function(t){"string"==typeof t?delete M[t]:M={}},N=function(t){var e=t.$value===o?t:t.$value;return this[t.$type||"service"].apply(this,[t.$name,e].concat(t.$inject||[]))},D=function(t){delete this.providerMap[t],delete this.container[t],delete this.container[t+"Provider"]},R=function(t){var e=this.originalProviders,n=Array.isArray(t);Object.keys(this.originalProviders).forEach(function(r){if(!n||-1!==t.indexOf(r)){var i=r.split(".");i.length>1&&i.forEach(D,l.call(this,i[0])),D.call(this,r),this.provider(r,e[r])}},this)},F=function(t){return this.deferred.forEach(function(e){e(t)}),this};a=function t(e){if(!(this instanceof t))return t.pop(e);this.id=s++,this.decorators={},this.middlewares={},this.nested={},this.providerMap={},this.originalProviders={},this.deferred=[],this.container={$decorator:C.bind(this),$register:N.bind(this),$list:L.bind(this)}},a.prototype={constant:E,decorator:C,defer:A,digest:S,factory:g,instanceFactory:P,list:L,middleware:d,provider:y,resetProviders:R,register:N,resolve:F,service:w,serviceFactory:x,value:T},a.pop=$,a.clear=I,a.list=L,a.config={strict:!1};var B={function:!0,object:!0};!function(s){var c=B[typeof e]&&e&&!e.nodeType&&e,u=B[typeof t]&&t&&!t.nodeType&&t,l=u&&u.exports===c&&c,p=B[typeof r]&&r;!p||p.global!==p&&p.window!==p||(s=p),"object"==typeof n(15)&&n(15)?(s.Bottle=a,(i=function(){return a}.call(e,n,e,t))!==o&&(t.exports=i)):c&&u?l?(u.exports=a).Bottle=a:c.Bottle=a:s.Bottle=a}(B[typeof window]&&window||this)}).call(this)}).call(e,n(45)(t),n(3))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){!function(e,n){t.exports=function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=6)}([function(t,e,n){"use strict";function r(){d=!1}function i(t){if(!t)return void(p!==v&&(p=v,r()));if(t!==p){if(t.length!==v.length)throw new Error("Custom alphabet for shortid must be "+v.length+" unique characters. You submitted "+t.length+" characters: "+t);var e=t.split("").filter(function(t,e,n){return e!==n.lastIndexOf(t)});if(e.length)throw new Error("Custom alphabet for shortid must be "+v.length+" unique characters. These characters were not unique: "+e.join(", "));p=t,r()}}function o(t){return i(t),p}function a(t){h.seed(t),f!==t&&(r(),f=t)}function s(){p||i(v);for(var t,e=p.split(""),n=[],r=h.nextValue();e.length>0;)r=h.nextValue(),t=Math.floor(r*e.length),n.push(e.splice(t,1)[0]);return n.join("")}function c(){return d||(d=s())}function u(t){return c()[t]}function l(){return p||v}var p,f,d,h=n(19),v="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";t.exports={get:l,characters:o,seed:a,lookup:u,shuffled:c}},function(t,e,n){"use strict";var r=n(5),i=n.n(r);e.a={animateIn:function(t){i()({targets:t,translateY:"-35px",opacity:1,duration:300,easing:"easeOutCubic"})},animateOut:function(t,e){i()({targets:t,opacity:0,marginTop:"-40px",duration:300,easing:"easeOutExpo",complete:e})},animateOutBottom:function(t,e){i()({targets:t,opacity:0,marginBottom:"-40px",duration:300,easing:"easeOutExpo",complete:e})},animateReset:function(t){i()({targets:t,left:0,opacity:1,duration:300,easing:"easeOutExpo"})},animatePanning:function(t,e,n){i()({targets:t,duration:10,easing:"easeOutQuad",left:e,opacity:n})},animatePanEnd:function(t,e){i()({targets:t,opacity:0,duration:300,easing:"easeOutExpo",complete:e})},clearAnimation:function(t){var e=i.a.timeline();t.forEach(function(t){e.add({targets:t.el,opacity:0,right:"-40px",duration:300,offset:"-=150",easing:"easeOutExpo",complete:function(){t.remove()}})})}}},function(t,e,n){"use strict";t.exports=n(16)},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(8),i=n(1),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=n(2);n(11).polyfill();var s=function t(e){var n=this;return this.id=a.generate(),this.options=e,this.cached_options={},this.global={},this.groups=[],this.toasts=[],u(this),this.group=function(e){e||(e={}),e.globalToasts||(e.globalToasts={}),Object.assign(e.globalToasts,n.global);var r=new t(e);return n.groups.push(r),r},this.register=function(t,e,r){return r=r||{},l(n,t,e,r)},this.show=function(t,e){return c(n,t,e)},this.success=function(t,e){return e=e||{},e.type="success",c(n,t,e)},this.info=function(t,e){return e=e||{},e.type="info",c(n,t,e)},this.error=function(t,e){return e=e||{},e.type="error",c(n,t,e)},this.remove=function(t){n.toasts=n.toasts.filter(function(e){return e.el.hash!==t.hash}),t.parentNode&&t.parentNode.removeChild(t)},this.clear=function(t){return i.a.clearAnimation(n.toasts,function(){t&&t()}),n.toasts=[],!0},this},c=function(t,e,i){i=i||{};var a=null;if("object"!==(void 0===i?"undefined":o(i)))return console.error("Options should be a type of object. given : "+i),null;t.options.singleton&&t.toasts.length>0&&(t.cached_options=i,t.toasts[t.toasts.length-1].goAway(0));var s=Object.assign({},t.options);return Object.assign(s,i),a=n.i(r.a)(t,e,s),t.toasts.push(a),a},u=function(t){var e=t.options.globalToasts,n=function(e,n){return"string"==typeof n&&t[n]?t[n].apply(t,[e,{}]):c(t,e,n)};e&&(t.global={},Object.keys(e).forEach(function(r){t.global[r]=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e[r].apply(null,[t,n])}}))},l=function(t,e,n,r){t.options.globalToasts||(t.options.globalToasts={}),t.options.globalToasts[e]=function(t,e){var i=null;return"string"==typeof n&&(i=n),"function"==typeof n&&(i=n(t)),e(i,r)},u(t)}},function(t,e,n){n(22);var r=n(21)(null,null,null,null);t.exports=r.exports},function(t,e,n){(function(n){var r,i,o,a={scope:{}};a.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){if(n.get||n.set)throw new TypeError("ES3 does not support getters and setters.");t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},a.getGlobal=function(t){return"undefined"!=typeof window&&window===t?t:void 0!==n&&null!=n?n:t},a.global=a.getGlobal(this),a.SYMBOL_PREFIX="jscomp_symbol_",a.initSymbol=function(){a.initSymbol=function(){},a.global.Symbol||(a.global.Symbol=a.Symbol)},a.symbolCounter_=0,a.Symbol=function(t){return a.SYMBOL_PREFIX+(t||"")+a.symbolCounter_++},a.initSymbolIterator=function(){a.initSymbol();var t=a.global.Symbol.iterator;t||(t=a.global.Symbol.iterator=a.global.Symbol("iterator")),"function"!=typeof Array.prototype[t]&&a.defineProperty(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return a.arrayIterator(this)}}),a.initSymbolIterator=function(){}},a.arrayIterator=function(t){var e=0;return a.iteratorPrototype(function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}})},a.iteratorPrototype=function(t){return a.initSymbolIterator(),t={next:t},t[a.global.Symbol.iterator]=function(){return this},t},a.array=a.array||{},a.iteratorFromArray=function(t,e){a.initSymbolIterator(),t instanceof String&&(t+="");var n=0,r={next:function(){if(n<t.length){var i=n++;return{value:e(i,t[i]),done:!1}}return r.next=function(){return{done:!0,value:void 0}},r.next()}};return r[Symbol.iterator]=function(){return r},r},a.polyfill=function(t,e,n,r){if(e){for(n=a.global,t=t.split("."),r=0;r<t.length-1;r++){var i=t[r];i in n||(n[i]={}),n=n[i]}t=t[t.length-1],r=n[t],(e=e(r))!=r&&null!=e&&a.defineProperty(n,t,{configurable:!0,writable:!0,value:e})}},a.polyfill("Array.prototype.keys",function(t){return t||function(){return a.iteratorFromArray(this,function(t){return t})}},"es6-impl","es3");var s=this;!function(n,a){i=[],r=a,void 0!==(o="function"==typeof r?r.apply(e,i):r)&&(t.exports=o)}(0,function(){function t(t){if(!R.col(t))try{return document.querySelectorAll(t)}catch(t){}}function e(t,e){for(var n=t.length,r=2<=arguments.length?arguments[1]:void 0,i=[],o=0;o<n;o++)if(o in t){var a=t[o];e.call(r,a,o,t)&&i.push(a)}return i}function n(t){return t.reduce(function(t,e){return t.concat(R.arr(e)?n(e):e)},[])}function r(e){return R.arr(e)?e:(R.str(e)&&(e=t(e)||e),e instanceof NodeList||e instanceof HTMLCollection?[].slice.call(e):[e])}function i(t,e){return t.some(function(t){return t===e})}function o(t){var e,n={};for(e in t)n[e]=t[e];return n}function a(t,e){var n,r=o(t);for(n in t)r[n]=e.hasOwnProperty(n)?e[n]:t[n];return r}function c(t,e){var n,r=o(t);for(n in e)r[n]=R.und(t[n])?e[n]:t[n];return r}function u(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,n,r){return e+e+n+n+r+r});var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);t=parseInt(e[1],16);var n=parseInt(e[2],16),e=parseInt(e[3],16);return"rgba("+t+","+n+","+e+",1)"}function l(t){function e(t,e,n){return 0>n&&(n+=1),1<n&&--n,n<1/6?t+6*(e-t)*n:.5>n?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var n=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t);t=parseInt(n[1])/360;var r=parseInt(n[2])/100,i=parseInt(n[3])/100,n=n[4]||1;if(0==r)i=r=t=i;else{var o=.5>i?i*(1+r):i+r-i*r,a=2*i-o,i=e(a,o,t+1/3),r=e(a,o,t);t=e(a,o,t-1/3)}return"rgba("+255*i+","+255*r+","+255*t+","+n+")"}function p(t){if(t=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t))return t[2]}function f(t){return-1<t.indexOf("translate")||"perspective"===t?"px":-1<t.indexOf("rotate")||-1<t.indexOf("skew")?"deg":void 0}function d(t,e){return R.fnc(t)?t(e.target,e.id,e.total):t}function h(t,e){if(e in t.style)return getComputedStyle(t).getPropertyValue(e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())||"0"}function v(t,e){return R.dom(t)&&i(D,e)?"transform":R.dom(t)&&(t.getAttribute(e)||R.svg(t)&&t[e])?"attribute":R.dom(t)&&"transform"!==e&&h(t,e)?"css":null!=t[e]?"object":void 0}function m(t,n){var r=f(n),r=-1<n.indexOf("scale")?1:0+r;if(!(t=t.style.transform))return r;for(var i=[],o=[],a=[],s=/(\w+)\((.+?)\)/g;i=s.exec(t);)o.push(i[1]),a.push(i[2]);return t=e(a,function(t,e){return o[e]===n}),t.length?t[0]:r}function y(t,e){switch(v(t,e)){case"transform":return m(t,e);case"css":return h(t,e);case"attribute":return t.getAttribute(e)}return t[e]||0}function g(t,e){var n=/^(\*=|\+=|-=)/.exec(t);if(!n)return t;var r=p(t)||0;switch(e=parseFloat(e),t=parseFloat(t.replace(n[0],"")),n[0][0]){case"+":return e+t+r;case"-":return e-t+r;case"*":return e*t+r}}function b(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function w(t){t=t.points;for(var e,n=0,r=0;r<t.numberOfItems;r++){var i=t.getItem(r);0<r&&(n+=b(e,i)),e=i}return n}function x(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return 2*Math.PI*t.getAttribute("r");case"rect":return 2*t.getAttribute("width")+2*t.getAttribute("height");case"line":return b({x:t.getAttribute("x1"),y:t.getAttribute("y1")},{x:t.getAttribute("x2"),y:t.getAttribute("y2")});case"polyline":return w(t);case"polygon":var e=t.points;return w(t)+b(e.getItem(e.numberOfItems-1),e.getItem(0))}}function _(t,e){function n(n){return n=void 0===n?0:n,t.el.getPointAtLength(1<=e+n?e+n:0)}var r=n(),i=n(-1),o=n(1);switch(t.property){case"x":return r.x;case"y":return r.y;case"angle":return 180*Math.atan2(o.y-i.y,o.x-i.x)/Math.PI}}function k(t,e){var n,r=/-?\d*\.?\d+/g;if(n=R.pth(t)?t.totalLength:t,R.col(n))if(R.rgb(n)){var i=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(n);n=i?"rgba("+i[1]+",1)":n}else n=R.hex(n)?u(n):R.hsl(n)?l(n):void 0;else i=(i=p(n))?n.substr(0,n.length-i.length):n,n=e&&!/\s/g.test(n)?i+e:i;return n+="",{original:n,numbers:n.match(r)?n.match(r).map(Number):[0],strings:R.str(t)||e?n.split(r):[]}}function T(t){return t=t?n(R.arr(t)?t.map(r):r(t)):[],e(t,function(t,e,n){return n.indexOf(t)===e})}function O(t){var e=T(t);return e.map(function(t,n){return{target:t,id:n,total:e.length}})}function E(t,e){var n=o(e);if(R.arr(t)){var i=t.length;2!==i||R.obj(t[0])?R.fnc(e.duration)||(n.duration=e.duration/i):t={value:t}}return r(t).map(function(t,n){return n=n?0:e.delay,t=R.obj(t)&&!R.pth(t)?t:{value:t},R.und(t.delay)&&(t.delay=n),t}).map(function(t){return c(t,n)})}function C(t,e){var n,r={};for(n in t){var i=d(t[n],e);R.arr(i)&&(i=i.map(function(t){return d(t,e)}),1===i.length&&(i=i[0])),r[n]=i}return r.duration=parseFloat(r.duration),r.delay=parseFloat(r.delay),r}function A(t){return R.arr(t)?F.apply(this,t):B[t]}function S(t,e){var n;return t.tweens.map(function(r){r=C(r,e);var i=r.value,o=y(e.target,t.name),a=n?n.to.original:o,a=R.arr(i)?i[0]:a,s=g(R.arr(i)?i[1]:i,a),o=p(s)||p(a)||p(o);return r.from=k(a,o),r.to=k(s,o),r.start=n?n.end:t.offset,r.end=r.start+r.delay+r.duration,r.easing=A(r.easing),r.elasticity=(1e3-Math.min(Math.max(r.elasticity,1),999))/1e3,r.isPath=R.pth(i),r.isColor=R.col(r.from.original),r.isColor&&(r.round=1),n=r})}function P(t,r){return e(n(t.map(function(t){return r.map(function(e){var n=v(t.target,e.name);if(n){var r=S(e,t);e={type:n,property:e.name,animatable:t,tweens:r,duration:r[r.length-1].end,delay:r[0].delay}}else e=void 0;return e})})),function(t){return!R.und(t)})}function j(t,e,n,r){var i="delay"===t;return e.length?(i?Math.min:Math.max).apply(Math,e.map(function(e){return e[t]})):i?r.delay:n.offset+r.delay+r.duration}function L(t){var e,n=a(I,t),r=a(N,t),i=O(t.targets),o=[],s=c(n,r);for(e in t)s.hasOwnProperty(e)||"targets"===e||o.push({name:e,offset:s.offset,tweens:E(t[e],r)});return t=P(i,o),c(n,{children:[],animatables:i,animations:t,duration:j("duration",t,n,r),delay:j("delay",t,n,r)})}function M(t){function n(){return window.Promise&&new Promise(function(t){return p=t})}function r(t){return d.reversed?d.duration-t:t}function i(t){for(var n=0,r={},i=d.animations,o=i.length;n<o;){var a=i[n],s=a.animatable,c=a.tweens,u=c.length-1,l=c[u];u&&(l=e(c,function(e){return t<e.end})[0]||l);for(var c=Math.min(Math.max(t-l.start-l.delay,0),l.duration)/l.duration,p=isNaN(c)?1:l.easing(c,l.elasticity),c=l.to.strings,f=l.round,u=[],v=void 0,v=l.to.numbers.length,m=0;m<v;m++){var y=void 0,y=l.to.numbers[m],g=l.from.numbers[m],y=l.isPath?_(l.value,p*y):g+p*(y-g);f&&(l.isColor&&2<m||(y=Math.round(y*f)/f)),u.push(y)}if(l=c.length)for(v=c[0],p=0;p<l;p++)f=c[p+1],m=u[p],isNaN(m)||(v=f?v+(m+f):v+(m+" "));else v=u[0];U[a.type](s.target,a.property,v,r,s.id),a.currentValue=v,n++}if(n=Object.keys(r).length)for(i=0;i<n;i++)$||($=h(document.body,"transform")?"transform":"-webkit-transform"),d.animatables[i].target.style[$]=r[i].join(" ");d.currentTime=t,d.progress=t/d.duration*100}function o(t){d[t]&&d[t](d)}function a(){d.remaining&&!0!==d.remaining&&d.remaining--}function s(t){var e=d.duration,s=d.offset,h=s+d.delay,v=d.currentTime,m=d.reversed,y=r(t);if(d.children.length){var g=d.children,b=g.length;if(y>=d.currentTime)for(var w=0;w<b;w++)g[w].seek(y);else for(;b--;)g[b].seek(y)}(y>=h||!e)&&(d.began||(d.began=!0,o("begin")),o("run")),y>s&&y<e?i(y):(y<=s&&0!==v&&(i(0),m&&a()),(y>=e&&v!==e||!e)&&(i(e),m||a())),o("update"),t>=e&&(d.remaining?(u=c,"alternate"===d.direction&&(d.reversed=!d.reversed)):(d.pause(),d.completed||(d.completed=!0,o("complete"),"Promise"in window&&(p(),f=n()))),l=0)}t=void 0===t?{}:t;var c,u,l=0,p=null,f=n(),d=L(t);return d.reset=function(){var t=d.direction,e=d.loop;for(d.currentTime=0,d.progress=0,d.paused=!0,d.began=!1,d.completed=!1,d.reversed="reverse"===t,d.remaining="alternate"===t&&1===e?2:e,i(0),t=d.children.length;t--;)d.children[t].reset()},d.tick=function(t){c=t,u||(u=c),s((l+c-u)*M.speed)},d.seek=function(t){s(r(t))},d.pause=function(){var t=H.indexOf(d);-1<t&&H.splice(t,1),d.paused=!0},d.play=function(){d.paused&&(d.paused=!1,u=0,l=r(d.currentTime),H.push(d),X||z())},d.reverse=function(){d.reversed=!d.reversed,u=0,l=r(d.currentTime)},d.restart=function(){d.pause(),d.reset(),d.play()},d.finished=f,d.reset(),d.autoplay&&d.play(),d}var $,I={update:void 0,begin:void 0,run:void 0,complete:void 0,loop:1,direction:"normal",autoplay:!0,offset:0},N={duration:1e3,delay:0,easing:"easeOutElastic",elasticity:500,round:0},D="translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY perspective".split(" "),R={arr:function(t){return Array.isArray(t)},obj:function(t){return-1<Object.prototype.toString.call(t).indexOf("Object")},pth:function(t){return R.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},dom:function(t){return t.nodeType||R.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return R.hex(t)||R.rgb(t)||R.hsl(t)}},F=function(){function t(t,e,n){return(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t}return function(e,n,r,i){if(0<=e&&1>=e&&0<=r&&1>=r){var o=new Float32Array(11);if(e!==n||r!==i)for(var a=0;11>a;++a)o[a]=t(.1*a,e,r);return function(a){if(e===n&&r===i)return a;if(0===a)return 0;if(1===a)return 1;for(var s=0,c=1;10!==c&&o[c]<=a;++c)s+=.1;--c;var c=s+(a-o[c])/(o[c+1]-o[c])*.1,u=3*(1-3*r+3*e)*c*c+2*(3*r-6*e)*c+3*e;if(.001<=u){for(s=0;4>s&&0!=(u=3*(1-3*r+3*e)*c*c+2*(3*r-6*e)*c+3*e);++s)var l=t(c,e,r)-a,c=c-l/u;a=c}else if(0===u)a=c;else{var c=s,s=s+.1,p=0;do{l=c+(s-c)/2,u=t(l,e,r)-a,0<u?s=l:c=l}while(1e-7<Math.abs(u)&&10>++p);a=l}return t(a,n,i)}}}}(),B=function(){function t(t,e){return 0===t||1===t?t:-Math.pow(2,10*(t-1))*Math.sin(2*(t-1-e/(2*Math.PI)*Math.asin(1))*Math.PI/e)}var e,n="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),r={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],t],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(e,n){return 1-t(1-e,n)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(e,n){return.5>e?t(2*e,n)/2:1-t(-2*e+2,n)/2}]},i={linear:F(.25,.25,.75,.75)},o={};for(e in r)o.type=e,r[o.type].forEach(function(t){return function(e,r){i["ease"+t.type+n[r]]=R.fnc(e)?e:F.apply(s,e)}}(o)),o={type:o.type};return i}(),U={css:function(t,e,n){return t.style[e]=n},attribute:function(t,e,n){return t.setAttribute(e,n)},object:function(t,e,n){return t[e]=n},transform:function(t,e,n,r,i){r[i]||(r[i]=[]),r[i].push(e+"("+n+")")}},H=[],X=0,z=function(){function t(){X=requestAnimationFrame(e)}function e(e){var n=H.length;if(n){for(var r=0;r<n;)H[r]&&H[r].tick(e),r++;t()}else cancelAnimationFrame(X),X=0}return t}();return M.version="2.2.0",M.speed=1,M.running=H,M.remove=function(t){t=T(t);for(var e=H.length;e--;)for(var n=H[e],r=n.animations,o=r.length;o--;)i(t,r[o].animatable.target)&&(r.splice(o,1),r.length||n.pause())},M.getValue=y,M.path=function(e,n){var r=R.str(e)?t(e)[0]:e,i=n||100;return function(t){return{el:r,property:t,totalLength:x(r)*(i/100)}}},M.setDashoffset=function(t){var e=x(t);return t.setAttribute("stroke-dasharray",e),e},M.bezier=F,M.easings=B,M.timeline=function(t){var e=M(t);return e.pause(),e.duration=0,e.add=function(n){return e.children.forEach(function(t){t.began=!0,t.completed=!0}),r(n).forEach(function(n){var r=c(n,a(N,t||{}));r.targets=r.targets||t.targets,n=e.duration;var i=r.offset;r.autoplay=!1,r.direction=e.direction,r.offset=R.und(i)?n:g(i,n),e.began=!0,e.completed=!0,e.seek(r.offset),r=M(r),r.began=!0,r.completed=!0,r.duration>n&&(e.duration=r.duration),e.children.push(r)}),e.seek(0),e.reset(),e.autoplay&&e.restart(),e},e},M.random=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},M})}).call(e,n(25))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=n(4),o=n.n(i),a={install:function(t,e){e||(e={});var n=new r.a(e);t.component("toasted",o.a),t.toasted=t.prototype.$toasted=n}};"undefined"!=typeof window&&window.Vue&&(window.Toasted=a),e.default=a},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(1),i=this,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(t,e,n){return setTimeout(function(){if(n.cached_options.position&&n.cached_options.position.includes("bottom"))return void r.a.animateOutBottom(t,function(){n.remove(t)});r.a.animateOut(t,function(){n.remove(t)})},e),!0},s=function(t,e){return("object"===("undefined"==typeof HTMLElement?"undefined":o(HTMLElement))?e instanceof HTMLElement:e&&"object"===(void 0===e?"undefined":o(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)?t.appendChild(e):t.innerHTML=e,i},c=function(t,e){var n=!1;return{el:t,text:function(e){return s(t,e),this},goAway:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:800;return n=!0,a(t,r,e)},remove:function(){e.remove(t)},disposed:function(){return n}}}},function(t,e,n){"use strict";var r=n(12),i=n.n(r),o=n(1),a=n(7),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c=n(2);String.prototype.includes||Object.defineProperty(String.prototype,"includes",{value:function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}});var u={},l=null,p=function(t){return t.className=t.className||null,t.onComplete=t.onComplete||null,t.position=t.position||"top-right",t.duration=t.duration||null,t.theme=t.theme||"toasted-primary",t.type=t.type||"default",t.containerClass=t.containerClass||null,t.fullWidth=t.fullWidth||!1,t.icon=t.icon||null,t.action=t.action||null,t.fitToScreen=t.fitToScreen||null,t.closeOnSwipe=void 0===t.closeOnSwipe||t.closeOnSwipe,t.iconPack=t.iconPack||"material",t.className&&"string"==typeof t.className&&(t.className=t.className.split(" ")),t.className||(t.className=[]),t.theme&&t.className.push(t.theme.trim()),t.type&&t.className.push(t.type),t.containerClass&&"string"==typeof t.containerClass&&(t.containerClass=t.containerClass.split(" ")),t.containerClass||(t.containerClass=[]),t.position&&t.containerClass.push(t.position.trim()),t.fullWidth&&t.containerClass.push("full-width"),t.fitToScreen&&t.containerClass.push("fit-to-screen"),u=t,t},f=function(t,e){var r=document.createElement("div");if(r.classList.add("toasted"),r.hash=c.generate(),e.className&&e.className.forEach(function(t){r.classList.add(t)}),("object"===("undefined"==typeof HTMLElement?"undefined":s(HTMLElement))?t instanceof HTMLElement:t&&"object"===(void 0===t?"undefined":s(t))&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName)?r.appendChild(t):r.innerHTML=t,d(e,r),e.closeOnSwipe){var u=new i.a(r,{prevent_default:!1});u.on("pan",function(t){var e=t.deltaX;r.classList.contains("panning")||r.classList.add("panning");var n=1-Math.abs(e/80);n<0&&(n=0),o.a.animatePanning(r,e,n)}),u.on("panend",function(t){var n=t.deltaX;Math.abs(n)>80?o.a.animatePanEnd(r,function(){"function"==typeof e.onComplete&&e.onComplete(),r.parentNode&&l.remove(r)}):(r.classList.remove("panning"),o.a.animateReset(r))})}if(Array.isArray(e.action))e.action.forEach(function(t){var e=v(t,n.i(a.a)(r,l));e&&r.appendChild(e)});else if("object"===s(e.action)){var p=v(e.action,n.i(a.a)(r,l));p&&r.appendChild(p)}return r},d=function(t,e){if(t.icon){var n=document.createElement("i");switch(t.iconPack){case"fontawesome":n.classList.add("fa");var r=t.icon.name?t.icon.name:t.icon;r.includes("fa-")?n.classList.add(r.trim()):n.classList.add("fa-"+r.trim());break;case"mdi":n.classList.add("mdi");var i=t.icon.name?t.icon.name:t.icon;i.includes("mdi-")?n.classList.add(i.trim()):n.classList.add("mdi-"+i.trim());break;case"custom-class":var o=t.icon.name?t.icon.name:t.icon;"string"==typeof o?o.split(" ").forEach(function(t){n.classList.add(t)}):Array.isArray(o)&&o.forEach(function(t){n.classList.add(t.trim())});break;case"callback":var a=t.icon&&t.icon instanceof Function?t.icon:null;a&&(n=a(n));break;default:n.classList.add("material-icons"),n.textContent=t.icon.name?t.icon.name:t.icon}t.icon.after&&n.classList.add("after"),h(t,n,e)}},h=function(t,e,n){t.icon&&(t.icon.after&&t.icon.name?n.appendChild(e):(t.icon.name,n.insertBefore(e,n.firstChild)))},v=function(t,e){if(!t)return null;var n=document.createElement("a");if(n.classList.add("action"),n.classList.add("ripple"),t.text&&(n.text=t.text),t.href&&(n.href=t.href),t.target&&(n.target=t.target),t.icon){n.classList.add("icon");var r=document.createElement("i");switch(u.iconPack){case"fontawesome":r.classList.add("fa"),t.icon.includes("fa-")?r.classList.add(t.icon.trim()):r.classList.add("fa-"+t.icon.trim());break;case"mdi":r.classList.add("mdi"),t.icon.includes("mdi-")?r.classList.add(t.icon.trim()):r.classList.add("mdi-"+t.icon.trim());break;case"custom-class":"string"==typeof t.icon?t.icon.split(" ").forEach(function(t){n.classList.add(t)}):Array.isArray(t.icon)&&t.icon.forEach(function(t){n.classList.add(t.trim())});break;default:r.classList.add("material-icons"),r.textContent=t.icon}n.appendChild(r)}return t.class&&("string"==typeof t.class?t.class.split(" ").forEach(function(t){n.classList.add(t)}):Array.isArray(t.class)&&t.class.forEach(function(t){n.classList.add(t.trim())})),t.push&&n.addEventListener("click",function(n){n.preventDefault(),u.router&&(u.router.push(t.push),t.push.dontClose||e.goAway(0))}),t.onClick&&"function"==typeof t.onClick&&n.addEventListener("click",function(n){t.onClick&&(n.preventDefault(),t.onClick(n,e))}),n};e.a=function(t,e,r){l=t,r=p(r);var i=document.getElementById(l.id);null===i&&(i=document.createElement("div"),i.id=l.id,document.body.appendChild(i)),r.containerClass.unshift("toasted-container"),i.className!==r.containerClass.join(" ")&&(i.className="",r.containerClass.forEach(function(t){i.classList.add(t)}));var s=f(e,r);e&&i.appendChild(s),s.style.opacity=0,o.a.animateIn(s);var c=r.duration,u=void 0;return null!==c&&(u=setInterval(function(){null===s.parentNode&&window.clearInterval(u),s.classList.contains("panning")||(c-=20),c<=0&&(o.a.animateOut(s,function(){"function"==typeof r.onComplete&&r.onComplete(),s.parentNode&&l.remove(s)}),window.clearInterval(u))},20)),n.i(a.a)(s,l)}},function(t,e,n){e=t.exports=n(10)(),e.push([t.i,".toasted{padding:0 20px}.toasted.rounded{border-radius:24px}.toasted .primary,.toasted.toasted-primary{border-radius:2px;min-height:38px;line-height:1.1em;background-color:#353535;padding:0 20px;font-size:15px;font-weight:300;color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}.toasted .primary.success,.toasted.toasted-primary.success{background:#4caf50}.toasted .primary.error,.toasted.toasted-primary.error{background:#f44336}.toasted .primary.info,.toasted.toasted-primary.info{background:#3f51b5}.toasted .primary .action,.toasted.toasted-primary .action{color:#a1c2fa}.toasted.bubble{border-radius:30px;min-height:38px;line-height:1.1em;background-color:#ff7043;padding:0 20px;font-size:15px;font-weight:300;color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}.toasted.bubble.success{background:#4caf50}.toasted.bubble.error{background:#f44336}.toasted.bubble.info{background:#3f51b5}.toasted.bubble .action{color:#8e2b0c}.toasted.outline{border-radius:30px;min-height:38px;line-height:1.1em;background-color:#fff;border:1px solid #676767;padding:0 20px;font-size:15px;color:#676767;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);font-weight:700}.toasted.outline.success{color:#4caf50;border-color:#4caf50}.toasted.outline.error{color:#f44336;border-color:#f44336}.toasted.outline.info{color:#3f51b5;border-color:#3f51b5}.toasted.outline .action{color:#607d8b}.toasted-container{position:fixed;z-index:10000}.toasted-container,.toasted-container.full-width{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.toasted-container.full-width{max-width:86%;width:100%}.toasted-container.full-width.fit-to-screen{min-width:100%}.toasted-container.full-width.fit-to-screen .toasted:first-child{margin-top:0}.toasted-container.full-width.fit-to-screen.top-right{top:0;right:0}.toasted-container.full-width.fit-to-screen.top-left{top:0;left:0}.toasted-container.full-width.fit-to-screen.top-center{top:0;left:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.full-width.fit-to-screen.bottom-right{right:0;bottom:0}.toasted-container.full-width.fit-to-screen.bottom-left{left:0;bottom:0}.toasted-container.full-width.fit-to-screen.bottom-center{left:0;bottom:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.top-right{top:10%;right:7%}.toasted-container.top-left{top:10%;left:7%}.toasted-container.top-center{top:10%;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.toasted-container.bottom-right{right:5%;bottom:7%}.toasted-container.bottom-left{left:5%;bottom:7%}.toasted-container.bottom-center{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);bottom:7%}.toasted-container.bottom-left .toasted,.toasted-container.top-left .toasted{float:left}.toasted-container.bottom-right .toasted,.toasted-container.top-right .toasted{float:right}.toasted-container .toasted{top:35px;width:auto;clear:both;margin-top:10px;position:relative;max-width:100%;height:auto;word-break:normal;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;box-sizing:inherit}.toasted-container .toasted .fa,.toasted-container .toasted .fab,.toasted-container .toasted .far,.toasted-container .toasted .fas,.toasted-container .toasted .material-icons,.toasted-container .toasted .mdi{margin-right:.5rem;margin-left:-.4rem}.toasted-container .toasted .fa.after,.toasted-container .toasted .fab.after,.toasted-container .toasted .far.after,.toasted-container .toasted .fas.after,.toasted-container .toasted .material-icons.after,.toasted-container .toasted .mdi.after{margin-left:.5rem;margin-right:-.4rem}.toasted-container .toasted .action{text-decoration:none;font-size:.8rem;padding:8px;margin:5px -7px 5px 7px;border-radius:3px;text-transform:uppercase;letter-spacing:.03em;font-weight:600;cursor:pointer}.toasted-container .toasted .action.icon{padding:4px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.toasted-container .toasted .action.icon .fa,.toasted-container .toasted .action.icon .material-icons,.toasted-container .toasted .action.icon .mdi{margin-right:0;margin-left:4px}.toasted-container .toasted .action.icon:hover{text-decoration:none}.toasted-container .toasted .action:hover{text-decoration:underline}@media only screen and (max-width:600px){#toasted-container{min-width:100%}#toasted-container .toasted:first-child{margin-top:0}#toasted-container.top-right{top:0;right:0}#toasted-container.top-left{top:0;left:0}#toasted-container.top-center{top:0;left:0;-webkit-transform:translateX(0);transform:translateX(0)}#toasted-container.bottom-right{right:0;bottom:0}#toasted-container.bottom-left{left:0;bottom:0}#toasted-container.bottom-center{left:0;bottom:0;-webkit-transform:translateX(0);transform:translateX(0)}#toasted-container.bottom-center,#toasted-container.top-center{-ms-flex-align:stretch!important;align-items:stretch!important}#toasted-container.bottom-left .toasted,#toasted-container.bottom-right .toasted,#toasted-container.top-left .toasted,#toasted-container.top-right .toasted{float:none}#toasted-container .toasted{border-radius:0}}",""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(t,e,n){"use strict";function r(t,e){if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var n=Object(t),r=1;r<arguments.length;r++){var i=arguments[r];if(void 0!==i&&null!==i)for(var o=Object.keys(Object(i)),a=0,s=o.length;a<s;a++){var c=o[a],u=Object.getOwnPropertyDescriptor(i,c);void 0!==u&&u.enumerable&&(n[c]=i[c])}}return n}function i(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:r})}t.exports={assign:r,polyfill:i}},function(t,e,n){var r;!function(i,o,a,s){"use strict";function c(t,e,n){return setTimeout(d(t,n),e)}function u(t,e,n){return!!Array.isArray(t)&&(l(t,n[e],n),!0)}function l(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==s)for(r=0;r<t.length;)e.call(n,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t)}function p(t,e,n){var r="DEPRECATED METHOD: "+e+"\n"+n+" AT \n";return function(){var e=new Error("get-stack-trace"),n=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),t.apply(this,arguments)}}function f(t,e,n){var r,i=e.prototype;r=t.prototype=Object.create(i),r.constructor=t,r._super=i,n&&ht(r,n)}function d(t,e){return function(){return t.apply(e,arguments)}}function h(t,e){return typeof t==yt?t.apply(e?e[0]||s:s,e):t}function v(t,e){return t===s?e:t}function m(t,e,n){l(w(e),function(e){t.addEventListener(e,n,!1)})}function y(t,e,n){l(w(e),function(e){t.removeEventListener(e,n,!1)})}function g(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return t.indexOf(e)>-1}function w(t){return t.trim().split(/\s+/g)}function x(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;r<t.length;){if(n&&t[r][n]==e||!n&&t[r]===e)return r;r++}return-1}function _(t){return Array.prototype.slice.call(t,0)}function k(t,e,n){for(var r=[],i=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];x(i,a)<0&&r.push(t[o]),i[o]=a,o++}return n&&(r=e?r.sort(function(t,n){return t[e]>n[e]}):r.sort()),r}function T(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o<vt.length;){if(n=vt[o],(r=n?n+i:e)in t)return r;o++}return s}function O(){return kt++}function E(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||i}function C(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){h(t.options.enable,[t])&&n.handler(e)},this.init()}function A(t){return new(t.options.inputClass||(Et?H:Ct?Y:Ot?V:U))(t,S)}function S(t,e,n){var r=n.pointers.length,i=n.changedPointers.length,o=e&St&&r-i==0,a=e&(jt|Lt)&&r-i==0;n.isFirst=!!o,n.isFinal=!!a,o&&(t.session={}),n.eventType=e,P(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function P(t,e){var n=t.session,r=e.pointers,i=r.length;n.firstInput||(n.firstInput=M(e)),i>1&&!n.firstMultiple?n.firstMultiple=M(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,c=e.center=$(r);e.timeStamp=wt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=R(s,c),e.distance=D(s,c),j(n,e),e.offsetDirection=N(e.deltaX,e.deltaY);var u=I(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=bt(u.x)>bt(u.y)?u.x:u.y,e.scale=a?B(a.pointers,r):1,e.rotation=a?F(a.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,L(n,e);var l=t.element;g(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function j(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};e.eventType!==St&&o.eventType!==jt||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}function L(t,e){var n,r,i,o,a=t.lastInterval||e,c=e.timeStamp-a.timeStamp;if(e.eventType!=Lt&&(c>At||a.velocity===s)){var u=e.deltaX-a.deltaX,l=e.deltaY-a.deltaY,p=I(c,u,l);r=p.x,i=p.y,n=bt(p.x)>bt(p.y)?p.x:p.y,o=N(u,l),t.lastInterval=e}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}function M(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:gt(t.pointers[n].clientX),clientY:gt(t.pointers[n].clientY)},n++;return{timeStamp:wt(),pointers:e,center:$(e),deltaX:t.deltaX,deltaY:t.deltaY}}function $(t){var e=t.length;if(1===e)return{x:gt(t[0].clientX),y:gt(t[0].clientY)};for(var n=0,r=0,i=0;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:gt(n/e),y:gt(r/e)}}function I(t,e,n){return{x:e/t||0,y:n/t||0}}function N(t,e){return t===e?Mt:bt(t)>=bt(e)?t<0?$t:It:e<0?Nt:Dt}function D(t,e,n){n||(n=Ut);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function R(t,e,n){n||(n=Ut);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}function F(t,e){return R(e[1],e[0],Ht)+R(t[1],t[0],Ht)}function B(t,e){return D(e[0],e[1],Ht)/D(t[0],t[1],Ht)}function U(){this.evEl=zt,this.evWin=Yt,this.pressed=!1,C.apply(this,arguments)}function H(){this.evEl=Wt,this.evWin=Gt,C.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function X(){this.evTarget=Jt,this.evWin=Qt,this.started=!1,C.apply(this,arguments)}function z(t,e){var n=_(t.touches),r=_(t.changedTouches);return e&(jt|Lt)&&(n=k(n.concat(r),"identifier",!0)),[n,r]}function Y(){this.evTarget=te,this.targetIds={},C.apply(this,arguments)}function q(t,e){var n=_(t.touches),r=this.targetIds;if(e&(St|Pt)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=_(t.changedTouches),s=[],c=this.target;if(o=n.filter(function(t){return g(t.target,c)}),e===St)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),e&(jt|Lt)&&delete r[a[i].identifier],i++;return s.length?[k(o.concat(s),"identifier",!0),s]:void 0}function V(){C.apply(this,arguments);var t=d(this.handler,this);this.touch=new Y(this.manager,t),this.mouse=new U(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function W(t,e){t&St?(this.primaryTouch=e.changedPointers[0].identifier,G.call(this,e)):t&(jt|Lt)&&G.call(this,e)}function G(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var r=this.lastTouches,i=function(){var t=r.indexOf(n);t>-1&&r.splice(t,1)};setTimeout(i,ee)}}function K(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(e-i.x),a=Math.abs(n-i.y);if(o<=ne&&a<=ne)return!0}return!1}function J(t,e){this.manager=t,this.set(e)}function Q(t){if(b(t,se))return se;var e=b(t,ce),n=b(t,ue);return e&&n?se:e||n?e?ce:ue:b(t,ae)?ae:oe}function Z(t){this.options=ht({},this.defaults,t||{}),this.id=O(),this.manager=null,this.options.enable=v(this.options.enable,!0),this.state=pe,this.simultaneous={},this.requireFail=[]}function tt(t){return t&me?"cancel":t&he?"end":t&de?"move":t&fe?"start":""}function et(t){return t==Dt?"down":t==Nt?"up":t==$t?"left":t==It?"right":""}function nt(t,e){var n=e.manager;return n?n.get(t):t}function rt(){Z.apply(this,arguments)}function it(){rt.apply(this,arguments),this.pX=null,this.pY=null}function ot(){rt.apply(this,arguments)}function at(){Z.apply(this,arguments),this._timer=null,this._input=null}function st(){rt.apply(this,arguments)}function ct(){rt.apply(this,arguments)}function ut(){Z.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function lt(t,e){return e=e||{},e.recognizers=v(e.recognizers,lt.defaults.preset),new pt(t,e)}function pt(t,e){this.options=ht({},lt.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=A(this),this.touchAction=new J(this,this.options.touchAction),ft(this,!0),l(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function ft(t,e){var n=t.element;if(n.style){var r;l(t.options.cssProps,function(i,o){r=T(n.style,o),e?(t.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=t.oldCssProps[r]||""}),e||(t.oldCssProps={})}}function dt(t,e){var n=o.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}var ht,vt=["","webkit","Moz","MS","ms","o"],mt=o.createElement("div"),yt="function",gt=Math.round,bt=Math.abs,wt=Date.now;ht="function"!=typeof Object.assign?function(t){if(t===s||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==s&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}:Object.assign;var xt=p(function(t,e,n){for(var r=Object.keys(e),i=0;i<r.length;)(!n||n&&t[r[i]]===s)&&(t[r[i]]=e[r[i]]),i++;return t},"extend","Use `assign`."),_t=p(function(t,e){return xt(t,e,!0)},"merge","Use `assign`."),kt=1,Tt=/mobile|tablet|ip(ad|hone|od)|android/i,Ot="ontouchstart"in i,Et=T(i,"PointerEvent")!==s,Ct=Ot&&Tt.test(navigator.userAgent),At=25,St=1,Pt=2,jt=4,Lt=8,Mt=1,$t=2,It=4,Nt=8,Dt=16,Rt=$t|It,Ft=Nt|Dt,Bt=Rt|Ft,Ut=["x","y"],Ht=["clientX","clientY"];C.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(E(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(E(this.element),this.evWin,this.domHandler)}};var Xt={mousedown:St,mousemove:Pt,mouseup:jt},zt="mousedown",Yt="mousemove mouseup";f(U,C,{handler:function(t){var e=Xt[t.type];e&St&&0===t.button&&(this.pressed=!0),e&Pt&&1!==t.which&&(e=jt),this.pressed&&(e&jt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var qt={pointerdown:St,pointermove:Pt,pointerup:jt,pointercancel:Lt,pointerout:Lt},Vt={2:"touch",3:"pen",4:"mouse",5:"kinect"},Wt="pointerdown",Gt="pointermove pointerup pointercancel";i.MSPointerEvent&&!i.PointerEvent&&(Wt="MSPointerDown",Gt="MSPointerMove MSPointerUp MSPointerCancel"),f(H,C,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=qt[r],o=Vt[t.pointerType]||t.pointerType,a="touch"==o,s=x(e,t.pointerId,"pointerId");i&St&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):i&(jt|Lt)&&(n=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}});var Kt={touchstart:St,touchmove:Pt,touchend:jt,touchcancel:Lt},Jt="touchstart",Qt="touchstart touchmove touchend touchcancel";f(X,C,{handler:function(t){var e=Kt[t.type];if(e===St&&(this.started=!0),this.started){var n=z.call(this,t,e);e&(jt|Lt)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var Zt={touchstart:St,touchmove:Pt,touchend:jt,touchcancel:Lt},te="touchstart touchmove touchend touchcancel";f(Y,C,{handler:function(t){var e=Zt[t.type],n=q.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}});var ee=2500,ne=25;f(V,C,{handler:function(t,e,n){var r="touch"==n.pointerType,i="mouse"==n.pointerType;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)W.call(this,e,n);else if(i&&K.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var re=T(mt.style,"touchAction"),ie=re!==s,oe="auto",ae="manipulation",se="none",ce="pan-x",ue="pan-y",le=function(){if(!ie)return!1;var t={},e=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(n){t[n]=!e||i.CSS.supports("touch-action",n)}),t}();J.prototype={set:function(t){"compute"==t&&(t=this.compute()),ie&&this.manager.element.style&&le[t]&&(this.manager.element.style[re]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){h(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),Q(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var r=this.actions,i=b(r,se)&&!le[se],o=b(r,ue)&&!le[ue],a=b(r,ce)&&!le[ce];if(i){var s=1===t.pointers.length,c=t.distance<2,u=t.deltaTime<250;if(s&&c&&u)return}return a&&o?void 0:i||o&&n&Rt||a&&n&Ft?this.preventSrc(e):void 0},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var pe=1,fe=2,de=4,he=8,ve=he,me=16;Z.prototype={defaults:{},set:function(t){return ht(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(u(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=nt(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return u(t,"dropRecognizeWith",this)?this:(t=nt(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(u(t,"requireFailure",this))return this;var e=this.requireFail;return t=nt(t,this),-1===x(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(u(t,"dropRequireFailure",this))return this;t=nt(t,this);var e=x(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,r=this.state;r<he&&e(n.options.event+tt(r)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),r>=he&&e(n.options.event+tt(r))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(32|pe)))return!1;t++}return!0},recognize:function(t){var e=ht({},t);if(!h(this.options.enable,[this,e]))return this.reset(),void(this.state=32);this.state&(ve|me|32)&&(this.state=pe),this.state=this.process(e),this.state&(fe|de|he|me)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},f(rt,Z,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,r=e&(fe|de),i=this.attrTest(t);return r&&(n&Lt||!i)?e|me:r||i?n&jt?e|he:e&fe?e|de:fe:32}}),f(it,rt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Bt},getTouchAction:function(){var t=this.options.direction,e=[];return t&Rt&&e.push(ue),t&Ft&&e.push(ce),e},directionTest:function(t){var e=this.options,n=!0,r=t.distance,i=t.direction,o=t.deltaX,a=t.deltaY;return i&e.direction||(e.direction&Rt?(i=0===o?Mt:o<0?$t:It,n=o!=this.pX,r=Math.abs(t.deltaX)):(i=0===a?Mt:a<0?Nt:Dt,n=a!=this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&e.direction},attrTest:function(t){return rt.prototype.attrTest.call(this,t)&&(this.state&fe||!(this.state&fe)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=et(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),f(ot,rt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[se]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&fe)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),f(at,Z,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[oe]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!r||!n||t.eventType&(jt|Lt)&&!i)this.reset();else if(t.eventType&St)this.reset(),this._timer=c(function(){this.state=ve,this.tryEmit()},e.time,this);else if(t.eventType&jt)return ve;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===ve&&(t&&t.eventType&jt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=wt(),this.manager.emit(this.options.event,this._input)))}}),f(st,rt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[se]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&fe)}}),f(ct,rt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Rt|Ft,pointers:1},getTouchAction:function(){return it.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Rt|Ft)?e=t.overallVelocity:n&Rt?e=t.overallVelocityX:n&Ft&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&bt(e)>this.options.velocity&&t.eventType&jt},emit:function(t){var e=et(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),f(ut,Z,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ae]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),t.eventType&St&&0===this.count)return this.failTimeout();if(r&&i&&n){if(t.eventType!=jt)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||D(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t,0==this.count%e.taps)return this.hasRequireFailures()?(this._timer=c(function(){this.state=ve,this.tryEmit()},e.interval,this),fe):ve}return 32},failTimeout:function(){return this._timer=c(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ve&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),lt.VERSION="2.0.7",lt.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[st,{enable:!1}],[ot,{enable:!1},["rotate"]],[ct,{direction:Rt}],[it,{direction:Rt},["swipe"]],[ut],[ut,{event:"doubletap",taps:2},["tap"]],[at]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},pt.prototype={set:function(t){return ht(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var n,r=this.recognizers,i=e.curRecognizer;(!i||i&&i.state&ve)&&(i=e.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===e.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&n.state&(fe|de|he)&&(i=e.curRecognizer=n),o++}},get:function(t){if(t instanceof Z)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(u(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(u(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=x(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==s&&e!==s){var n=this.handlers;return l(w(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this}},off:function(t,e){if(t!==s){var n=this.handlers;return l(w(t),function(t){e?n[t]&&n[t].splice(x(n[t],e),1):delete n[t]}),this}},emit:function(t,e){this.options.domEvents&&dt(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&ft(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ht(lt,{INPUT_START:St,INPUT_MOVE:Pt,INPUT_END:jt,INPUT_CANCEL:Lt,STATE_POSSIBLE:pe,STATE_BEGAN:fe,STATE_CHANGED:de,STATE_ENDED:he,STATE_RECOGNIZED:ve,STATE_CANCELLED:me,STATE_FAILED:32,DIRECTION_NONE:Mt,DIRECTION_LEFT:$t,DIRECTION_RIGHT:It,DIRECTION_UP:Nt,DIRECTION_DOWN:Dt,DIRECTION_HORIZONTAL:Rt,DIRECTION_VERTICAL:Ft,DIRECTION_ALL:Bt,Manager:pt,Input:C,TouchAction:J,TouchInput:Y,MouseInput:U,PointerEventInput:H,TouchMouseInput:V,SingleTouchInput:X,Recognizer:Z,AttrRecognizer:rt,Tap:ut,Pan:it,Swipe:ct,Pinch:ot,Rotate:st,Press:at,on:m,off:y,each:l,merge:_t,extend:xt,assign:ht,inherit:f,bindFn:d,prefixed:T}),(void 0!==i?i:"undefined"!=typeof self?self:{}).Hammer=lt,(r=function(){return lt}.call(e,n,e,t))!==s&&(t.exports=r)}(window,document)},function(t,e){t.exports=function(t,e,n){for(var r=(2<<Math.log(e.length-1)/Math.LN2)-1,i=Math.ceil(1.6*r*n/e.length),o="";;)for(var a=t(i),s=0;s<i;s++){var c=a[s]&r;if(e[c]&&(o+=e[c],o.length===n))return o}}},function(t,e,n){"use strict";function r(t){var e="",n=Math.floor(.001*(Date.now()-s));return n===o?i++:(i=0,o=n),e+=a(c),e+=a(t),i>0&&(e+=a(i)),e+=a(n)}var i,o,a=n(15),s=(n(0),1459707606518),c=6;t.exports=r},function(t,e,n){"use strict";function r(t){for(var e,n=0,r="";!e;)r+=a(o,i.get(),1),e=t<Math.pow(16,n+1),n++;return r}var i=n(0),o=n(18),a=n(13);t.exports=r},function(t,e,n){"use strict";function r(e){return s.seed(e),t.exports}function i(e){return l=e,t.exports}function o(t){return void 0!==t&&s.characters(t),s.shuffled()}function a(){return c(l)}var s=n(0),c=n(14),u=n(17),l=n(20)||0;t.exports=a,t.exports.generate=a,t.exports.seed=r,t.exports.worker=i,t.exports.characters=o,t.exports.isValid=u},function(t,e,n){"use strict";function r(t){return!(!t||"string"!=typeof t||t.length<6||new RegExp("[^"+i.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]").test(t))}var i=n(0);t.exports=r},function(t,e,n){"use strict";var r,i="object"==typeof window&&(window.crypto||window.msCrypto);r=i&&i.getRandomValues?function(t){return i.getRandomValues(new Uint8Array(t))}:function(t){for(var e=[],n=0;n<t;n++)e.push(Math.floor(256*Math.random()));return e},t.exports=r},function(t,e,n){"use strict";function r(){return(o=(9301*o+49297)%233280)/233280}function i(t){o=t}var o=1;t.exports={nextValue:r,seed:i}},function(t,e,n){"use strict";t.exports=0},function(t,e){t.exports=function(t,e,n,r){var i,o=t=t||{},a=typeof t.default;"object"!==a&&"function"!==a||(i=t,o=t.default);var s="function"==typeof o?o.options:o;if(e&&(s.render=e.render,s.staticRenderFns=e.staticRenderFns),n&&(s._scopeId=n),r){var c=Object.create(s.computed||null);Object.keys(r).forEach(function(t){var e=r[t];c[t]=function(){return e}}),s.computed=c}return{esModule:i,exports:o,options:s}}},function(t,e,n){var r=n(9);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(23)("02af2e15",r,!0,{})},function(t,e,n){function r(t){for(var e=0;e<t.length;e++){var n=t[e],r=l[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(o(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var a=[],i=0;i<n.parts.length;i++)a.push(o(n.parts[i]));l[n.id]={id:n.id,refs:1,parts:a}}}}function i(){var t=document.createElement("style");return t.type="text/css",p.appendChild(t),t}function o(t){var e,n,r=document.querySelector("style["+y+'~="'+t.id+'"]');if(r){if(h)return v;r.parentNode.removeChild(r)}if(g){var o=d++;r=f||(f=i()),e=a.bind(null,r,o,!1),n=a.bind(null,r,o,!0)}else r=i(),e=s.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}function a(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=b(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function s(t,e){var n=e.css,r=e.media,i=e.sourceMap;if(r&&t.setAttribute("media",r),m.ssrId&&t.setAttribute(y,e.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var c="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!c)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var u=n(24),l={},p=c&&(document.head||document.getElementsByTagName("head")[0]),f=null,d=0,h=!1,v=function(){},m=null,y="data-vue-ssr-id",g="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,n,i){h=n,m=i||{};var o=u(t,e);return r(o),function(e){for(var n=[],i=0;i<o.length;i++){var a=o[i],s=l[a.id];s.refs--,n.push(s)}e?(o=u(t,e),r(o)):o=[];for(var i=0;i<n.length;i++){var s=n[i];if(0===s.refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete l[s.id]}}}};var b=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){t.exports=function(t,e){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],a=o[0],s=o[1],c=o[2],u=o[3],l={id:t+":"+i,css:s,media:c,sourceMap:u};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n}])}()}()},function(t,e,n){/*!
|
13 |
* vue-tippy v2.1.2
|
14 |
* (c) 2019 Georges KABBOUCHI
|
15 |
* Released under the MIT License.
|
@@ -1,7 +1,7 @@
|
|
1 |
jQuery( document ).ready( function() {
|
2 |
if(jQuery.fn.colorbox) {
|
3 |
-
jQuery( '
|
4 |
{iframe:true, width:'80%', height:'80%'}
|
5 |
);
|
6 |
}
|
7 |
-
});
|
1 |
jQuery( document ).ready( function() {
|
2 |
if(jQuery.fn.colorbox) {
|
3 |
+
jQuery( '.colorbox' ).colorbox(
|
4 |
{iframe:true, width:'80%', height:'80%'}
|
5 |
);
|
6 |
}
|
7 |
+
});
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function WpraGallery(config) {
|
2 |
+
this.config = config;
|
3 |
+
this.gallery = null;
|
4 |
+
|
5 |
+
this.valueEl = null;
|
6 |
+
this.openEl = null;
|
7 |
+
this.removeEl = null;
|
8 |
+
this.previewEl = null;
|
9 |
+
this.previewHintEl = null;
|
10 |
+
|
11 |
+
config.elements && (this.valueEl = config.elements.value);
|
12 |
+
config.elements && (this.openEl = config.elements.open);
|
13 |
+
config.elements && (this.removeEl = config.elements.remove);
|
14 |
+
config.elements && (this.previewEl = config.elements.preview);
|
15 |
+
config.elements && (this.previewHintEl = config.elements.previewHint);
|
16 |
+
|
17 |
+
this.createGallery();
|
18 |
+
|
19 |
+
if (this.openEl !== null) {
|
20 |
+
this.openEl.click(this.open.bind(this));
|
21 |
+
}
|
22 |
+
|
23 |
+
if (this.previewEl !== null) {
|
24 |
+
this.previewEl.css({cursor: 'pointer'});
|
25 |
+
this.previewEl.click(this.open.bind(this));
|
26 |
+
}
|
27 |
+
|
28 |
+
if (this.removeEl !== null) {
|
29 |
+
this.removeEl.click(this.update.bind(this));
|
30 |
+
}
|
31 |
+
|
32 |
+
var image = (this.valueEl)
|
33 |
+
? {id: this.valueEl.val(), url: this.previewEl.attr('src')}
|
34 |
+
: null;
|
35 |
+
this.update(image);
|
36 |
+
}
|
37 |
+
|
38 |
+
WpraGallery.prototype.createGallery = function () {
|
39 |
+
var args = {
|
40 |
+
id: this.config.id,
|
41 |
+
title: this.config.title,
|
42 |
+
button: {
|
43 |
+
text: this.config.button
|
44 |
+
},
|
45 |
+
library: this.config.library,
|
46 |
+
multiple: this.config.multiple,
|
47 |
+
};
|
48 |
+
|
49 |
+
this.gallery = wp.media.frames[this.config.id] = wp.media(args);
|
50 |
+
|
51 |
+
this.gallery.states.add([
|
52 |
+
new wp.media.controller.Library({
|
53 |
+
id: this.config.id,
|
54 |
+
title: this.config.title,
|
55 |
+
priority: 0,
|
56 |
+
toolbar: 'main-gallery',
|
57 |
+
filterable: 'uploaded',
|
58 |
+
library: wp.media.query( this.gallery.options.library ),
|
59 |
+
multiple: this.config.multiple,
|
60 |
+
editable: this.config.editable,
|
61 |
+
}),
|
62 |
+
]);
|
63 |
+
|
64 |
+
// Hide the gallery side bar
|
65 |
+
this.gallery.on('ready', function () {
|
66 |
+
jQuery('#' + this.config.id).addClass('hide-menu');
|
67 |
+
}.bind(this));
|
68 |
+
|
69 |
+
// Set selected image when the gallery is opened
|
70 |
+
this.gallery.on('open', function () {
|
71 |
+
// Hide the gallery side bar
|
72 |
+
jQuery('#' + this.config.id).addClass('hide-menu');
|
73 |
+
var id = this.valueEl.val();
|
74 |
+
|
75 |
+
if (id) {
|
76 |
+
var attachment = wp.media.attachment(id);
|
77 |
+
attachment.fetch();
|
78 |
+
this.gallery.state().get('selection').add(attachment ? [attachment] : []);
|
79 |
+
}
|
80 |
+
}.bind(this));
|
81 |
+
|
82 |
+
var selectCb = function () {
|
83 |
+
var image = this.gallery.state().get('selection').first();
|
84 |
+
|
85 |
+
this.update({
|
86 |
+
id: image.attributes.id,
|
87 |
+
url: image.attributes.url,
|
88 |
+
});
|
89 |
+
}.bind(this);
|
90 |
+
|
91 |
+
// Update fields when an image is selected and the modal is closed
|
92 |
+
this.gallery.on('insert', selectCb);
|
93 |
+
this.gallery.on('select', selectCb);
|
94 |
+
};
|
95 |
+
|
96 |
+
WpraGallery.prototype.update = function (image) {
|
97 |
+
if (image && image.id) {
|
98 |
+
this.valueEl && this.valueEl.val(image.id);
|
99 |
+
this.previewEl && this.previewEl.attr('src', image.url).show();
|
100 |
+
this.previewHintEl && this.previewHintEl.show();
|
101 |
+
this.removeEl && this.removeEl.show();
|
102 |
+
this.openEl && this.openEl.hide();
|
103 |
+
|
104 |
+
return;
|
105 |
+
}
|
106 |
+
|
107 |
+
this.valueEl && this.valueEl.val('');
|
108 |
+
this.previewEl && this.previewEl.hide().attr('src', '');
|
109 |
+
this.previewHintEl && this.previewHintEl.hide();
|
110 |
+
this.removeEl && this.removeEl.hide();
|
111 |
+
this.openEl && this.openEl.show();
|
112 |
+
};
|
113 |
+
|
114 |
+
WpraGallery.prototype.open = function (image) {
|
115 |
+
this.gallery.open();
|
116 |
+
};
|
@@ -48,33 +48,46 @@
|
|
48 |
// Update the next update time
|
49 |
updatesCol.find('code.next-update').text( feed_source['next-update'] );
|
50 |
|
51 |
-
// Update the last update time
|
52 |
-
if ( feed_source['last-update'] == '' )
|
53 |
updatesCol.find('p.last-update-container').hide();
|
54 |
-
else
|
55 |
-
updatesCol.find('
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
updatesCol.find('span.last-update-imported-container').hide();
|
60 |
-
else
|
61 |
-
updatesCol.find('code.last-update-imported').text( feed_source['last-update-imported'] );
|
62 |
|
63 |
// Update the items imported count and the icon
|
64 |
-
var icon = itemsCol.find('i.fa-spin');
|
65 |
var itemCount = itemsCol.find('span.items-imported');
|
66 |
|
67 |
// Update the count and the icon appropriately
|
68 |
itemCount.text( feed_source['items'] );
|
69 |
-
icon.toggleClass( 'wprss-show', feed_source['updating'] );
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
// Update the error icon
|
76 |
-
var
|
77 |
-
var errorIcon = errorsCol.find('i.fa');
|
78 |
errorIcon.toggleClass( 'wprss-show', feed_source['errors'] !== '' );
|
79 |
}
|
80 |
|
@@ -91,7 +104,7 @@
|
|
91 |
},
|
92 |
success: function(data, status, jqXHR){
|
93 |
updateFeedSourceTable(data);
|
94 |
-
setTimeout(wprssFeedSourceTableAjax,
|
95 |
},
|
96 |
dataType: 'json'
|
97 |
});
|
48 |
// Update the next update time
|
49 |
updatesCol.find('code.next-update').text( feed_source['next-update'] );
|
50 |
|
51 |
+
// Update the last update time and item count
|
52 |
+
if ( feed_source['last-update'] == '' ) {
|
53 |
updatesCol.find('p.last-update-container').hide();
|
54 |
+
} else {
|
55 |
+
updatesCol.find('.last-update-time').text(feed_source['last-update'] + ' ' + wprss_admin_heartbeat.ago);
|
56 |
+
updatesCol.find('.last-update-num-items').text( feed_source['last-update-imported'] );
|
57 |
+
updatesCol.find('p.last-update-container').show();
|
58 |
+
}
|
|
|
|
|
|
|
59 |
|
60 |
// Update the items imported count and the icon
|
|
|
61 |
var itemCount = itemsCol.find('span.items-imported');
|
62 |
|
63 |
// Update the count and the icon appropriately
|
64 |
itemCount.text( feed_source['items'] );
|
|
|
|
|
|
|
|
|
65 |
|
66 |
+
// Toggle the row's updating class - the check ignores false negatives
|
67 |
+
if (row.hasClass('wpra-manual-update')) {
|
68 |
+
row.removeClass('wpra-manual-update');
|
69 |
+
} else {
|
70 |
+
row.toggleClass('wpra-feed-is-updating', !!feed_source['fetching']);
|
71 |
+
}
|
72 |
+
|
73 |
+
// Toggle the row's deleting class - the check ignores false negatives
|
74 |
+
if (row.hasClass('wpra-manual-delete')) {
|
75 |
+
row.removeClass('wpra-manual-delete');
|
76 |
+
} else {
|
77 |
+
row.toggleClass('wpra-feed-is-deleting', !!feed_source['deleting'] && !feed_source['fetching']);
|
78 |
+
}
|
79 |
+
|
80 |
+
// False negatives occur when the handlers for the update/delete row actions add the "is updating" or
|
81 |
+
// "is deleting" class to the row, and immediately after a heartbeat response comes back that reports the
|
82 |
+
// same feed source as not updating and not deleting, which results in the row losing those classes.
|
83 |
+
|
84 |
+
// Toggle the "has imported items" class depending on the number of imported items
|
85 |
+
itemsCol.find('.items-imported-link').toggleClass('has-imported-items', feed_source['items'] > 0);
|
86 |
+
// Hide the "Delete" row action for items if there are no imported items
|
87 |
+
itemsCol.find('.row-actions .purge-posts').toggle(feed_source['items'] >= 0);
|
88 |
|
89 |
// Update the error icon
|
90 |
+
var errorIcon = itemsCol.find('i.wprss-feed-error-symbol').attr('title', feed_source['errors']);
|
|
|
91 |
errorIcon.toggleClass( 'wprss-show', feed_source['errors'] !== '' );
|
92 |
}
|
93 |
|
104 |
},
|
105 |
success: function(data, status, jqXHR){
|
106 |
updateFeedSourceTable(data);
|
107 |
+
setTimeout(wprssFeedSourceTableAjax, 1500);
|
108 |
},
|
109 |
dataType: 'json'
|
110 |
});
|
@@ -1,4 +1,9 @@
|
|
|
|
|
|
1 |
export default {
|
|
|
|
|
|
|
2 |
props: {
|
3 |
id: {
|
4 |
type: String,
|
@@ -8,6 +13,7 @@ export default {
|
|
8 |
},
|
9 |
label: {},
|
10 |
description: {},
|
|
|
11 |
type: {},
|
12 |
value: {},
|
13 |
placeholder: {},
|
@@ -21,6 +27,10 @@ export default {
|
|
21 |
},
|
22 |
methods: {
|
23 |
inputNode () {
|
|
|
|
|
|
|
|
|
24 |
if (this.type === 'checkbox') {
|
25 |
return <input type="checkbox"
|
26 |
id={this.id}
|
@@ -83,7 +93,7 @@ export default {
|
|
83 |
</label>
|
84 |
) : null }
|
85 |
<div class="form-input__field">
|
86 |
-
{ this.inputNode() }
|
87 |
</div>
|
88 |
</div>
|
89 |
}
|
1 |
+
import MediaInput from './MediaInput'
|
2 |
+
|
3 |
export default {
|
4 |
+
mixins: [
|
5 |
+
MediaInput
|
6 |
+
],
|
7 |
props: {
|
8 |
id: {
|
9 |
type: String,
|
13 |
},
|
14 |
label: {},
|
15 |
description: {},
|
16 |
+
after: {},
|
17 |
type: {},
|
18 |
value: {},
|
19 |
placeholder: {},
|
27 |
},
|
28 |
methods: {
|
29 |
inputNode () {
|
30 |
+
if (this.type === 'media') {
|
31 |
+
return this.mediaNode()
|
32 |
+
}
|
33 |
+
|
34 |
if (this.type === 'checkbox') {
|
35 |
return <input type="checkbox"
|
36 |
id={this.id}
|
93 |
</label>
|
94 |
) : null }
|
95 |
<div class="form-input__field">
|
96 |
+
{ this.inputNode() }{ this.after }
|
97 |
</div>
|
98 |
</div>
|
99 |
}
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
let imageFrame = null
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @see https://core.trac.wordpress.org/browser/tags/5.1.1/src/js/_enqueues/wp/media?order=name
|
5 |
+
*
|
6 |
+
* @var {{media: Function}} wp
|
7 |
+
*
|
8 |
+
* @property {{}} value
|
9 |
+
*/
|
10 |
+
export default {
|
11 |
+
props: {
|
12 |
+
mediaType: {
|
13 |
+
type: String,
|
14 |
+
default: 'image'
|
15 |
+
},
|
16 |
+
mediaTitle: {
|
17 |
+
type: String,
|
18 |
+
default: 'Select Media'
|
19 |
+
},
|
20 |
+
/**
|
21 |
+
* Property to use as a value for the media. Can be `id` or `url`.
|
22 |
+
*
|
23 |
+
* @property {string} mediaValueProperty
|
24 |
+
*/
|
25 |
+
mediaValueProperty: {
|
26 |
+
type: String,
|
27 |
+
default: 'id',
|
28 |
+
},
|
29 |
+
},
|
30 |
+
methods: {
|
31 |
+
mediaNode () {
|
32 |
+
this.assertMediaLoaded()
|
33 |
+
|
34 |
+
return <div>
|
35 |
+
<input type="text" value={this.value}/>
|
36 |
+
<button class="button" onClick={this.openFrame}>Choose image</button>
|
37 |
+
</div>
|
38 |
+
},
|
39 |
+
|
40 |
+
openFrame () {
|
41 |
+
if (!imageFrame) {
|
42 |
+
imageFrame = this.createFrame()
|
43 |
+
}
|
44 |
+
imageFrame.open()
|
45 |
+
},
|
46 |
+
|
47 |
+
createFrame () {
|
48 |
+
imageFrame = wp.media({
|
49 |
+
title: this.mediaTitle,
|
50 |
+
multiple: false,
|
51 |
+
library: {
|
52 |
+
type: this.mediaType,
|
53 |
+
}
|
54 |
+
})
|
55 |
+
|
56 |
+
imageFrame.on('close', () => {
|
57 |
+
const selection = imageFrame.state().get('selection')
|
58 |
+
let selectedAttachment = null
|
59 |
+
selection.each((attachment) => {
|
60 |
+
console.info({attachment})
|
61 |
+
selectedAttachment = attachment
|
62 |
+
})
|
63 |
+
if (!selectedAttachment || !selectedAttachment.id) {
|
64 |
+
return
|
65 |
+
}
|
66 |
+
this.$emit('input', ({
|
67 |
+
id: selectedAttachment.id,
|
68 |
+
url: selectedAttachment.attributes.url
|
69 |
+
})[this.mediaValueProperty])
|
70 |
+
})
|
71 |
+
|
72 |
+
imageFrame.on('open', () => {
|
73 |
+
const selection = imageFrame.state().get('selection')
|
74 |
+
|
75 |
+
if (this.mediaValueProperty === 'id' && this.value) {
|
76 |
+
const attachment = wp.media.attachment(this.value)
|
77 |
+
attachment.fetch()
|
78 |
+
selection.add(attachment ? [attachment] : [])
|
79 |
+
}
|
80 |
+
})
|
81 |
+
|
82 |
+
return imageFrame
|
83 |
+
},
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Check whether wp.media is loaded. If not - throw an error.
|
87 |
+
*
|
88 |
+
* @throws Error When wp.media is not loaded.
|
89 |
+
*/
|
90 |
+
assertMediaLoaded () {
|
91 |
+
if (!window.wp.media) {
|
92 |
+
throw Error('[MediaInput] wp.media dependency is not loaded')
|
93 |
+
}
|
94 |
+
}
|
95 |
+
},
|
96 |
+
}
|
@@ -1,7 +1,7 @@
|
|
1 |
/**
|
2 |
* Library agnostic wrapper for notifications.
|
3 |
*
|
4 |
-
* @since
|
5 |
*
|
6 |
* @class NotificationsCenter
|
7 |
*/
|
@@ -9,7 +9,7 @@ export default class NotificationsCenter {
|
|
9 |
/**
|
10 |
* NotificationsCenter constructor.
|
11 |
*
|
12 |
-
* @since
|
13 |
*
|
14 |
* @param {Function} show Function implementation for displaying messages.
|
15 |
* @param {Function} error Function implementation for displaying errors.
|
@@ -22,7 +22,7 @@ export default class NotificationsCenter {
|
|
22 |
/**
|
23 |
* Display informational message.
|
24 |
*
|
25 |
-
* @since
|
26 |
*
|
27 |
* @param {string} msg Message for displaying
|
28 |
* @param {object} options Options for notification.
|
@@ -34,7 +34,7 @@ export default class NotificationsCenter {
|
|
34 |
/**
|
35 |
* Display error message.
|
36 |
*
|
37 |
-
* @since
|
38 |
*
|
39 |
* @param {string} msg Message for displaying
|
40 |
* @param {object} options Options for notification.
|
1 |
/**
|
2 |
* Library agnostic wrapper for notifications.
|
3 |
*
|
4 |
+
* @since 4.14
|
5 |
*
|
6 |
* @class NotificationsCenter
|
7 |
*/
|
9 |
/**
|
10 |
* NotificationsCenter constructor.
|
11 |
*
|
12 |
+
* @since 4.14
|
13 |
*
|
14 |
* @param {Function} show Function implementation for displaying messages.
|
15 |
* @param {Function} error Function implementation for displaying errors.
|
22 |
/**
|
23 |
* Display informational message.
|
24 |
*
|
25 |
+
* @since 4.14
|
26 |
*
|
27 |
* @param {string} msg Message for displaying
|
28 |
* @param {object} options Options for notification.
|
34 |
/**
|
35 |
* Display error message.
|
36 |
*
|
37 |
+
* @since 4.14
|
38 |
*
|
39 |
* @param {string} msg Message for displaying
|
40 |
* @param {object} options Options for notification.
|
@@ -16,6 +16,8 @@ import {
|
|
16 |
FormTokenField,
|
17 |
SelectControl,
|
18 |
} from '@wordpress/components'
|
|
|
|
|
19 |
import MultipleSelectControl from './components/MultipleSelectControl'
|
20 |
|
21 |
// Default template is selected by default.
|
@@ -39,7 +41,7 @@ registerBlockType('wpra-shortcode/wpra-shortcode', {
|
|
39 |
// Remove to make block editable in HTML mode.
|
40 |
supportHTML: false,
|
41 |
|
42 |
-
attributes: {
|
43 |
isAll: {
|
44 |
type: 'boolean',
|
45 |
default: true
|
@@ -64,11 +66,7 @@ registerBlockType('wpra-shortcode/wpra-shortcode', {
|
|
64 |
source: {
|
65 |
type: 'string'
|
66 |
}
|
67 |
-
},
|
68 |
-
|
69 |
-
state: {
|
70 |
-
foo: 'bar'
|
71 |
-
},
|
72 |
|
73 |
/**
|
74 |
* Called when Gutenberg initially loads the block.
|
@@ -93,20 +91,17 @@ registerBlockType('wpra-shortcode/wpra-shortcode', {
|
|
93 |
}
|
94 |
|
95 |
const etWarning = WPRA_BLOCK.is_et_active ? <p style={{fontStyle: 'italic'}}>
|
96 |
-
Excerpts & Thumbnails is incompatible with the WP RSS Aggregator Feeds block. <a
|
|
|
|
|
97 |
</p> : null
|
98 |
|
99 |
-
|
100 |
-
<
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
<InspectorControls>
|
106 |
-
<PanelBody
|
107 |
-
title={__('Feed Sources')}
|
108 |
-
initialOpen={true}
|
109 |
-
>
|
110 |
<ToggleControl
|
111 |
label={__('Show all Feed Sources ')}
|
112 |
checked={props.attributes.isAll}
|
@@ -115,7 +110,7 @@ registerBlockType('wpra-shortcode/wpra-shortcode', {
|
|
115 |
props.setAttributes({exclude: ''})
|
116 |
props.setAttributes({source: ''})
|
117 |
}}
|
118 |
-
|
119 |
<MultipleSelectControl
|
120 |
label={props.attributes.isAll ? __('Feed Sources to Exclude') : __('Feed Sources to Show')}
|
121 |
key={'select'}
|
@@ -132,59 +127,76 @@ registerBlockType('wpra-shortcode/wpra-shortcode', {
|
|
132 |
props.setAttributes({source: selected})
|
133 |
}}
|
134 |
/>
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
}
|
150 |
-
|
151 |
-
|
152 |
-
}
|
153 |
-
}
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
}
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
}
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
}
|
185 |
-
|
186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
</InspectorControls>
|
|
|
188 |
</div>
|
189 |
},
|
190 |
|
@@ -194,4 +206,4 @@ registerBlockType('wpra-shortcode/wpra-shortcode', {
|
|
194 |
save: function (props) {
|
195 |
return null
|
196 |
}
|
197 |
-
})
|
16 |
FormTokenField,
|
17 |
SelectControl,
|
18 |
} from '@wordpress/components'
|
19 |
+
import { addFilter, applyFilters } from '@wordpress/hooks'
|
20 |
+
|
21 |
import MultipleSelectControl from './components/MultipleSelectControl'
|
22 |
|
23 |
// Default template is selected by default.
|
41 |
// Remove to make block editable in HTML mode.
|
42 |
supportHTML: false,
|
43 |
|
44 |
+
attributes: applyFilters('wpra.gutenbergBlock.attributes', {
|
45 |
isAll: {
|
46 |
type: 'boolean',
|
47 |
default: true
|
66 |
source: {
|
67 |
type: 'string'
|
68 |
}
|
69 |
+
}),
|
|
|
|
|
|
|
|
|
70 |
|
71 |
/**
|
72 |
* Called when Gutenberg initially loads the block.
|
91 |
}
|
92 |
|
93 |
const etWarning = WPRA_BLOCK.is_et_active ? <p style={{fontStyle: 'italic'}}>
|
94 |
+
Excerpts & Thumbnails is incompatible with the WP RSS Aggregator Feeds block. <a
|
95 |
+
href="https://kb.wprssaggregator.com/article/459-using-excerpts-thumbnails-with-templates" target={'_blank'}>Learn
|
96 |
+
more</a>.
|
97 |
</p> : null
|
98 |
|
99 |
+
const panels = applyFilters('wpra.gutenbergBlock.panels', [
|
100 |
+
<PanelBody
|
101 |
+
title={__('Feed Sources')}
|
102 |
+
initialOpen={true}
|
103 |
+
>
|
104 |
+
{applyFilters('wpra.gutenbergBlock.panelItems', [
|
|
|
|
|
|
|
|
|
|
|
105 |
<ToggleControl
|
106 |
label={__('Show all Feed Sources ')}
|
107 |
checked={props.attributes.isAll}
|
110 |
props.setAttributes({exclude: ''})
|
111 |
props.setAttributes({source: ''})
|
112 |
}}
|
113 |
+
/>,
|
114 |
<MultipleSelectControl
|
115 |
label={props.attributes.isAll ? __('Feed Sources to Exclude') : __('Feed Sources to Show')}
|
116 |
key={'select'}
|
127 |
props.setAttributes({source: selected})
|
128 |
}}
|
129 |
/>
|
130 |
+
], 'feedSources', {props})}
|
131 |
+
</PanelBody>,
|
132 |
+
<PanelBody
|
133 |
+
title={__('Display Options')}
|
134 |
+
initialOpen={false}
|
135 |
+
>
|
136 |
+
{applyFilters('wpra.gutenbergBlock.panelItems', [
|
137 |
+
<SelectControl
|
138 |
+
label={__('Select Template')}
|
139 |
+
value={props.attributes.template}
|
140 |
+
onChange={(template) => {
|
141 |
+
selectedTemplate = WPRA_BLOCK.templates.find(item => item.value === template)
|
142 |
+
props.setAttributes({template: template || ''})
|
143 |
+
if (!templateLock['limit']) {
|
144 |
+
props.setAttributes({limit: getTemplateDefault('limit', parseInt, 15)})
|
145 |
+
}
|
146 |
+
if (!templateLock['pagination']) {
|
147 |
+
props.setAttributes({pagination: getTemplateDefault('pagination', v => !!v, false)})
|
148 |
+
}
|
149 |
+
}}
|
150 |
+
options={WPRA_BLOCK.templates}
|
151 |
+
/>,
|
152 |
+
<TextControl
|
153 |
+
label={__('Feed Limit')}
|
154 |
+
help={__('Number of feed items to display')}
|
155 |
+
placeholder={getTemplateDefault('limit', parseInt)}
|
156 |
+
type={'number'}
|
157 |
+
min={1}
|
158 |
+
value={props.attributes.limit || getTemplateDefault('limit', parseInt)}
|
159 |
+
onChange={(value) => {
|
160 |
+
templateLock['limit'] = true
|
161 |
+
props.setAttributes({limit: parseInt(value) || getTemplateDefault('limit', parseInt)})
|
162 |
+
}}
|
163 |
+
/>,
|
164 |
+
<ToggleControl
|
165 |
+
label={__('Show Pagination ')}
|
166 |
+
checked={props.attributes.pagination}
|
167 |
+
onChange={(value) => {
|
168 |
+
templateLock['pagination'] = true
|
169 |
+
props.setAttributes({pagination: value})
|
170 |
+
}}
|
171 |
+
/>,
|
172 |
+
<TextControl
|
173 |
+
label={__('Page')}
|
174 |
+
placeholder={__('1')}
|
175 |
+
type={'number'}
|
176 |
+
min={1}
|
177 |
+
value={props.attributes.page || 1}
|
178 |
+
onChange={(value) => {
|
179 |
+
props.setAttributes({page: parseInt(value) || 1})
|
180 |
+
}}
|
181 |
+
/>,
|
182 |
+
etWarning
|
183 |
+
], 'displayOptions', {props})}
|
184 |
+
</PanelBody>,
|
185 |
+
], {props})
|
186 |
+
|
187 |
+
console.warn({panels})
|
188 |
+
|
189 |
+
return <div>
|
190 |
+
<ServerSideRender
|
191 |
+
block={'wpra-shortcode/wpra-shortcode'}
|
192 |
+
attributes={props.attributes}
|
193 |
+
className={'wpra-gutenberg-block'}
|
194 |
+
/>
|
195 |
+
{applyFilters('wpra.gutenbergBlock.before', [], {props})}
|
196 |
+
<InspectorControls>
|
197 |
+
{panels}
|
198 |
</InspectorControls>
|
199 |
+
{applyFilters('wpra.gutenbergBlock.after', [], {props})}
|
200 |
</div>
|
201 |
},
|
202 |
|
206 |
save: function (props) {
|
207 |
return null
|
208 |
}
|
209 |
+
})
|
@@ -11,7 +11,8 @@ jQuery(document).ready(($) => {
|
|
11 |
const template = params.template
|
12 |
delete params.template
|
13 |
|
14 |
-
let
|
|
|
15 |
|
16 |
$.ajax({
|
17 |
type: 'POST',
|
@@ -19,7 +20,9 @@ jQuery(document).ready(($) => {
|
|
19 |
data: JSON.stringify(params),
|
20 |
contentType: 'application/json',
|
21 |
}).done((data) => {
|
22 |
-
$
|
|
|
|
|
23 |
})
|
24 |
}
|
25 |
|
11 |
const template = params.template
|
12 |
delete params.template
|
13 |
|
14 |
+
let tmp = template.length? template : '0'
|
15 |
+
let url = WpraPagination.baseUri.replace('%s', tmp)
|
16 |
|
17 |
$.ajax({
|
18 |
type: 'POST',
|
20 |
data: JSON.stringify(params),
|
21 |
contentType: 'application/json',
|
22 |
}).done((data) => {
|
23 |
+
$newEl = $(data.html)
|
24 |
+
$newEl.find('.colorbox').colorbox({iframe:true, width:'80%', height:'80%'})
|
25 |
+
$targetEl.replaceWith($newEl)
|
26 |
})
|
27 |
}
|
28 |
|
@@ -1,11 +0,0 @@
|
|
1 |
-
import Vue from 'vue'
|
2 |
-
import NoticeBlock from 'app/components/NoticeBlock'
|
3 |
-
|
4 |
-
new Vue({
|
5 |
-
el: '#wpra-settings-app',
|
6 |
-
render (h) {
|
7 |
-
return h(NoticeBlock, {
|
8 |
-
props: WpraSettings.notice
|
9 |
-
})
|
10 |
-
}
|
11 |
-
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -9,6 +9,7 @@ import NoticeBlock from 'app/components/NoticeBlock'
|
|
9 |
import deepmerge from 'app/utils/deepmerge'
|
10 |
import DataChangesAware from 'app/mixins/DataChangesAware'
|
11 |
import jsonClone from 'app/utils/jsonClone'
|
|
|
12 |
import { copyToClipboard } from 'app/utils/copy'
|
13 |
|
14 |
export default {
|
@@ -42,7 +43,9 @@ export default {
|
|
42 |
},
|
43 |
computed: {
|
44 |
previewUrl () {
|
45 |
-
|
|
|
|
|
46 |
}
|
47 |
},
|
48 |
methods: {
|
@@ -182,9 +185,7 @@ export default {
|
|
182 |
title={'Setting up your Templates'}
|
183 |
body={'Templates are used to display the items imported using WP RSS Aggregator. Choose the preferred options ' +
|
184 |
'below and use them anywhere on your site via our <a href="https://kb.wprssaggregator.com/article/54-displaying-imported-items-shortcode#tinymce" target="_blank">shortcode</a> ' +
|
185 |
-
'or our <a href="https://kb.wprssaggregator.com/article/454-displaying-imported-items-block-gutenberg" target="_blank">block</a>.
|
186 |
-
'<br/><br/>' +
|
187 |
-
'More template types and options will be made available soon. Have you got a template idea in mind? <a href="https://www.wprssaggregator.com/request-a-template/" target="_blank">Share it with us.</a>'}
|
188 |
learnMore={'https://kb.wprssaggregator.com/article/457-templates'}
|
189 |
/>
|
190 |
|
@@ -247,7 +248,7 @@ export default {
|
|
247 |
disabled={this.model.type === '__built_in'}
|
248 |
inputDisabled={!WpraTemplates.options.is_type_enabled}
|
249 |
description={
|
250 |
-
WpraTemplates.options.is_type_enabled ? null : '<div class="disable-ignored"><strong class="disable-ignored"
|
251 |
}
|
252 |
/>
|
253 |
{
|
@@ -281,108 +282,121 @@ export default {
|
|
281 |
<Input type="number"
|
282 |
label={'Number of items to show'}
|
283 |
value={this.model.options.limit || ''}
|
284 |
-
onInput={(e) => this.model.options.limit = e}
|
285 |
title={this.tooltips.options.limit}
|
|
|
|
|
286 |
/>
|
287 |
|
288 |
-
<
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
|
|
|
|
317 |
|
318 |
-
<
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
|
|
|
|
339 |
|
340 |
-
<
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
|
|
|
|
354 |
|
355 |
-
<
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
|
|
|
|
|
|
370 |
|
371 |
-
<
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
|
|
|
|
386 |
</Postbox>
|
387 |
</Main>
|
388 |
<Sidebar>
|
@@ -437,20 +451,31 @@ export default {
|
|
437 |
onInput={(e) => this.model.options.links_behavior = e}
|
438 |
title={this.tooltips.options.links_behavior}
|
439 |
/>
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
448 |
/>
|
449 |
</Postbox>
|
450 |
<Postbox id="template-custom-css" title="Custom Style" context={this}>
|
451 |
<Input type="text"
|
452 |
class="form-input--vertical"
|
453 |
-
label={'Custom
|
454 |
value={this.model.options.custom_css_classname}
|
455 |
onInput={(e) => this.model.options.custom_css_classname = e}
|
456 |
title={this.tooltips.options.custom_css_classname}
|
9 |
import deepmerge from 'app/utils/deepmerge'
|
10 |
import DataChangesAware from 'app/mixins/DataChangesAware'
|
11 |
import jsonClone from 'app/utils/jsonClone'
|
12 |
+
import base64 from 'app/utils/base64'
|
13 |
import { copyToClipboard } from 'app/utils/copy'
|
14 |
|
15 |
export default {
|
43 |
},
|
44 |
computed: {
|
45 |
previewUrl () {
|
46 |
+
let options = base64.encode(JSON.stringify(this.model.options))
|
47 |
+
|
48 |
+
return `${WpraGlobal.admin_base_url}?wpra_preview_template=${this.router.params.id}&wpra_template_options=${options}`
|
49 |
}
|
50 |
},
|
51 |
methods: {
|
185 |
title={'Setting up your Templates'}
|
186 |
body={'Templates are used to display the items imported using WP RSS Aggregator. Choose the preferred options ' +
|
187 |
'below and use them anywhere on your site via our <a href="https://kb.wprssaggregator.com/article/54-displaying-imported-items-shortcode#tinymce" target="_blank">shortcode</a> ' +
|
188 |
+
'or our <a href="https://kb.wprssaggregator.com/article/454-displaying-imported-items-block-gutenberg" target="_blank">block</a>.'}
|
|
|
|
|
189 |
learnMore={'https://kb.wprssaggregator.com/article/457-templates'}
|
190 |
/>
|
191 |
|
248 |
disabled={this.model.type === '__built_in'}
|
249 |
inputDisabled={!WpraTemplates.options.is_type_enabled}
|
250 |
description={
|
251 |
+
WpraTemplates.options.is_type_enabled ? null : '<div class="disable-ignored"><strong class="disable-ignored">Get more template types, including a customisable grid template.</strong> <a target="_blank" href="https://www.wprssaggregator.com/extensions/templates/" class="disable-ignored">Learn more.</a></div>'
|
252 |
}
|
253 |
/>
|
254 |
{
|
282 |
<Input type="number"
|
283 |
label={'Number of items to show'}
|
284 |
value={this.model.options.limit || ''}
|
285 |
+
onInput={(e) => this.model.options.limit = (e === '') ? 0 : e}
|
286 |
title={this.tooltips.options.limit}
|
287 |
+
placeholder={"Show all items"}
|
288 |
+
min="0"
|
289 |
/>
|
290 |
|
291 |
+
<div id={'wpra-list-template-publish-date'} style={{paddingTop: '10px'}}>
|
292 |
+
<Input type="checkbox"
|
293 |
+
label={'Show publish date'}
|
294 |
+
value={this.model.options.date_enabled}
|
295 |
+
onInput={(e) => this.model.options.date_enabled = e}
|
296 |
+
style={{fontWeight: 'bold'}}
|
297 |
+
title={this.tooltips.options.date_enabled}
|
298 |
+
/>
|
299 |
+
<Input type="text"
|
300 |
+
label={'Date prefix'}
|
301 |
+
value={this.model.options.date_prefix}
|
302 |
+
onInput={(e) => this.model.options.date_prefix = e}
|
303 |
+
disabled={!this.model.options.date_enabled}
|
304 |
+
title={this.tooltips.options.date_prefix}
|
305 |
+
/>
|
306 |
+
<Input type="text"
|
307 |
+
label={'Date format'}
|
308 |
+
value={this.model.options.date_format}
|
309 |
+
onInput={(e) => this.model.options.date_format = e}
|
310 |
+
disabled={this.model.options.date_use_time_ago || !this.model.options.date_enabled}
|
311 |
+
title={this.tooltips.options.date_format}
|
312 |
+
/>
|
313 |
+
<Input type="checkbox"
|
314 |
+
label={'Use "time ago" format'}
|
315 |
+
description={'Example: 20 minutes ago'}
|
316 |
+
value={this.model.options.date_use_time_ago}
|
317 |
+
onInput={(e) => this.model.options.date_use_time_ago = e}
|
318 |
+
disabled={!this.model.options.date_enabled}
|
319 |
+
title={this.tooltips.options.date_use_time_ago}
|
320 |
+
/>
|
321 |
+
</div>
|
322 |
|
323 |
+
<div id={'wpra-list-template-source'} style={{paddingTop: '10px'}}>
|
324 |
+
<Input type="checkbox"
|
325 |
+
label={'Show source name'}
|
326 |
+
value={this.model.options.source_enabled}
|
327 |
+
onInput={(e) => this.model.options.source_enabled = e}
|
328 |
+
style={{fontWeight: 'bold'}}
|
329 |
+
title={this.tooltips.options.source_enabled}
|
330 |
+
/>
|
331 |
+
<Input type="text"
|
332 |
+
label={'Source prefix'}
|
333 |
+
value={this.model.options.source_prefix}
|
334 |
+
onInput={(e) => this.model.options.source_prefix = e}
|
335 |
+
disabled={!this.model.options.source_enabled}
|
336 |
+
title={this.tooltips.options.source_prefix}
|
337 |
+
/>
|
338 |
+
<Input type="checkbox"
|
339 |
+
label={'Link source name'}
|
340 |
+
value={this.model.options.source_is_link}
|
341 |
+
onInput={(e) => this.model.options.source_is_link = e}
|
342 |
+
disabled={!this.model.options.source_enabled}
|
343 |
+
title={this.tooltips.options.source_is_link}
|
344 |
+
/>
|
345 |
+
</div>
|
346 |
|
347 |
+
<div id={'wpra-list-template-author'} style={{paddingTop: '10px'}}>
|
348 |
+
<Input type="checkbox"
|
349 |
+
label={'Show author name'}
|
350 |
+
value={this.model.options.author_enabled}
|
351 |
+
onInput={(e) => this.model.options.author_enabled = e}
|
352 |
+
style={{fontWeight: 'bold'}}
|
353 |
+
title={this.tooltips.options.author_enabled}
|
354 |
+
/>
|
355 |
+
<Input type="text"
|
356 |
+
label={'Author prefix'}
|
357 |
+
value={this.model.options.author_prefix}
|
358 |
+
onInput={(e) => this.model.options.author_prefix = e}
|
359 |
+
disabled={!this.model.options.author_enabled}
|
360 |
+
title={this.tooltips.options.author_prefix}
|
361 |
+
/>
|
362 |
+
</div>
|
363 |
|
364 |
+
<div id={'wpra-list-template-pagination'} style={{paddingTop: '10px'}}>
|
365 |
+
<Input type="checkbox"
|
366 |
+
label={'Pagination'}
|
367 |
+
value={this.model.options.pagination}
|
368 |
+
onInput={(e) => this.model.options.pagination = e}
|
369 |
+
style={{fontWeight: 'bold'}}
|
370 |
+
title={this.tooltips.options.pagination}
|
371 |
+
disabled={parseInt(this.model.options.limit) < 1 || !this.model.options.limit}
|
372 |
+
/>
|
373 |
+
<Input type="select"
|
374 |
+
label={'Pagination style'}
|
375 |
+
options={WpraTemplates.options.pagination_type}
|
376 |
+
value={this.model.options.pagination_type}
|
377 |
+
onInput={(e) => this.model.options.pagination_type = e}
|
378 |
+
disabled={!this.model.options.pagination || parseInt(this.model.options.limit) < 1 || !this.model.options.limit}
|
379 |
+
title={this.tooltips.options.pagination_type}
|
380 |
+
/>
|
381 |
+
</div>
|
382 |
|
383 |
+
<div id={'wpra-list-template-bullets'} style={{paddingTop: '10px'}}>
|
384 |
+
<Input type="checkbox"
|
385 |
+
label={'Show bullets'}
|
386 |
+
value={this.model.options.bullets_enabled}
|
387 |
+
onInput={(e) => this.model.options.bullets_enabled = e}
|
388 |
+
style={{fontWeight: 'bold'}}
|
389 |
+
title={this.tooltips.options.bullets_enabled}
|
390 |
+
/>
|
391 |
+
<Input type="select"
|
392 |
+
label={'Bullet style'}
|
393 |
+
options={WpraTemplates.options.bullet_type}
|
394 |
+
value={this.model.options.bullet_type}
|
395 |
+
onInput={(e) => this.model.options.bullet_type = e}
|
396 |
+
disabled={!this.model.options.bullets_enabled}
|
397 |
+
title={this.tooltips.options.bullet_type}
|
398 |
+
/>
|
399 |
+
</div>
|
400 |
</Postbox>
|
401 |
</Main>
|
402 |
<Sidebar>
|
451 |
onInput={(e) => this.model.options.links_behavior = e}
|
452 |
title={this.tooltips.options.links_behavior}
|
453 |
/>
|
454 |
+
{
|
455 |
+
(this.model.options.links_behavior === 'lightbox' )?
|
456 |
+
<div class="notice notice-info notice-alt">
|
457 |
+
<p>Some sites may not allow their content to be shown in a lightbox.</p>
|
458 |
+
<p>Embedded content usually works. Try ticking the below checkbox.</p>
|
459 |
+
<p>
|
460 |
+
<a href="https://kb.wprssaggregator.com/article/471-q-why-wont-some-of-my-feed-items-work-with-the-lightbox-link-behaviour-for-templates"
|
461 |
+
target="_blank">
|
462 |
+
{'Learn more'}
|
463 |
+
</a>
|
464 |
+
</p>
|
465 |
+
</div>
|
466 |
+
: null
|
467 |
+
}
|
468 |
+
<Input type="checkbox"
|
469 |
+
label={'Set links to open embeds'}
|
470 |
+
value={this.model.options.link_to_embed}
|
471 |
+
onInput={(e) => this.model.options.link_to_embed = e}
|
472 |
+
title={this.tooltips.options.link_to_embed}
|
473 |
/>
|
474 |
</Postbox>
|
475 |
<Postbox id="template-custom-css" title="Custom Style" context={this}>
|
476 |
<Input type="text"
|
477 |
class="form-input--vertical"
|
478 |
+
label={'Custom HTML class name'}
|
479 |
value={this.model.options.custom_css_classname}
|
480 |
onInput={(e) => this.model.options.custom_css_classname = e}
|
481 |
title={this.tooltips.options.custom_css_classname}
|
@@ -3,7 +3,6 @@ import RouteLink from 'app/components/RouteLink'
|
|
3 |
import Input from 'app/components/Input'
|
4 |
import BottomPanel from 'app/components/BottomPanel'
|
5 |
import jsonClone from 'app/utils/jsonClone'
|
6 |
-
import NoticeBlock from 'app/components/NoticeBlock'
|
7 |
import collect from 'app/utils/Collection'
|
8 |
|
9 |
export default {
|
@@ -233,9 +232,21 @@ export default {
|
|
233 |
]
|
234 |
},
|
235 |
style: ({row}) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
return [
|
237 |
-
<div>
|
238 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
},
|
240 |
previewTemplate: ({row}) => {
|
241 |
return [
|
@@ -296,19 +307,6 @@ export default {
|
|
296 |
/>
|
297 |
</p>
|
298 |
|
299 |
-
<NoticeBlock
|
300 |
-
id={'templates-introduction'}
|
301 |
-
title={'🎉 Welcome to Templates for WP RSS Aggregator!'}
|
302 |
-
body={'As of version 4.13, we have introduced the concept of templates to replace the display settings that were ' +
|
303 |
-
'previously available in the WP RSS Aggregator settings. These templates provide you with much more ' +
|
304 |
-
'flexibility and new designs. They also come with a revamped <a target="_blank" href="https://kb.wprssaggregator.com/article/54-displaying-imported-items-shortcode">TinyMCE shortcode button</a> for the Classic Editor and ' +
|
305 |
-
'a <em><a href="https://kb.wprssaggregator.com/article/454-displaying-imported-items-block-gutenberg" target="_blank">brand new block</a></em> for those using WP 5.0+ with the Gutenberg block editor!<br/><br/>There are new template types coming ' +
|
306 |
-
'your way in the coming weeks, but for now, the <em>list template type</em> replicates the previous options. ' +
|
307 |
-
'Please note that the <em>Default</em> template below is set up using your pre-existing display options, nothing is lost or changed.'}
|
308 |
-
learnMore={'https://www.wprssaggregator.com/core-version-4-13-celebrating-one-million-downloads/'}
|
309 |
-
visible={!!WpraGlobal.is_existing_user}
|
310 |
-
/>
|
311 |
-
|
312 |
<hr class="wp-header-end"/>
|
313 |
|
314 |
<VueTable
|
3 |
import Input from 'app/components/Input'
|
4 |
import BottomPanel from 'app/components/BottomPanel'
|
5 |
import jsonClone from 'app/utils/jsonClone'
|
|
|
6 |
import collect from 'app/utils/Collection'
|
7 |
|
8 |
export default {
|
232 |
]
|
233 |
},
|
234 |
style: ({row}) => {
|
235 |
+
if (this.filters[row.type]) {
|
236 |
+
return [
|
237 |
+
<div>{this.filters[row.type]}</div>
|
238 |
+
]
|
239 |
+
}
|
240 |
+
|
241 |
return [
|
242 |
+
<div>
|
243 |
+
{this.filters.list}
|
244 |
+
|
245 |
+
<span style={{opacity: 0.7, fontSize: '90%'}}>
|
246 |
+
(Missing type: <code>{row.type}</code>)
|
247 |
+
</span>
|
248 |
+
</div>
|
249 |
+
];
|
250 |
},
|
251 |
previewTemplate: ({row}) => {
|
252 |
return [
|
307 |
/>
|
308 |
</p>
|
309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
<hr class="wp-header-end"/>
|
311 |
|
312 |
<VueTable
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
let Base64 = {
|
2 |
+
|
3 |
+
// private property
|
4 |
+
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
5 |
+
|
6 |
+
// public method for encoding
|
7 |
+
encode: function (input) {
|
8 |
+
var output = "";
|
9 |
+
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
10 |
+
var i = 0;
|
11 |
+
|
12 |
+
input = Base64._utf8_encode(input);
|
13 |
+
|
14 |
+
while (i < input.length) {
|
15 |
+
|
16 |
+
chr1 = input.charCodeAt(i++);
|
17 |
+
chr2 = input.charCodeAt(i++);
|
18 |
+
chr3 = input.charCodeAt(i++);
|
19 |
+
|
20 |
+
enc1 = chr1 >> 2;
|
21 |
+
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
22 |
+
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
23 |
+
enc4 = chr3 & 63;
|
24 |
+
|
25 |
+
if (isNaN(chr2)) {
|
26 |
+
enc3 = enc4 = 64;
|
27 |
+
} else if (isNaN(chr3)) {
|
28 |
+
enc4 = 64;
|
29 |
+
}
|
30 |
+
|
31 |
+
output = output +
|
32 |
+
this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
|
33 |
+
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
|
34 |
+
|
35 |
+
}
|
36 |
+
|
37 |
+
return output;
|
38 |
+
},
|
39 |
+
|
40 |
+
// public method for decoding
|
41 |
+
decode: function (input) {
|
42 |
+
var output = "";
|
43 |
+
var chr1, chr2, chr3;
|
44 |
+
var enc1, enc2, enc3, enc4;
|
45 |
+
var i = 0;
|
46 |
+
|
47 |
+
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
48 |
+
|
49 |
+
while (i < input.length) {
|
50 |
+
|
51 |
+
enc1 = this._keyStr.indexOf(input.charAt(i++));
|
52 |
+
enc2 = this._keyStr.indexOf(input.charAt(i++));
|
53 |
+
enc3 = this._keyStr.indexOf(input.charAt(i++));
|
54 |
+
enc4 = this._keyStr.indexOf(input.charAt(i++));
|
55 |
+
|
56 |
+
chr1 = (enc1 << 2) | (enc2 >> 4);
|
57 |
+
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
58 |
+
chr3 = ((enc3 & 3) << 6) | enc4;
|
59 |
+
|
60 |
+
output = output + String.fromCharCode(chr1);
|
61 |
+
|
62 |
+
if (enc3 != 64) {
|
63 |
+
output = output + String.fromCharCode(chr2);
|
64 |
+
}
|
65 |
+
if (enc4 != 64) {
|
66 |
+
output = output + String.fromCharCode(chr3);
|
67 |
+
}
|
68 |
+
|
69 |
+
}
|
70 |
+
|
71 |
+
output = Base64._utf8_decode(output);
|
72 |
+
|
73 |
+
return output;
|
74 |
+
|
75 |
+
},
|
76 |
+
|
77 |
+
// private method for UTF-8 encoding
|
78 |
+
_utf8_encode: function (string) {
|
79 |
+
string = string.replace(/\r\n/g, "\n");
|
80 |
+
var utftext = "";
|
81 |
+
|
82 |
+
for (var n = 0; n < string.length; n++) {
|
83 |
+
|
84 |
+
var c = string.charCodeAt(n);
|
85 |
+
|
86 |
+
if (c < 128) {
|
87 |
+
utftext += String.fromCharCode(c);
|
88 |
+
} else if ((c > 127) && (c < 2048)) {
|
89 |
+
utftext += String.fromCharCode((c >> 6) | 192);
|
90 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
91 |
+
} else {
|
92 |
+
utftext += String.fromCharCode((c >> 12) | 224);
|
93 |
+
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
94 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
95 |
+
}
|
96 |
+
|
97 |
+
}
|
98 |
+
|
99 |
+
return utftext;
|
100 |
+
},
|
101 |
+
|
102 |
+
// private method for UTF-8 decoding
|
103 |
+
_utf8_decode: function (utftext) {
|
104 |
+
var string = "";
|
105 |
+
var i = 0;
|
106 |
+
var c = 0, c1 = 0, c2 = 0;
|
107 |
+
|
108 |
+
while (i < utftext.length) {
|
109 |
+
|
110 |
+
c = utftext.charCodeAt(i);
|
111 |
+
|
112 |
+
if (c < 128) {
|
113 |
+
string += String.fromCharCode(c);
|
114 |
+
i++;
|
115 |
+
} else if ((c > 191) && (c < 224)) {
|
116 |
+
c2 = utftext.charCodeAt(i + 1);
|
117 |
+
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
|
118 |
+
i += 2;
|
119 |
+
} else {
|
120 |
+
c2 = utftext.charCodeAt(i + 1);
|
121 |
+
c3 = utftext.charCodeAt(i + 2);
|
122 |
+
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
|
123 |
+
i += 3;
|
124 |
+
}
|
125 |
+
|
126 |
+
}
|
127 |
+
|
128 |
+
return string;
|
129 |
+
}
|
130 |
+
|
131 |
+
}
|
132 |
+
|
133 |
+
export default Base64
|
@@ -1,11 +1,11 @@
|
|
1 |
=== WP RSS Aggregator ===
|
2 |
-
Contributors: RebelCode, jeangalea, markzahra, Mekku, xedin.unknown
|
3 |
Plugin URI: https://www.wprssaggregator.com
|
4 |
Tags: RSS import, RSS aggregator, feed import, content curation, feed to post
|
5 |
Requires at least: 4.0 or higher
|
6 |
-
Tested up to: 5.
|
7 |
-
Requires PHP: 5.4
|
8 |
-
Stable tag: 4.
|
9 |
License: GPLv3
|
10 |
|
11 |
WP RSS Aggregator is the original & most popular WordPress solution for importing RSS feeds, auto-blogging, content curation & aggregation.
|
@@ -17,35 +17,27 @@ WP RSS Aggregator is the original and best plugin for importing, merging and dis
|
|
17 |
== Automatically import RSS feeds & display them on your site ==
|
18 |
|
19 |
* No limit on the number of sources to import from.
|
|
|
20 |
* No limit on the number of items to import.
|
21 |
-
* Automate each feed's import with
|
22 |
-
*
|
23 |
-
*
|
24 |
-
* Show or hide pagination on your templates, and display specific pages.
|
25 |
-
* Use our [wp-rss-aggregator] [shortcode](https://kb.wprssaggregator.com/article/54-how-to-use-the-shortcode-to-display-feed-items) or [Gutenberg block](https://kb.wprssaggregator.com/article/454-displaying-imported-items-block-gutenberg) to display items.
|
26 |
* Feed auto-discovery (add sources without the exact RSS feed URL).
|
27 |
-
*
|
28 |
-
*
|
29 |
-
* Limit the
|
30 |
-
* Create a custom RSS feed from imported items
|
31 |
* Extendable via action and filter hooks.
|
32 |
|
33 |
[Click here to learn more about the free WP RSS Aggregator plugin.](https://www.wprssaggregator.com/extension/core-plugin/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_learn_more&utm_content=learn_more)
|
34 |
|
35 |
-
== NEW SINCE v4.13: Templates, gutenberg block, improved logs ==
|
36 |
-
|
37 |
-
Create as many [templates](https://kb.wprssaggregator.com/article/457-templates) as you need to display feed items in different ways across your site. Be it on the homepage, in a sidebar, or in the footer, you can specify which template to use and which sources to display in each individual area.
|
38 |
-
|
39 |
-
Our brand new [gutenberg block](https://kb.wprssaggregator.com/article/454-displaying-imported-items-block-gutenberg) ensures seamless integration with WordPress. Choose the template to use and the sources to display, then you're all set (plus a few other customisation options). If you are using the classic WordPress editor, we've got you covered. Click on the WP RSS Aggregator button in the TinyMCE editor to open our shortcode modal. It has all the same options as the block, ensuring that no functionality is lost no matter what you use.
|
40 |
-
|
41 |
-
[Debug logs](https://kb.wprssaggregator.com/article/110-error-logs-system-information) are an important part of any site. From time to time, some feeds may have problems that are hard to find. With our new and improved logging system we are reducing the time it takes to find the problem and making it easier to figure out the best solution.
|
42 |
-
|
43 |
== Who is the plugin for?? ==
|
44 |
|
45 |
Importing and displaying RSS feeds is helpful for many types of sites:
|
46 |
|
47 |
* Curate news, videos and more from the top sources in your niche.
|
48 |
* Add related posts from other sites to your site.
|
|
|
49 |
* Curate job, real estate or other listings for your market or niche.
|
50 |
* Embed videos from other sources (Youtube) to engage more visitors.
|
51 |
* Aggregate podcast episodes related to your hobby or profession.
|
@@ -56,7 +48,7 @@ For example...
|
|
56 |
|
57 |
* [WP News Desk](http://wpnewsdesk.com/) curates WordPress news, tutorials and more from over 100 trusted sources.
|
58 |
* [Travel Blogger Community](http://travelbloggercommunity.com/) does something similar to share blog posts from well-known travellers.
|
59 |
-
* [Crypto Headlines](https://cryptoheadlines.com/youtube-videos/) shares Youtube videos from popular Youtubers.
|
60 |
* [Euro Finance Blogs](https://eurofinanceblogs.com/) curates content on investment, personal finance and early retirement.
|
61 |
|
62 |
Browse through our [**Showcase**](https://www.wprssaggregator.com/showcase/) to see how WP RSS Aggregator is being put to great use on a large variety of WordPress sites.
|
@@ -78,37 +70,21 @@ Importing RSS feeds alone won't improve your site's SEO, however, if you curate
|
|
78 |
|
79 |
*Quick note: Please don't steal other people's work; give credit where it's due.*
|
80 |
|
81 |
-
== Premium add-ons
|
82 |
|
83 |
-
|
84 |
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
-
|
88 |
-
* **[Full Text RSS Feeds](https://www.wprssaggregator.com/extension/full-text-rss-feeds/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_ftr_link&utm_content=ftr_link)**
|
89 |
-
* **[Keyword Filtering](https://www.wprssaggregator.com/extension/keyword-filtering/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_kf_link&utm_content=kf_link)**
|
90 |
|
91 |
[youtube https://www.youtube.com/watch?v=-2z_bNws2MM]
|
92 |
|
93 |
-
Here's a quick look at what these add-ons can offer:
|
94 |
-
|
95 |
-
* Import Posts as Drafts (to edit or approve) or set them to Publish automatically.
|
96 |
-
* Automatically assign categories and/or tags to imported posts.
|
97 |
-
* Import all media within the content and automatically set featured images.
|
98 |
-
* Import the original author's details or assign another user as the author.
|
99 |
-
* Automatically add you own custom content before or after imported posts.
|
100 |
-
* Custom field mapping to map the data you want to where you need it.
|
101 |
-
* Exclude unwanted elements from the original source with extraction rules.
|
102 |
-
* Import only the items you want with specific keyword, phrase and tag filters.
|
103 |
-
* Connect to our premium full text service to import the full content from sources that are missing text, images and more in the original feeds.
|
104 |
-
|
105 |
-
== Other add-Ons ==
|
106 |
-
|
107 |
-
* **[Excerpts & Thumbnails](https://www.wprssaggregator.com/extension/excerpts-thumbnails/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_et_link&utm_content=et_link)**
|
108 |
-
* **[Categories](https://www.wprssaggregator.com/extension/categories/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_cat_link&utm_content=cat_link)**
|
109 |
-
|
110 |
-
The above two add-ons enable you to enhance the typical feeds list that you can create with our shortcode or block templates. They also form part of our [Simple Feeds Bundle](https://www.wprssaggregator.com/extension/simple-feeds-bundle/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_afb_link&utm_content=afb_link).
|
111 |
-
|
112 |
== We stand behind what we build ==
|
113 |
|
114 |
Our comprehensive [Knowledge Base](https://kb.wprssaggregator.com/) provides you with everything you need to install, set up and customise the plugin to your needs. You can also browse through a number of FAQs to get started.
|
@@ -151,14 +127,14 @@ Method 1:
|
|
151 |
> 2. Click the "Add New" button.
|
152 |
> 3. Search for "WP RSS Aggregator".
|
153 |
> 4. When found, click on the "Install" button, then hit the "Activate" button once it has installed.
|
154 |
-
> 5. Go to the RSS Aggregator menu item, then set up your [feed sources](https://docs.wprssaggregator.com/adding-a-feed-source-importing-as-feed-items/), [templates](https://kb.wprssaggregator.com/article/457-templates) [general settings](https://docs.wprssaggregator.com/general-plugin-settings/).
|
155 |
|
156 |
Method 2:
|
157 |
|
158 |
> 1. Click on the "Download" button above.
|
159 |
> 2. Upload the wp-rss-aggregator.zip file to your site's `/wp-content/plugins/` directory via FTP.
|
160 |
> 3. Activate the WP RSS Aggregator plugin from the 'Plugins' section in your dashboard.
|
161 |
-
> 4. Go to the RSS Aggregator menu item, then set up your [feed sources](https://docs.wprssaggregator.com/adding-a-feed-source-importing-as-feed-items/), [templates](https://kb.wprssaggregator.com/article/457-templates) [general settings](https://docs.wprssaggregator.com/general-plugin-settings/).
|
162 |
|
163 |
*DISPLAYING THE FEED ITEMS*
|
164 |
|
@@ -283,12 +259,54 @@ Our complete Knowledge Base with FAQs can be found [here](https://kb.wprssaggreg
|
|
283 |
|
284 |
== Changelog ==
|
285 |
|
286 |
-
= 4.
|
287 |
-
|
288 |
-
*
|
289 |
-
*
|
290 |
-
*
|
291 |
-
*
|
292 |
-
*
|
293 |
-
*
|
294 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
=== WP RSS Aggregator ===
|
2 |
+
Contributors: RebelCode, jeangalea, markzahra, Mekku, xedin.unknown
|
3 |
Plugin URI: https://www.wprssaggregator.com
|
4 |
Tags: RSS import, RSS aggregator, feed import, content curation, feed to post
|
5 |
Requires at least: 4.0 or higher
|
6 |
+
Tested up to: 5.2.2
|
7 |
+
Requires PHP: 5.4
|
8 |
+
Stable tag: 4.14
|
9 |
License: GPLv3
|
10 |
|
11 |
WP RSS Aggregator is the original & most popular WordPress solution for importing RSS feeds, auto-blogging, content curation & aggregation.
|
17 |
== Automatically import RSS feeds & display them on your site ==
|
18 |
|
19 |
* No limit on the number of sources to import from.
|
20 |
+
* Manage all your sources from a single page.
|
21 |
* No limit on the number of items to import.
|
22 |
+
* Automate each feed's import with unique or global schedules.
|
23 |
+
* Customisable [templates](https://kb.wprssaggregator.com/article/457-templates) with various styling options.
|
24 |
+
* Built-in [shortcode](https://kb.wprssaggregator.com/article/54-how-to-use-the-shortcode-to-display-feed-items) and [block](https://kb.wprssaggregator.com/article/454-displaying-imported-items-block-gutenberg) to display items.
|
|
|
|
|
25 |
* Feed auto-discovery (add sources without the exact RSS feed URL).
|
26 |
+
* Youtube importing using just a channel or user URL.
|
27 |
+
* Playable Youtube videos directly on your site.
|
28 |
+
* Limit the items stored and fetched for better performance.
|
29 |
+
* Create a custom RSS feed from imported items.
|
30 |
* Extendable via action and filter hooks.
|
31 |
|
32 |
[Click here to learn more about the free WP RSS Aggregator plugin.](https://www.wprssaggregator.com/extension/core-plugin/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_learn_more&utm_content=learn_more)
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
== Who is the plugin for?? ==
|
35 |
|
36 |
Importing and displaying RSS feeds is helpful for many types of sites:
|
37 |
|
38 |
* Curate news, videos and more from the top sources in your niche.
|
39 |
* Add related posts from other sites to your site.
|
40 |
+
* Share Youtube videos anywhere on your site.
|
41 |
* Curate job, real estate or other listings for your market or niche.
|
42 |
* Embed videos from other sources (Youtube) to engage more visitors.
|
43 |
* Aggregate podcast episodes related to your hobby or profession.
|
48 |
|
49 |
* [WP News Desk](http://wpnewsdesk.com/) curates WordPress news, tutorials and more from over 100 trusted sources.
|
50 |
* [Travel Blogger Community](http://travelbloggercommunity.com/) does something similar to share blog posts from well-known travellers.
|
51 |
+
* [Crypto Headlines](https://cryptoheadlines.com/youtube-videos/)' videos page shares Youtube videos from popular Youtubers in the Crypto world.
|
52 |
* [Euro Finance Blogs](https://eurofinanceblogs.com/) curates content on investment, personal finance and early retirement.
|
53 |
|
54 |
Browse through our [**Showcase**](https://www.wprssaggregator.com/showcase/) to see how WP RSS Aggregator is being put to great use on a large variety of WordPress sites.
|
70 |
|
71 |
*Quick note: Please don't steal other people's work; give credit where it's due.*
|
72 |
|
73 |
+
== Premium add-ons for additional functionality ==
|
74 |
|
75 |
+
WP RSS Aggregator can be extended through a set of [premium add-ons](https://www.wprssaggregator.com/extensions/) that are also available as part of our discounted [pricing plans](https://www.wprssaggregator.com/pricing/).
|
76 |
|
77 |
+
* **[Templates](https://www.wprssaggregator.com/extension/templates/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_f2p_link&utm_content=f2p_link)** offers premium template types including the fully customisable Grid as well as an Excerpts & Thumbnails template that take your block or shortcake displays to a whole new level!
|
78 |
+
* **[Feed to Post](https://www.wprssaggregator.com/extension/feed-to-post/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_f2p_link&utm_content=f2p_link)** is the most powerful add-on available, enabling you to import items as Posts or any other custom post type. It includes options such as automatically assigning post type, post status, categories, tags, images, authors and much more.
|
79 |
+
* **[Full Text RSS Feeds](https://www.wprssaggregator.com/extension/full-text-rss-feeds/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_ftr_link&utm_content=ftr_link)** takes Feed to Post to the next level by connecting it to our premium full text service. This helps bring in content from sources that don't provide it in their RSS feeds.
|
80 |
+
* **[Keyword Filtering](https://www.wprssaggregator.com/extension/keyword-filtering/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_kf_link&utm_content=kf_link)** enables you to filter the content imported from any source based on keywords, phrases and/or tags.
|
81 |
+
* **[Categories](https://www.wprssaggregator.com/extension/categories/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_cat_link&utm_content=cat_link)** provides a simple way to categorise your sources and keep them organised.
|
82 |
+
* **[WordAi](https://www.wprssaggregator.com/extension/wordai/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_cat_link&utm_content=cat_link)** and **[Spinner Chief](https://www.wprssaggregator.com/extension/spinnerchief/?utm_source=wordpress-dot-org&utm_medium=readme&utm_campaign=readme_cat_link&utm_content=cat_link)** integrate the Feed to Post add-on with the respective 3rd-party content spinning services.
|
83 |
|
84 |
+
Here's a closer look at what the Feed to Post add-on offers:
|
|
|
|
|
85 |
|
86 |
[youtube https://www.youtube.com/watch?v=-2z_bNws2MM]
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
== We stand behind what we build ==
|
89 |
|
90 |
Our comprehensive [Knowledge Base](https://kb.wprssaggregator.com/) provides you with everything you need to install, set up and customise the plugin to your needs. You can also browse through a number of FAQs to get started.
|
127 |
> 2. Click the "Add New" button.
|
128 |
> 3. Search for "WP RSS Aggregator".
|
129 |
> 4. When found, click on the "Install" button, then hit the "Activate" button once it has installed.
|
130 |
+
> 5. Go to the RSS Aggregator menu item, then set up your [feed sources](https://docs.wprssaggregator.com/adding-a-feed-source-importing-as-feed-items/), [templates](https://kb.wprssaggregator.com/article/457-templates) and [general settings](https://docs.wprssaggregator.com/general-plugin-settings/).
|
131 |
|
132 |
Method 2:
|
133 |
|
134 |
> 1. Click on the "Download" button above.
|
135 |
> 2. Upload the wp-rss-aggregator.zip file to your site's `/wp-content/plugins/` directory via FTP.
|
136 |
> 3. Activate the WP RSS Aggregator plugin from the 'Plugins' section in your dashboard.
|
137 |
+
> 4. Go to the RSS Aggregator menu item, then set up your [feed sources](https://docs.wprssaggregator.com/adding-a-feed-source-importing-as-feed-items/), [templates](https://kb.wprssaggregator.com/article/457-templates) and [general settings](https://docs.wprssaggregator.com/general-plugin-settings/).
|
138 |
|
139 |
*DISPLAYING THE FEED ITEMS*
|
140 |
|
259 |
|
260 |
== Changelog ==
|
261 |
|
262 |
+
= 4.14 (2019-07-09) =
|
263 |
+
**Added**
|
264 |
+
* YouTube channel URLs are now supported.
|
265 |
+
* Items imported from YouTube are detected and their embed links are saved.
|
266 |
+
* Embedded YouTube videos can now be shown in a lightbox.
|
267 |
+
* New option to enable or disable the plugin's logging.
|
268 |
+
* New option to set the log age, in days, for daily truncation.
|
269 |
+
* Image URLs are detected and saved in feed item meta, to be used by templates that can show images.
|
270 |
+
* Feed item excerpts are now imported, to be used by templates that can show excerpts.
|
271 |
+
* Activating or pausing feed sources from the Feed Sources page is now asynchronous.
|
272 |
+
* Deleting feed items from the Feed Sources page is now asynchronous.
|
273 |
+
* New plugin-wide error handling to prevent site locks, with the option to deactivate the plugin and its addons.
|
274 |
+
* Feed sources that are missing their respective cron are detected and fixed while on the Feed Sources page.
|
275 |
+
* Added tooltips to various links and controls in the feed source list page.
|
276 |
+
* Import errors are now asynchronously added to the error icon in the feed sources list page.
|
277 |
+
|
278 |
+
**Changed**
|
279 |
+
* Previewing a template no longer requires saving the template.
|
280 |
+
* Redesigned the feed sources page to be more compact and informative at a glance.
|
281 |
+
* The imported item count in the feed sources page is now a link to that feed's imported items.
|
282 |
+
* Improved the responsive styling of the feed sources list table.
|
283 |
+
* The custom feed now uses the Atom 1.0 standard.
|
284 |
+
* Improved the detection of cron scheduling failures, prevent feeds from appearing to be stuck.
|
285 |
+
* Converted log section in the debugging page to use the new module system.
|
286 |
+
* Some options were renamed to be consistent across various plugin pages.
|
287 |
+
* Improved the wording, description and tooltip of the "Import order" option.
|
288 |
+
* Added better error handling during image file creation when using the GD extension.
|
289 |
+
* Rewrote the unique item title checking logic to be faster and more accurate.
|
290 |
+
* Now suppressing "non-numeric value encountered" warnings from SimplePie.
|
291 |
+
* Increased the time by which the plugin detects stuck feeds to 2 minutes.
|
292 |
+
* The addon licensing registration system has been partially converted to the new module system.
|
293 |
+
|
294 |
+
**Fixed**
|
295 |
+
* The default template could not be saved with a particular combination of settings.
|
296 |
+
* The age limit setting was incorrectly being copied to feed sources.
|
297 |
+
* Fixed links in templates not opening in new tabs under certain conditions.
|
298 |
+
* Non image files are no longer wrongly downloaded, cached and treated as images.
|
299 |
+
* The unique titles option caused a PHP warning when enabled.
|
300 |
+
* Fixed use of previously cached version scripts and styles for the Templates page.
|
301 |
+
* Fixed pagination not working correctly when no item limit is set.
|
302 |
+
* Fixed the "Set links as no follow" option not having any effect.
|
303 |
+
* An empty limit for the number of items in a template silently defaults to 5 items.
|
304 |
+
* The name of the user was being shown as the author for feed items that had no author.
|
305 |
+
* Fixed the "property on non-object" error on the Licensing settings page for new addons.
|
306 |
+
* On some sites, multiple default templates are constantly being created.
|
307 |
+
* The default template is auto-created is corrupted data. An update procedure will now fix this data.
|
308 |
+
|
309 |
+
**Removed**
|
310 |
+
* Removed old secure reset code.
|
311 |
+
* The "View items" row action link in the Feed Sources page has been removed.
|
312 |
+
* Removed the "Edit" bulk action from the feed sources list page.
|
@@ -2,6 +2,7 @@
|
|
2 |
|
3 |
namespace RebelCode\Wpra\Core\Data;
|
4 |
|
|
|
5 |
use ArrayIterator;
|
6 |
use Dhii\Exception\CreateInvalidArgumentExceptionCapableTrait;
|
7 |
use Dhii\I18n\StringTranslatingTrait;
|
@@ -34,16 +35,25 @@ class ArrayDataSet extends AbstractDataSet
|
|
34 |
*/
|
35 |
protected $data;
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
/**
|
38 |
* Constructor.
|
39 |
*
|
40 |
* @since 4.13
|
41 |
*
|
42 |
-
* @param array|stdClass|Traversable $data
|
|
|
43 |
*/
|
44 |
-
public function __construct($data)
|
45 |
{
|
46 |
$this->data = $this->_normalizeArray($data);
|
|
|
47 |
}
|
48 |
|
49 |
/**
|
@@ -73,6 +83,14 @@ class ArrayDataSet extends AbstractDataSet
|
|
73 |
*/
|
74 |
protected function set($key, $value)
|
75 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
$this->data[$key] = $value;
|
77 |
}
|
78 |
|
2 |
|
3 |
namespace RebelCode\Wpra\Core\Data;
|
4 |
|
5 |
+
use ArrayAccess;
|
6 |
use ArrayIterator;
|
7 |
use Dhii\Exception\CreateInvalidArgumentExceptionCapableTrait;
|
8 |
use Dhii\I18n\StringTranslatingTrait;
|
35 |
*/
|
36 |
protected $data;
|
37 |
|
38 |
+
/**
|
39 |
+
* @since 4.14
|
40 |
+
*
|
41 |
+
* @var bool
|
42 |
+
*/
|
43 |
+
protected $recursive;
|
44 |
+
|
45 |
/**
|
46 |
* Constructor.
|
47 |
*
|
48 |
* @since 4.13
|
49 |
*
|
50 |
+
* @param array|stdClass|Traversable $data The data store, as an associative array, object or iterator.
|
51 |
+
* @param bool $recursive Whether or not to recursively set data to children data sets.
|
52 |
*/
|
53 |
+
public function __construct($data, $recursive = false)
|
54 |
{
|
55 |
$this->data = $this->_normalizeArray($data);
|
56 |
+
$this->recursive = $recursive;
|
57 |
}
|
58 |
|
59 |
/**
|
83 |
*/
|
84 |
protected function set($key, $value)
|
85 |
{
|
86 |
+
if ($this->recursive && (is_array($value) || $value instanceof ArrayAccess)) {
|
87 |
+
foreach ($value as $subKey => $subValue) {
|
88 |
+
$this->data[$key][$subKey] = $subValue;
|
89 |
+
}
|
90 |
+
|
91 |
+
return;
|
92 |
+
}
|
93 |
+
|
94 |
$this->data[$key] = $value;
|
95 |
}
|
96 |
|
@@ -219,11 +219,19 @@ class WpPostCollection extends AbstractDataSet implements CollectionInterface
|
|
219 |
$result = wp_insert_post($post, true);
|
220 |
|
221 |
if ($result instanceof WP_Error) {
|
222 |
-
throw new RuntimeException($result->get_error_message()
|
223 |
}
|
224 |
|
225 |
$this->lastInsertedId = $result;
|
|
|
|
|
|
|
|
|
|
|
226 |
$this->updatePost($result, $data);
|
|
|
|
|
|
|
227 |
}
|
228 |
|
229 |
/**
|
@@ -401,6 +409,7 @@ class WpPostCollection extends AbstractDataSet implements CollectionInterface
|
|
401 |
{
|
402 |
return [
|
403 |
'post_type' => $this->postType,
|
|
|
404 |
'suppress_filters' => true,
|
405 |
'cache_results' => false,
|
406 |
'posts_per_page' => -1,
|
@@ -434,7 +443,7 @@ class WpPostCollection extends AbstractDataSet implements CollectionInterface
|
|
434 |
}
|
435 |
|
436 |
if ($key === 'num_items') {
|
437 |
-
$queryArgs['posts_per_page'] = $value;
|
438 |
|
439 |
return true;
|
440 |
}
|
219 |
$result = wp_insert_post($post, true);
|
220 |
|
221 |
if ($result instanceof WP_Error) {
|
222 |
+
throw new RuntimeException($result->get_error_message());
|
223 |
}
|
224 |
|
225 |
$this->lastInsertedId = $result;
|
226 |
+
|
227 |
+
// Temporarily disable the filter
|
228 |
+
$tFilter = $this->filter;
|
229 |
+
$this->filter = [];
|
230 |
+
|
231 |
$this->updatePost($result, $data);
|
232 |
+
|
233 |
+
// Restore the filter
|
234 |
+
$this->filter = $tFilter;
|
235 |
}
|
236 |
|
237 |
/**
|
409 |
{
|
410 |
return [
|
411 |
'post_type' => $this->postType,
|
412 |
+
'post_status' => array_keys(get_post_statuses()),
|
413 |
'suppress_filters' => true,
|
414 |
'cache_results' => false,
|
415 |
'posts_per_page' => -1,
|
443 |
}
|
444 |
|
445 |
if ($key === 'num_items') {
|
446 |
+
$queryArgs['posts_per_page'] = (!$value) ? -1 : $value;
|
447 |
|
448 |
return true;
|
449 |
}
|
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Data;
|
4 |
+
|
5 |
+
use ArrayAccess;
|
6 |
+
use RebelCode\Wpra\Core\Util\IteratorDelegateTrait;
|
7 |
+
use RebelCode\Wpra\Core\Util\MergedIterator;
|
8 |
+
use RuntimeException;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* A data set implementation that delegates functionality to one of many children data sets, determined by a callback.
|
12 |
+
*
|
13 |
+
* @since 4.14
|
14 |
+
*/
|
15 |
+
class DelegatorDataSet implements DataSetInterface
|
16 |
+
{
|
17 |
+
/* @since 4.14 */
|
18 |
+
use IteratorDelegateTrait;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The children data set mapping.
|
22 |
+
*
|
23 |
+
* @since 4.14
|
24 |
+
*
|
25 |
+
* @var DataSetInterface[]|ArrayAccess
|
26 |
+
*/
|
27 |
+
protected $children;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* The callable that maps a key to a data set.
|
31 |
+
*
|
32 |
+
* @since 4.14
|
33 |
+
*
|
34 |
+
* @var callable
|
35 |
+
*/
|
36 |
+
protected $mappingFn;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Constructor.
|
40 |
+
*
|
41 |
+
* @since 4.14
|
42 |
+
*
|
43 |
+
* @param ArrayAccess|DataSetInterface[] $children The mapping of data set keys to data set instances.
|
44 |
+
* @param callable $mappingFn The mapping function to use to determine which data set to
|
45 |
+
* use for which keys.
|
46 |
+
*/
|
47 |
+
public function __construct($children, callable $mappingFn)
|
48 |
+
{
|
49 |
+
$this->children = $children;
|
50 |
+
$this->mappingFn = $mappingFn;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Retrieves the child data set to use for the given key.
|
55 |
+
*
|
56 |
+
* @since 4.14
|
57 |
+
*
|
58 |
+
* @param int|string $key The data key.
|
59 |
+
*
|
60 |
+
* @return DataSetInterface The data set instance to use.
|
61 |
+
*
|
62 |
+
* @throws RuntimeException If the key returned by the callable does not correspond to a child data set.
|
63 |
+
*/
|
64 |
+
protected function getChildDataSetFor($key)
|
65 |
+
{
|
66 |
+
$dataSetKey = call_user_func_array($this->mappingFn, [$key]);
|
67 |
+
|
68 |
+
if (!isset($this->children[$dataSetKey])) {
|
69 |
+
throw new RuntimeException(sprintf('Child data set "%s" does not exist', $dataSetKey));
|
70 |
+
}
|
71 |
+
|
72 |
+
return $this->children[$dataSetKey];
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @inheritdoc
|
77 |
+
*
|
78 |
+
* @since 4.14
|
79 |
+
*/
|
80 |
+
public function offsetGet($key)
|
81 |
+
{
|
82 |
+
return $this->getChildDataSetFor($key)->offsetGet($key);
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* @inheritdoc
|
87 |
+
*
|
88 |
+
* @since 4.14
|
89 |
+
*/
|
90 |
+
public function offsetExists($key)
|
91 |
+
{
|
92 |
+
return $this->getChildDataSetFor($key)->offsetExists($key);
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* @inheritdoc
|
97 |
+
*
|
98 |
+
* @since 4.14
|
99 |
+
*/
|
100 |
+
public function offsetSet($key, $value)
|
101 |
+
{
|
102 |
+
$this->getChildDataSetFor($key)->offsetSet($key, $value);
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* @inheritdoc
|
107 |
+
*
|
108 |
+
* @since 4.14
|
109 |
+
*/
|
110 |
+
public function offsetUnset($key)
|
111 |
+
{
|
112 |
+
$this->getChildDataSetFor($key)->offsetUnset($key);
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* @inheritdoc
|
117 |
+
*
|
118 |
+
* @since 4.14
|
119 |
+
*/
|
120 |
+
protected function getIterator()
|
121 |
+
{
|
122 |
+
return new MergedIterator($this->children);
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Creates a mapping function that uses a fixed map of keys.
|
127 |
+
*
|
128 |
+
* @since 4.14
|
129 |
+
*
|
130 |
+
* @param string[]|ArrayAccess $keyMap The mapping of entry keys to child data set keys.
|
131 |
+
* @param string $default The default child data set key to use.
|
132 |
+
*
|
133 |
+
* @return callable
|
134 |
+
*/
|
135 |
+
public static function fixedMap($keyMap, $default)
|
136 |
+
{
|
137 |
+
return function ($key) use ($keyMap, $default) {
|
138 |
+
if (isset($keyMap[$key])) {
|
139 |
+
return $keyMap[$key];
|
140 |
+
}
|
141 |
+
|
142 |
+
return $default;
|
143 |
+
};
|
144 |
+
}
|
145 |
+
}
|
@@ -2,6 +2,7 @@
|
|
2 |
|
3 |
namespace RebelCode\Wpra\Core\Data\Wp;
|
4 |
|
|
|
5 |
use RebelCode\Wpra\Core\Data\MaskingDataSet;
|
6 |
use RebelCode\Wpra\Core\Data\PrefixingDataSet;
|
7 |
use RebelCode\Wpra\Core\Util\NormalizeWpPostCapableTrait;
|
@@ -44,6 +45,8 @@ class WpCptDataSet extends WpPostDataSet
|
|
44 |
* @param int|string|WP_Post $postOrId The post instance or ID.
|
45 |
* @param string|null $metaPrefix Optional meta data prefix to strip from keys, or null for no stripping.
|
46 |
* @param string[]|null $postFields Optional list of post fields to use, or null to use all of them.
|
|
|
|
|
47 |
*/
|
48 |
public function __construct($postOrId, $metaPrefix = null, $postFields = null)
|
49 |
{
|
2 |
|
3 |
namespace RebelCode\Wpra\Core\Data\Wp;
|
4 |
|
5 |
+
use OutOfRangeException;
|
6 |
use RebelCode\Wpra\Core\Data\MaskingDataSet;
|
7 |
use RebelCode\Wpra\Core\Data\PrefixingDataSet;
|
8 |
use RebelCode\Wpra\Core\Util\NormalizeWpPostCapableTrait;
|
45 |
* @param int|string|WP_Post $postOrId The post instance or ID.
|
46 |
* @param string|null $metaPrefix Optional meta data prefix to strip from keys, or null for no stripping.
|
47 |
* @param string[]|null $postFields Optional list of post fields to use, or null to use all of them.
|
48 |
+
*
|
49 |
+
* @throws OutOfRangeException If the post does not exist.
|
50 |
*/
|
51 |
public function __construct($postOrId, $metaPrefix = null, $postFields = null)
|
52 |
{
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Data\Wp;
|
4 |
+
|
5 |
+
use Dhii\Collection\CallbackIterator;
|
6 |
+
use RebelCode\Wpra\Core\Data\AbstractDataSet;
|
7 |
+
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* A data set implementation for WordPress options.
|
11 |
+
*
|
12 |
+
* @since 4.14
|
13 |
+
*/
|
14 |
+
class WpOptionsDataSet extends AbstractDataSet
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* An associative array of option names as keys and their defaults as values.
|
18 |
+
*
|
19 |
+
* @since 4.14
|
20 |
+
*
|
21 |
+
* @var DataSetInterface
|
22 |
+
*/
|
23 |
+
protected $options;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Constructor.
|
27 |
+
*
|
28 |
+
* @since 4.14
|
29 |
+
*
|
30 |
+
* @param DataSetInterface $options A data set with option names as keys and their defaults as values.
|
31 |
+
*/
|
32 |
+
public function __construct($options)
|
33 |
+
{
|
34 |
+
$this->options = $options;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @inheritdoc
|
39 |
+
*
|
40 |
+
* @since 4.14
|
41 |
+
*/
|
42 |
+
protected function get($key)
|
43 |
+
{
|
44 |
+
return get_option($key, $this->options[$key]);
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @inheritdoc
|
49 |
+
*
|
50 |
+
* @since 4.14
|
51 |
+
*/
|
52 |
+
protected function has($key)
|
53 |
+
{
|
54 |
+
return isset($key, $this->options);
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @inheritdoc
|
59 |
+
*
|
60 |
+
* @since 4.14
|
61 |
+
*/
|
62 |
+
protected function set($key, $value)
|
63 |
+
{
|
64 |
+
update_option($key, $value);
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Deletes a specific entry by key.
|
69 |
+
*
|
70 |
+
* @since 4.13
|
71 |
+
*
|
72 |
+
* @param string $key The key of the entry to delete.
|
73 |
+
*/
|
74 |
+
protected function delete($key)
|
75 |
+
{
|
76 |
+
delete_option($key);
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* @inheritdoc
|
81 |
+
*
|
82 |
+
* @since 4.14
|
83 |
+
*/
|
84 |
+
protected function getIterator()
|
85 |
+
{
|
86 |
+
return new CallbackIterator($this->options, function ($key) {
|
87 |
+
return $this->get($key);
|
88 |
+
});
|
89 |
+
}
|
90 |
+
}
|
@@ -37,6 +37,10 @@ class WpPluginInfoDataSet extends AbstractDelegateDataSet
|
|
37 |
*/
|
38 |
protected function createInnerDataSet($pluginFilePath)
|
39 |
{
|
|
|
|
|
|
|
|
|
40 |
$inner = new ArrayDataSet(get_plugin_data($pluginFilePath));
|
41 |
$aliased = new AliasingDataSet($inner, [
|
42 |
'name' => 'Name',
|
37 |
*/
|
38 |
protected function createInnerDataSet($pluginFilePath)
|
39 |
{
|
40 |
+
if (!function_exists('get_plugin_data')) {
|
41 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
42 |
+
}
|
43 |
+
|
44 |
$inner = new ArrayDataSet(get_plugin_data($pluginFilePath));
|
45 |
$aliased = new AliasingDataSet($inner, [
|
46 |
'name' => 'Name',
|
@@ -2,6 +2,7 @@
|
|
2 |
|
3 |
namespace RebelCode\Wpra\Core\Data\Wp;
|
4 |
|
|
|
5 |
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
6 |
use RebelCode\Wpra\Core\Data\MergedDataSet;
|
7 |
use RebelCode\Wpra\Core\Util\NormalizeWpPostCapableTrait;
|
@@ -23,6 +24,8 @@ class WpPostDataSet extends MergedDataSet
|
|
23 |
* @since 4.13
|
24 |
*
|
25 |
* @param int|string|WP_Post $postOrId The WordPress post instance or post ID.
|
|
|
|
|
26 |
*/
|
27 |
public function __construct($postOrId)
|
28 |
{
|
2 |
|
3 |
namespace RebelCode\Wpra\Core\Data\Wp;
|
4 |
|
5 |
+
use OutOfRangeException;
|
6 |
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
7 |
use RebelCode\Wpra\Core\Data\MergedDataSet;
|
8 |
use RebelCode\Wpra\Core\Util\NormalizeWpPostCapableTrait;
|
24 |
* @since 4.13
|
25 |
*
|
26 |
* @param int|string|WP_Post $postOrId The WordPress post instance or post ID.
|
27 |
+
*
|
28 |
+
* @throws OutOfRangeException If the post does not exist.
|
29 |
*/
|
30 |
public function __construct($postOrId)
|
31 |
{
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\Feeds;
|
4 |
|
5 |
use RuntimeException;
|
6 |
|
@@ -9,7 +9,7 @@ use RuntimeException;
|
|
9 |
*
|
10 |
* @since 4.13
|
11 |
*/
|
12 |
-
class ImportedItemsCollection extends
|
13 |
{
|
14 |
/**
|
15 |
* Constructor.
|
@@ -46,6 +46,7 @@ class ImportedItemsCollection extends FeedItemCollection
|
|
46 |
$args = parent::getBasePostQueryArgs();
|
47 |
|
48 |
$args['post_type'] = get_post_types();
|
|
|
49 |
|
50 |
return $args;
|
51 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Entities\Feeds\Items;
|
4 |
|
5 |
use RuntimeException;
|
6 |
|
9 |
*
|
10 |
* @since 4.13
|
11 |
*/
|
12 |
+
class ImportedItemsCollection extends WpPostFeedItemCollection
|
13 |
{
|
14 |
/**
|
15 |
* Constructor.
|
46 |
$args = parent::getBasePostQueryArgs();
|
47 |
|
48 |
$args['post_type'] = get_post_types();
|
49 |
+
$args['post_status'] = 'publish';
|
50 |
|
51 |
return $args;
|
52 |
}
|
@@ -1,14 +1,16 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\Feeds\
|
4 |
|
5 |
use LogicException;
|
|
|
6 |
use RebelCode\Wpra\Core\Data\AliasingDataSet;
|
7 |
use RebelCode\Wpra\Core\Data\ArrayDataSet;
|
8 |
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
9 |
use RebelCode\Wpra\Core\Data\MergedDataSet;
|
10 |
use RebelCode\Wpra\Core\Data\PrefixingDataSet;
|
11 |
use RebelCode\Wpra\Core\Data\Wp\WpCptDataSet;
|
|
|
12 |
use WP_Post;
|
13 |
|
14 |
/**
|
@@ -25,6 +27,13 @@ class WpPostFeedItem extends WpCptDataSet
|
|
25 |
*/
|
26 |
const META_PREFIX = 'wprss_';
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
/**
|
29 |
* The key to which to map the feed source dataset.
|
30 |
*
|
@@ -53,12 +62,21 @@ class WpPostFeedItem extends WpCptDataSet
|
|
53 |
*/
|
54 |
const TIMESTAMP_KEY = 'timestamp';
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
/**
|
57 |
* Constructor.
|
58 |
*
|
59 |
* @since 4.13
|
60 |
*
|
61 |
* @param int|string|WP_Post $post The WordPress Post object or post ID.
|
|
|
|
|
62 |
*/
|
63 |
public function __construct($post)
|
64 |
{
|
@@ -92,12 +110,12 @@ class WpPostFeedItem extends WpCptDataSet
|
|
92 |
*/
|
93 |
protected function createMetaDataSet($postOrId)
|
94 |
{
|
95 |
-
//
|
96 |
-
$
|
97 |
-
|
|
|
|
|
98 |
'source_id' => 'feed_id',
|
99 |
-
'author' => 'item_author',
|
100 |
-
'enclosure' => 'item_enclosure',
|
101 |
]);
|
102 |
|
103 |
$post = $this->normalizeWpPost($postOrId);
|
@@ -118,26 +136,23 @@ class WpPostFeedItem extends WpCptDataSet
|
|
118 |
*/
|
119 |
protected function wrapPostMetaDataSet(WP_Post $post, DataSetInterface $meta)
|
120 |
{
|
|
|
|
|
121 |
$wrapperData = [
|
122 |
-
static::SOURCE_KEY =>
|
123 |
static::TIMESTAMP_KEY => strtotime($post->post_date_gmt),
|
|
|
|
|
124 |
];
|
125 |
|
126 |
-
//
|
127 |
-
if (
|
128 |
$wrapperData[static::AUTHOR_KEY] = get_the_author_meta('display_name', $post->post_author);
|
129 |
}
|
130 |
|
131 |
-
//
|
132 |
-
|
133 |
-
|
134 |
-
}
|
135 |
-
|
136 |
-
// Copy the wrapper data and replace all values with true
|
137 |
-
// This will be used as the overrides option for the merged data set
|
138 |
-
$overrides = array_map(function () {
|
139 |
-
return true;
|
140 |
-
}, $wrapperData);
|
141 |
|
142 |
// Merge the real meta data with the wrapper dataset,
|
143 |
// and explicitly set the secondary dataset to override to wrapper's entries
|
@@ -162,4 +177,57 @@ class WpPostFeedItem extends WpCptDataSet
|
|
162 |
|
163 |
return parent::set($key, $value);
|
164 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Entities\Feeds\Items;
|
4 |
|
5 |
use LogicException;
|
6 |
+
use OutOfRangeException;
|
7 |
use RebelCode\Wpra\Core\Data\AliasingDataSet;
|
8 |
use RebelCode\Wpra\Core\Data\ArrayDataSet;
|
9 |
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
10 |
use RebelCode\Wpra\Core\Data\MergedDataSet;
|
11 |
use RebelCode\Wpra\Core\Data\PrefixingDataSet;
|
12 |
use RebelCode\Wpra\Core\Data\Wp\WpCptDataSet;
|
13 |
+
use RebelCode\Wpra\Core\Entities\Feeds\Sources\WpPostFeedSource;
|
14 |
use WP_Post;
|
15 |
|
16 |
/**
|
27 |
*/
|
28 |
const META_PREFIX = 'wprss_';
|
29 |
|
30 |
+
/**
|
31 |
+
* The second item-specific meta key prefix.
|
32 |
+
*
|
33 |
+
* @since 4.14
|
34 |
+
*/
|
35 |
+
const SECOND_META_PREFIX = 'wprss_item_';
|
36 |
+
|
37 |
/**
|
38 |
* The key to which to map the feed source dataset.
|
39 |
*
|
62 |
*/
|
63 |
const TIMESTAMP_KEY = 'timestamp';
|
64 |
|
65 |
+
/**
|
66 |
+
* The key to which to map the item featured image.
|
67 |
+
*
|
68 |
+
* @since 4.14
|
69 |
+
*/
|
70 |
+
const FT_IMAGE_KEY = 'ft_image_url';
|
71 |
+
|
72 |
/**
|
73 |
* Constructor.
|
74 |
*
|
75 |
* @since 4.13
|
76 |
*
|
77 |
* @param int|string|WP_Post $post The WordPress Post object or post ID.
|
78 |
+
*
|
79 |
+
* @throws OutOfRangeException If the post does not exist.
|
80 |
*/
|
81 |
public function __construct($post)
|
82 |
{
|
110 |
*/
|
111 |
protected function createMetaDataSet($postOrId)
|
112 |
{
|
113 |
+
// Add the second meta prefix
|
114 |
+
$prefixed = new PrefixingDataSet(parent::createMetaDataSet($postOrId), static::SECOND_META_PREFIX);
|
115 |
+
|
116 |
+
// Alias some of the meta data
|
117 |
+
$aliased = new AliasingDataSet($prefixed, [
|
118 |
'source_id' => 'feed_id',
|
|
|
|
|
119 |
]);
|
120 |
|
121 |
$post = $this->normalizeWpPost($postOrId);
|
136 |
*/
|
137 |
protected function wrapPostMetaDataSet(WP_Post $post, DataSetInterface $meta)
|
138 |
{
|
139 |
+
$source = new WpPostFeedSource($meta['source_id']);
|
140 |
+
|
141 |
$wrapperData = [
|
142 |
+
static::SOURCE_KEY => $source,
|
143 |
static::TIMESTAMP_KEY => strtotime($post->post_date_gmt),
|
144 |
+
static::FT_IMAGE_KEY => $this->getFtImageUrl($post),
|
145 |
+
static::URL_KEY => $this->getItemUrl($post, $meta, $source),
|
146 |
];
|
147 |
|
148 |
+
// For non-WPRSS feed items, use the real WordPress post author if the meta author does not exist
|
149 |
+
if ($post->post_type !== 'wprss_feed_item' && empty($meta[static::AUTHOR_KEY])) {
|
150 |
$wrapperData[static::AUTHOR_KEY] = get_the_author_meta('display_name', $post->post_author);
|
151 |
}
|
152 |
|
153 |
+
// Create a copy of the wrapper data with all the values replaced with `true`
|
154 |
+
// This will be used as the override map for the merged data set
|
155 |
+
$overrides = array_map('__return_true', $wrapperData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
// Merge the real meta data with the wrapper dataset,
|
158 |
// and explicitly set the secondary dataset to override to wrapper's entries
|
177 |
|
178 |
return parent::set($key, $value);
|
179 |
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Retrieves the featured image URL for the feed item.
|
183 |
+
*
|
184 |
+
* @since 4.14
|
185 |
+
*
|
186 |
+
* @param WP_Post $post The post for the feed item.
|
187 |
+
*
|
188 |
+
* @return string|null The URL of the featured image or null if the item has no featured image.
|
189 |
+
*/
|
190 |
+
protected function getFtImageUrl($post)
|
191 |
+
{
|
192 |
+
// Fetch the featured image first
|
193 |
+
$attachment = wp_get_attachment_image_url(get_post_thumbnail_id($post->ID), '');
|
194 |
+
if ($attachment !== false) {
|
195 |
+
return $attachment;
|
196 |
+
}
|
197 |
+
|
198 |
+
// Then try the old E&T meta key
|
199 |
+
$etThumbnail = get_post_meta($post->ID, 'wprss_item_thumbnail', true);
|
200 |
+
if (!empty($etThumbnail)) {
|
201 |
+
return $etThumbnail;
|
202 |
+
}
|
203 |
+
|
204 |
+
return null;
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Retrieves the item URL to use for a feed item.
|
209 |
+
*
|
210 |
+
* @since 4.14
|
211 |
+
*
|
212 |
+
* @param WP_Post $post The post object.
|
213 |
+
* @param DataSetInterface $meta The meta data set.
|
214 |
+
* @param DataSetInterface $source The feed source data set.
|
215 |
+
*
|
216 |
+
* @return string
|
217 |
+
*/
|
218 |
+
protected function getItemUrl($post, $meta, $source)
|
219 |
+
{
|
220 |
+
// If not a WPRSS feed item, use its WordPress post permalink
|
221 |
+
if ($post->post_type !== 'wprss_feed_item') {
|
222 |
+
return get_permalink($post);
|
223 |
+
}
|
224 |
+
|
225 |
+
// Use the enclosure if the feed source option is enabled and the item has an enclosure link
|
226 |
+
if (!empty($source['enclosure']) && filter_var($source['enclosure'], FILTER_VALIDATE_BOOLEAN) && !empty($meta['enclosure'])) {
|
227 |
+
return $meta['enclosure'];
|
228 |
+
}
|
229 |
+
|
230 |
+
// Use the permalink in the meta data
|
231 |
+
return $meta['permalink'];
|
232 |
+
}
|
233 |
}
|
@@ -1,9 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\Feeds;
|
4 |
|
5 |
use RebelCode\Wpra\Core\Data\Collections\WpPostCollection;
|
6 |
-
use RebelCode\Wpra\Core\Feeds\Models\WpPostFeedItem;
|
7 |
use WP_Post;
|
8 |
|
9 |
/**
|
@@ -11,7 +10,7 @@ use WP_Post;
|
|
11 |
*
|
12 |
* @since 4.13
|
13 |
*/
|
14 |
-
class
|
15 |
{
|
16 |
/**
|
17 |
* Constructor.
|
@@ -36,6 +35,19 @@ class FeedItemCollection extends WpPostCollection
|
|
36 |
return new WpPostFeedItem($post);
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
/**
|
40 |
* {@inheritdoc}
|
41 |
*
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Entities\Feeds\Items;
|
4 |
|
5 |
use RebelCode\Wpra\Core\Data\Collections\WpPostCollection;
|
|
|
6 |
use WP_Post;
|
7 |
|
8 |
/**
|
10 |
*
|
11 |
* @since 4.13
|
12 |
*/
|
13 |
+
class WpPostFeedItemCollection extends WpPostCollection
|
14 |
{
|
15 |
/**
|
16 |
* Constructor.
|
35 |
return new WpPostFeedItem($post);
|
36 |
}
|
37 |
|
38 |
+
/**
|
39 |
+
* {@inheritdoc}
|
40 |
+
*
|
41 |
+
* @since 4.14
|
42 |
+
*/
|
43 |
+
protected function getBasePostQueryArgs()
|
44 |
+
{
|
45 |
+
$args = parent::getBasePostQueryArgs();
|
46 |
+
$args['post_status'] = 'publish';
|
47 |
+
|
48 |
+
return $args;
|
49 |
+
}
|
50 |
+
|
51 |
/**
|
52 |
* {@inheritdoc}
|
53 |
*
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Entities\Feeds\Sources;
|
4 |
+
|
5 |
+
use OutOfRangeException;
|
6 |
+
use RebelCode\Wpra\Core\Data\AliasingDataSet;
|
7 |
+
use RebelCode\Wpra\Core\Data\ArrayDataSet;
|
8 |
+
use RebelCode\Wpra\Core\Data\MergedDataSet;
|
9 |
+
use RebelCode\Wpra\Core\Data\Wp\WpCptDataSet;
|
10 |
+
use WP_Post;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Model class for posts of the WP RSS Aggregator feed source custom post type.
|
14 |
+
*
|
15 |
+
* @since 4.13
|
16 |
+
*/
|
17 |
+
class WpPostFeedSource extends WpCptDataSet
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* The meta prefix.
|
21 |
+
*
|
22 |
+
* @since 4.13
|
23 |
+
*/
|
24 |
+
const META_PREFIX = 'wprss_';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Constructor.
|
28 |
+
*
|
29 |
+
* @since 4.13
|
30 |
+
*
|
31 |
+
* @param int|string|WP_Post $post The post instance or ID.
|
32 |
+
*
|
33 |
+
* @throws OutOfRangeException If the post does not exist.
|
34 |
+
*/
|
35 |
+
public function __construct($post)
|
36 |
+
{
|
37 |
+
parent::__construct($post, static::META_PREFIX, ['ID', 'post_title']);
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* {@inheritdoc}
|
42 |
+
*
|
43 |
+
* @since 4.13
|
44 |
+
*/
|
45 |
+
protected function createPostDataSet($postOrId)
|
46 |
+
{
|
47 |
+
return new AliasingDataSet(parent::createPostDataSet($postOrId), [
|
48 |
+
'id' => 'ID',
|
49 |
+
'title' => 'post_title'
|
50 |
+
]);
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* {@inheritdoc}
|
55 |
+
*
|
56 |
+
* @since 4.14
|
57 |
+
*/
|
58 |
+
protected function createMetaDataSet($postOrId)
|
59 |
+
{
|
60 |
+
$meta = parent::createMetaDataSet($postOrId);
|
61 |
+
$defaults = $this->getDefaultMetaData();
|
62 |
+
$fullMeta = new MergedDataSet($meta, $defaults);
|
63 |
+
|
64 |
+
return new MergedDataSet($fullMeta, new ArrayDataSet([
|
65 |
+
'def_ft_image_id' => $defFtImage = get_post_thumbnail_id($postOrId),
|
66 |
+
'def_ft_image_url' => wp_get_attachment_image_url($defFtImage, ''),
|
67 |
+
]));
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Retrieves the default meta data.
|
72 |
+
*
|
73 |
+
* @since 4.14
|
74 |
+
*
|
75 |
+
* @return ArrayDataSet The data set containing the default meta data.
|
76 |
+
*/
|
77 |
+
protected function getDefaultMetaData()
|
78 |
+
{
|
79 |
+
return new ArrayDataSet([
|
80 |
+
'import_ft_images' => 'auto',
|
81 |
+
'download_images' => '0',
|
82 |
+
'siphon_ft_image' => '0',
|
83 |
+
'must_have_ft_image' => '0',
|
84 |
+
'image_min_width' => 150,
|
85 |
+
'image_min_height' => 150,
|
86 |
+
]);
|
87 |
+
}
|
88 |
+
}
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Entities\Feeds\Sources;
|
4 |
+
|
5 |
+
use RebelCode\Wpra\Core\Data\Collections\WpPostCollection;
|
6 |
+
use WP_Post;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* A collection implementation that is specific to WP RSS Aggregator feed sources.
|
10 |
+
*
|
11 |
+
* @since 4.14
|
12 |
+
*/
|
13 |
+
class WpPostFeedSourceCollection extends WpPostCollection
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Constructor.
|
17 |
+
*
|
18 |
+
* @since @since 4.14
|
19 |
+
*
|
20 |
+
* @param string $postType The name of the post type.
|
21 |
+
* @param array|null $filter Optional filter to restrict the collection query.
|
22 |
+
*/
|
23 |
+
public function __construct($postType, $filter = null)
|
24 |
+
{
|
25 |
+
parent::__construct($postType, [], $filter);
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* {@inheritdoc}
|
30 |
+
*
|
31 |
+
* @since 4.14
|
32 |
+
*/
|
33 |
+
protected function createModel(WP_Post $post)
|
34 |
+
{
|
35 |
+
return new WpPostFeedSource($post);
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* {@inheritdoc}
|
40 |
+
*
|
41 |
+
* @since 4.14
|
42 |
+
*/
|
43 |
+
protected function getBasePostQueryArgs()
|
44 |
+
{
|
45 |
+
$args = parent::getBasePostQueryArgs();
|
46 |
+
$args['post_status'] = 'publish';
|
47 |
+
|
48 |
+
return $args;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* {@inheritdoc}
|
53 |
+
*
|
54 |
+
* Overridden to ensure that the status is "publish".
|
55 |
+
*
|
56 |
+
* @since 4.14
|
57 |
+
*/
|
58 |
+
protected function getNewPostData($data)
|
59 |
+
{
|
60 |
+
$post = parent::getNewPostData($data);
|
61 |
+
$post['post_status'] = 'publish';
|
62 |
+
|
63 |
+
return $post;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* {@inheritdoc}
|
68 |
+
*
|
69 |
+
* @since 4.14
|
70 |
+
*/
|
71 |
+
protected function createSelfWithFilter($filter)
|
72 |
+
{
|
73 |
+
return new static($this->postType, $filter);
|
74 |
+
}
|
75 |
+
}
|
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Entities\Feeds\Templates;
|
4 |
+
|
5 |
+
use RebelCode\Wpra\Core\Data\AbstractDelegateDataSet;
|
6 |
+
use RebelCode\Wpra\Core\Data\AliasingDataSet;
|
7 |
+
use RebelCode\Wpra\Core\Data\ArrayDataSet;
|
8 |
+
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
9 |
+
use RebelCode\Wpra\Core\Data\DelegatorDataSet;
|
10 |
+
use RebelCode\Wpra\Core\Data\MaskingDataSet;
|
11 |
+
use RebelCode\Wpra\Core\Data\MergedDataSet;
|
12 |
+
use RebelCode\Wpra\Core\Data\Wp\WpCptDataSet;
|
13 |
+
use RebelCode\Wpra\Core\Data\Wp\WpPostArrayMetaDataSet;
|
14 |
+
use WP_Post;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* A specialized feed template model implementation that uses the old WP RSS Aggregator display settings as the
|
18 |
+
* template options.
|
19 |
+
*
|
20 |
+
* @since 4.13
|
21 |
+
*/
|
22 |
+
class BuiltInFeedTemplate extends AbstractDelegateDataSet
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* The name of the option from which to retrieve the template settings.
|
26 |
+
*
|
27 |
+
* @since 4.13
|
28 |
+
*/
|
29 |
+
const WP_OPTION_NAME = 'wprss_settings_general';
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The key to which to map the settings options.
|
33 |
+
*
|
34 |
+
* @since 4.13
|
35 |
+
*/
|
36 |
+
const OPTIONS_KEY = 'options';
|
37 |
+
|
38 |
+
/**
|
39 |
+
* The meta prefix.
|
40 |
+
*
|
41 |
+
* @since 4.14
|
42 |
+
*/
|
43 |
+
const META_PREFIX = 'wprss_template_';
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Constructor.
|
47 |
+
*
|
48 |
+
* @since 4.13
|
49 |
+
*
|
50 |
+
* @param int|string|WP_Post $postOrId The post instance or ID.
|
51 |
+
*/
|
52 |
+
public function __construct($postOrId)
|
53 |
+
{
|
54 |
+
parent::__construct($this->createDataSet($postOrId));
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Creates the internal data set.
|
59 |
+
*
|
60 |
+
* @since 4.14
|
61 |
+
*
|
62 |
+
* @param int|WP_Post $postOrId The post instance or ID.
|
63 |
+
*
|
64 |
+
* @return DataSetInterface
|
65 |
+
*/
|
66 |
+
protected function createDataSet($postOrId)
|
67 |
+
{
|
68 |
+
// Create the CPT data set, which only includes the required wp_post fields, which are aliased
|
69 |
+
$cptDataSet = new AliasingDataSet(
|
70 |
+
new WpCptDataSet(
|
71 |
+
$postOrId,
|
72 |
+
static::META_PREFIX,
|
73 |
+
['ID', 'post_title', 'post_name']
|
74 |
+
),
|
75 |
+
[
|
76 |
+
'id' => 'ID',
|
77 |
+
'name' => 'post_title',
|
78 |
+
'slug' => 'post_name',
|
79 |
+
]
|
80 |
+
);
|
81 |
+
|
82 |
+
// Create the data set for the template options (the "options" key)
|
83 |
+
{
|
84 |
+
// Create the data set for the "options" sub-meta
|
85 |
+
$metaOptsDataSet = new WpPostArrayMetaDataSet($postOrId, static::META_PREFIX . 'options');
|
86 |
+
// Create the data set for the "options" stored in the settings
|
87 |
+
// And wrap it to be able to use the aliases instead of the old settings keys
|
88 |
+
// And mask it to prevent other settings from being read or written to
|
89 |
+
$settingOptsDataSet = new MaskingDataSet(
|
90 |
+
new AliasingDataSet(
|
91 |
+
wpra_container()->get('wpra/settings/general/dataset'),
|
92 |
+
$this->getSettingsAliases()
|
93 |
+
),
|
94 |
+
$this->getSettingsMask(),
|
95 |
+
false
|
96 |
+
);
|
97 |
+
|
98 |
+
// Create the template options delegator data set for the options in meta and settings
|
99 |
+
// This is used to determine which keys are stored in which which data set
|
100 |
+
$optsDelegatorDataSet = new DelegatorDataSet(
|
101 |
+
[
|
102 |
+
'settings' => $settingOptsDataSet,
|
103 |
+
'meta' => $metaOptsDataSet,
|
104 |
+
],
|
105 |
+
DelegatorDataSet::fixedMap($this->getKeyMapping(), 'meta')
|
106 |
+
);
|
107 |
+
}
|
108 |
+
|
109 |
+
// Wrap the opts delegator data set to nest it under the "options" key, with recursive writing
|
110 |
+
// This consists of the post data set, and the meta and settings combined under an "options" key
|
111 |
+
$optsDataSet = new ArrayDataSet(
|
112 |
+
[
|
113 |
+
'options' => $optsDelegatorDataSet,
|
114 |
+
],
|
115 |
+
true
|
116 |
+
);
|
117 |
+
|
118 |
+
// Create the full data set, explicitly forwarding the options key to the second data set
|
119 |
+
$dataSet = new MergedDataSet(
|
120 |
+
$cptDataSet,
|
121 |
+
$optsDataSet,
|
122 |
+
['options' => true],
|
123 |
+
MergedDataSet::ITERATE_BOTH
|
124 |
+
);
|
125 |
+
|
126 |
+
return $dataSet;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Retrieves the settings options aliases.
|
131 |
+
*
|
132 |
+
* @since 4.14
|
133 |
+
*
|
134 |
+
* @return string[]
|
135 |
+
*/
|
136 |
+
protected function getSettingsAliases()
|
137 |
+
{
|
138 |
+
return [
|
139 |
+
'title_is_link' => 'title_link',
|
140 |
+
'title_max_length' => 'title_limit',
|
141 |
+
'limit' => 'feed_limit',
|
142 |
+
'date_enabled' => 'date_enable',
|
143 |
+
'date_prefix' => 'text_preceding_date',
|
144 |
+
'date_format' => 'date_format',
|
145 |
+
'date_use_time_ago' => 'time_ago_format_enable',
|
146 |
+
'source_enabled' => 'source_enable',
|
147 |
+
'source_prefix' => 'text_preceding_source',
|
148 |
+
'source_is_link' => 'source_link',
|
149 |
+
'author_enabled' => 'authors_enable',
|
150 |
+
'pagination_type' => 'pagination',
|
151 |
+
'links_nofollow' => 'follow_dd',
|
152 |
+
'links_behavior' => 'open_dd',
|
153 |
+
'links_video_embed_page' => 'video_link',
|
154 |
+
];
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Retrieves the mapping of data keys to the key of the corresponding data set.
|
159 |
+
*
|
160 |
+
* The settings aliases are used to construct this mapping, since the only explicit mapping we need are for
|
161 |
+
* settings keys. Any other keys will default to the meta data set.
|
162 |
+
*
|
163 |
+
* @since 4.14
|
164 |
+
*
|
165 |
+
* @return array
|
166 |
+
*/
|
167 |
+
protected function getKeyMapping()
|
168 |
+
{
|
169 |
+
$keys = array_keys($this->getSettingsAliases());
|
170 |
+
$values = array_fill(0, count($keys), 'settings');
|
171 |
+
|
172 |
+
return array_combine($keys, $values);
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Retrieves the mask for which settings option keys to retain in the dataset.
|
177 |
+
*
|
178 |
+
* @since 4.14
|
179 |
+
*
|
180 |
+
* @return bool[]
|
181 |
+
*/
|
182 |
+
protected function getSettingsMask()
|
183 |
+
{
|
184 |
+
$keys = array_keys($this->getSettingsAliases());
|
185 |
+
$values = array_fill(0, count($keys), true);
|
186 |
+
|
187 |
+
return array_combine($keys, $values);
|
188 |
+
}
|
189 |
+
}
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use RebelCode\Wpra\Core\Data\AliasingDataSet;
|
6 |
use RebelCode\Wpra\Core\Data\Wp\WpCptDataSet;
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Entities\Feeds\Templates;
|
4 |
|
5 |
use RebelCode\Wpra\Core\Data\AliasingDataSet;
|
6 |
use RebelCode\Wpra\Core\Data\Wp\WpCptDataSet;
|
@@ -1,10 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use RebelCode\Wpra\Core\Data\Collections\WpPostCollection;
|
6 |
-
use RebelCode\Wpra\Core\Templates\Feeds\Models\BuiltInFeedTemplate;
|
7 |
-
use RebelCode\Wpra\Core\Templates\Feeds\Models\WpPostFeedTemplate;
|
8 |
use WP_Post;
|
9 |
|
10 |
/**
|
@@ -12,7 +10,7 @@ use WP_Post;
|
|
12 |
*
|
13 |
* @since 4.13
|
14 |
*/
|
15 |
-
class
|
16 |
{
|
17 |
/**
|
18 |
* The default template's type.
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Entities\Feeds\Templates;
|
4 |
|
5 |
use RebelCode\Wpra\Core\Data\Collections\WpPostCollection;
|
|
|
|
|
6 |
use WP_Post;
|
7 |
|
8 |
/**
|
10 |
*
|
11 |
* @since 4.13
|
12 |
*/
|
13 |
+
class WpPostFeedTemplateCollection extends WpPostCollection
|
14 |
{
|
15 |
/**
|
16 |
* The default template's type.
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core;
|
4 |
+
|
5 |
+
use Dhii\I18n\StringTranslatingTrait;
|
6 |
+
use Exception;
|
7 |
+
use Throwable;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Handles errors.
|
11 |
+
*
|
12 |
+
* @since 4.14
|
13 |
+
*/
|
14 |
+
class ErrorHandler
|
15 |
+
{
|
16 |
+
/*
|
17 |
+
* Provides string translating functionality.
|
18 |
+
*
|
19 |
+
* @since 4.14
|
20 |
+
*/
|
21 |
+
use StringTranslatingTrait;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* The callback to invoke.
|
25 |
+
*
|
26 |
+
* @since 4.14
|
27 |
+
*
|
28 |
+
* @var callable
|
29 |
+
*/
|
30 |
+
protected $callback;
|
31 |
+
|
32 |
+
/*
|
33 |
+
* The previous exception handler.
|
34 |
+
*
|
35 |
+
* @since 4.14
|
36 |
+
*/
|
37 |
+
protected $previous;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* The root directory for which to limit exception handling.
|
41 |
+
*
|
42 |
+
* @since 4.14
|
43 |
+
*
|
44 |
+
* @var string
|
45 |
+
*/
|
46 |
+
protected $rootDir;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Constructor.
|
50 |
+
*
|
51 |
+
* @since 4.14
|
52 |
+
*
|
53 |
+
* @param string $rootDir The root directory for which to limit exception handling.
|
54 |
+
* @param callable $callback The callback to invoke when an exception is handled. The callback will receive the
|
55 |
+
* exception or PHP7 {@see \Throwable} as argument.
|
56 |
+
*/
|
57 |
+
public function __construct($rootDir, $callback)
|
58 |
+
{
|
59 |
+
$this->rootDir = $rootDir;
|
60 |
+
$this->callback = $callback;
|
61 |
+
$this->previous = null;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Registers the handler.
|
66 |
+
*
|
67 |
+
* @since 4.14
|
68 |
+
*/
|
69 |
+
public function register()
|
70 |
+
{
|
71 |
+
$this->previous = set_exception_handler($this);
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* De-registers the handler.
|
76 |
+
*
|
77 |
+
* @since 4.14
|
78 |
+
*/
|
79 |
+
public function deregister()
|
80 |
+
{
|
81 |
+
set_exception_handler($this->previous);
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* {@inheritdoc}
|
86 |
+
*
|
87 |
+
* @since 4.14
|
88 |
+
*/
|
89 |
+
public function __invoke()
|
90 |
+
{
|
91 |
+
if ($this->previous) {
|
92 |
+
call_user_func_array($this->previous, func_get_args());
|
93 |
+
}
|
94 |
+
|
95 |
+
$throwable = func_get_arg(0);
|
96 |
+
|
97 |
+
if (!($throwable instanceof Exception) && !($throwable instanceof Throwable)) {
|
98 |
+
return;
|
99 |
+
}
|
100 |
+
|
101 |
+
if ($this->errorOriginInRootDir($throwable->getFile())) {
|
102 |
+
$this->handleError($throwable);
|
103 |
+
|
104 |
+
return;
|
105 |
+
}
|
106 |
+
|
107 |
+
// Detect an exception thrown from within the root directory
|
108 |
+
foreach ($throwable->getTrace() as $trace) {
|
109 |
+
if ($this->errorOriginInRootDir($trace['file'])) {
|
110 |
+
$this->handleError($throwable);
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
protected function errorOriginInRootDir($path)
|
116 |
+
{
|
117 |
+
return stripos($path, $this->rootDir) === 0;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* @param Exception|Throwable $throwable
|
122 |
+
*/
|
123 |
+
protected function handleError($throwable)
|
124 |
+
{
|
125 |
+
if (defined('REST_REQUEST')) {
|
126 |
+
wp_send_json_error(['error' => $throwable->getMessage(), 'trace' => $throwable->getTrace()], 500);
|
127 |
+
|
128 |
+
return;
|
129 |
+
}
|
130 |
+
|
131 |
+
if (is_callable($this->callback)) {
|
132 |
+
call_user_func_array($this->callback, [$throwable]);
|
133 |
+
|
134 |
+
return;
|
135 |
+
}
|
136 |
+
|
137 |
+
return;
|
138 |
+
}
|
139 |
+
}
|
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace RebelCode\Wpra\Core\Feeds\Models;
|
4 |
-
|
5 |
-
use RebelCode\Wpra\Core\Data\AliasingDataSet;
|
6 |
-
use RebelCode\Wpra\Core\Data\Wp\WpCptDataSet;
|
7 |
-
use WP_Post;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Model class for posts of the WP RSS Aggregator feed source custom post type.
|
11 |
-
*
|
12 |
-
* @since 4.13
|
13 |
-
*/
|
14 |
-
class WpPostFeedSource extends WpCptDataSet
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* The meta prefix.
|
18 |
-
*
|
19 |
-
* @since 4.13
|
20 |
-
*/
|
21 |
-
const META_PREFIX = 'wprss_';
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Constructor.
|
25 |
-
*
|
26 |
-
* @since 4.13
|
27 |
-
*
|
28 |
-
* @param int|string|WP_Post $post The post instance or ID.
|
29 |
-
*/
|
30 |
-
public function __construct($post)
|
31 |
-
{
|
32 |
-
parent::__construct($post, static::META_PREFIX, ['ID', 'post_title']);
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* {@inheritdoc}
|
37 |
-
*
|
38 |
-
* @since 4.13
|
39 |
-
*/
|
40 |
-
protected function createPostDataSet($postOrId)
|
41 |
-
{
|
42 |
-
return new AliasingDataSet(parent::createPostDataSet($postOrId), [
|
43 |
-
'id' => 'ID',
|
44 |
-
'title' => 'post_title'
|
45 |
-
]);
|
46 |
-
}
|
47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use Exception;
|
6 |
use RebelCode\Wpra\Core\Util\NormalizeWpPostCapableTrait;
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
use Exception;
|
6 |
use RebelCode\Wpra\Core\Util\NormalizeWpPostCapableTrait;
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use stdClass;
|
6 |
use Traversable;
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
use stdClass;
|
6 |
use Traversable;
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use stdClass;
|
6 |
use Traversable;
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
use stdClass;
|
6 |
use Traversable;
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
6 |
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\CustomFeed;
|
4 |
|
5 |
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
6 |
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\CustomFeed;
|
4 |
+
|
5 |
+
use Dhii\Output\TemplateInterface;
|
6 |
+
use RebelCode\Wpra\Core\Data\Collections\CollectionInterface;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* The handler that renders the custom feed.
|
10 |
+
*
|
11 |
+
* @since 4.13
|
12 |
+
*/
|
13 |
+
class RenderCustomFeedHandler
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @since 4.14
|
17 |
+
*
|
18 |
+
* @var CollectionInterface
|
19 |
+
*/
|
20 |
+
protected $items;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @since 4.14
|
24 |
+
*
|
25 |
+
* @var TemplateInterface
|
26 |
+
*/
|
27 |
+
protected $template;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Constructor.
|
31 |
+
*
|
32 |
+
* @todo Inject the required wp-options dataset, when it's available as a service
|
33 |
+
*
|
34 |
+
* @since 4.14
|
35 |
+
*
|
36 |
+
* @param CollectionInterface $items The items to include in the feed.
|
37 |
+
* @param TemplateInterface $template The template to use for rendering the feed.
|
38 |
+
*/
|
39 |
+
public function __construct(CollectionInterface $items, TemplateInterface $template)
|
40 |
+
{
|
41 |
+
$this->items = $items;
|
42 |
+
$this->template = $template;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* {@inheritdoc}
|
47 |
+
*
|
48 |
+
* @since 4.13
|
49 |
+
*/
|
50 |
+
public function __invoke()
|
51 |
+
{
|
52 |
+
$options = get_option('wprss_settings_general', []);
|
53 |
+
|
54 |
+
$items = empty($options['custom_feed_limit'])
|
55 |
+
? $this->items
|
56 |
+
: $this->items->filter(['posts_per_page' => $options['custom_feed_limit']]);
|
57 |
+
|
58 |
+
$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');
|
59 |
+
header("$protocol 200 OK");
|
60 |
+
// Send content header and start ATOM output
|
61 |
+
header('Content-Type: application/rss+xml');
|
62 |
+
// Disabling caching
|
63 |
+
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
|
64 |
+
header('Pragma: no-cache'); // HTTP 1.0.
|
65 |
+
header('Expires: 0'); // Proxies.
|
66 |
+
|
67 |
+
$title = wprss_get_general_setting('custom_feed_title');
|
68 |
+
$context = [
|
69 |
+
'charset' => get_option('blog_charset'),
|
70 |
+
'title' => $title,
|
71 |
+
'subtitle' => $title,
|
72 |
+
'site_url' => trailingslashit(get_site_url()),
|
73 |
+
'self_url' => trailingslashit(get_feed_link('wprss')),
|
74 |
+
'updated_date' => date(DATE_ATOM),
|
75 |
+
'generator' => [
|
76 |
+
'name' => 'WP RSS Aggregator',
|
77 |
+
'url' => 'https://wprssaggregator.com',
|
78 |
+
'version' => WPRSS_VERSION,
|
79 |
+
],
|
80 |
+
'items' => $items,
|
81 |
+
];
|
82 |
+
|
83 |
+
echo $this->template->render($context);
|
84 |
+
}
|
85 |
+
}
|
@@ -1,8 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
-
use RebelCode\Wpra\Core\
|
6 |
use WP_Post;
|
7 |
|
8 |
/**
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\FeedBlacklist;
|
4 |
|
5 |
+
use RebelCode\Wpra\Core\Handlers\AbstractSavePostHandler;
|
6 |
use WP_Post;
|
7 |
|
8 |
/**
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use Dhii\Output\TemplateInterface;
|
6 |
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\FeedShortcode;
|
4 |
|
5 |
use Dhii\Output\TemplateInterface;
|
6 |
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\FeedSources;
|
4 |
+
|
5 |
+
use RebelCode\Wpra\Core\Entities\Feeds\Sources\WpPostFeedSource;
|
6 |
+
use WP_Post;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Handler for saving feed source meta data submitted from the edit page meta box.
|
10 |
+
*
|
11 |
+
* @since 4.14
|
12 |
+
*/
|
13 |
+
class FeedSourceSaveMetaHandler
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @inheritdoc
|
17 |
+
*
|
18 |
+
* @since 4.14
|
19 |
+
*/
|
20 |
+
public function __invoke($postId, WP_Post $post)
|
21 |
+
{
|
22 |
+
// Verify the nonce to ensure that the data is coming from the feed source edit page
|
23 |
+
$nonce = filter_input(INPUT_POST, 'wprss_meta_box_nonce');
|
24 |
+
if (!wp_verify_nonce($nonce, 'wpra_feed_source')) {
|
25 |
+
return;
|
26 |
+
}
|
27 |
+
|
28 |
+
// Stop if doing AJAX, cron or an auto save
|
29 |
+
if (wp_doing_ajax() || wp_doing_cron() || defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
|
30 |
+
return;
|
31 |
+
}
|
32 |
+
|
33 |
+
// Get the post type object.
|
34 |
+
$post_type = get_post_type_object($post->post_type);
|
35 |
+
|
36 |
+
// Check if the current user has permission to edit the post.
|
37 |
+
if (!current_user_can($post_type->cap->edit_post, $postId)) {
|
38 |
+
return;
|
39 |
+
}
|
40 |
+
|
41 |
+
// Get the submitted post meta
|
42 |
+
$meta = filter_input(INPUT_POST, 'wpra_feed', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
|
43 |
+
if (empty($meta)) {
|
44 |
+
return;
|
45 |
+
}
|
46 |
+
|
47 |
+
// Get the feed source model object
|
48 |
+
$feed = new WpPostFeedSource($post);
|
49 |
+
// Save the meta to the feed
|
50 |
+
foreach ($meta as $key => $value) {
|
51 |
+
$feed[$key] = $value;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use Dhii\Output\TemplateInterface;
|
6 |
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\FeedSources;
|
4 |
|
5 |
use Dhii\Output\TemplateInterface;
|
6 |
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use Dhii\Output\TemplateInterface;
|
6 |
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\FeedTemplates;
|
4 |
|
5 |
use Dhii\Output\TemplateInterface;
|
6 |
|
@@ -1,9 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
-
use
|
6 |
-
use Traversable;
|
7 |
|
8 |
/**
|
9 |
* The handler that auto creates the default feed template.
|
@@ -13,11 +12,11 @@ use Traversable;
|
|
13 |
class CreateDefaultFeedTemplateHandler
|
14 |
{
|
15 |
/**
|
16 |
-
*
|
17 |
*
|
18 |
* @since 4.13
|
19 |
*
|
20 |
-
* @var
|
21 |
*/
|
22 |
protected $collection;
|
23 |
|
@@ -35,8 +34,8 @@ class CreateDefaultFeedTemplateHandler
|
|
35 |
*
|
36 |
* @since 4.13
|
37 |
*
|
38 |
-
* @param
|
39 |
-
* @param array
|
40 |
*/
|
41 |
public function __construct($collection, $data)
|
42 |
{
|
@@ -49,11 +48,9 @@ class CreateDefaultFeedTemplateHandler
|
|
49 |
*/
|
50 |
public function __invoke()
|
51 |
{
|
52 |
-
$
|
53 |
-
? count((array) $this->collection)
|
54 |
-
: iterator_count($this->collection);
|
55 |
|
56 |
-
if ($
|
57 |
$this->collection[] = $this->data;
|
58 |
}
|
59 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\FeedTemplates;
|
4 |
|
5 |
+
use RebelCode\Wpra\Core\Data\Collections\CollectionInterface;
|
|
|
6 |
|
7 |
/**
|
8 |
* The handler that auto creates the default feed template.
|
12 |
class CreateDefaultFeedTemplateHandler
|
13 |
{
|
14 |
/**
|
15 |
+
* The collection of feed templates.
|
16 |
*
|
17 |
* @since 4.13
|
18 |
*
|
19 |
+
* @var CollectionInterface
|
20 |
*/
|
21 |
protected $collection;
|
22 |
|
34 |
*
|
35 |
* @since 4.13
|
36 |
*
|
37 |
+
* @param CollectionInterface $collection The feed templates collection.
|
38 |
+
* @param array $data The data to use for creating the default feed template.
|
39 |
*/
|
40 |
public function __construct($collection, $data)
|
41 |
{
|
48 |
*/
|
49 |
public function __invoke()
|
50 |
{
|
51 |
+
$slug = $this->data['slug'];
|
|
|
|
|
52 |
|
53 |
+
if (!isset($this->collection[$slug])) {
|
54 |
$this->collection[] = $this->data;
|
55 |
}
|
56 |
}
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
/**
|
6 |
* The handler that hides template content from the public-facing side unless a nonce is given.
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\FeedTemplates;
|
4 |
|
5 |
/**
|
6 |
* The handler that hides template content from the public-facing side unless a nonce is given.
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
/**
|
6 |
* The handler that detects a preview template request and redirects to the template's front-facing page.
|
@@ -82,10 +82,19 @@ class PreviewTemplateRedirectHandler
|
|
82 |
exit;
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
85 |
$urlQuery = parse_url($permalink, PHP_URL_QUERY);
|
86 |
$separator = (empty($urlQuery)) ? '?' : "&";
|
87 |
$nonce = wp_create_nonce($this->nonce);
|
88 |
-
$
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
wp_safe_redirect($fullUrl);
|
91 |
die;
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\FeedTemplates;
|
4 |
|
5 |
/**
|
6 |
* The handler that detects a preview template request and redirects to the template's front-facing page.
|
82 |
exit;
|
83 |
}
|
84 |
|
85 |
+
// Get the template options, if present. They will in the form of a Base64 string of their JSON serialization
|
86 |
+
$options = filter_input(INPUT_GET, 'wpra_template_options', FILTER_SANITIZE_STRING);
|
87 |
+
$options = empty($options) ? '' : $options;
|
88 |
+
|
89 |
$urlQuery = parse_url($permalink, PHP_URL_QUERY);
|
90 |
$separator = (empty($urlQuery)) ? '?' : "&";
|
91 |
$nonce = wp_create_nonce($this->nonce);
|
92 |
+
$getParams = [
|
93 |
+
'_wpnonce' => $nonce,
|
94 |
+
'options' => $options,
|
95 |
+
];
|
96 |
+
|
97 |
+
$fullUrl = $permalink . $separator . http_build_query($getParams);
|
98 |
|
99 |
wp_safe_redirect($fullUrl);
|
100 |
die;
|
@@ -1,8 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
-
use RebelCode\Wpra\Core\Data\Collections\CollectionInterface;
|
6 |
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
7 |
|
8 |
/**
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\FeedTemplates;
|
4 |
|
|
|
5 |
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
6 |
|
7 |
/**
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\FeedTemplates;
|
4 |
+
|
5 |
+
use Dhii\Output\RendererInterface;
|
6 |
+
use RebelCode\Wpra\Core\Wp\Asset\AssetInterface;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* The handler that renders the admin feed templates page.
|
10 |
+
*
|
11 |
+
* @since 4.13
|
12 |
+
*/
|
13 |
+
class RenderAdminTemplatesPageHandler
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* The list of assets required to render the page.
|
17 |
+
*
|
18 |
+
* @since 4.14
|
19 |
+
*
|
20 |
+
* @var AssetInterface[]
|
21 |
+
*/
|
22 |
+
protected $assets;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* RenderAdminTemplatesPageHandler constructor.
|
26 |
+
*
|
27 |
+
* @param AssetInterface[] $assets The list of assets required to render the page.
|
28 |
+
*/
|
29 |
+
public function __construct($assets)
|
30 |
+
{
|
31 |
+
$this->assets = $assets;
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @since 4.13
|
36 |
+
*/
|
37 |
+
public function __invoke()
|
38 |
+
{
|
39 |
+
foreach ($this->assets as $asset) {
|
40 |
+
$asset->enqueue();
|
41 |
+
}
|
42 |
+
|
43 |
+
echo wprss_render_template('admin/templates-page.twig', [
|
44 |
+
'title' => 'Templates',
|
45 |
+
'subtitle' => 'Follow these introductory steps to get started with WP RSS Aggregator.',
|
46 |
+
]);
|
47 |
+
}
|
48 |
+
}
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\FeedTemplates;
|
4 |
+
|
5 |
+
use Dhii\Output\TemplateInterface;
|
6 |
+
use RebelCode\Wpra\Core\Entities\Feeds\Templates\WpPostFeedTemplate;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* The handler that renders the template content, by rendering the template itself as would be done through normal
|
10 |
+
* means in WP RSS Aggregator.
|
11 |
+
*
|
12 |
+
* @since 4.13
|
13 |
+
*/
|
14 |
+
class RenderTemplateContentHandler
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* The name of the templates CPT.
|
18 |
+
*
|
19 |
+
* @since 4.13
|
20 |
+
*
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
protected $cpt;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* The master template to use for rendering.
|
27 |
+
*
|
28 |
+
* @since 4.13
|
29 |
+
*
|
30 |
+
* @var TemplateInterface
|
31 |
+
*/
|
32 |
+
protected $masterTemplate;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* The template to use for rendering previews.
|
36 |
+
*
|
37 |
+
* @since 4.14
|
38 |
+
*
|
39 |
+
* @var TemplateInterface
|
40 |
+
*/
|
41 |
+
protected $previewTemplate;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Constructor.
|
45 |
+
*
|
46 |
+
* @since 4.13
|
47 |
+
*
|
48 |
+
* @param string $cpt The name of the templates CPT.
|
49 |
+
* @param TemplateInterface $template The master template to use for rendering.
|
50 |
+
* @param TemplateInterface $previewTemplate The template to use for rendering previews.
|
51 |
+
*/
|
52 |
+
public function __construct($cpt, TemplateInterface $template, TemplateInterface $previewTemplate)
|
53 |
+
{
|
54 |
+
$this->cpt = $cpt;
|
55 |
+
$this->masterTemplate = $template;
|
56 |
+
$this->previewTemplate = $previewTemplate;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* {@inheritdoc}
|
61 |
+
*
|
62 |
+
* @since 4.13
|
63 |
+
*/
|
64 |
+
public function __invoke($content)
|
65 |
+
{
|
66 |
+
global $post;
|
67 |
+
|
68 |
+
// Check if current post type is a WPRA template
|
69 |
+
if ($post->post_type !== $this->cpt) {
|
70 |
+
return $content;
|
71 |
+
}
|
72 |
+
|
73 |
+
// Get the template instance
|
74 |
+
$template = new WpPostFeedTemplate($post);
|
75 |
+
|
76 |
+
// Check if this is a preview, determined by serialized options in the GET param
|
77 |
+
$options = filter_input(INPUT_GET, 'options', FILTER_DEFAULT);
|
78 |
+
if (!empty($options)) {
|
79 |
+
// Unserialize the options
|
80 |
+
$options = json_decode(base64_decode($options), true);
|
81 |
+
$options = empty($options) ? [] : (array) $options;
|
82 |
+
|
83 |
+
|
84 |
+
// Render the preview
|
85 |
+
return $this->previewTemplate->render([
|
86 |
+
'type' => $template['type'],
|
87 |
+
'options' => $options
|
88 |
+
]);
|
89 |
+
}
|
90 |
+
|
91 |
+
// Render the template
|
92 |
+
return $this->masterTemplate->render([
|
93 |
+
'template' => $template['slug'],
|
94 |
+
]);
|
95 |
+
}
|
96 |
+
}
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
/**
|
6 |
* Class for retrieving feed sources in Gutenberg block.
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\GutenbergBlock;
|
4 |
|
5 |
/**
|
6 |
* Class for retrieving feed sources in Gutenberg block.
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\GutenbergBlock;
|
4 |
+
|
5 |
+
use Dhii\Output\RendererInterface;
|
6 |
+
use RebelCode\Wpra\Core\Wp\Asset\AssetInterface;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class for registering assets for gutenberg block.
|
10 |
+
*
|
11 |
+
* @since 4.13
|
12 |
+
*/
|
13 |
+
class GutenbergBlockAssetsHandler
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* The list of assets required to render the block.
|
17 |
+
*
|
18 |
+
* @since 4.14
|
19 |
+
*
|
20 |
+
* @var AssetInterface[]
|
21 |
+
*/
|
22 |
+
protected $assets;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* The list of states for the block.
|
26 |
+
*
|
27 |
+
* @since 4.14
|
28 |
+
*
|
29 |
+
* @var RendererInterface[]
|
30 |
+
*/
|
31 |
+
protected $states;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* GutenbergBlockAssetsHandler constructor.
|
35 |
+
*
|
36 |
+
* @param AssetInterface[] $assets The list of assets for the block.
|
37 |
+
* @param RendererInterface[] $states The list of states for the block.
|
38 |
+
*/
|
39 |
+
public function __construct(array $assets, array $states)
|
40 |
+
{
|
41 |
+
$this->assets = $assets;
|
42 |
+
$this->states = $states;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* {@inheritdoc}
|
47 |
+
*
|
48 |
+
* @since 4.13
|
49 |
+
*/
|
50 |
+
public function __invoke()
|
51 |
+
{
|
52 |
+
foreach ($this->assets as $asset) {
|
53 |
+
$asset->enqueue();
|
54 |
+
}
|
55 |
+
|
56 |
+
foreach ($this->states as $state) {
|
57 |
+
$state->render();
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\Images;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* The handler that adds the images column to the feed items page.
|
7 |
+
*
|
8 |
+
* @since 4.14
|
9 |
+
*/
|
10 |
+
class AddItemsImageColumnHandler
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* @since 4.14
|
14 |
+
*
|
15 |
+
* @var string
|
16 |
+
*/
|
17 |
+
protected $key;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @since 4.14
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
protected $name;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @since 4.14
|
28 |
+
*
|
29 |
+
* @var int
|
30 |
+
*/
|
31 |
+
protected $pos;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Constructor.
|
35 |
+
*
|
36 |
+
* @since 4.14
|
37 |
+
*
|
38 |
+
* @param string $key The column key.
|
39 |
+
* @param string $name The column name.
|
40 |
+
* @param int $pos The column position, 0-based.
|
41 |
+
*/
|
42 |
+
public function __construct($key, $name, $pos)
|
43 |
+
{
|
44 |
+
$this->key = $key;
|
45 |
+
$this->name = $name;
|
46 |
+
$this->pos = $pos;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @inheritdoc
|
51 |
+
*
|
52 |
+
* @since 4.14
|
53 |
+
*/
|
54 |
+
public function __invoke($columns)
|
55 |
+
{
|
56 |
+
$before = array_slice($columns, 0, $this->pos, true);
|
57 |
+
$after = array_slice($columns, $this->pos, null, true);
|
58 |
+
|
59 |
+
return $before + [$this->key => $this->name] + $after;
|
60 |
+
}
|
61 |
+
}
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\Images;
|
4 |
+
|
5 |
+
use Exception;
|
6 |
+
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* The handler that deletes attached images for an imported item.
|
10 |
+
*
|
11 |
+
* @since 4.14
|
12 |
+
*/
|
13 |
+
class DeleteImagesHandler
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @since 4.14
|
17 |
+
*
|
18 |
+
* @var DataSetInterface
|
19 |
+
*/
|
20 |
+
protected $importedItems;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Constructor.
|
24 |
+
*
|
25 |
+
* @since 4.14
|
26 |
+
*
|
27 |
+
* @param DataSetInterface $importedItems The imported items data set.
|
28 |
+
*/
|
29 |
+
public function __construct(DataSetInterface $importedItems)
|
30 |
+
{
|
31 |
+
$this->importedItems = $importedItems;
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @inheritdoc
|
36 |
+
*
|
37 |
+
* @since 4.14
|
38 |
+
*/
|
39 |
+
public function __invoke($post_id)
|
40 |
+
{
|
41 |
+
try {
|
42 |
+
$item = $this->importedItems[$post_id];
|
43 |
+
} catch (Exception $e) {
|
44 |
+
// Item is not imported by WPRA or does not exist
|
45 |
+
return;
|
46 |
+
}
|
47 |
+
|
48 |
+
// Get the attachments
|
49 |
+
$attachments = get_children([
|
50 |
+
'post_parent' => $item['id'],
|
51 |
+
'post_type' => 'attachment',
|
52 |
+
'post_mime_type' => 'image',
|
53 |
+
]);
|
54 |
+
|
55 |
+
// Delete them
|
56 |
+
foreach ($attachments as $id => $attachment) {
|
57 |
+
wp_delete_post($id);
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\Images;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* The handler that removes the WordPress featured image meta box.
|
7 |
+
*
|
8 |
+
* @since 4.14
|
9 |
+
*/
|
10 |
+
class RemoveFtImageMetaBoxHandler
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* @inheritdoc
|
14 |
+
*
|
15 |
+
* @since 4.14
|
16 |
+
*/
|
17 |
+
public function __invoke()
|
18 |
+
{
|
19 |
+
// Removes the 'Featured Image' meta box
|
20 |
+
remove_meta_box('postimagediv', 'wprss_feed', 'side');
|
21 |
+
// Removes the hook that E&T uses to add the same meta box
|
22 |
+
remove_action('do_meta_boxes', 'wprss_et_feed_default_thumbnail_metabox');
|
23 |
+
}
|
24 |
+
}
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\Images;
|
4 |
+
|
5 |
+
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* The handler that renders the contents of the images column in the feed items page.
|
9 |
+
*
|
10 |
+
* @since 4.14
|
11 |
+
*/
|
12 |
+
class RenderItemsImageColumnHandler
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* @since 4.14
|
16 |
+
*
|
17 |
+
* @var DataSetInterface
|
18 |
+
*/
|
19 |
+
protected $feedItems;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @since 4.14
|
23 |
+
*
|
24 |
+
* @var string
|
25 |
+
*/
|
26 |
+
protected $column;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Constructor.
|
30 |
+
*
|
31 |
+
* @since 4.14
|
32 |
+
*
|
33 |
+
* @param DataSetInterface $feedItems
|
34 |
+
* @param string $column
|
35 |
+
*/
|
36 |
+
public function __construct(DataSetInterface $feedItems, $column)
|
37 |
+
{
|
38 |
+
$this->feedItems = $feedItems;
|
39 |
+
$this->column = $column;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @inheritdoc
|
44 |
+
*
|
45 |
+
* @since 4.14
|
46 |
+
*/
|
47 |
+
public function __invoke($column, $postId)
|
48 |
+
{
|
49 |
+
if (!isset($this->feedItems[$postId]) || $column !== $this->column) {
|
50 |
+
return;
|
51 |
+
}
|
52 |
+
|
53 |
+
$feedItem = $this->feedItems[$postId];
|
54 |
+
$image = isset($feedItem['ft_image_url'])
|
55 |
+
? $feedItem['ft_image_url']
|
56 |
+
: null;
|
57 |
+
|
58 |
+
if (empty($image)) {
|
59 |
+
return;
|
60 |
+
}
|
61 |
+
|
62 |
+
printf(
|
63 |
+
'<div><img src="%1$s" alt="%2$s" title="%2$s" class="wpra-item-ft-image" /></div>',
|
64 |
+
$feedItem['ft_image_url'],
|
65 |
+
__('Feed item image', 'wprss')
|
66 |
+
);
|
67 |
+
}
|
68 |
+
}
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
/**
|
6 |
* A handler that loads a plugin's text domain.
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
/**
|
6 |
* A handler that loads a plugin's text domain.
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\Logger;
|
4 |
+
|
5 |
+
use RebelCode\Wpra\Core\Logger\ClearableLoggerInterface;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Handles log clearing requests.
|
9 |
+
*
|
10 |
+
* @since 4.14
|
11 |
+
*/
|
12 |
+
class ClearLogHandler
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* @since 4.14
|
16 |
+
*
|
17 |
+
* @var ClearableLoggerInterface
|
18 |
+
*/
|
19 |
+
protected $logger;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @since 4.14
|
23 |
+
*
|
24 |
+
* @var string
|
25 |
+
*/
|
26 |
+
protected $nonceName;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Constructor.
|
30 |
+
*
|
31 |
+
* @since 4.14
|
32 |
+
*
|
33 |
+
* @param ClearableLoggerInterface $logger The logger.
|
34 |
+
* @param string $nonceName The name of the nonce to verify requests.
|
35 |
+
*/
|
36 |
+
public function __construct(ClearableLoggerInterface $logger, $nonceName)
|
37 |
+
{
|
38 |
+
$this->logger = $logger;
|
39 |
+
$this->nonceName = $nonceName;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @inheritdoc
|
44 |
+
*
|
45 |
+
* @since 4.14
|
46 |
+
*/
|
47 |
+
public function __invoke()
|
48 |
+
{
|
49 |
+
$clearLog = filter_input(INPUT_POST, 'wpra-clear-log', FILTER_DEFAULT);
|
50 |
+
|
51 |
+
if (empty($clearLog) || !check_admin_referer($this->nonceName)) {
|
52 |
+
return;
|
53 |
+
}
|
54 |
+
|
55 |
+
$this->logger->clearLogs();
|
56 |
+
}
|
57 |
+
}
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\Logger;
|
4 |
+
|
5 |
+
use RebelCode\Wpra\Core\Logger\LogReaderInterface;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Handles log download requests.
|
9 |
+
*
|
10 |
+
* @since 4.14
|
11 |
+
*/
|
12 |
+
class DownloadLogHandler
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* @var LogReaderInterface
|
16 |
+
*/
|
17 |
+
protected $reader;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @since 4.14
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
protected $nonceName;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Constructor.
|
28 |
+
*
|
29 |
+
* @since 4.14
|
30 |
+
*
|
31 |
+
* @param LogReaderInterface $reader The log reader.
|
32 |
+
* @param string $nonceName The name of the nonce to verify requests.
|
33 |
+
*/
|
34 |
+
public function __construct(LogReaderInterface $reader, $nonceName)
|
35 |
+
{
|
36 |
+
$this->reader = $reader;
|
37 |
+
$this->nonceName = $nonceName;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @inheritdoc
|
42 |
+
*
|
43 |
+
* @since 4.14
|
44 |
+
*/
|
45 |
+
public function __invoke()
|
46 |
+
{
|
47 |
+
$downloadLog = filter_input(INPUT_POST, 'wpra-download-log', FILTER_DEFAULT);
|
48 |
+
|
49 |
+
if (empty($downloadLog) || !check_admin_referer($this->nonceName)) {
|
50 |
+
return;
|
51 |
+
}
|
52 |
+
|
53 |
+
wprss_download_log();
|
54 |
+
}
|
55 |
+
}
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\Logger;
|
4 |
+
|
5 |
+
use Dhii\Output\TemplateInterface;
|
6 |
+
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
7 |
+
use RebelCode\Wpra\Core\Logger\LogReaderInterface;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* The handler that renders the log.
|
11 |
+
*
|
12 |
+
* @since 4.14
|
13 |
+
*/
|
14 |
+
class RenderLogHandler
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* @since 4.14
|
18 |
+
*
|
19 |
+
* @var LogReaderInterface
|
20 |
+
*/
|
21 |
+
protected $reader;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @since 4.14
|
25 |
+
*
|
26 |
+
* @var TemplateInterface
|
27 |
+
*/
|
28 |
+
protected $template;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @since 4.14
|
32 |
+
*
|
33 |
+
* @var DataSetInterface
|
34 |
+
*/
|
35 |
+
protected $config;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @since 4.14
|
39 |
+
*
|
40 |
+
* @var string
|
41 |
+
*/
|
42 |
+
protected $nonceName;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @since 4.14
|
46 |
+
*
|
47 |
+
* @var int
|
48 |
+
*/
|
49 |
+
protected $numLogs;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Constructor.
|
53 |
+
*
|
54 |
+
* @since 4.14
|
55 |
+
*
|
56 |
+
* @param LogReaderInterface $reader The log reader.
|
57 |
+
* @param TemplateInterface $template The template to render.
|
58 |
+
* @param DataSetInterface $config The logging config.
|
59 |
+
* @param string $nonceName The name of the nonce to use for log operations.
|
60 |
+
* @param int $numLogs The number of logs to show.
|
61 |
+
*/
|
62 |
+
public function __construct(
|
63 |
+
LogReaderInterface $reader,
|
64 |
+
TemplateInterface $template,
|
65 |
+
DataSetInterface $config,
|
66 |
+
$nonceName,
|
67 |
+
$numLogs = 200
|
68 |
+
) {
|
69 |
+
$this->reader = $reader;
|
70 |
+
$this->template = $template;
|
71 |
+
$this->config = $config;
|
72 |
+
$this->numLogs = $numLogs;
|
73 |
+
$this->nonceName = $nonceName;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* @inheritdoc
|
78 |
+
*
|
79 |
+
* @since 4.14
|
80 |
+
*/
|
81 |
+
public function __invoke()
|
82 |
+
{
|
83 |
+
echo $this->template->render([
|
84 |
+
'logs' => $this->reader->getLogs($this->numLogs),
|
85 |
+
'nonce_name' => $this->nonceName,
|
86 |
+
'config' => $this->config,
|
87 |
+
'show_options' => true,
|
88 |
+
]);
|
89 |
+
}
|
90 |
+
}
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\Logger;
|
4 |
+
|
5 |
+
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Handles log option save requests.
|
9 |
+
*
|
10 |
+
* @since 4.14
|
11 |
+
*/
|
12 |
+
class SaveLogOptionsHandler
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* @since 4.14
|
16 |
+
*
|
17 |
+
* @var DataSetInterface
|
18 |
+
*/
|
19 |
+
protected $config;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @since 4.14
|
23 |
+
*
|
24 |
+
* @var string
|
25 |
+
*/
|
26 |
+
protected $nonceName;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Constructor.
|
30 |
+
*
|
31 |
+
* @since 4.14
|
32 |
+
*
|
33 |
+
* @param DataSetInterface $config The logging config data set.
|
34 |
+
* @param string $nonceName The name of the nonce to verify requests.
|
35 |
+
*/
|
36 |
+
public function __construct(DataSetInterface $config, $nonceName)
|
37 |
+
{
|
38 |
+
$this->config = $config;
|
39 |
+
$this->nonceName = $nonceName;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @inheritdoc
|
44 |
+
*
|
45 |
+
* @since 4.14
|
46 |
+
*/
|
47 |
+
public function __invoke()
|
48 |
+
{
|
49 |
+
$logOptions = filter_input(INPUT_POST, 'wpra-log-options', FILTER_DEFAULT);
|
50 |
+
|
51 |
+
if (empty($logOptions) || !check_admin_referer($this->nonceName)) {
|
52 |
+
return;
|
53 |
+
}
|
54 |
+
|
55 |
+
$this->config['logging/enabled'] = filter_input(
|
56 |
+
INPUT_POST,
|
57 |
+
'logging_enabled',
|
58 |
+
FILTER_VALIDATE_BOOLEAN
|
59 |
+
);
|
60 |
+
|
61 |
+
$this->config['logging/limit_days'] = filter_input(
|
62 |
+
INPUT_POST,
|
63 |
+
'logging_limit_days',
|
64 |
+
FILTER_VALIDATE_INT
|
65 |
+
);
|
66 |
+
}
|
67 |
+
}
|
@@ -1,7 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
|
|
5 |
use RebelCode\Wpra\Core\Database\TableInterface;
|
6 |
|
7 |
/**
|
@@ -21,26 +22,26 @@ class TruncateLogsCronHandler
|
|
21 |
protected $table;
|
22 |
|
23 |
/**
|
24 |
-
*
|
25 |
*
|
26 |
-
* @since 4.
|
27 |
*
|
28 |
-
* @var
|
29 |
*/
|
30 |
-
protected $
|
31 |
|
32 |
/**
|
33 |
* Constructor.
|
34 |
*
|
35 |
* @since 4.13
|
36 |
*
|
37 |
-
* @param TableInterface
|
38 |
-
* @param
|
39 |
*/
|
40 |
-
public function __construct(TableInterface $table, $
|
41 |
{
|
42 |
$this->table = $table;
|
43 |
-
$this->
|
44 |
}
|
45 |
|
46 |
/**
|
@@ -50,9 +51,15 @@ class TruncateLogsCronHandler
|
|
50 |
*/
|
51 |
public function __invoke()
|
52 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
// Filter to retrieve logs older than 60 days
|
54 |
$table = $this->table->filter([
|
55 |
-
'where' => 'DATEDIFF(CURDATE(), `date`) >
|
56 |
]);
|
57 |
|
58 |
// Clear the filtered table
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers\Logger;
|
4 |
|
5 |
+
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
6 |
use RebelCode\Wpra\Core\Database\TableInterface;
|
7 |
|
8 |
/**
|
22 |
protected $table;
|
23 |
|
24 |
/**
|
25 |
+
* The logging config data set.
|
26 |
*
|
27 |
+
* @since 4.14
|
28 |
*
|
29 |
+
* @var DataSetInterface
|
30 |
*/
|
31 |
+
protected $config;
|
32 |
|
33 |
/**
|
34 |
* Constructor.
|
35 |
*
|
36 |
* @since 4.13
|
37 |
*
|
38 |
+
* @param TableInterface $table The log table.
|
39 |
+
* @param DataSetInterface $config The logging config data set.
|
40 |
*/
|
41 |
+
public function __construct(TableInterface $table, DataSetInterface $config)
|
42 |
{
|
43 |
$this->table = $table;
|
44 |
+
$this->config = $config;
|
45 |
}
|
46 |
|
47 |
/**
|
51 |
*/
|
52 |
public function __invoke()
|
53 |
{
|
54 |
+
$daysLimit = $this->config['logging/limit_days'];
|
55 |
+
|
56 |
+
if (empty($daysLimit) || $daysLimit <= 0) {
|
57 |
+
return;
|
58 |
+
}
|
59 |
+
|
60 |
// Filter to retrieve logs older than 60 days
|
61 |
$table = $this->table->filter([
|
62 |
+
'where' => sprintf('DATEDIFF(CURDATE(), `date`) > %d', $daysLimit),
|
63 |
]);
|
64 |
|
65 |
// Clear the filtered table
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use stdClass;
|
6 |
use Traversable;
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
use stdClass;
|
6 |
use Traversable;
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
/**
|
6 |
* An implementation of a null handler that does nothing.
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
/**
|
6 |
* An implementation of a null handler that does nothing.
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
/**
|
6 |
* A handler for registering custom post types.
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
/**
|
6 |
* A handler for registering custom post types.
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
/**
|
6 |
* A handler for Gutenberg block registration.
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
/**
|
6 |
* A handler for Gutenberg block registration.
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use stdClass;
|
6 |
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
use stdClass;
|
6 |
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
+
|
5 |
+
use WP_Screen;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* A generic handler for registering WordPress meta boxes.
|
9 |
+
*
|
10 |
+
* @since 4.14
|
11 |
+
*/
|
12 |
+
class RegisterMetaBoxHandler
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* @since 4.14
|
16 |
+
*/
|
17 |
+
const CONTEXT_NORMAL = 'normal';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @since 4.14
|
21 |
+
*/
|
22 |
+
const CONTEXT_ADVANCED = 'advanced';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @since 4.14
|
26 |
+
*/
|
27 |
+
const CONTEXT_SIDE = 'side';
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @since 4.14
|
31 |
+
*/
|
32 |
+
const PRIORITY_DEFAULT = 'default';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @since 4.14
|
36 |
+
*/
|
37 |
+
const PRIORITY_LOW = 'low';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* @since 4.14
|
41 |
+
*/
|
42 |
+
const PRIORITY_HIGH = 'high';
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @since 4.14
|
46 |
+
*
|
47 |
+
* @var string
|
48 |
+
*/
|
49 |
+
protected $id;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @since 4.14
|
53 |
+
*
|
54 |
+
* @var string
|
55 |
+
*/
|
56 |
+
protected $title;
|
57 |
+
|
58 |
+
/**
|
59 |
+
* @since 4.14
|
60 |
+
*
|
61 |
+
* @var callable
|
62 |
+
*/
|
63 |
+
protected $callback;
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @since 4.14
|
67 |
+
*
|
68 |
+
* @var string
|
69 |
+
*/
|
70 |
+
protected $screen;
|
71 |
+
|
72 |
+
/**
|
73 |
+
* @since 4.14
|
74 |
+
*
|
75 |
+
* @var string|array|WP_Screen
|
76 |
+
*/
|
77 |
+
protected $context;
|
78 |
+
|
79 |
+
/**
|
80 |
+
* @since 4.14
|
81 |
+
*
|
82 |
+
* @var string
|
83 |
+
*/
|
84 |
+
protected $priority;
|
85 |
+
|
86 |
+
/**
|
87 |
+
* @since 4.14
|
88 |
+
*
|
89 |
+
* @var array
|
90 |
+
*/
|
91 |
+
protected $args;
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Constructor.
|
95 |
+
*
|
96 |
+
* @since 4.14
|
97 |
+
*
|
98 |
+
* @param string $id The meta box ID.
|
99 |
+
* @param string $title The title of the meta box.
|
100 |
+
* @param callable $callback The callback that renders the contents of the meta box.
|
101 |
+
* @param string|array|WP_Screen $screen The screen(s) on which to add the meta box.
|
102 |
+
* @param string $context The meta box context. See the `CONTEXT_*` constants in this class.
|
103 |
+
* @param string $priority The meta box priority. See the `PRIORITY_*` constants in this class.
|
104 |
+
* @param array $args Additional arguments to pass to the render callback.
|
105 |
+
*/
|
106 |
+
public function __construct(
|
107 |
+
$id,
|
108 |
+
$title,
|
109 |
+
callable $callback,
|
110 |
+
$screen,
|
111 |
+
$context = self::CONTEXT_NORMAL,
|
112 |
+
$priority = self::PRIORITY_DEFAULT,
|
113 |
+
array $args = []
|
114 |
+
) {
|
115 |
+
$this->id = $id;
|
116 |
+
$this->title = $title;
|
117 |
+
$this->callback = $callback;
|
118 |
+
$this->screen = $screen;
|
119 |
+
$this->context = $context;
|
120 |
+
$this->priority = $priority;
|
121 |
+
$this->args = $args;
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* @inheritdoc
|
126 |
+
*
|
127 |
+
* @since 4.14
|
128 |
+
*/
|
129 |
+
public function __invoke()
|
130 |
+
{
|
131 |
+
add_meta_box(
|
132 |
+
$this->id,
|
133 |
+
$this->title,
|
134 |
+
$this->callback,
|
135 |
+
$this->screen,
|
136 |
+
$this->context,
|
137 |
+
$this->priority,
|
138 |
+
$this->args
|
139 |
+
);
|
140 |
+
}
|
141 |
+
}
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
/**
|
6 |
* A generic handler implementation that registers a WordPress shortcode.
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
/**
|
6 |
* A generic handler implementation that registers a WordPress shortcode.
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use stdClass;
|
6 |
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
use stdClass;
|
6 |
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
use Dhii\Output\TemplateInterface;
|
6 |
use stdClass;
|
@@ -31,6 +31,15 @@ class RenderTemplateHandler
|
|
31 |
*/
|
32 |
protected $context;
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
/**
|
35 |
* Constructor.
|
36 |
*
|
@@ -39,11 +48,14 @@ class RenderTemplateHandler
|
|
39 |
* @param TemplateInterface $template The template to render.
|
40 |
* @param array|callable $context The template context or a callback that receives the handler's arguments
|
41 |
* and returns the template context.
|
|
|
|
|
42 |
*/
|
43 |
-
public function __construct(TemplateInterface $template, $context = [])
|
44 |
{
|
45 |
$this->template = $template;
|
46 |
$this->context = $context;;
|
|
|
47 |
}
|
48 |
|
49 |
/**
|
@@ -57,6 +69,12 @@ class RenderTemplateHandler
|
|
57 |
? call_user_func_array($this->context, func_get_args())
|
58 |
: $this->context;
|
59 |
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
use Dhii\Output\TemplateInterface;
|
6 |
use stdClass;
|
31 |
*/
|
32 |
protected $context;
|
33 |
|
34 |
+
/**
|
35 |
+
* If true, the rendered content is echoed to the output buffer. Otherwise, it is returned.
|
36 |
+
*
|
37 |
+
* @since 4.14
|
38 |
+
*
|
39 |
+
* @var bool
|
40 |
+
*/
|
41 |
+
protected $echo;
|
42 |
+
|
43 |
/**
|
44 |
* Constructor.
|
45 |
*
|
48 |
* @param TemplateInterface $template The template to render.
|
49 |
* @param array|callable $context The template context or a callback that receives the handler's arguments
|
50 |
* and returns the template context.
|
51 |
+
* @param bool $echo If true, the rendered content is echoed to the output buffer. Otherwise, it
|
52 |
+
* is returned.
|
53 |
*/
|
54 |
+
public function __construct(TemplateInterface $template, $context = [], $echo = false)
|
55 |
{
|
56 |
$this->template = $template;
|
57 |
$this->context = $context;;
|
58 |
+
$this->echo = $echo;
|
59 |
}
|
60 |
|
61 |
/**
|
69 |
? call_user_func_array($this->context, func_get_args())
|
70 |
: $this->context;
|
71 |
|
72 |
+
$content = $this->template->render($ctx);
|
73 |
+
|
74 |
+
if ($this->echo) {
|
75 |
+
echo $content;
|
76 |
+
}
|
77 |
+
|
78 |
+
return ($this->echo) ? '' : $content;
|
79 |
}
|
80 |
}
|
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace RebelCode\Wpra\Core\
|
4 |
|
5 |
/**
|
6 |
* A generic handler that schedules a WordPress cron job and its handler.
|
1 |
<?php
|
2 |
|
3 |
+
namespace RebelCode\Wpra\Core\Handlers;
|
4 |
|
5 |
/**
|
6 |
* A generic handler that schedules a WordPress cron job and its handler.
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Importer\Images;
|
4 |
+
|
5 |
+
use Psr\Container\ContainerInterface;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* An image container decorator that can detect Facebook image URLs and convert them for large image URLs.
|
9 |
+
*
|
10 |
+
* @since 4.14
|
11 |
+
*/
|
12 |
+
class FbImageContainer implements ContainerInterface
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* The container instance to decorate.
|
16 |
+
*
|
17 |
+
* @since 4.14
|
18 |
+
*
|
19 |
+
* @var ContainerInterface
|
20 |
+
*/
|
21 |
+
protected $container;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Constructor.
|
25 |
+
*
|
26 |
+
* @since 4.14
|
27 |
+
*
|
28 |
+
* @param ContainerInterface $container The container instance to decorate.
|
29 |
+
*/
|
30 |
+
public function __construct(ContainerInterface $container)
|
31 |
+
{
|
32 |
+
$this->container = $container;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @inheritdoc
|
37 |
+
*
|
38 |
+
* @since 4.14
|
39 |
+
*/
|
40 |
+
public function get($url)
|
41 |
+
{
|
42 |
+
return $this->container->get($this->getFbUrl($url));
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* @inheritdoc
|
47 |
+
*
|
48 |
+
* @since 4.14
|
49 |
+
*/
|
50 |
+
public function has($url)
|
51 |
+
{
|
52 |
+
return $this->container->has($url);
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Checks if a URL is from Facebook and attempts to modify the URL to point to the larger version of the image.
|
57 |
+
*
|
58 |
+
* @since 4.14
|
59 |
+
*
|
60 |
+
* @param string $url The original image URL.
|
61 |
+
*
|
62 |
+
* @return string The URL of the found large image, or the original image URL if no large image was found or the
|
63 |
+
* image is not from Facebook.
|
64 |
+
*/
|
65 |
+
protected function getFbUrl($url)
|
66 |
+
{
|
67 |
+
// Check if image is provided from Facebook's CDN, and if so remove any "_s" small image extension in the URL
|
68 |
+
if (stripos($url, 'fbcdn') > 0) {
|
69 |
+
$imageExt = strrchr($url, '.');
|
70 |
+
$largerImgUrl = str_replace('_s' . $imageExt, '_n' . $imageExt, $url);
|
71 |
+
|
72 |
+
if ($this->has($largerImgUrl)) {
|
73 |
+
$url = $largerImgUrl;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
// If the URL is from 'fbexternal-a.akamaihd.net',an included GET param points to the original image
|
78 |
+
if (parse_url($url, PHP_URL_HOST) === 'fbexternal-a.akamaihd.net') {
|
79 |
+
// Get the query string
|
80 |
+
$queryStr = parse_url($url, PHP_URL_QUERY);
|
81 |
+
// If not empty
|
82 |
+
if (!empty($queryStr)) {
|
83 |
+
// Parse it
|
84 |
+
parse_str(urldecode($queryStr), $output);
|
85 |
+
|
86 |
+
// If it has a url GET param, use it as the image URL
|
87 |
+
if (isset($output['amp;url'])) {
|
88 |
+
$output['url'] = $output['amp;url'];
|
89 |
+
}
|
90 |
+
|
91 |
+
if (isset($output['url'])) {
|
92 |
+
$url = urldecode($output['url']);
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
return $url;
|
98 |
+
}
|
99 |
+
}
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Importer\Images;
|
4 |
+
|
5 |
+
use Aventura\Wprss\Core\Caching\ImageCache;
|
6 |
+
use Dhii\Di\Exception\ContainerException;
|
7 |
+
use Exception;
|
8 |
+
use Psr\Container\ContainerInterface;
|
9 |
+
use Psr\Log\LoggerInterface;
|
10 |
+
use WPRSS_Image_Cache_Image;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* A container implementation for fetching remote images and checking if they exist remotely.
|
14 |
+
*
|
15 |
+
* @since 4.14
|
16 |
+
*/
|
17 |
+
class ImageContainer implements ContainerInterface
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* @since 4.14
|
21 |
+
*
|
22 |
+
* @var ImageCache
|
23 |
+
*/
|
24 |
+
protected $cache;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @since 4.14
|
28 |
+
*
|
29 |
+
* @var LoggerInterface
|
30 |
+
*/
|
31 |
+
protected $logger;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Constructor.
|
35 |
+
*
|
36 |
+
* @since 4.14
|
37 |
+
*
|
38 |
+
* @param ImageCache $cache The image cache instance.
|
39 |
+
* @param LoggerInterface $logger The logger instance.
|
40 |
+
*/
|
41 |
+
public function __construct(ImageCache $cache, LoggerInterface $logger)
|
42 |
+
{
|
43 |
+
$this->cache = $cache;
|
44 |
+
$this->logger = $logger;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @inheritdoc
|
49 |
+
*
|
50 |
+
* @since 4.14
|
51 |
+
*
|
52 |
+
* @return WPRSS_Image_Cache_Image
|
53 |
+
*/
|
54 |
+
public function get($url)
|
55 |
+
{
|
56 |
+
if (empty($url)) {
|
57 |
+
throw new ContainerException(__('Image URL cannot be empty', 'wprss'), 0, null);
|
58 |
+
}
|
59 |
+
|
60 |
+
try {
|
61 |
+
return $this->cache->get_images($url);
|
62 |
+
} catch (Exception $e) {
|
63 |
+
$message = $e->getMessage();
|
64 |
+
|
65 |
+
$this->logger->warning(
|
66 |
+
'Image could not be downloaded from {url}. Error: {error}',
|
67 |
+
[
|
68 |
+
'url' => $url,
|
69 |
+
'error' => $message,
|
70 |
+
]
|
71 |
+
);
|
72 |
+
|
73 |
+
throw new ContainerException($message);
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* @inheritdoc
|
79 |
+
*
|
80 |
+
* @since 4.14
|
81 |
+
*/
|
82 |
+
public function has($url)
|
83 |
+
{
|
84 |
+
$exists = false;
|
85 |
+
|
86 |
+
$curl = curl_init($url);
|
87 |
+
curl_setopt($curl, CURLOPT_NOBODY, true);
|
88 |
+
$response = curl_exec($curl);
|
89 |
+
|
90 |
+
if ($response !== false && curl_getinfo($curl, CURLINFO_HTTP_CODE) == 200) {
|
91 |
+
$exists = true;
|
92 |
+
}
|
93 |
+
|
94 |
+
curl_close($curl);
|
95 |
+
|
96 |
+
return $exists;
|
97 |
+
}
|
98 |
+
}
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Licensing;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* A class for standard WP RSS Aggregator addon class.
|
7 |
+
*
|
8 |
+
* @since 4.14
|
9 |
+
*/
|
10 |
+
class Addon
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* @since 4.14
|
14 |
+
*
|
15 |
+
* @var string
|
16 |
+
*/
|
17 |
+
public $key;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @since 4.14
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
public $name;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @since 4.14
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
public $version;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @since 4.14
|
35 |
+
*
|
36 |
+
* @var string
|
37 |
+
*/
|
38 |
+
public $filePath;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @since 4.14
|
42 |
+
*
|
43 |
+
* @var string
|
44 |
+
*/
|
45 |
+
public $storeUrl;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Constructor.
|
49 |
+
*
|
50 |
+
* @since 4.14
|
51 |
+
*
|
52 |
+
* @param string $key The addon key.
|
53 |
+
* @param string $name The addon name.
|
54 |
+
* @param string $version The addon plugin version.
|
55 |
+
* @param string $filePath The addon plugin file ath.
|
56 |
+
* @param string $storeUrl The addon licensing store URL.
|
57 |
+
*/
|
58 |
+
public function __construct($key, $name, $version, $filePath, $storeUrl)
|
59 |
+
{
|
60 |
+
$this->key = $key;
|
61 |
+
$this->name = $name;
|
62 |
+
$this->version = $version;
|
63 |
+
$this->filePath = $filePath;
|
64 |
+
$this->storeUrl = $storeUrl;
|
65 |
+
}
|
66 |
+
}
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Logger;
|
4 |
+
|
5 |
+
use Psr\Log\AbstractLogger;
|
6 |
+
use Psr\Log\LoggerInterface;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* A PSR-3 logger decorator that conditionally delegates to an inner logger.
|
10 |
+
*
|
11 |
+
* @since 4.14
|
12 |
+
*/
|
13 |
+
class ConditionalLogger extends AbstractLogger
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @since 4.14
|
17 |
+
*
|
18 |
+
* @var LoggerInterface
|
19 |
+
*/
|
20 |
+
protected $logger;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @since 4.14
|
24 |
+
*
|
25 |
+
* @var bool
|
26 |
+
*/
|
27 |
+
protected $enabled;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Constructor.
|
31 |
+
*
|
32 |
+
* @since 4.14
|
33 |
+
*
|
34 |
+
* @param LoggerInterface $logger The inner logger instance.
|
35 |
+
* @param bool $enabled The enabled flag: true to log using the inner logger, false to not log.
|
36 |
+
*/
|
37 |
+
public function __construct(LoggerInterface $logger, $enabled)
|
38 |
+
{
|
39 |
+
$this->logger = $logger;
|
40 |
+
$this->enabled = $enabled;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @inheritdoc
|
45 |
+
*
|
46 |
+
* @since 4.14
|
47 |
+
*/
|
48 |
+
public function log($level, $message, array $context = [])
|
49 |
+
{
|
50 |
+
if ($this->enabled) {
|
51 |
+
$this->logger->log($level, $message, $context);
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
@@ -154,6 +154,8 @@ class WpdbLogger extends AbstractLogger implements ClearableLoggerInterface, Log
|
|
154 |
foreach ($this->columns as $prop => $col) {
|
155 |
$log[$prop] = $row[$col];
|
156 |
}
|
|
|
|
|
157 |
$logs[] = $log;
|
158 |
}
|
159 |
|
154 |
foreach ($this->columns as $prop => $col) {
|
155 |
$log[$prop] = $row[$col];
|
156 |
}
|
157 |
+
$log['feed'] = get_post($log['feed_id']);
|
158 |
+
|
159 |
$logs[] = $log;
|
160 |
}
|
161 |
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Modules;
|
4 |
+
|
5 |
+
use Psr\Container\ContainerInterface;
|
6 |
+
use RebelCode\Wpra\Core\Wp\Asset\ScriptAsset;
|
7 |
+
use RebelCode\Wpra\Core\Wp\Asset\StyleAsset;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* The WP RSS Aggregator module that handles asset management and registration.
|
11 |
+
*
|
12 |
+
* @since 4.14
|
13 |
+
*/
|
14 |
+
class AssetsModule implements ModuleInterface
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* @inheritdoc
|
18 |
+
*
|
19 |
+
* @since 4.14
|
20 |
+
*/
|
21 |
+
public function run(ContainerInterface $c)
|
22 |
+
{
|
23 |
+
// Register assets for the admin side
|
24 |
+
add_action('admin_enqueue_scripts', function () use ($c) {
|
25 |
+
foreach ($c->get('wpra/assets/admin') as $asset) {
|
26 |
+
$asset->register();
|
27 |
+
}
|
28 |
+
});
|
29 |
+
|
30 |
+
// Register assets for the front side
|
31 |
+
add_action('wp_enqueue_scripts', function () use ($c) {
|
32 |
+
foreach ($c->get('wpra/assets/front') as $asset) {
|
33 |
+
$asset->register();
|
34 |
+
}
|
35 |
+
});
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @inheritdoc
|
40 |
+
*
|
41 |
+
* @since 4.14
|
42 |
+
*/
|
43 |
+
public function getFactories()
|
44 |
+
{
|
45 |
+
return [
|
46 |
+
'wpra/assets/admin' => function (ContainerInterface $c) {
|
47 |
+
return [
|
48 |
+
$c->get('wpra/assets/scripts/manifest'),
|
49 |
+
$c->get('wpra/assets/scripts/vendor'),
|
50 |
+
$c->get('wpra/assets/styles/common'),
|
51 |
+
];
|
52 |
+
},
|
53 |
+
'wpra/assets/front' => function (ContainerInterface $c) {
|
54 |
+
return [];
|
55 |
+
},
|
56 |
+
/*
|
57 |
+
* Manifest file holds function used for bootstrapping and ordered loading of dependencies and application.
|
58 |
+
*
|
59 |
+
* @since 4.14
|
60 |
+
*/
|
61 |
+
'wpra/assets/scripts/manifest' => function() {
|
62 |
+
return new ScriptAsset(
|
63 |
+
'wpra-manifest',
|
64 |
+
WPRSS_APP_JS . 'wpra-manifest.min.js',
|
65 |
+
[],
|
66 |
+
'0.1',
|
67 |
+
true
|
68 |
+
);
|
69 |
+
},
|
70 |
+
/*
|
71 |
+
* Vendor file holds all common dependencies for "compilable" applications.
|
72 |
+
*
|
73 |
+
* For example, `intro` pages application's and plugin's page application's files holds only logic for
|
74 |
+
* that particular application. Common dependencies like Vue live in this file and loaded before that
|
75 |
+
* application.
|
76 |
+
*
|
77 |
+
* @since 4.14
|
78 |
+
*/
|
79 |
+
'wpra/assets/scripts/vendor' => function() {
|
80 |
+
return new ScriptAsset(
|
81 |
+
'wpra-vendor',
|
82 |
+
WPRSS_APP_JS . 'wpra-vendor.min.js',
|
83 |
+
['wpra-manifest'],
|
84 |
+
'0.1',
|
85 |
+
true
|
86 |
+
);
|
87 |
+
},
|
88 |
+
/*
|
89 |
+
* The common styles.
|
90 |
+
*
|
91 |
+
* @since 4.14
|
92 |
+
*/
|
93 |
+
'wpra/assets/styles/common' => function () {
|
94 |
+
return new StyleAsset('wpra-common', WPRSS_APP_CSS . 'common.min.css');
|
95 |
+
},
|
96 |
+
];
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* @inheritdoc
|
101 |
+
*
|
102 |
+
* @since 4.14
|
103 |
+
*/
|
104 |
+
public function getExtensions()
|
105 |
+
{
|
106 |
+
return [];
|
107 |
+
}
|
108 |
+
}
|
@@ -3,7 +3,11 @@
|
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
|
|
6 |
use RebelCode\Wpra\Core\Data\ChangelogDataSet;
|
|
|
|
|
|
|
7 |
use RebelCode\Wpra\Core\Data\Wp\WpPluginInfoDataSet;
|
8 |
|
9 |
/**
|
@@ -146,6 +150,33 @@ class CoreModule implements ModuleInterface
|
|
146 |
'wpra/core/db_version' => function () {
|
147 |
return WPRSS_DB_VERSION;
|
148 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
/*
|
150 |
* The WP RSS Aggregator changelog.
|
151 |
*
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
+
use RebelCode\Wpra\Core\Data\ArrayDataSet;
|
7 |
use RebelCode\Wpra\Core\Data\ChangelogDataSet;
|
8 |
+
use RebelCode\Wpra\Core\Data\DeprefixingDataSet;
|
9 |
+
use RebelCode\Wpra\Core\Data\PrefixingDataSet;
|
10 |
+
use RebelCode\Wpra\Core\Data\Wp\WpOptionsDataSet;
|
11 |
use RebelCode\Wpra\Core\Data\Wp\WpPluginInfoDataSet;
|
12 |
|
13 |
/**
|
150 |
'wpra/core/db_version' => function () {
|
151 |
return WPRSS_DB_VERSION;
|
152 |
},
|
153 |
+
/*
|
154 |
+
* The config for WP RSS Aggregator.
|
155 |
+
*
|
156 |
+
* @since 4.14
|
157 |
+
*/
|
158 |
+
'wpra/core/config' => function (ContainerInterface $c) {
|
159 |
+
$prefix = $c->get('wpra/core/config/prefix');
|
160 |
+
$options = new DeprefixingDataSet($c->get('wpra/core/config/options'), $prefix);
|
161 |
+
|
162 |
+
return new PrefixingDataSet(new WpOptionsDataSet($options), $prefix, true);
|
163 |
+
},
|
164 |
+
/*
|
165 |
+
* The options available in the WP RSS Aggregator config.
|
166 |
+
*
|
167 |
+
* @since 4.14
|
168 |
+
*/
|
169 |
+
'wpra/core/config/options' => function () {
|
170 |
+
return new ArrayDataSet([]);
|
171 |
+
},
|
172 |
+
/*
|
173 |
+
* The prefix to use for config options.
|
174 |
+
*
|
175 |
+
* @since 4.14
|
176 |
+
*/
|
177 |
+
'wpra/core/config/prefix' => function (ContainerInterface $c) {
|
178 |
+
return 'wpra/';
|
179 |
+
},
|
180 |
/*
|
181 |
* The WP RSS Aggregator changelog.
|
182 |
*
|
@@ -4,8 +4,8 @@ namespace RebelCode\Wpra\Core\Modules;
|
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
use RebelCode\Wpra\Core\Data\ArrayDataSet;
|
7 |
-
use RebelCode\Wpra\Core\
|
8 |
-
use RebelCode\Wpra\Core\
|
9 |
|
10 |
/**
|
11 |
* The module for the WP RSS Aggregator custom feed.
|
@@ -71,8 +71,13 @@ class CustomFeedModule implements ModuleInterface
|
|
71 |
*
|
72 |
* @since 4.13
|
73 |
*/
|
74 |
-
'wpra/custom_feed/render_handler' => function () {
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
76 |
}
|
77 |
];
|
78 |
}
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
use RebelCode\Wpra\Core\Data\ArrayDataSet;
|
7 |
+
use RebelCode\Wpra\Core\Handlers\CustomFeed\RegisterCustomFeedHandler;
|
8 |
+
use RebelCode\Wpra\Core\Handlers\CustomFeed\RenderCustomFeedHandler;
|
9 |
|
10 |
/**
|
11 |
* The module for the WP RSS Aggregator custom feed.
|
71 |
*
|
72 |
* @since 4.13
|
73 |
*/
|
74 |
+
'wpra/custom_feed/render_handler' => function (ContainerInterface $c) {
|
75 |
+
$templates = $c->get('wpra/twig/collection');
|
76 |
+
|
77 |
+
return new RenderCustomFeedHandler(
|
78 |
+
$c->get('wpra/feeds/items/collection'),
|
79 |
+
$templates['custom-feed/main.twig']
|
80 |
+
);
|
81 |
}
|
82 |
];
|
83 |
}
|
@@ -3,10 +3,10 @@
|
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
-
use RebelCode\Wpra\Core\
|
7 |
-
use RebelCode\Wpra\Core\
|
8 |
-
use RebelCode\Wpra\Core\
|
9 |
-
use RebelCode\Wpra\Core\
|
10 |
|
11 |
/**
|
12 |
* The feed blacklist module for WP RSS Aggregator.
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
+
use RebelCode\Wpra\Core\Handlers\AddCptMetaCapsHandler;
|
7 |
+
use RebelCode\Wpra\Core\Handlers\FeedBlacklist\SaveBlacklistHandler;
|
8 |
+
use RebelCode\Wpra\Core\Handlers\NullHandler;
|
9 |
+
use RebelCode\Wpra\Core\Handlers\RegisterCptHandler;
|
10 |
|
11 |
/**
|
12 |
* The feed blacklist module for WP RSS Aggregator.
|
@@ -3,10 +3,10 @@
|
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
-
use RebelCode\Wpra\Core\Feeds\
|
7 |
-
use RebelCode\Wpra\Core\
|
8 |
-
use RebelCode\Wpra\Core\
|
9 |
-
use RebelCode\Wpra\Core\
|
10 |
|
11 |
/**
|
12 |
* The feed items module for WP RSS Aggregator.
|
@@ -88,6 +88,7 @@ class FeedItemsModule implements ModuleInterface
|
|
88 |
'capability_type' => $c->get('wpra/feeds/items/cpt/capability'),
|
89 |
'map_meta_cap' => true,
|
90 |
'labels' => $c->get('wpra/feeds/items/cpt/labels'),
|
|
|
91 |
];
|
92 |
},
|
93 |
/*
|
@@ -96,7 +97,7 @@ class FeedItemsModule implements ModuleInterface
|
|
96 |
* @since 4.13
|
97 |
*/
|
98 |
'wpra/feeds/items/collection' => function (ContainerInterface $c) {
|
99 |
-
return new
|
100 |
},
|
101 |
/*
|
102 |
* The handler that registers the feed items CPT.
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
+
use RebelCode\Wpra\Core\Entities\Feeds\Items\WpPostFeedItemCollection;
|
7 |
+
use RebelCode\Wpra\Core\Handlers\AddCptMetaCapsHandler;
|
8 |
+
use RebelCode\Wpra\Core\Handlers\NullHandler;
|
9 |
+
use RebelCode\Wpra\Core\Handlers\RegisterCptHandler;
|
10 |
|
11 |
/**
|
12 |
* The feed items module for WP RSS Aggregator.
|
88 |
'capability_type' => $c->get('wpra/feeds/items/cpt/capability'),
|
89 |
'map_meta_cap' => true,
|
90 |
'labels' => $c->get('wpra/feeds/items/cpt/labels'),
|
91 |
+
'supports' => ['title', 'editor', 'excerpt']
|
92 |
];
|
93 |
},
|
94 |
/*
|
97 |
* @since 4.13
|
98 |
*/
|
99 |
'wpra/feeds/items/collection' => function (ContainerInterface $c) {
|
100 |
+
return new WpPostFeedItemCollection($c->get('wpra/feeds/items/cpt/name'));
|
101 |
},
|
102 |
/*
|
103 |
* The handler that registers the feed items CPT.
|
@@ -3,8 +3,8 @@
|
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
-
use RebelCode\Wpra\Core\
|
7 |
-
use RebelCode\Wpra\Core\
|
8 |
use RebelCode\Wpra\Core\Templates\NullTemplate;
|
9 |
|
10 |
/**
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
+
use RebelCode\Wpra\Core\Handlers\FeedShortcode\FeedsShortcodeHandler;
|
7 |
+
use RebelCode\Wpra\Core\Handlers\RegisterShortcodeHandler;
|
8 |
use RebelCode\Wpra\Core\Templates\NullTemplate;
|
9 |
|
10 |
/**
|
@@ -3,12 +3,14 @@
|
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
-
use RebelCode\Wpra\Core\
|
7 |
-
use RebelCode\Wpra\Core\
|
8 |
-
use RebelCode\Wpra\Core\
|
9 |
-
use RebelCode\Wpra\Core\
|
10 |
-
use RebelCode\Wpra\Core\
|
11 |
-
use RebelCode\Wpra\Core\
|
|
|
|
|
12 |
use RebelCode\Wpra\Core\Templates\NullTemplate;
|
13 |
|
14 |
/**
|
@@ -34,6 +36,14 @@ class FeedSourcesModule implements ModuleInterface
|
|
34 |
'wpra/feeds/sources/cpt/name' => function () {
|
35 |
return 'wprss_feed';
|
36 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
/*
|
38 |
* The labels for the feed sources CPT.
|
39 |
*
|
@@ -185,6 +195,14 @@ class FeedSourcesModule implements ModuleInterface
|
|
185 |
$c->get('wpra/feeds/sources/handlers/add_cpt_capabilities'),
|
186 |
]);
|
187 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
];
|
189 |
}
|
190 |
|
@@ -208,5 +226,6 @@ class FeedSourcesModule implements ModuleInterface
|
|
208 |
add_action('init', $c->get('wpra/feeds/sources/handlers/register_cpt'));
|
209 |
add_filter('the_content', $c->get('wpra/feeds/sources/handlers/render_content'));
|
210 |
add_action('admin_init', $c->get('wpra/feeds/sources/add_capabilities_handler'));
|
|
|
211 |
}
|
212 |
}
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
+
use RebelCode\Wpra\Core\Entities\Feeds\Sources\WpPostFeedSourceCollection;
|
7 |
+
use RebelCode\Wpra\Core\Handlers\AddCapabilitiesHandler;
|
8 |
+
use RebelCode\Wpra\Core\Handlers\AddCptMetaCapsHandler;
|
9 |
+
use RebelCode\Wpra\Core\Handlers\FeedSources\FeedSourceSaveMetaHandler;
|
10 |
+
use RebelCode\Wpra\Core\Handlers\FeedSources\RenderFeedSourceContentHandler;
|
11 |
+
use RebelCode\Wpra\Core\Handlers\MultiHandler;
|
12 |
+
use RebelCode\Wpra\Core\Handlers\NullHandler;
|
13 |
+
use RebelCode\Wpra\Core\Handlers\RegisterCptHandler;
|
14 |
use RebelCode\Wpra\Core\Templates\NullTemplate;
|
15 |
|
16 |
/**
|
36 |
'wpra/feeds/sources/cpt/name' => function () {
|
37 |
return 'wprss_feed';
|
38 |
},
|
39 |
+
/*
|
40 |
+
* The collection for feed sources.
|
41 |
+
*
|
42 |
+
* @since 4.14
|
43 |
+
*/
|
44 |
+
'wpra/feeds/sources/collection' => function (ContainerInterface $c) {
|
45 |
+
return new WpPostFeedSourceCollection($c->get('wpra/feeds/sources/cpt/name'));
|
46 |
+
},
|
47 |
/*
|
48 |
* The labels for the feed sources CPT.
|
49 |
*
|
195 |
$c->get('wpra/feeds/sources/handlers/add_cpt_capabilities'),
|
196 |
]);
|
197 |
},
|
198 |
+
/*
|
199 |
+
* The handler that saves meta data for feed sources when saved through the edit page.
|
200 |
+
*
|
201 |
+
* @since 4.14
|
202 |
+
*/
|
203 |
+
'wpra/feeds/sources/meta_box/save_handler' => function (ContainerInterface $c) {
|
204 |
+
return new FeedSourceSaveMetaHandler();
|
205 |
+
},
|
206 |
];
|
207 |
}
|
208 |
|
226 |
add_action('init', $c->get('wpra/feeds/sources/handlers/register_cpt'));
|
227 |
add_filter('the_content', $c->get('wpra/feeds/sources/handlers/render_content'));
|
228 |
add_action('admin_init', $c->get('wpra/feeds/sources/add_capabilities_handler'));
|
229 |
+
add_action('save_post', $c->get('wpra/feeds/sources/meta_box/save_handler'), 20, 2);
|
230 |
}
|
231 |
}
|
@@ -5,26 +5,29 @@ namespace RebelCode\Wpra\Core\Modules;
|
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
use Psr\Log\NullLogger;
|
7 |
use RebelCode\Wpra\Core\Data\Collections\NullCollection;
|
8 |
-
use RebelCode\Wpra\Core\
|
9 |
-
use RebelCode\Wpra\Core\
|
10 |
-
use RebelCode\Wpra\Core\
|
11 |
-
use RebelCode\Wpra\Core\
|
12 |
-
use RebelCode\Wpra\Core\
|
13 |
-
use RebelCode\Wpra\Core\
|
14 |
-
use RebelCode\Wpra\Core\
|
15 |
-
use RebelCode\Wpra\Core\
|
16 |
-
use RebelCode\Wpra\Core\
|
17 |
-
use RebelCode\Wpra\Core\
|
18 |
-
use RebelCode\Wpra\Core\
|
|
|
19 |
use RebelCode\Wpra\Core\RestApi\EndPoints\EndPoint;
|
20 |
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\CreateUpdateTemplateEndPoint;
|
21 |
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\DeleteTemplateEndPoint;
|
22 |
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\GetTemplatesEndPoint;
|
23 |
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\PatchTemplateEndPoint;
|
24 |
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\RenderTemplateEndPoint;
|
25 |
-
use RebelCode\Wpra\Core\Templates\Feeds\FeedTemplateCollection;
|
26 |
use RebelCode\Wpra\Core\Templates\Feeds\MasterFeedsTemplate;
|
|
|
27 |
use RebelCode\Wpra\Core\Templates\Feeds\Types\ListTemplateType;
|
|
|
|
|
28 |
|
29 |
/**
|
30 |
* The templates module for WP RSS Aggregator.
|
@@ -41,37 +44,198 @@ class FeedTemplatesModule implements ModuleInterface
|
|
41 |
public function getFactories()
|
42 |
{
|
43 |
return [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
/*
|
45 |
* The default feed template's slug name.
|
46 |
*
|
47 |
* @since 4.13
|
48 |
*/
|
49 |
-
'wpra/templates/
|
50 |
return 'default';
|
51 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
/*
|
53 |
* The master feed template.
|
54 |
*
|
55 |
* @since 4.13
|
56 |
*/
|
57 |
-
'wpra/templates/
|
58 |
return new MasterFeedsTemplate(
|
59 |
-
$c->get('wpra/templates/
|
60 |
-
$c->get('wpra/templates/
|
61 |
-
$c->get('wpra/templates/
|
62 |
-
$c->get('wpra/templates/
|
63 |
-
$c->get('wpra/templates/
|
64 |
$c->get('wpra/display/feeds/legacy_template'),
|
65 |
-
$c->get('wpra/templates/
|
66 |
);
|
67 |
},
|
68 |
/*
|
69 |
-
* The
|
|
|
|
|
70 |
*/
|
71 |
-
'wpra/templates/
|
72 |
-
return
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
},
|
76 |
/*
|
77 |
* The feed item collection to use with the master template.
|
@@ -80,7 +244,7 @@ class FeedTemplatesModule implements ModuleInterface
|
|
80 |
*
|
81 |
* @since 4.13
|
82 |
*/
|
83 |
-
'wpra/templates/
|
84 |
if (!$c->has('wpra/importer/items/collection')) {
|
85 |
return new NullCollection();
|
86 |
}
|
@@ -94,7 +258,7 @@ class FeedTemplatesModule implements ModuleInterface
|
|
94 |
*
|
95 |
* @since 4.13
|
96 |
*/
|
97 |
-
'wpra/templates/
|
98 |
if ($c->has('wpra/logging/logger')) {
|
99 |
return new NullLogger();
|
100 |
}
|
@@ -108,7 +272,7 @@ class FeedTemplatesModule implements ModuleInterface
|
|
108 |
*
|
109 |
* @since 4.13
|
110 |
*/
|
111 |
-
'wpra/templates/
|
112 |
if (!$c->has('wpra/twig/collection')) {
|
113 |
return new NullCollection();
|
114 |
}
|
@@ -120,9 +284,9 @@ class FeedTemplatesModule implements ModuleInterface
|
|
120 |
*
|
121 |
* @since 4.13
|
122 |
*/
|
123 |
-
'wpra/templates/
|
124 |
return new ListTemplateType(
|
125 |
-
$c->get('wpra/templates/
|
126 |
);
|
127 |
},
|
128 |
/*
|
@@ -130,10 +294,10 @@ class FeedTemplatesModule implements ModuleInterface
|
|
130 |
*
|
131 |
* @since 4.13
|
132 |
*/
|
133 |
-
'wpra/templates/
|
134 |
-
return new
|
135 |
-
$c->get('wpra/templates/
|
136 |
-
$c->get('wpra/templates/
|
137 |
);
|
138 |
},
|
139 |
/*
|
@@ -141,10 +305,10 @@ class FeedTemplatesModule implements ModuleInterface
|
|
141 |
*
|
142 |
* @since 4.13
|
143 |
*/
|
144 |
-
'wpra/templates/
|
145 |
return new CreateDefaultFeedTemplateHandler(
|
146 |
-
$c->get('wpra/templates/
|
147 |
-
$c->get('wpra/templates/
|
148 |
);
|
149 |
},
|
150 |
/*
|
@@ -152,127 +316,43 @@ class FeedTemplatesModule implements ModuleInterface
|
|
152 |
*
|
153 |
* @since 4.13
|
154 |
*/
|
155 |
-
'wpra/templates/
|
156 |
return [
|
157 |
'name' => __('Default', 'wprss'),
|
158 |
-
'
|
|
|
159 |
];
|
160 |
},
|
161 |
/*
|
162 |
-
* The
|
163 |
-
*
|
164 |
-
* @since 4.13
|
165 |
-
*/
|
166 |
-
'wpra/templates/feeds/default_template_type' => function () {
|
167 |
-
return '__built_in';
|
168 |
-
},
|
169 |
-
/*
|
170 |
-
* The handler that responds to AJAX requests with rendered feed items.
|
171 |
*
|
172 |
-
* @since 4.
|
173 |
*/
|
174 |
-
'wpra/templates/
|
175 |
-
return
|
176 |
-
},
|
177 |
-
|
178 |
-
/*
|
179 |
-
* The name of the feeds template CPT.
|
180 |
-
*
|
181 |
-
* @since 4.13
|
182 |
-
*/
|
183 |
-
'wpra/templates/feeds/cpt/name' => function (ContainerInterface $c) {
|
184 |
-
return 'wprss_feed_template';
|
185 |
-
},
|
186 |
-
/*
|
187 |
-
* The labels for the feeds template CPT.
|
188 |
-
*
|
189 |
-
* @since 4.13
|
190 |
-
*/
|
191 |
-
'wpra/templates/feeds/cpt/labels' => function (ContainerInterface $c) {
|
192 |
-
return [
|
193 |
-
'name' => __('Templates', 'wprss'),
|
194 |
-
'singular_name' => __('Template', 'wprss'),
|
195 |
-
'add_new' => __('Add New', 'wprss'),
|
196 |
-
'all_items' => __('Templates', 'wprss'),
|
197 |
-
'add_new_item' => __('Add New Template', 'wprss'),
|
198 |
-
'edit_item' => __('Edit Template', 'wprss'),
|
199 |
-
'new_item' => __('New Template', 'wprss'),
|
200 |
-
'view_item' => __('View Template', 'wprss'),
|
201 |
-
'search_items' => __('Search Feeds', 'wprss'),
|
202 |
-
'not_found' => __('No Templates Found', 'wprss'),
|
203 |
-
'not_found_in_trash' => __('No Templates Found In Trash', 'wprss'),
|
204 |
-
'menu_name' => __('Templates', 'wprss'),
|
205 |
-
];
|
206 |
-
},
|
207 |
-
/*
|
208 |
-
* The capability for the feed templates CPT.
|
209 |
-
*
|
210 |
-
* @since 4.13
|
211 |
-
*/
|
212 |
-
'wpra/templates/feeds/cpt/capability' => function () {
|
213 |
-
return 'feed_template';
|
214 |
-
},
|
215 |
-
/*
|
216 |
-
* The user roles that have the feed templates CPT capabilities.
|
217 |
-
*
|
218 |
-
* Equal to the feed sources' CPT capability roles, if available.
|
219 |
-
*
|
220 |
-
* @since 4.13
|
221 |
-
*/
|
222 |
-
'wpra/templates/feeds/cpt/capability_roles' => function (ContainerInterface $c) {
|
223 |
-
if (!$c->has('wpra/feeds/sources/cpt/capability_roles')) {
|
224 |
-
return ['administrator'];
|
225 |
-
}
|
226 |
-
|
227 |
-
return $c->get('wpra/feeds/sources/cpt/capability_roles');
|
228 |
},
|
229 |
/*
|
230 |
-
* The
|
231 |
*
|
232 |
* @since 4.13
|
233 |
*/
|
234 |
-
'wpra/
|
235 |
-
return
|
236 |
-
'exclude_from_search' => true,
|
237 |
-
'publicly_queryable' => true,
|
238 |
-
'show_in_nav_menus' => false,
|
239 |
-
'show_in_admin_bar' => false,
|
240 |
-
'has_archive' => false,
|
241 |
-
'show_ui' => false,
|
242 |
-
'query_var' => 'feed_template',
|
243 |
-
'menu_position' => 100,
|
244 |
-
'show_in_menu' => false,
|
245 |
-
'rewrite' => [
|
246 |
-
'slug' => 'feed-templates',
|
247 |
-
'with_front' => false,
|
248 |
-
],
|
249 |
-
'capability_type' => $c->get('wpra/templates/feeds/cpt/capability'),
|
250 |
-
'map_meta_cap' => true,
|
251 |
-
'supports' => ['title'],
|
252 |
-
'labels' => $c->get('wpra/templates/feeds/cpt/labels'),
|
253 |
-
];
|
254 |
},
|
255 |
/*
|
256 |
-
* The
|
257 |
*
|
258 |
* @since 4.13
|
259 |
*/
|
260 |
-
'wpra/templates/
|
261 |
-
return
|
262 |
-
'parent' => 'edit.php?post_type=wprss_feed',
|
263 |
-
'slug' => 'wpra_feed_templates',
|
264 |
-
'page_title' => __('Templates', 'wprss'),
|
265 |
-
'menu_label' => __('Templates', 'wprss'),
|
266 |
-
'capability' => 'edit_feed_templates',
|
267 |
-
'callback' => $c->get('wpra/templates/feeds/render_admin_page_handler'),
|
268 |
-
];
|
269 |
},
|
270 |
/*
|
271 |
* The feeds template model structure.
|
272 |
*
|
273 |
* @since 4.13
|
274 |
*/
|
275 |
-
'wpra/templates/
|
276 |
return [
|
277 |
'id' => '',
|
278 |
'name' => '',
|
@@ -307,7 +387,7 @@ class FeedTemplatesModule implements ModuleInterface
|
|
307 |
*
|
308 |
* @since 4.13
|
309 |
*/
|
310 |
-
'wpra/templates/
|
311 |
return [
|
312 |
'name' => false,
|
313 |
'type' => false,
|
@@ -328,10 +408,10 @@ class FeedTemplatesModule implements ModuleInterface
|
|
328 |
'date_use_time_ago' => __('Enable this option to show the elapsed time from the feed item\'s date and time to the present time. <em>Eg. 2 hours ago</em>', 'wprss'),
|
329 |
'links_behavior' => __('Choose how you want links to be opened. This applies to the feed item title and the source link.', 'wprss'),
|
330 |
'links_nofollow' => __('Enable this option to set all links displayed as "NoFollow".<hr/>"Nofollow" provides a way to tell search engines to <em>not</em> follow certain links, such as links to feed items in this case.', 'wprss'),
|
331 |
-
'
|
332 |
'bullets_enabled' => __('Enable this option to show bullets next to feed items.', 'wprss'),
|
333 |
'bullet_type' => __('The bullet type to use for feed items.', 'wprss'),
|
334 |
-
'custom_css_classname' =>
|
335 |
],
|
336 |
];
|
337 |
},
|
@@ -340,13 +420,13 @@ class FeedTemplatesModule implements ModuleInterface
|
|
340 |
*
|
341 |
* @since 4.13.2
|
342 |
*/
|
343 |
-
'wpra/templates/
|
344 |
// The built in type, which appears as "List"
|
345 |
$types = [
|
346 |
'__built_in' => __('List', 'wprss'),
|
347 |
];
|
348 |
// Add all other template types
|
349 |
-
foreach ($c->get('wpra/templates/
|
350 |
$types[$key] = $templateType->getName();
|
351 |
}
|
352 |
|
@@ -357,7 +437,7 @@ class FeedTemplatesModule implements ModuleInterface
|
|
357 |
*
|
358 |
* @since 4.13.2
|
359 |
*/
|
360 |
-
'wpra/templates/
|
361 |
return false;
|
362 |
},
|
363 |
/*
|
@@ -365,10 +445,10 @@ class FeedTemplatesModule implements ModuleInterface
|
|
365 |
*
|
366 |
* @since 4.13
|
367 |
*/
|
368 |
-
'wpra/templates/
|
369 |
return [
|
370 |
-
'is_type_enabled' => $c->get('wpra/templates/
|
371 |
-
'type' => $c->get('wpra/templates/
|
372 |
'links_behavior' => [
|
373 |
'self' => __('Open in same tab/window', 'wprss'),
|
374 |
'blank' => __('Open in a new tab', 'wprss'),
|
@@ -393,171 +473,200 @@ class FeedTemplatesModule implements ModuleInterface
|
|
393 |
*
|
394 |
* @since 4.13.2
|
395 |
*/
|
396 |
-
'wpra/templates/js_modules' => function (ContainerInterface $c) {
|
397 |
return [
|
398 |
'templates-app',
|
399 |
];
|
400 |
},
|
|
|
401 |
/*
|
402 |
-
* The
|
403 |
*
|
404 |
-
* @since 4.
|
405 |
*/
|
406 |
-
'wpra/
|
407 |
-
return
|
|
|
|
|
|
|
408 |
},
|
409 |
/*
|
410 |
-
* The
|
411 |
*
|
412 |
-
* @since 4.
|
413 |
*/
|
414 |
-
'wpra/templates/
|
415 |
-
return new
|
416 |
},
|
417 |
/*
|
418 |
-
* The
|
419 |
*
|
420 |
-
* @since 4.
|
421 |
*/
|
422 |
-
'wpra/templates/
|
423 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
},
|
425 |
/*
|
426 |
-
* The
|
427 |
*
|
428 |
-
* @since 4.
|
429 |
*/
|
430 |
-
'wpra/templates/
|
431 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
432 |
},
|
433 |
/*
|
434 |
-
* The
|
435 |
*
|
436 |
-
* @since 4.
|
437 |
*/
|
438 |
-
'wpra/templates/
|
439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
},
|
441 |
/*
|
442 |
-
* The
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
*
|
444 |
* @since 4.13
|
445 |
*/
|
446 |
-
'wpra/
|
447 |
-
return new
|
448 |
-
$c->get('wpra/
|
|
|
|
|
449 |
);
|
450 |
},
|
451 |
-
|
452 |
/*
|
453 |
-
* The handler that
|
454 |
*
|
455 |
* @since 4.13
|
456 |
*/
|
457 |
-
'wpra/templates/
|
458 |
-
return new
|
459 |
-
$c->get('wpra/templates/
|
460 |
-
$c->get('wpra/
|
461 |
);
|
462 |
},
|
463 |
/*
|
464 |
-
* The
|
465 |
*
|
466 |
* @since 4.13
|
467 |
*/
|
468 |
-
'wpra/templates/
|
469 |
-
return
|
470 |
},
|
471 |
/*
|
472 |
-
* The handler that
|
473 |
-
*
|
474 |
-
* Resolves to a null handler if the WordPress role manager is not available.
|
475 |
*
|
476 |
* @since 4.13
|
477 |
*/
|
478 |
-
'wpra/templates/
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
return new AddCptMetaCapsHandler(
|
484 |
-
$c->get('wp/roles'),
|
485 |
-
$c->get('wpra/templates/feeds/cpt/capability_roles'),
|
486 |
-
$c->get('wpra/templates/feeds/cpt/capability')
|
487 |
);
|
488 |
},
|
489 |
/*
|
490 |
-
* The
|
491 |
*
|
492 |
* @since 4.13
|
493 |
*/
|
494 |
-
'wpra/templates/
|
495 |
-
return
|
496 |
-
$c->get('wpra/templates/feeds/model_schema'),
|
497 |
-
$c->get('wpra/templates/feeds/model_tooltips'),
|
498 |
-
$c->get('wpra/templates/feeds/template_options'),
|
499 |
-
$c->get('wpra/templates/js_modules')
|
500 |
-
);
|
501 |
},
|
502 |
/*
|
503 |
-
* The handler that
|
504 |
*
|
505 |
* @since 4.13
|
506 |
*/
|
507 |
-
'wpra/templates/
|
508 |
-
return new
|
509 |
-
$c->get('wpra/
|
510 |
-
$c->get('wpra/templates/
|
511 |
);
|
512 |
},
|
|
|
513 |
/*
|
514 |
-
* The
|
515 |
*
|
516 |
* @since 4.13
|
517 |
*/
|
518 |
-
'wpra/templates/
|
519 |
-
return new
|
520 |
-
$c->get('wpra/templates/feeds/cpt/name'),
|
521 |
-
$c->get('wpra/templates/feeds/public_template_content_nonce')
|
522 |
-
);
|
523 |
},
|
524 |
/*
|
525 |
-
* The
|
526 |
*
|
527 |
* @since 4.13
|
528 |
*/
|
529 |
-
'wpra/templates/
|
530 |
-
return '
|
531 |
},
|
532 |
/*
|
533 |
-
* The
|
534 |
*
|
535 |
* @since 4.13
|
536 |
*/
|
537 |
-
'wpra/templates/
|
538 |
-
return new
|
539 |
-
$c->get('wpra/templates/feeds/preview_template_request_param'),
|
540 |
-
$c->get('wpra/templates/feeds/public_template_content_nonce'),
|
541 |
-
$c->get('wpra/templates/feeds/cpt/capability')
|
542 |
-
);
|
543 |
},
|
544 |
/*
|
545 |
-
* The
|
546 |
*
|
547 |
* @since 4.13
|
548 |
*/
|
549 |
-
'wpra/templates/
|
550 |
-
return '
|
551 |
},
|
552 |
/*
|
553 |
-
* The
|
554 |
*
|
555 |
* @since 4.13
|
556 |
*/
|
557 |
-
'wpra/templates/
|
558 |
-
return new
|
559 |
-
|
560 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
561 |
);
|
562 |
},
|
563 |
];
|
@@ -571,13 +680,25 @@ class FeedTemplatesModule implements ModuleInterface
|
|
571 |
public function getExtensions()
|
572 |
{
|
573 |
return [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
574 |
/*
|
575 |
* Overrides the core display template with the master template.
|
576 |
*
|
577 |
* @since 4.13
|
578 |
*/
|
579 |
'wpra/display/feeds/template' => function (ContainerInterface $c) {
|
580 |
-
return $c->get('wpra/templates/
|
581 |
},
|
582 |
/*
|
583 |
* Extends the list of REST API endpoints with the template endpoints.
|
@@ -588,37 +709,37 @@ class FeedTemplatesModule implements ModuleInterface
|
|
588 |
$endPoints['get_templates'] = new EndPoint(
|
589 |
'/templates(?:/(?P<id>[^/]+))?',
|
590 |
['GET'],
|
591 |
-
$c->get('wpra/templates/
|
592 |
$c->get('wpra/rest_api/v1/auth/user_is_admin')
|
593 |
);
|
594 |
$endPoints['patch_templates'] = new EndPoint(
|
595 |
'/templates/(?P<id>[^/]+)',
|
596 |
['PATCH'],
|
597 |
-
$c->get('wpra/templates/
|
598 |
$c->get('wpra/rest_api/v1/auth/user_is_admin')
|
599 |
);
|
600 |
$endPoints['put_templates'] = new EndPoint(
|
601 |
'/templates(?:/(?P<id>[^/]+))?',
|
602 |
['PUT'],
|
603 |
-
$c->get('wpra/templates/
|
604 |
$c->get('wpra/rest_api/v1/auth/user_is_admin')
|
605 |
);
|
606 |
$endPoints['post_templates'] = new EndPoint(
|
607 |
'/templates(?:/(?P<id>[^/]+))?',
|
608 |
['POST'],
|
609 |
-
$c->get('wpra/templates/
|
610 |
$c->get('wpra/rest_api/v1/auth/user_is_admin')
|
611 |
);
|
612 |
$endPoints['delete_templates'] = new EndPoint(
|
613 |
'/templates(?:/(?P<id>[^/]+))?',
|
614 |
['DELETE'],
|
615 |
-
$c->get('wpra/templates/
|
616 |
$c->get('wpra/rest_api/v1/auth/user_is_admin')
|
617 |
);
|
618 |
$endPoints['render_templates'] = new EndPoint(
|
619 |
'/templates/(?P<template>[^/]+)/render',
|
620 |
['POST'],
|
621 |
-
$c->get('wpra/templates/
|
622 |
);
|
623 |
|
624 |
return $endPoints;
|
@@ -634,11 +755,11 @@ class FeedTemplatesModule implements ModuleInterface
|
|
634 |
public function run(ContainerInterface $c)
|
635 |
{
|
636 |
// Register the CPT
|
637 |
-
add_action('init', $c->get('wpra/templates/
|
638 |
// Add the capabilities
|
639 |
-
add_action('admin_init', $c->get('wpra/templates/
|
640 |
// Register the admin submenu, unless E&T is active
|
641 |
-
add_action('admin_menu', $c->get('wpra/templates/
|
642 |
|
643 |
// Hooks in the handler for server-side feed item rendering
|
644 |
add_action('wp_ajax_wprss_render', [$this, 'serverSideRenderFeeds']);
|
@@ -646,18 +767,18 @@ class FeedTemplatesModule implements ModuleInterface
|
|
646 |
|
647 |
// This ensures that there is always at least one template available, by constructing the core list template
|
648 |
// from the old general display settings.
|
649 |
-
add_action('init', $c->get('wpra/templates/
|
650 |
|
651 |
// Filters the front-end content for templates to render them
|
652 |
-
add_action('the_content', $c->get('wpra/templates/
|
653 |
|
654 |
// Hooks in the handler that hides template content from the front-end by requiring a nonce
|
655 |
-
add_action('wp_head', $c->get('wpra/templates/
|
656 |
|
657 |
// Hooks in the handler that listens to template preview requests
|
658 |
-
add_action('init', $c->get('wpra/templates/
|
659 |
|
660 |
// After settings have been reset, the default template and the display settings need to be synchronized
|
661 |
-
add_action('wprss_after_restore_settings', $c->get('wpra/templates/
|
662 |
}
|
663 |
}
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
use Psr\Log\NullLogger;
|
7 |
use RebelCode\Wpra\Core\Data\Collections\NullCollection;
|
8 |
+
use RebelCode\Wpra\Core\Entities\Feeds\Templates\WpPostFeedTemplateCollection;
|
9 |
+
use RebelCode\Wpra\Core\Handlers\AddCptMetaCapsHandler;
|
10 |
+
use RebelCode\Wpra\Core\Handlers\FeedTemplates\AjaxRenderFeedsTemplateHandler;
|
11 |
+
use RebelCode\Wpra\Core\Handlers\FeedTemplates\CreateDefaultFeedTemplateHandler;
|
12 |
+
use RebelCode\Wpra\Core\Handlers\FeedTemplates\HidePublicTemplateContentHandler;
|
13 |
+
use RebelCode\Wpra\Core\Handlers\FeedTemplates\PreviewTemplateRedirectHandler;
|
14 |
+
use RebelCode\Wpra\Core\Handlers\FeedTemplates\RenderAdminTemplatesPageHandler;
|
15 |
+
use RebelCode\Wpra\Core\Handlers\FeedTemplates\RenderTemplateContentHandler;
|
16 |
+
use RebelCode\Wpra\Core\Handlers\FeedTemplates\ReSaveTemplateHandler;
|
17 |
+
use RebelCode\Wpra\Core\Handlers\NullHandler;
|
18 |
+
use RebelCode\Wpra\Core\Handlers\RegisterCptHandler;
|
19 |
+
use RebelCode\Wpra\Core\Handlers\RegisterSubMenuPageHandler;
|
20 |
use RebelCode\Wpra\Core\RestApi\EndPoints\EndPoint;
|
21 |
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\CreateUpdateTemplateEndPoint;
|
22 |
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\DeleteTemplateEndPoint;
|
23 |
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\GetTemplatesEndPoint;
|
24 |
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\PatchTemplateEndPoint;
|
25 |
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\RenderTemplateEndPoint;
|
|
|
26 |
use RebelCode\Wpra\Core\Templates\Feeds\MasterFeedsTemplate;
|
27 |
+
use RebelCode\Wpra\Core\Templates\Feeds\TemplateTypeTemplate;
|
28 |
use RebelCode\Wpra\Core\Templates\Feeds\Types\ListTemplateType;
|
29 |
+
use RebelCode\Wpra\Core\Wp\Asset\ScriptAsset;
|
30 |
+
use RebelCode\Wpra\Core\Wp\Asset\StyleAsset;
|
31 |
|
32 |
/**
|
33 |
* The templates module for WP RSS Aggregator.
|
44 |
public function getFactories()
|
45 |
{
|
46 |
return [
|
47 |
+
/*
|
48 |
+
* The name of the feeds template CPT.
|
49 |
+
*
|
50 |
+
* @since 4.13
|
51 |
+
*/
|
52 |
+
'wpra/feeds/templates/cpt/name' => function (ContainerInterface $c) {
|
53 |
+
return 'wprss_feed_template';
|
54 |
+
},
|
55 |
+
/*
|
56 |
+
* The labels for the feeds template CPT.
|
57 |
+
*
|
58 |
+
* @since 4.13
|
59 |
+
*/
|
60 |
+
'wpra/feeds/templates/cpt/labels' => function (ContainerInterface $c) {
|
61 |
+
return [
|
62 |
+
'name' => __('Templates', 'wprss'),
|
63 |
+
'singular_name' => __('Template', 'wprss'),
|
64 |
+
'add_new' => __('Add New', 'wprss'),
|
65 |
+
'all_items' => __('Templates', 'wprss'),
|
66 |
+
'add_new_item' => __('Add New Template', 'wprss'),
|
67 |
+
'edit_item' => __('Edit Template', 'wprss'),
|
68 |
+
'new_item' => __('New Template', 'wprss'),
|
69 |
+
'view_item' => __('View Template', 'wprss'),
|
70 |
+
'search_items' => __('Search Feeds', 'wprss'),
|
71 |
+
'not_found' => __('No Templates Found', 'wprss'),
|
72 |
+
'not_found_in_trash' => __('No Templates Found In Trash', 'wprss'),
|
73 |
+
'menu_name' => __('Templates', 'wprss'),
|
74 |
+
];
|
75 |
+
},
|
76 |
+
/*
|
77 |
+
* The capability for the feed templates CPT.
|
78 |
+
*
|
79 |
+
* @since 4.13
|
80 |
+
*/
|
81 |
+
'wpra/feeds/templates/cpt/capability' => function () {
|
82 |
+
return 'feed_template';
|
83 |
+
},
|
84 |
+
/*
|
85 |
+
* The user roles that have the feed templates CPT capabilities.
|
86 |
+
*
|
87 |
+
* Equal to the feed sources' CPT capability roles, if available.
|
88 |
+
*
|
89 |
+
* @since 4.13
|
90 |
+
*/
|
91 |
+
'wpra/feeds/templates/cpt/capability_roles' => function (ContainerInterface $c) {
|
92 |
+
if (!$c->has('wpra/feeds/sources/cpt/capability_roles')) {
|
93 |
+
return ['administrator'];
|
94 |
+
}
|
95 |
+
|
96 |
+
return $c->get('wpra/feeds/sources/cpt/capability_roles');
|
97 |
+
},
|
98 |
+
/*
|
99 |
+
* The full arguments for the feeds template CPT.
|
100 |
+
*
|
101 |
+
* @since 4.13
|
102 |
+
*/
|
103 |
+
'wpra/feeds/templates/cpt/args' => function (ContainerInterface $c) {
|
104 |
+
return [
|
105 |
+
'exclude_from_search' => true,
|
106 |
+
'publicly_queryable' => true,
|
107 |
+
'show_in_nav_menus' => false,
|
108 |
+
'show_in_admin_bar' => false,
|
109 |
+
'has_archive' => false,
|
110 |
+
'show_ui' => false,
|
111 |
+
'query_var' => 'feed_template',
|
112 |
+
'menu_position' => 100,
|
113 |
+
'show_in_menu' => false,
|
114 |
+
'rewrite' => [
|
115 |
+
'slug' => 'feed-templates',
|
116 |
+
'with_front' => false,
|
117 |
+
],
|
118 |
+
'capability_type' => $c->get('wpra/feeds/templates/cpt/capability'),
|
119 |
+
'map_meta_cap' => true,
|
120 |
+
'supports' => ['title'],
|
121 |
+
'labels' => $c->get('wpra/feeds/templates/cpt/labels'),
|
122 |
+
];
|
123 |
+
},
|
124 |
+
/*
|
125 |
+
* The handler that registers the feeds template CPT.
|
126 |
+
*
|
127 |
+
* @since 4.13
|
128 |
+
*/
|
129 |
+
'wpra/feeds/templates/register_cpt_handler' => function (ContainerInterface $c) {
|
130 |
+
return new RegisterCptHandler(
|
131 |
+
$c->get('wpra/feeds/templates/cpt/name'),
|
132 |
+
$c->get('wpra/feeds/templates/cpt/args')
|
133 |
+
);
|
134 |
+
},
|
135 |
+
/*
|
136 |
+
* The handler that adds the feed templates CPT capabilities to the appropriate user roles.
|
137 |
+
*
|
138 |
+
* Resolves to a null handler if the WordPress role manager is not available.
|
139 |
+
*
|
140 |
+
* @since 4.13
|
141 |
+
*/
|
142 |
+
'wpra/feeds/templates/add_cpt_capabilities_handler' => function (ContainerInterface $c) {
|
143 |
+
if (!$c->has('wp/roles')) {
|
144 |
+
return new NullHandler();
|
145 |
+
}
|
146 |
+
|
147 |
+
return new AddCptMetaCapsHandler(
|
148 |
+
$c->get('wp/roles'),
|
149 |
+
$c->get('wpra/feeds/templates/cpt/capability_roles'),
|
150 |
+
$c->get('wpra/feeds/templates/cpt/capability')
|
151 |
+
);
|
152 |
+
},
|
153 |
+
/*
|
154 |
+
* The admin feeds templates page information.
|
155 |
+
*
|
156 |
+
* @since 4.13
|
157 |
+
*/
|
158 |
+
'wpra/feeds/templates/submenu_info' => function (ContainerInterface $c) {
|
159 |
+
return [
|
160 |
+
'parent' => 'edit.php?post_type=wprss_feed',
|
161 |
+
'slug' => 'wpra_feed_templates',
|
162 |
+
'page_title' => __('Templates', 'wprss'),
|
163 |
+
'menu_label' => __('Templates', 'wprss'),
|
164 |
+
'capability' => 'edit_feed_templates',
|
165 |
+
'callback' => $c->get('wpra/feeds/templates/admin/render_handler'),
|
166 |
+
];
|
167 |
+
},
|
168 |
+
/*
|
169 |
+
* The handler that registers the feeds template submenu page.
|
170 |
+
*
|
171 |
+
* @since 4.13
|
172 |
+
*/
|
173 |
+
'wpra/feeds/templates/register_submenu_handler' => function (ContainerInterface $c) {
|
174 |
+
return new RegisterSubMenuPageHandler($c->get('wpra/feeds/templates/submenu_info'));
|
175 |
+
},
|
176 |
+
|
177 |
/*
|
178 |
* The default feed template's slug name.
|
179 |
*
|
180 |
* @since 4.13
|
181 |
*/
|
182 |
+
'wpra/feeds/templates/default_template' => function (ContainerInterface $c) {
|
183 |
return 'default';
|
184 |
},
|
185 |
+
/*
|
186 |
+
* The available template types.
|
187 |
+
*/
|
188 |
+
'wpra/feeds/templates/template_types' => function (ContainerInterface $c) {
|
189 |
+
return [
|
190 |
+
'list' => $c->get('wpra/feeds/templates/list_template_type'),
|
191 |
+
];
|
192 |
+
},
|
193 |
/*
|
194 |
* The master feed template.
|
195 |
*
|
196 |
* @since 4.13
|
197 |
*/
|
198 |
+
'wpra/feeds/templates/master_template' => function (ContainerInterface $c) {
|
199 |
return new MasterFeedsTemplate(
|
200 |
+
$c->get('wpra/feeds/templates/default_template'),
|
201 |
+
$c->get('wpra/feeds/templates/template_types'),
|
202 |
+
$c->get('wpra/feeds/templates/collection'),
|
203 |
+
$c->get('wpra/feeds/templates/feed_item_collection'),
|
204 |
+
$c->get('wpra/feeds/templates/container_template'),
|
205 |
$c->get('wpra/display/feeds/legacy_template'),
|
206 |
+
$c->get('wpra/feeds/templates/master_template_logger')
|
207 |
);
|
208 |
},
|
209 |
/*
|
210 |
+
* The generic template type template.
|
211 |
+
*
|
212 |
+
* @since 4.14
|
213 |
*/
|
214 |
+
'wpra/feeds/templates/generic_template' => function (ContainerInterface $c) {
|
215 |
+
return new TemplateTypeTemplate(
|
216 |
+
$c->get('wpra/feeds/templates/generic_template_default_type'),
|
217 |
+
$c->get('wpra/feeds/templates/template_types'),
|
218 |
+
$c->get('wpra/feeds/templates/feed_item_collection'),
|
219 |
+
$c->get('wpra/feeds/templates/container_template')
|
220 |
+
);
|
221 |
+
},
|
222 |
+
/*
|
223 |
+
* The default template type to use for the generic template.
|
224 |
+
*
|
225 |
+
* @since 4.14
|
226 |
+
*/
|
227 |
+
'wpra/feeds/templates/generic_template_default_type' => function (ContainerInterface $c) {
|
228 |
+
return 'list';
|
229 |
+
},
|
230 |
+
/*
|
231 |
+
* The template for the HTML container that wraps all rendered templates.
|
232 |
+
*
|
233 |
+
* @since 4.14
|
234 |
+
*/
|
235 |
+
'wpra/feeds/templates/container_template' => function (ContainerInterface $c) {
|
236 |
+
$twigTemplates = $c->get('wpra/feeds/templates/file_template_collection');
|
237 |
+
|
238 |
+
return $twigTemplates['feeds/container.twig'];
|
239 |
},
|
240 |
/*
|
241 |
* The feed item collection to use with the master template.
|
244 |
*
|
245 |
* @since 4.13
|
246 |
*/
|
247 |
+
'wpra/feeds/templates/feed_item_collection' => function (ContainerInterface $c) {
|
248 |
if (!$c->has('wpra/importer/items/collection')) {
|
249 |
return new NullCollection();
|
250 |
}
|
258 |
*
|
259 |
* @since 4.13
|
260 |
*/
|
261 |
+
'wpra/feeds/templates/master_template_logger' => function (ContainerInterface $c) {
|
262 |
if ($c->has('wpra/logging/logger')) {
|
263 |
return new NullLogger();
|
264 |
}
|
272 |
*
|
273 |
* @since 4.13
|
274 |
*/
|
275 |
+
'wpra/feeds/templates/file_template_collection' => function (ContainerInterface $c) {
|
276 |
if (!$c->has('wpra/twig/collection')) {
|
277 |
return new NullCollection();
|
278 |
}
|
284 |
*
|
285 |
* @since 4.13
|
286 |
*/
|
287 |
+
'wpra/feeds/templates/list_template_type' => function (ContainerInterface $c) {
|
288 |
return new ListTemplateType(
|
289 |
+
$c->get('wpra/feeds/templates/file_template_collection')
|
290 |
);
|
291 |
},
|
292 |
/*
|
294 |
*
|
295 |
* @since 4.13
|
296 |
*/
|
297 |
+
'wpra/feeds/templates/collection' => function (ContainerInterface $c) {
|
298 |
+
return new WpPostFeedTemplateCollection(
|
299 |
+
$c->get('wpra/feeds/templates/cpt/name'),
|
300 |
+
$c->get('wpra/feeds/templates/default_template_type')
|
301 |
);
|
302 |
},
|
303 |
/*
|
305 |
*
|
306 |
* @since 4.13
|
307 |
*/
|
308 |
+
'wpra/feeds/templates/create_default_template_handler' => function (ContainerInterface $c) {
|
309 |
return new CreateDefaultFeedTemplateHandler(
|
310 |
+
$c->get('wpra/feeds/templates/collection'),
|
311 |
+
$c->get('wpra/feeds/templates/default_template_data')
|
312 |
);
|
313 |
},
|
314 |
/*
|
316 |
*
|
317 |
* @since 4.13
|
318 |
*/
|
319 |
+
'wpra/feeds/templates/default_template_data' => function (ContainerInterface $c) {
|
320 |
return [
|
321 |
'name' => __('Default', 'wprss'),
|
322 |
+
'slug' => $c->get('wpra/feeds/templates/default_template_slug'),
|
323 |
+
'type' => $c->get('wpra/feeds/templates/default_template_type'),
|
324 |
];
|
325 |
},
|
326 |
/*
|
327 |
+
* The slug to use for the default template.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
*
|
329 |
+
* @since 4.14
|
330 |
*/
|
331 |
+
'wpra/feeds/templates/default_template_slug' => function () {
|
332 |
+
return 'default';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
},
|
334 |
/*
|
335 |
+
* The template type to use for the default template.
|
336 |
*
|
337 |
* @since 4.13
|
338 |
*/
|
339 |
+
'wpra/feeds/templates/default_template_type' => function () {
|
340 |
+
return '__built_in';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
},
|
342 |
/*
|
343 |
+
* The handler that responds to AJAX requests with rendered feed items.
|
344 |
*
|
345 |
* @since 4.13
|
346 |
*/
|
347 |
+
'wpra/feeds/templates/ajax_render_handler' => function (ContainerInterface $c) {
|
348 |
+
return new AjaxRenderFeedsTemplateHandler($c->get('wpra/feeds/templates/master_template'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
},
|
350 |
/*
|
351 |
* The feeds template model structure.
|
352 |
*
|
353 |
* @since 4.13
|
354 |
*/
|
355 |
+
'wpra/feeds/templates/model_schema' => function (ContainerInterface $c) {
|
356 |
return [
|
357 |
'id' => '',
|
358 |
'name' => '',
|
387 |
*
|
388 |
* @since 4.13
|
389 |
*/
|
390 |
+
'wpra/feeds/templates/model_tooltips' => function (ContainerInterface $c) {
|
391 |
return [
|
392 |
'name' => false,
|
393 |
'type' => false,
|
408 |
'date_use_time_ago' => __('Enable this option to show the elapsed time from the feed item\'s date and time to the present time. <em>Eg. 2 hours ago</em>', 'wprss'),
|
409 |
'links_behavior' => __('Choose how you want links to be opened. This applies to the feed item title and the source link.', 'wprss'),
|
410 |
'links_nofollow' => __('Enable this option to set all links displayed as "NoFollow".<hr/>"Nofollow" provides a way to tell search engines to <em>not</em> follow certain links, such as links to feed items in this case.', 'wprss'),
|
411 |
+
'link_to_embed' => __('Tick this box to have feed items link to their embedded content, if they have any. This works especially well when links are set to <em>"Open in a lightbox"</em>.', 'wprss'),
|
412 |
'bullets_enabled' => __('Enable this option to show bullets next to feed items.', 'wprss'),
|
413 |
'bullet_type' => __('The bullet type to use for feed items.', 'wprss'),
|
414 |
+
'custom_css_classname' => __('You can add your own HTML class name to the template output. This lets you customize your template further using custom CSS styling or custom JS functionality.'),
|
415 |
],
|
416 |
];
|
417 |
},
|
420 |
*
|
421 |
* @since 4.13.2
|
422 |
*/
|
423 |
+
'wpra/feeds/templates/template_types_options' => function (ContainerInterface $c) {
|
424 |
// The built in type, which appears as "List"
|
425 |
$types = [
|
426 |
'__built_in' => __('List', 'wprss'),
|
427 |
];
|
428 |
// Add all other template types
|
429 |
+
foreach ($c->get('wpra/feeds/templates/template_types') as $key => $templateType) {
|
430 |
$types[$key] = $templateType->getName();
|
431 |
}
|
432 |
|
437 |
*
|
438 |
* @since 4.13.2
|
439 |
*/
|
440 |
+
'wpra/feeds/templates/template_type_enabled' => function (ContainerInterface $c) {
|
441 |
return false;
|
442 |
},
|
443 |
/*
|
445 |
*
|
446 |
* @since 4.13
|
447 |
*/
|
448 |
+
'wpra/feeds/templates/template_options' => function (ContainerInterface $c) {
|
449 |
return [
|
450 |
+
'is_type_enabled' => $c->get('wpra/feeds/templates/template_type_enabled'),
|
451 |
+
'type' => $c->get('wpra/feeds/templates/template_types_options'),
|
452 |
'links_behavior' => [
|
453 |
'self' => __('Open in same tab/window', 'wprss'),
|
454 |
'blank' => __('Open in a new tab', 'wprss'),
|
473 |
*
|
474 |
* @since 4.13.2
|
475 |
*/
|
476 |
+
'wpra/feeds/templates/admin/js_modules' => function (ContainerInterface $c) {
|
477 |
return [
|
478 |
'templates-app',
|
479 |
];
|
480 |
},
|
481 |
+
|
482 |
/*
|
483 |
+
* The assets used on the admin templates page.
|
484 |
*
|
485 |
+
* @since 4.14
|
486 |
*/
|
487 |
+
'wpra/feeds/templates/admin/assets' => function (ContainerInterface $c) {
|
488 |
+
return [
|
489 |
+
$c->get('wpra/feeds/templates/admin/styles/main'),
|
490 |
+
$c->get('wpra/feeds/templates/admin/scripts/main'),
|
491 |
+
];
|
492 |
},
|
493 |
/*
|
494 |
+
* The template style.
|
495 |
*
|
496 |
+
* @since 4.14
|
497 |
*/
|
498 |
+
'wpra/feeds/templates/admin/styles/main' => function () {
|
499 |
+
return new StyleAsset('wpra-templates', WPRSS_APP_CSS . 'templates.min.css', ['wpra-common']);
|
500 |
},
|
501 |
/*
|
502 |
+
* The template script.
|
503 |
*
|
504 |
+
* @since 4.14
|
505 |
*/
|
506 |
+
'wpra/feeds/templates/admin/scripts/main' => function (ContainerInterface $c) {
|
507 |
+
$script = new ScriptAsset('wpra-templates', WPRSS_APP_JS . 'templates.min.js', [
|
508 |
+
'wpra-manifest',
|
509 |
+
'wpra-vendor',
|
510 |
+
]);
|
511 |
+
|
512 |
+
$script = $script->localize('WpraTemplates', function () use ($c) {
|
513 |
+
return $c->get('wpra/feeds/templates/admin/states/main');
|
514 |
+
});
|
515 |
+
|
516 |
+
$script = $script->localize('WpraGlobal', function () use ($c) {
|
517 |
+
return $c->get('wpra/feeds/templates/admin/states/global');
|
518 |
+
});
|
519 |
+
|
520 |
+
return $script;
|
521 |
},
|
522 |
/*
|
523 |
+
* The state for the templates script.
|
524 |
*
|
525 |
+
* @since 4.14
|
526 |
*/
|
527 |
+
'wpra/feeds/templates/admin/states/main' => function (ContainerInterface $c) {
|
528 |
+
return [
|
529 |
+
'model_schema' => $c->get('wpra/feeds/templates/model_schema'),
|
530 |
+
'model_tooltips' => $c->get('wpra/feeds/templates/model_tooltips'),
|
531 |
+
'options' => $c->get('wpra/feeds/templates/template_options'),
|
532 |
+
'modules' => $c->get('wpra/feeds/templates/admin/js_modules'),
|
533 |
+
'base_url' => rest_url('/wpra/v1/templates'),
|
534 |
+
];
|
535 |
},
|
536 |
/*
|
537 |
+
* The global state of the application.
|
538 |
*
|
539 |
+
* @since 4.14
|
540 |
*/
|
541 |
+
'wpra/feeds/templates/admin/states/global' => function (ContainerInterface $c) {
|
542 |
+
$url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
|
543 |
+
return [
|
544 |
+
'admin_base_url' => admin_url(),
|
545 |
+
'templates_url_base' => str_replace($url, '', menu_page_url('wpra_feed_templates', false)),
|
546 |
+
'is_existing_user' => !wprss_is_new_user(),
|
547 |
+
'nonce' => wp_create_nonce('wp_rest'),
|
548 |
+
];
|
549 |
},
|
550 |
/*
|
551 |
+
* The handler that renders the admin templates page.
|
552 |
+
*
|
553 |
+
* @since 4.14
|
554 |
+
*/
|
555 |
+
'wpra/feeds/templates/admin/render_handler' => function (ContainerInterface $c) {
|
556 |
+
return new RenderAdminTemplatesPageHandler($c->get('wpra/feeds/templates/admin/assets'));
|
557 |
+
},
|
558 |
+
/*
|
559 |
+
* The handler that renders template content.
|
560 |
*
|
561 |
* @since 4.13
|
562 |
*/
|
563 |
+
'wpra/feeds/templates/handlers/render_content' => function (ContainerInterface $c) {
|
564 |
+
return new RenderTemplateContentHandler(
|
565 |
+
$c->get('wpra/feeds/templates/cpt/name'),
|
566 |
+
$c->get('wpra/feeds/templates/master_template'),
|
567 |
+
$c->get('wpra/feeds/templates/generic_template')
|
568 |
);
|
569 |
},
|
|
|
570 |
/*
|
571 |
+
* The handler that hides template content from the public-facing side.
|
572 |
*
|
573 |
* @since 4.13
|
574 |
*/
|
575 |
+
'wpra/feeds/templates/handlers/hide_public_content' => function (ContainerInterface $c) {
|
576 |
+
return new HidePublicTemplateContentHandler(
|
577 |
+
$c->get('wpra/feeds/templates/cpt/name'),
|
578 |
+
$c->get('wpra/feeds/templates/public_template_content_nonce')
|
579 |
);
|
580 |
},
|
581 |
/*
|
582 |
+
* The name of the nonce that allows template content to be shown on the public-facing side.
|
583 |
*
|
584 |
* @since 4.13
|
585 |
*/
|
586 |
+
'wpra/feeds/templates/public_template_content_nonce' => function (ContainerInterface $c) {
|
587 |
+
return 'wpra_template_preview';
|
588 |
},
|
589 |
/*
|
590 |
+
* The handler that listens to requests for previewing templates.
|
|
|
|
|
591 |
*
|
592 |
* @since 4.13
|
593 |
*/
|
594 |
+
'wpra/feeds/templates/handlers/preview_template_request' => function (ContainerInterface $c) {
|
595 |
+
return new PreviewTemplateRedirectHandler(
|
596 |
+
$c->get('wpra/feeds/templates/preview_template_request_param'),
|
597 |
+
$c->get('wpra/feeds/templates/public_template_content_nonce'),
|
598 |
+
$c->get('wpra/feeds/templates/cpt/capability')
|
|
|
|
|
|
|
|
|
599 |
);
|
600 |
},
|
601 |
/*
|
602 |
+
* The name of the GET parameter to detect for previewing templates.
|
603 |
*
|
604 |
* @since 4.13
|
605 |
*/
|
606 |
+
'wpra/feeds/templates/preview_template_request_param' => function (ContainerInterface $c) {
|
607 |
+
return 'wpra_preview_template';
|
|
|
|
|
|
|
|
|
|
|
608 |
},
|
609 |
/*
|
610 |
+
* The handler that synchronizes the default template with the display settings.
|
611 |
*
|
612 |
* @since 4.13
|
613 |
*/
|
614 |
+
'wpra/feeds/templates/handlers/sync_default_template' => function (ContainerInterface $c) {
|
615 |
+
return new ReSaveTemplateHandler(
|
616 |
+
$c->get('wpra/feeds/templates/collection'),
|
617 |
+
$c->get('wpra/feeds/templates/default_template')
|
618 |
);
|
619 |
},
|
620 |
+
|
621 |
/*
|
622 |
+
* The templates GET endpoint for the REST API.
|
623 |
*
|
624 |
* @since 4.13
|
625 |
*/
|
626 |
+
'wpra/feeds/templates/rest_api/v1/get_endpoint' => function (ContainerInterface $c) {
|
627 |
+
return new GetTemplatesEndPoint($c->get('wpra/feeds/templates/collection'));
|
|
|
|
|
|
|
628 |
},
|
629 |
/*
|
630 |
+
* The templates PATCH endpoint for the REST API.
|
631 |
*
|
632 |
* @since 4.13
|
633 |
*/
|
634 |
+
'wpra/feeds/templates/rest_api/v1/patch_endpoint' => function (ContainerInterface $c) {
|
635 |
+
return new PatchTemplateEndPoint($c->get('wpra/feeds/templates/collection'));
|
636 |
},
|
637 |
/*
|
638 |
+
* The templates POST endpoint for the REST API.
|
639 |
*
|
640 |
* @since 4.13
|
641 |
*/
|
642 |
+
'wpra/feeds/templates/rest_api/v1/post_endpoint' => function (ContainerInterface $c) {
|
643 |
+
return new CreateUpdateTemplateEndPoint($c->get('wpra/feeds/templates/collection'), false);
|
|
|
|
|
|
|
|
|
644 |
},
|
645 |
/*
|
646 |
+
* The templates PUT endpoint for the REST API.
|
647 |
*
|
648 |
* @since 4.13
|
649 |
*/
|
650 |
+
'wpra/feeds/templates/rest_api/v1/put_endpoint' => function (ContainerInterface $c) {
|
651 |
+
return new CreateUpdateTemplateEndPoint($c->get('wpra/feeds/templates/collection'));
|
652 |
},
|
653 |
/*
|
654 |
+
* The templates deletion endpoint for the REST API.
|
655 |
*
|
656 |
* @since 4.13
|
657 |
*/
|
658 |
+
'wpra/feeds/templates/rest_api/v1/delete_endpoint' => function (ContainerInterface $c) {
|
659 |
+
return new DeleteTemplateEndPoint($c->get('wpra/feeds/templates/collection'));
|
660 |
+
},
|
661 |
+
/*
|
662 |
+
* The templates rendering endpoint for the REST API.
|
663 |
+
*
|
664 |
+
* @since 4.13
|
665 |
+
*/
|
666 |
+
'wpra/feeds/templates/rest_api/v1/render_endpoint' => function (ContainerInterface $c) {
|
667 |
+
return new RenderTemplateEndPoint(
|
668 |
+
$c->get('wpra/display/feeds/template'),
|
669 |
+
$c->get('wpra/feeds/templates/generic_template')
|
670 |
);
|
671 |
},
|
672 |
];
|
680 |
public function getExtensions()
|
681 |
{
|
682 |
return [
|
683 |
+
/*
|
684 |
+
* Register the templates UI assets for the admin-side.
|
685 |
+
*
|
686 |
+
* @since 4.14
|
687 |
+
*/
|
688 |
+
'wpra/assets/admin' => function(ContainerInterface $c, $assets) {
|
689 |
+
foreach ($c->get('wpra/feeds/templates/admin/assets') as $asset) {
|
690 |
+
$assets[] = $asset;
|
691 |
+
}
|
692 |
+
|
693 |
+
return $assets;
|
694 |
+
},
|
695 |
/*
|
696 |
* Overrides the core display template with the master template.
|
697 |
*
|
698 |
* @since 4.13
|
699 |
*/
|
700 |
'wpra/display/feeds/template' => function (ContainerInterface $c) {
|
701 |
+
return $c->get('wpra/feeds/templates/master_template');
|
702 |
},
|
703 |
/*
|
704 |
* Extends the list of REST API endpoints with the template endpoints.
|
709 |
$endPoints['get_templates'] = new EndPoint(
|
710 |
'/templates(?:/(?P<id>[^/]+))?',
|
711 |
['GET'],
|
712 |
+
$c->get('wpra/feeds/templates/rest_api/v1/get_endpoint'),
|
713 |
$c->get('wpra/rest_api/v1/auth/user_is_admin')
|
714 |
);
|
715 |
$endPoints['patch_templates'] = new EndPoint(
|
716 |
'/templates/(?P<id>[^/]+)',
|
717 |
['PATCH'],
|
718 |
+
$c->get('wpra/feeds/templates/rest_api/v1/patch_endpoint'),
|
719 |
$c->get('wpra/rest_api/v1/auth/user_is_admin')
|
720 |
);
|
721 |
$endPoints['put_templates'] = new EndPoint(
|
722 |
'/templates(?:/(?P<id>[^/]+))?',
|
723 |
['PUT'],
|
724 |
+
$c->get('wpra/feeds/templates/rest_api/v1/put_endpoint'),
|
725 |
$c->get('wpra/rest_api/v1/auth/user_is_admin')
|
726 |
);
|
727 |
$endPoints['post_templates'] = new EndPoint(
|
728 |
'/templates(?:/(?P<id>[^/]+))?',
|
729 |
['POST'],
|
730 |
+
$c->get('wpra/feeds/templates/rest_api/v1/post_endpoint'),
|
731 |
$c->get('wpra/rest_api/v1/auth/user_is_admin')
|
732 |
);
|
733 |
$endPoints['delete_templates'] = new EndPoint(
|
734 |
'/templates(?:/(?P<id>[^/]+))?',
|
735 |
['DELETE'],
|
736 |
+
$c->get('wpra/feeds/templates/rest_api/v1/delete_endpoint'),
|
737 |
$c->get('wpra/rest_api/v1/auth/user_is_admin')
|
738 |
);
|
739 |
$endPoints['render_templates'] = new EndPoint(
|
740 |
'/templates/(?P<template>[^/]+)/render',
|
741 |
['POST'],
|
742 |
+
$c->get('wpra/feeds/templates/rest_api/v1/render_endpoint')
|
743 |
);
|
744 |
|
745 |
return $endPoints;
|
755 |
public function run(ContainerInterface $c)
|
756 |
{
|
757 |
// Register the CPT
|
758 |
+
add_action('init', $c->get('wpra/feeds/templates/register_cpt_handler'));
|
759 |
// Add the capabilities
|
760 |
+
add_action('admin_init', $c->get('wpra/feeds/templates/add_cpt_capabilities_handler'));
|
761 |
// Register the admin submenu, unless E&T is active
|
762 |
+
add_action('admin_menu', $c->get('wpra/feeds/templates/register_submenu_handler'));
|
763 |
|
764 |
// Hooks in the handler for server-side feed item rendering
|
765 |
add_action('wp_ajax_wprss_render', [$this, 'serverSideRenderFeeds']);
|
767 |
|
768 |
// This ensures that there is always at least one template available, by constructing the core list template
|
769 |
// from the old general display settings.
|
770 |
+
add_action('init', $c->get('wpra/feeds/templates/create_default_template_handler'));
|
771 |
|
772 |
// Filters the front-end content for templates to render them
|
773 |
+
add_action('the_content', $c->get('wpra/feeds/templates/handlers/render_content'));
|
774 |
|
775 |
// Hooks in the handler that hides template content from the front-end by requiring a nonce
|
776 |
+
add_action('wp_head', $c->get('wpra/feeds/templates/handlers/hide_public_content'));
|
777 |
|
778 |
// Hooks in the handler that listens to template preview requests
|
779 |
+
add_action('init', $c->get('wpra/feeds/templates/handlers/preview_template_request'));
|
780 |
|
781 |
// After settings have been reset, the default template and the display settings need to be synchronized
|
782 |
+
add_action('wprss_after_restore_settings', $c->get('wpra/feeds/templates/handlers/sync_default_template'));
|
783 |
}
|
784 |
}
|
@@ -3,9 +3,11 @@
|
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
-
use RebelCode\Wpra\Core\
|
7 |
-
use RebelCode\Wpra\Core\
|
8 |
-
use RebelCode\Wpra\Core\
|
|
|
|
|
9 |
|
10 |
/**
|
11 |
* The Gutenberg block for WP RSS Aggregator.
|
@@ -93,14 +95,67 @@ class GutenbergBlockModule implements ModuleInterface
|
|
93 |
},
|
94 |
|
95 |
/*
|
96 |
-
* The
|
97 |
*
|
98 |
-
* @since 4.
|
99 |
*/
|
100 |
-
'wpra/gutenberg_block/
|
101 |
-
return
|
102 |
-
$c->get('wpra/
|
103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
},
|
105 |
|
106 |
/*
|
@@ -131,10 +186,21 @@ class GutenbergBlockModule implements ModuleInterface
|
|
131 |
*/
|
132 |
public function run(ContainerInterface $c)
|
133 |
{
|
|
|
134 |
call_user_func($c->get('wpra/gutenberg_block/handlers/register'));
|
135 |
|
136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
|
|
|
138 |
add_action('wp_ajax_wprss_fetch_items', $c->get('wpra/gutenberg_block/handlers/fetch_feed_sources'));
|
139 |
}
|
140 |
}
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
+
use RebelCode\Wpra\Core\Handlers\GutenbergBlock\FetchFeedSourcesHandler;
|
7 |
+
use RebelCode\Wpra\Core\Handlers\RegisterGutenbergBlockHandler;
|
8 |
+
use RebelCode\Wpra\Core\Wp\Asset\AssetInterface;
|
9 |
+
use RebelCode\Wpra\Core\Wp\Asset\ScriptAsset;
|
10 |
+
use RebelCode\Wpra\Core\Wp\Asset\StyleAsset;
|
11 |
|
12 |
/**
|
13 |
* The Gutenberg block for WP RSS Aggregator.
|
95 |
},
|
96 |
|
97 |
/*
|
98 |
+
* The list of the block's assets.
|
99 |
*
|
100 |
+
* @since 4.14
|
101 |
*/
|
102 |
+
'wpra/gutenberg_block/assets' => function (ContainerInterface $c) {
|
103 |
+
return [
|
104 |
+
'gutenberg_script' => $c->get('wpra/gutenberg_block/scripts/main'),
|
105 |
+
'gutenberg_style' => $c->get('wpra/gutenberg_block/styles/main'),
|
106 |
+
];
|
107 |
+
},
|
108 |
+
|
109 |
+
/*
|
110 |
+
* The block's style.
|
111 |
+
*
|
112 |
+
* @since 4.14
|
113 |
+
*/
|
114 |
+
'wpra/gutenberg_block/styles/main' => function (ContainerInterface $c) {
|
115 |
+
return new StyleAsset('wpra-gutenberg-block', WPRSS_APP_CSS . 'gutenberg-block.min.css');
|
116 |
+
},
|
117 |
+
/*
|
118 |
+
* The block's script.
|
119 |
+
*
|
120 |
+
* @since 4.14
|
121 |
+
*/
|
122 |
+
'wpra/gutenberg_block/scripts/main' => function (ContainerInterface $c) {
|
123 |
+
$script = new ScriptAsset('wpra-gutenberg-block', WPRSS_APP_JS . 'gutenberg-block.min.js', [
|
124 |
+
'wp-hooks',
|
125 |
+
'wp-blocks',
|
126 |
+
'wp-i18n',
|
127 |
+
'wp-element',
|
128 |
+
'wp-editor',
|
129 |
+
]);
|
130 |
+
|
131 |
+
return $script->localize('WPRA_BLOCK', function () use ($c) {
|
132 |
+
return $c->get('wpra/gutenberg_block/states/main');
|
133 |
+
});
|
134 |
+
},
|
135 |
+
/*
|
136 |
+
* Gutenberg block script state.
|
137 |
+
*
|
138 |
+
* @since 4.14
|
139 |
+
*/
|
140 |
+
'wpra/gutenberg_block/states/main' => function (ContainerInterface $c) {
|
141 |
+
$templatesCollection = $c->get('wpra/feeds/templates/collection');
|
142 |
+
$templates = [];
|
143 |
+
|
144 |
+
foreach ($templatesCollection as $template) {
|
145 |
+
$tOptions = isset($template['options']) ? $template['options'] : [];
|
146 |
+
$templates[] = [
|
147 |
+
'label' => $template['name'],
|
148 |
+
'value' => $template['slug'],
|
149 |
+
'limit' => isset($tOptions['limit']) ? $tOptions['limit'] : 15,
|
150 |
+
'pagination' => isset($tOptions['pagination']) ? $tOptions['pagination'] : true,
|
151 |
+
];
|
152 |
+
}
|
153 |
+
|
154 |
+
return [
|
155 |
+
'ajax_url' => admin_url('admin-ajax.php'),
|
156 |
+
'templates' => $templates,
|
157 |
+
'is_et_active' => wprss_is_et_active(),
|
158 |
+
];
|
159 |
},
|
160 |
|
161 |
/*
|
186 |
*/
|
187 |
public function run(ContainerInterface $c)
|
188 |
{
|
189 |
+
// Registers the block
|
190 |
call_user_func($c->get('wpra/gutenberg_block/handlers/register'));
|
191 |
|
192 |
+
// Enqueues the assets for the block
|
193 |
+
add_action('enqueue_block_editor_assets', function () use ($c) {
|
194 |
+
$assets = $c->get('wpra/gutenberg_block/assets');
|
195 |
+
|
196 |
+
/* @var $assets AssetInterface[] */
|
197 |
+
foreach ($assets as $asset) {
|
198 |
+
$asset->register();
|
199 |
+
$asset->enqueue();
|
200 |
+
}
|
201 |
+
});
|
202 |
|
203 |
+
// Adds the AJAX listener for fetching feed sources from the block
|
204 |
add_action('wp_ajax_wprss_fetch_items', $c->get('wpra/gutenberg_block/handlers/fetch_feed_sources'));
|
205 |
}
|
206 |
}
|
@@ -1,98 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace RebelCode\Wpra\Core\Modules\Handlers\CustomFeed;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* The handler that renders the custom feed.
|
7 |
-
*
|
8 |
-
* @since 4.13
|
9 |
-
*/
|
10 |
-
class RenderCustomFeedHandler
|
11 |
-
{
|
12 |
-
/**
|
13 |
-
* {@inheritdoc}
|
14 |
-
*
|
15 |
-
* @since 4.13
|
16 |
-
*/
|
17 |
-
public function __invoke()
|
18 |
-
{
|
19 |
-
$wprss_custom_feed_query = wprss_get_feed_items_query(
|
20 |
-
apply_filters(
|
21 |
-
'wprss_custom_feed_query',
|
22 |
-
array(
|
23 |
-
'get-args' => TRUE, // Get the query args instead of the query object
|
24 |
-
'no-paged' => TRUE, // ignore pagination
|
25 |
-
'feed_limit' => 0, // ignore limit
|
26 |
-
)
|
27 |
-
)
|
28 |
-
);
|
29 |
-
|
30 |
-
// Suppress caching
|
31 |
-
$wprss_custom_feed_query['cache_results'] = FALSE;
|
32 |
-
|
33 |
-
// Get options
|
34 |
-
$options = get_option( 'wprss_settings_general' );
|
35 |
-
if ( $options !== FALSE ) {
|
36 |
-
// If options exist, get the limit
|
37 |
-
$limit = $options['custom_feed_limit'];
|
38 |
-
if ( $limit !== FALSE ) {
|
39 |
-
// if limit exists, set the query limit
|
40 |
-
$wprss_custom_feed_query['posts_per_page'] = $limit;
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
// Submit the query to get latest feed items
|
45 |
-
query_posts( $wprss_custom_feed_query );
|
46 |
-
|
47 |
-
$custom_feed_title = wprss_get_general_setting( 'custom_feed_title' );
|
48 |
-
|
49 |
-
$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');
|
50 |
-
header( "$protocol 200 OK" );
|
51 |
-
// Send content header and start ATOM output
|
52 |
-
header('Content-Type: application/rss+xml');
|
53 |
-
// Disabling caching
|
54 |
-
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
|
55 |
-
header('Pragma: no-cache'); // HTTP 1.0.
|
56 |
-
header('Expires: 0'); // Proxies.
|
57 |
-
|
58 |
-
printf('<?xml version="1.0" encoding="%s"?>', get_option('blog_charset'));
|
59 |
-
?>
|
60 |
-
|
61 |
-
<rss version="2.0"
|
62 |
-
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
63 |
-
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
|
64 |
-
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
65 |
-
xmlns:atom="https://www.w3.org/2005/Atom"
|
66 |
-
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
|
67 |
-
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
|
68 |
-
xmlns:media="https://search.yahoo.com/mrss/" >
|
69 |
-
<channel>
|
70 |
-
<title><?php echo $custom_feed_title; ?></title>
|
71 |
-
<description></description>
|
72 |
-
<link><?php echo get_site_url(); ?></link>
|
73 |
-
<atom:link href="<?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ?>" rel="self" type="application/rss+xml" />
|
74 |
-
|
75 |
-
<?php
|
76 |
-
// Start the Loop
|
77 |
-
while ( have_posts() ) : the_post();
|
78 |
-
$source = get_post_meta( get_the_ID(), 'wprss_feed_id', TRUE );
|
79 |
-
$permalink = get_post_meta( get_the_ID(), 'wprss_item_permalink', true );
|
80 |
-
$content = apply_filters( 'wprss_custom_feed_item_content', get_the_content() );
|
81 |
-
?>
|
82 |
-
<item>
|
83 |
-
<title><![CDATA[<?php the_title_rss(); ?>]]></title>
|
84 |
-
<link><?php echo $permalink; ?></link>
|
85 |
-
<guid isPermaLink="true"><?php echo $permalink; ?></guid>
|
86 |
-
<pubDate><?php echo get_post_time( DATE_RSS ); ?></pubDate>
|
87 |
-
<description><![CDATA[<?php echo $content; ?>]]></description>
|
88 |
-
<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
|
89 |
-
<source url="<?php echo esc_attr(get_post_meta( $source, 'wprss_url', TRUE )); ?>"><?php echo get_the_title( $source ); ?></source>
|
90 |
-
<?php do_action( 'wprss_custom_feed_entry', get_the_ID() ); ?>
|
91 |
-
</item>
|
92 |
-
<?php endwhile; ?>
|
93 |
-
|
94 |
-
</channel>
|
95 |
-
</rss>
|
96 |
-
<?php
|
97 |
-
}
|
98 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,89 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace RebelCode\Wpra\Core\Modules\Handlers\FeedTemplates;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* The handler that renders the admin feed templates page.
|
7 |
-
*
|
8 |
-
* @since 4.13
|
9 |
-
*/
|
10 |
-
class RenderAdminTemplatesPageHandler
|
11 |
-
{
|
12 |
-
/**
|
13 |
-
* The feeds template model structure.
|
14 |
-
*
|
15 |
-
* @var array
|
16 |
-
*/
|
17 |
-
protected $modelSchema;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Tooltips for feed template model fields.
|
21 |
-
*
|
22 |
-
* @var array
|
23 |
-
*/
|
24 |
-
protected $modelTooltips;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Feed template's fields options.
|
28 |
-
*
|
29 |
-
* @var array
|
30 |
-
*/
|
31 |
-
protected $templateOptions;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* The list of JS modules to load.
|
35 |
-
*
|
36 |
-
* @var array
|
37 |
-
*/
|
38 |
-
protected $modules;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* RenderAdminTemplatesPageHandler constructor.
|
42 |
-
*
|
43 |
-
* @param array $modelSchema The feeds template model structure.
|
44 |
-
* @param array $modelTooltips Tooltips for feed template model fields.
|
45 |
-
* @param array $templateOptions Feed template's fields options.
|
46 |
-
* @param array $modules The list of JS modules to load.
|
47 |
-
*/
|
48 |
-
public function __construct($modelSchema, $modelTooltips, $templateOptions, $modules)
|
49 |
-
{
|
50 |
-
$this->modelSchema = $modelSchema;
|
51 |
-
$this->modelTooltips = $modelTooltips;
|
52 |
-
$this->templateOptions = $templateOptions;
|
53 |
-
$this->modules = $modules;
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* @since 4.13
|
58 |
-
*/
|
59 |
-
public function __invoke()
|
60 |
-
{
|
61 |
-
wprss_plugin_enqueue_app_scripts('wpra-templates', WPRSS_APP_JS . 'templates.min.js', [], '0.1', true);
|
62 |
-
wp_enqueue_style('wpra-common', WPRSS_APP_CSS . 'common.min.css');
|
63 |
-
wp_enqueue_style('wpra-templates', WPRSS_APP_CSS . 'templates.min.css', [
|
64 |
-
'wpra-common'
|
65 |
-
]);
|
66 |
-
|
67 |
-
$url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
|
68 |
-
|
69 |
-
wp_localize_script('wpra-templates', 'WpraGlobal', [
|
70 |
-
'admin_base_url' => admin_url(),
|
71 |
-
'templates_url_base' => str_replace($url, '', menu_page_url('wpra_feed_templates', false)),
|
72 |
-
'is_existing_user' => !wprss_is_new_user(),
|
73 |
-
'nonce' => wp_create_nonce('wp_rest'),
|
74 |
-
]);
|
75 |
-
|
76 |
-
wp_localize_script('wpra-templates', 'WpraTemplates', [
|
77 |
-
'model_schema' => $this->modelSchema,
|
78 |
-
'model_tooltips' => $this->modelTooltips,
|
79 |
-
'options' => $this->templateOptions,
|
80 |
-
'modules' => $this->modules,
|
81 |
-
'base_url' => rest_url('/wpra/v1/templates'),
|
82 |
-
]);
|
83 |
-
|
84 |
-
echo wprss_render_template('admin/templates-page.twig', [
|
85 |
-
'title' => 'Templates',
|
86 |
-
'subtitle' => 'Follow these introductory steps to get started with WP RSS Aggregator.',
|
87 |
-
]);
|
88 |
-
}
|
89 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,64 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace RebelCode\Wpra\Core\Modules\Handlers\FeedTemplates;
|
4 |
-
|
5 |
-
use Dhii\Output\TemplateInterface;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The handler that renders the template content, by rendering the template itself as would be done through normal
|
9 |
-
* means in WP RSS Aggregator.
|
10 |
-
*
|
11 |
-
* @since 4.13
|
12 |
-
*/
|
13 |
-
class RenderTemplateContentHandler
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* The name of the templates CPT.
|
17 |
-
*
|
18 |
-
* @since 4.13
|
19 |
-
*
|
20 |
-
* @var string
|
21 |
-
*/
|
22 |
-
protected $cpt;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* The master template to use for rendering.
|
26 |
-
*
|
27 |
-
* @since 4.13
|
28 |
-
*
|
29 |
-
* @var TemplateInterface
|
30 |
-
*/
|
31 |
-
protected $template;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Constructor.
|
35 |
-
*
|
36 |
-
* @since 4.13
|
37 |
-
*
|
38 |
-
* @param string $cpt The name of the templates CPT.
|
39 |
-
* @param TemplateInterface $template The master template to use for rendering.
|
40 |
-
*/
|
41 |
-
public function __construct($cpt, TemplateInterface $template)
|
42 |
-
{
|
43 |
-
$this->cpt = $cpt;
|
44 |
-
$this->template = $template;
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* {@inheritdoc}
|
49 |
-
*
|
50 |
-
* @since 4.13
|
51 |
-
*/
|
52 |
-
public function __invoke($content)
|
53 |
-
{
|
54 |
-
global $post;
|
55 |
-
|
56 |
-
if ($post->post_type !== $this->cpt) {
|
57 |
-
return $content;
|
58 |
-
}
|
59 |
-
|
60 |
-
return $this->template->render([
|
61 |
-
'template' => $post->post_name,
|
62 |
-
]);
|
63 |
-
}
|
64 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,65 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace RebelCode\Wpra\Core\Modules\Handlers\GutenbergBlock;
|
4 |
-
|
5 |
-
use RebelCode\Wpra\Core\Data\Collections\CollectionInterface;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Class for registering assets for gutenberg block.
|
9 |
-
*
|
10 |
-
* @since 4.13
|
11 |
-
*/
|
12 |
-
class GutenbergBlockAssetsHandler
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* Templates collection.
|
16 |
-
*
|
17 |
-
* @since 4.13
|
18 |
-
*
|
19 |
-
* @var CollectionInterface
|
20 |
-
*/
|
21 |
-
protected $templates;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* GutenbergBlockAssetsHandler constructor.
|
25 |
-
*
|
26 |
-
* @param CollectionInterface $templates Templates collection.
|
27 |
-
*/
|
28 |
-
public function __construct(CollectionInterface $templates)
|
29 |
-
{
|
30 |
-
$this->templates = $templates;
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* {@inheritdoc}
|
35 |
-
*
|
36 |
-
* @since 4.13
|
37 |
-
*/
|
38 |
-
public function __invoke()
|
39 |
-
{
|
40 |
-
wp_enqueue_script('wpra-gutenberg-block', WPRSS_APP_JS . 'gutenberg-block.min.js', [
|
41 |
-
'wp-blocks',
|
42 |
-
'wp-i18n',
|
43 |
-
'wp-element',
|
44 |
-
'wp-editor',
|
45 |
-
]);
|
46 |
-
|
47 |
-
wp_enqueue_style('wpra-gutenberg-block', WPRSS_APP_CSS . 'gutenberg-block.min.css');
|
48 |
-
|
49 |
-
$templates = [];
|
50 |
-
foreach ($this->templates as $template) {
|
51 |
-
$templates[] = [
|
52 |
-
'label' => $template['name'],
|
53 |
-
'value' => $template['slug'],
|
54 |
-
'limit' => isset($template['options']['limit']) ? $template['options']['limit'] : 15,
|
55 |
-
'pagination' => isset($template['options']['pagination']) ? $template['options']['pagination'] : true,
|
56 |
-
];
|
57 |
-
}
|
58 |
-
|
59 |
-
wp_localize_script('wpra-gutenberg-block', 'WPRA_BLOCK', [
|
60 |
-
'ajax_url' => admin_url('admin-ajax.php'),
|
61 |
-
'templates' => $templates,
|
62 |
-
'is_et_active' => wprss_is_et_active(),
|
63 |
-
]);
|
64 |
-
}
|
65 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -3,7 +3,7 @@
|
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
-
use RebelCode\Wpra\Core\
|
7 |
|
8 |
/**
|
9 |
* The WP RSS Aggregator internationalization module.
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
+
use RebelCode\Wpra\Core\Handlers\LoadTextDomainHandler;
|
7 |
|
8 |
/**
|
9 |
* The WP RSS Aggregator internationalization module.
|
@@ -0,0 +1,424 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Modules;
|
4 |
+
|
5 |
+
use Aventura\Wprss\Core\Caching\ImageCache;
|
6 |
+
use Psr\Container\ContainerInterface;
|
7 |
+
use Psr\Log\NullLogger;
|
8 |
+
use RebelCode\Wpra\Core\Entities\Feeds\Items\WpPostFeedItem;
|
9 |
+
use RebelCode\Wpra\Core\Handlers\Images\AddItemsImageColumnHandler;
|
10 |
+
use RebelCode\Wpra\Core\Handlers\Images\DeleteImagesHandler;
|
11 |
+
use RebelCode\Wpra\Core\Handlers\Images\RemoveFtImageMetaBoxHandler;
|
12 |
+
use RebelCode\Wpra\Core\Handlers\Images\RenderItemsImageColumnHandler;
|
13 |
+
use RebelCode\Wpra\Core\Handlers\RegisterMetaBoxHandler;
|
14 |
+
use RebelCode\Wpra\Core\Handlers\RenderTemplateHandler;
|
15 |
+
use RebelCode\Wpra\Core\Importer\Images\FbImageContainer;
|
16 |
+
use RebelCode\Wpra\Core\Importer\Images\ImageContainer;
|
17 |
+
use RebelCode\Wpra\Core\Logger\ConditionalLogger;
|
18 |
+
use RebelCode\Wpra\Core\Logger\FeedLoggerDataSet;
|
19 |
+
use WPRSS_Help;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* The module that adds image importing functionality to WP RSS Aggregator.
|
23 |
+
*
|
24 |
+
* @since 4.14
|
25 |
+
*/
|
26 |
+
class ImagesModule implements ModuleInterface
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* @inheritdoc
|
30 |
+
*
|
31 |
+
* @since 4.14
|
32 |
+
*/
|
33 |
+
public function getFactories()
|
34 |
+
{
|
35 |
+
return [
|
36 |
+
/*
|
37 |
+
* The flag that controls whether UI for controlling image importing is enabled or not.
|
38 |
+
*
|
39 |
+
* @since 4.14
|
40 |
+
*/
|
41 |
+
'wpra/images/ui_enabled' => function (ContainerInterface $c) {
|
42 |
+
return false;
|
43 |
+
},
|
44 |
+
/*
|
45 |
+
* The flag that controls whether logging for image importing is enabled or not.
|
46 |
+
*
|
47 |
+
* @since 4.14
|
48 |
+
*/
|
49 |
+
'wpra/images/logging/enabled' => function (ContainerInterface $c) {
|
50 |
+
return false;
|
51 |
+
},
|
52 |
+
/*
|
53 |
+
* The logger for image importing, that only logs if image logging is enabled.
|
54 |
+
*
|
55 |
+
* @since 4.14
|
56 |
+
*/
|
57 |
+
'wpra/images/logging/logger' => function (ContainerInterface $c) {
|
58 |
+
// Get the original logger from WPRA's logger module, if available
|
59 |
+
$logger = $c->has('wpra/logging/logger')
|
60 |
+
? $c->get('wpra/logging/logger')
|
61 |
+
: new NullLogger();
|
62 |
+
|
63 |
+
// Get the decorator
|
64 |
+
$decorator = $c->get('wpra/images/logging/decorator');
|
65 |
+
|
66 |
+
// Decorate the original logger and return it
|
67 |
+
return $decorator($logger);
|
68 |
+
},
|
69 |
+
/*
|
70 |
+
* The decorator for decorating other loggers for image import logging.
|
71 |
+
*
|
72 |
+
* @since 4.14
|
73 |
+
*/
|
74 |
+
'wpra/images/logging/decorator' => function (ContainerInterface $c) {
|
75 |
+
return function($logger) use ($c) {
|
76 |
+
return new ConditionalLogger($logger, $c->get('wpra/images/logging/enabled'));
|
77 |
+
};
|
78 |
+
},
|
79 |
+
/*
|
80 |
+
* The data set that contains the image import logger instances for each feed source.
|
81 |
+
*
|
82 |
+
* @since 4.14
|
83 |
+
*/
|
84 |
+
'wpra/images/logging/feed_logger_dataset' => function (ContainerInterface $c) {
|
85 |
+
return new FeedLoggerDataSet($c->get('wpra/images/logging/feed_logger_factory'));
|
86 |
+
},
|
87 |
+
/*
|
88 |
+
* The factory that creates image importing logger instances for specific feeds.
|
89 |
+
*
|
90 |
+
* @since 4.14
|
91 |
+
*/
|
92 |
+
'wpra/images/logging/feed_logger_factory' => function (ContainerInterface $c) {
|
93 |
+
$factory = $c->has('wpra/logging/feed_logger_factory')
|
94 |
+
? $c->get('wpra/logging/feed_logger_factory')
|
95 |
+
: null;
|
96 |
+
|
97 |
+
if ($factory === null) {
|
98 |
+
return $c->get('wpra/images/logging/logger');
|
99 |
+
}
|
100 |
+
|
101 |
+
// Get the decorator
|
102 |
+
$decorator = $c->get('wpra/images/logging/decorator');
|
103 |
+
|
104 |
+
return function($feedId) use ($c, $factory, $decorator) {
|
105 |
+
return $decorator($factory($feedId));
|
106 |
+
};
|
107 |
+
},
|
108 |
+
/*
|
109 |
+
* Whether the feature to import featured images is enabled or not.
|
110 |
+
*
|
111 |
+
* @since 4.14
|
112 |
+
*/
|
113 |
+
'wpra/images/features/import_ft_images' => function () {
|
114 |
+
return false;
|
115 |
+
},
|
116 |
+
/*
|
117 |
+
* Whether the feature to restrict images by size is enabled or not.
|
118 |
+
*
|
119 |
+
* @since 4.14
|
120 |
+
*/
|
121 |
+
'wpra/images/features/image_min_size' => function () {
|
122 |
+
return false;
|
123 |
+
},
|
124 |
+
/*
|
125 |
+
* Whether the feature to download non-featured images is enabled or not.
|
126 |
+
*
|
127 |
+
* @since 4.14
|
128 |
+
*/
|
129 |
+
'wpra/images/features/download_images' => function () {
|
130 |
+
return false;
|
131 |
+
},
|
132 |
+
/*
|
133 |
+
* Whether the feature to remove featured images from the content is enabled or not.
|
134 |
+
*
|
135 |
+
* @since 4.14
|
136 |
+
*/
|
137 |
+
'wpra/images/features/siphon_ft_image' => function () {
|
138 |
+
return false;
|
139 |
+
},
|
140 |
+
/*
|
141 |
+
* Whether the feature to reject items without featured images is enabled or not.
|
142 |
+
*
|
143 |
+
* @since 4.14
|
144 |
+
*/
|
145 |
+
'wpra/images/features/must_have_ft_image' => function () {
|
146 |
+
return false;
|
147 |
+
},
|
148 |
+
/*
|
149 |
+
* The image cache manager instance.
|
150 |
+
*
|
151 |
+
* @since 4.14
|
152 |
+
*/
|
153 |
+
'wpra/images/cache' => function (ContainerInterface $c) {
|
154 |
+
$cache = new ImageCache();
|
155 |
+
$cache->set_ttl($c->get('wpra/images/cache/ttl'));
|
156 |
+
|
157 |
+
return $cache;
|
158 |
+
},
|
159 |
+
/*
|
160 |
+
* The time-to-live, in seconds, for cached images.
|
161 |
+
*
|
162 |
+
* @since 4.14
|
163 |
+
*/
|
164 |
+
'wpra/images/cache/ttl' => function () {
|
165 |
+
return WEEK_IN_SECONDS;
|
166 |
+
},
|
167 |
+
/*
|
168 |
+
* The container for remote images.
|
169 |
+
*
|
170 |
+
* @since 4.14
|
171 |
+
*/
|
172 |
+
'wpra/images/container' => function (ContainerInterface $c) {
|
173 |
+
return new ImageContainer(
|
174 |
+
$c->get('wpra/images/cache'),
|
175 |
+
$c->get('wpra/logging/logger')
|
176 |
+
);
|
177 |
+
},
|
178 |
+
/*
|
179 |
+
* The feed items image column key.
|
180 |
+
*
|
181 |
+
* @since 4.14
|
182 |
+
*/
|
183 |
+
'wpra/images/items/column/key' => function () {
|
184 |
+
return 'image';
|
185 |
+
},
|
186 |
+
/*
|
187 |
+
* The feed items image column name.
|
188 |
+
*
|
189 |
+
* @since 4.14
|
190 |
+
*/
|
191 |
+
'wpra/images/items/column/name' => function () {
|
192 |
+
return __('Image', 'wprss');
|
193 |
+
},
|
194 |
+
/*
|
195 |
+
* The feed items image column position.
|
196 |
+
*
|
197 |
+
* @since 4.14
|
198 |
+
*/
|
199 |
+
'wpra/images/items/column/position' => function () {
|
200 |
+
return 1;
|
201 |
+
},
|
202 |
+
/*
|
203 |
+
* The handler that adds the image column to the items list page.
|
204 |
+
*
|
205 |
+
* @since 4.14
|
206 |
+
*/
|
207 |
+
'wpra/images/items/column/handler/add' => function (ContainerInterface $c) {
|
208 |
+
return new AddItemsImageColumnHandler(
|
209 |
+
$c->get('wpra/images/items/column/key'),
|
210 |
+
$c->get('wpra/images/items/column/name'),
|
211 |
+
$c->get('wpra/images/items/column/position')
|
212 |
+
);
|
213 |
+
},
|
214 |
+
/*
|
215 |
+
* The handler that renders the contents of the image column in the items list page.
|
216 |
+
*
|
217 |
+
* @since 4.14
|
218 |
+
*/
|
219 |
+
'wpra/images/items/column/handler/render' => function (ContainerInterface $c) {
|
220 |
+
return new RenderItemsImageColumnHandler(
|
221 |
+
$c->get('wpra/feeds/items/collection'),
|
222 |
+
$c->get('wpra/images/items/column/key')
|
223 |
+
);
|
224 |
+
},
|
225 |
+
/*
|
226 |
+
* The handler that registers the feed sources images meta box.
|
227 |
+
*
|
228 |
+
* @since 4.14
|
229 |
+
*/
|
230 |
+
'wpra/images/feeds/meta_box/handler/register' => function (ContainerInterface $c) {
|
231 |
+
return new RegisterMetaBoxHandler(
|
232 |
+
'wpra-images',
|
233 |
+
__('Images', 'wprss'),
|
234 |
+
$c->get('wpra/images/feeds/meta_box/handler/render'),
|
235 |
+
'wprss_feed'
|
236 |
+
);
|
237 |
+
},
|
238 |
+
/*
|
239 |
+
* The handler that renders the feed sources image options meta box.
|
240 |
+
*
|
241 |
+
* @since 4.14
|
242 |
+
*/
|
243 |
+
'wpra/images/feeds/meta_box/handler/render' => function (ContainerInterface $c) {
|
244 |
+
return new RenderTemplateHandler(
|
245 |
+
$c->get('wpra/images/feeds/meta_box/template'),
|
246 |
+
$c->get('wpra/images/feeds/meta_box/template/context'),
|
247 |
+
true
|
248 |
+
);
|
249 |
+
},
|
250 |
+
/*
|
251 |
+
* The template for the feed sources image options meta box.
|
252 |
+
*
|
253 |
+
* @since 4.14
|
254 |
+
*/
|
255 |
+
'wpra/images/feeds/meta_box/template' => function (ContainerInterface $c) {
|
256 |
+
return $c->get('wpra/twig/collection')['admin/feeds/images-meta-box.twig'];
|
257 |
+
},
|
258 |
+
/*
|
259 |
+
* The context for the feed sources image options meta box template.
|
260 |
+
*
|
261 |
+
* @since 4.14
|
262 |
+
*/
|
263 |
+
'wpra/images/feeds/meta_box/template/context' => function (ContainerInterface $c) {
|
264 |
+
return function () use ($c) {
|
265 |
+
global $post;
|
266 |
+
|
267 |
+
$collection = $c->get('wpra/feeds/sources/collection');
|
268 |
+
$feed = isset($collection[$post->ID])
|
269 |
+
? $collection[$post->ID]
|
270 |
+
: [];
|
271 |
+
|
272 |
+
return [
|
273 |
+
'feed' => $feed,
|
274 |
+
'options' => $c->get('wpra/images/feeds/meta_box/template/enabled_options'),
|
275 |
+
];
|
276 |
+
};
|
277 |
+
},
|
278 |
+
/*
|
279 |
+
* The image options that should be shown in the feed sources image meta box.
|
280 |
+
*
|
281 |
+
* @since 4.14
|
282 |
+
*/
|
283 |
+
'wpra/images/feeds/meta_box/template/enabled_options' => function (ContainerInterface $c) {
|
284 |
+
return [
|
285 |
+
'import_ft_images' => $c->get('wpra/images/features/import_ft_images'),
|
286 |
+
'image_min_size' => $c->get('wpra/images/features/image_min_size'),
|
287 |
+
'download_images' => $c->get('wpra/images/features/download_images'),
|
288 |
+
'siphon_ft_image' => $c->get('wpra/images/features/siphon_ft_image'),
|
289 |
+
'must_have_ft_image' => $c->get('wpra/images/features/must_have_ft_image'),
|
290 |
+
];
|
291 |
+
},
|
292 |
+
/*
|
293 |
+
* The handler that removes the WordPress featured image meta box.
|
294 |
+
*
|
295 |
+
* @since 4.14
|
296 |
+
*/
|
297 |
+
'wpra/images/ft_image/meta_box/handler' => function (ContainerInterface $c) {
|
298 |
+
return new RemoveFtImageMetaBoxHandler();
|
299 |
+
},
|
300 |
+
/*
|
301 |
+
* The help tooltips for the feed sources images meta box.
|
302 |
+
*
|
303 |
+
* @since 4.14
|
304 |
+
*/
|
305 |
+
'wpra/images/feeds/meta_box/tooltips' => function () {
|
306 |
+
return [
|
307 |
+
'ft_image' => __(
|
308 |
+
"This option allows you to select which feed item image to use as the featured image. Automatic best image detection will attempt to find the largest image with the best aspect ratio.
|
309 |
+
|
310 |
+
WordPress requires that featured images exist in the media library, so WP RSS Aggregator will always download and save featured images.",
|
311 |
+
'wprss'
|
312 |
+
),
|
313 |
+
];
|
314 |
+
},
|
315 |
+
/*
|
316 |
+
* The handler for the developer images meta box for feed items.
|
317 |
+
*
|
318 |
+
* @since 4.14
|
319 |
+
*/
|
320 |
+
'wpra/images/items/dev_meta_box/handler' => function (ContainerInterface $c) {
|
321 |
+
$templates = $c->get('wpra/twig/collection');
|
322 |
+
|
323 |
+
return new RegisterMetaBoxHandler(
|
324 |
+
'wpra-dev-items-images',
|
325 |
+
__('Images', 'wprss'),
|
326 |
+
new RenderTemplateHandler($templates['admin/items/images-meta-box.twig'], function () {
|
327 |
+
global $post;
|
328 |
+
return [
|
329 |
+
'item' => new WpPostFeedItem($post),
|
330 |
+
];
|
331 |
+
}, true),
|
332 |
+
'wprss_feed_item'
|
333 |
+
);
|
334 |
+
},
|
335 |
+
/*
|
336 |
+
* The handler that deletes an imported item's featured image when the item is deleted.
|
337 |
+
*
|
338 |
+
* @since 4.14
|
339 |
+
*/
|
340 |
+
'wpra/images/items/handlers/delete_images' => function (ContainerInterface $c) {
|
341 |
+
return new DeleteImagesHandler(
|
342 |
+
$c->get('wpra/importer/items/collection')
|
343 |
+
);
|
344 |
+
},
|
345 |
+
];
|
346 |
+
}
|
347 |
+
|
348 |
+
/**
|
349 |
+
* @inheritdoc
|
350 |
+
*
|
351 |
+
* @since 4.14
|
352 |
+
*/
|
353 |
+
public function getExtensions()
|
354 |
+
{
|
355 |
+
return [
|
356 |
+
/*
|
357 |
+
* Adds featured image support to feed sources.
|
358 |
+
*
|
359 |
+
* @since 4.14
|
360 |
+
*/
|
361 |
+
'wpra/feeds/sources/cpt/args' => function (ContainerInterface $c, $args) {
|
362 |
+
$args['supports'][] = 'thumbnail';
|
363 |
+
|
364 |
+
return $args;
|
365 |
+
},
|
366 |
+
/*
|
367 |
+
* Adds featured image support to feed items.
|
368 |
+
*
|
369 |
+
* @since 4.14
|
370 |
+
*/
|
371 |
+
'wpra/feeds/items/cpt/args' => function (ContainerInterface $c, $args) {
|
372 |
+
$args['supports'][] = 'thumbnail';
|
373 |
+
|
374 |
+
return $args;
|
375 |
+
},
|
376 |
+
/*
|
377 |
+
* Decorates the images container to be able to fetch large versions of Facebook images.
|
378 |
+
*
|
379 |
+
* @since 4.14
|
380 |
+
*/
|
381 |
+
'wpra/images/container' => function (ContainerInterface $c, $container) {
|
382 |
+
return new FbImageContainer($container);
|
383 |
+
},
|
384 |
+
];
|
385 |
+
}
|
386 |
+
|
387 |
+
/**
|
388 |
+
* @inheritdoc
|
389 |
+
*
|
390 |
+
* @since 4.14
|
391 |
+
*/
|
392 |
+
public function run(ContainerInterface $c)
|
393 |
+
{
|
394 |
+
// The handler that removes the WordPress featured image meta box
|
395 |
+
add_action('add_meta_boxes', $c->get('wpra/images/ft_image/meta_box/handler'));
|
396 |
+
|
397 |
+
// Check if the images UI is enabled
|
398 |
+
if ($c->get('wpra/images/ui_enabled')) {
|
399 |
+
// The handler that registers the images meta box, if Feed to Post's version is not being used
|
400 |
+
if (!class_exists('WPRSS_FTP_Meta')) {
|
401 |
+
add_action('add_meta_boxes', $c->get('wpra/images/feeds/meta_box/handler/register'));
|
402 |
+
}
|
403 |
+
|
404 |
+
// Show the developer images meta box for feed items, if the developer filter is enabled
|
405 |
+
if (apply_filters('wpra_dev_mode', false) === true) {
|
406 |
+
add_action('add_meta_boxes', $c->get('wpra/images/items/dev_meta_box/handler'));
|
407 |
+
}
|
408 |
+
|
409 |
+
// Register the meta box tooltips
|
410 |
+
$tooltips = $c->get('wpra/images/feeds/meta_box/tooltips');
|
411 |
+
add_action('admin_init', function () use ($tooltips) {
|
412 |
+
WPRSS_Help::get_instance()->add_tooltips($tooltips);
|
413 |
+
});
|
414 |
+
|
415 |
+
// The handler that deletes images when the respective imported item is deleted
|
416 |
+
add_action('before_delete_post', $c->get('wpra/images/items/handlers/delete_images'));
|
417 |
+
|
418 |
+
// Adds the image column in the feed items page
|
419 |
+
add_filter('wprss_set_feed_item_custom_columns', $c->get('wpra/images/items/column/handler/add'));
|
420 |
+
// Renders the image column in the feed items page
|
421 |
+
add_action('manage_wprss_feed_item_posts_custom_column', $c->get('wpra/images/items/column/handler/render'), 10, 2 );
|
422 |
+
}
|
423 |
+
}
|
424 |
+
}
|
@@ -3,7 +3,7 @@
|
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
-
use RebelCode\Wpra\Core\Feeds\ImportedItemsCollection;
|
7 |
|
8 |
/**
|
9 |
* The WP RSS Aggregator importer module.
|
3 |
namespace RebelCode\Wpra\Core\Modules;
|
4 |
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
+
use RebelCode\Wpra\Core\Entities\Feeds\Items\ImportedItemsCollection;
|
7 |
|
8 |
/**
|
9 |
* The WP RSS Aggregator importer module.
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Modules;
|
4 |
+
|
5 |
+
use Aventura\Wprss\Core\Licensing\Manager;
|
6 |
+
use Psr\Container\ContainerInterface;
|
7 |
+
use RebelCode\Wpra\Core\Licensing\Addon;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* The licensing module for WP RSS Aggregator.
|
11 |
+
*
|
12 |
+
* @since 4.14
|
13 |
+
*/
|
14 |
+
class LicensingModule implements ModuleInterface
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* @inheritdoc
|
18 |
+
*
|
19 |
+
* @since 4.14
|
20 |
+
*/
|
21 |
+
public function run(ContainerInterface $c)
|
22 |
+
{
|
23 |
+
/* @var $manager Manager */
|
24 |
+
$manager = $c->get('wpra/licensing/manager');
|
25 |
+
/* @var $addons Addon[] */
|
26 |
+
$addons = $c->get('wpra/licensing/addons');
|
27 |
+
|
28 |
+
// Gets the addons from the service and registers them using the legacy filter
|
29 |
+
add_filter('wprss_register_addon', function ($argAddons) use ($addons) {
|
30 |
+
foreach ($addons as $addon) {
|
31 |
+
$argAddons[$addon->key] = $addon->name;
|
32 |
+
}
|
33 |
+
|
34 |
+
return $argAddons;
|
35 |
+
});
|
36 |
+
|
37 |
+
// Trigger after the licensing system has loaded and the admin-side has initialized
|
38 |
+
// Register each addon's updater instance to listen for potential plugin updates
|
39 |
+
add_action('wprss_init_licensing', function() use ($manager, $addons) {
|
40 |
+
add_action('admin_init', function () use ($manager, $addons) {
|
41 |
+
// Stop if the manager is not recent (because another addon auto-loaded a different version)
|
42 |
+
if (!method_exists($manager, 'initUpdaterInstance')) {
|
43 |
+
return;
|
44 |
+
}
|
45 |
+
|
46 |
+
foreach ($addons as $addon) {
|
47 |
+
$manager->initUpdaterInstance(
|
48 |
+
$addon->key,
|
49 |
+
$addon->name,
|
50 |
+
$addon->version,
|
51 |
+
$addon->filePath,
|
52 |
+
$addon->storeUrl
|
53 |
+
);
|
54 |
+
}
|
55 |
+
});
|
56 |
+
});
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* @inheritdoc
|
61 |
+
*
|
62 |
+
* @since 4.14
|
63 |
+
*/
|
64 |
+
public function getFactories()
|
65 |
+
{
|
66 |
+
return [
|
67 |
+
/*
|
68 |
+
* The licensing manager instance - uses the instance from the old system.
|
69 |
+
*
|
70 |
+
* @since 4.14
|
71 |
+
*/
|
72 |
+
'wpra/licensing/manager' => function () {
|
73 |
+
return wprss_licensing_get_manager();
|
74 |
+
},
|
75 |
+
/*
|
76 |
+
* Mirror for 'wpra/addons' service in the addons module.
|
77 |
+
*
|
78 |
+
* @since 4.14
|
79 |
+
*/
|
80 |
+
'wpra/licensing/addons' => function (ContainerInterface $c) {
|
81 |
+
if ($c->has('wpra/addons')) {
|
82 |
+
return $c->get('wpra/addons');
|
83 |
+
}
|
84 |
+
|
85 |
+
return [];
|
86 |
+
},
|
87 |
+
];
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* @inheritdoc
|
92 |
+
*
|
93 |
+
* @since 4.14
|
94 |
+
*/
|
95 |
+
public function getExtensions()
|
96 |
+
{
|
97 |
+
return [];
|
98 |
+
}
|
99 |
+
}
|
@@ -5,10 +5,15 @@ namespace RebelCode\Wpra\Core\Modules;
|
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
use RebelCode\Wpra\Core\Database\NullTable;
|
7 |
use RebelCode\Wpra\Core\Database\WpdbTable;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
use RebelCode\Wpra\Core\Logger\FeedLoggerDataSet;
|
9 |
use RebelCode\Wpra\Core\Logger\WpdbLogger;
|
10 |
-
use RebelCode\Wpra\Core\Modules\Handlers\Logger\TruncateLogsCronHandler;
|
11 |
-
use RebelCode\Wpra\Core\Modules\Handlers\ScheduleCronJobHandler;
|
12 |
|
13 |
/**
|
14 |
* A module that adds a logger to WP RSS Aggregator.
|
@@ -25,18 +30,53 @@ class LoggerModule implements ModuleInterface
|
|
25 |
public function getFactories()
|
26 |
{
|
27 |
return [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
/*
|
29 |
* The main logger instance.
|
30 |
*
|
31 |
* @since 4.13
|
32 |
*/
|
33 |
'wpra/logging/logger' => function (ContainerInterface $c) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
return new WpdbLogger(
|
35 |
$c->get('wpra/logging/log_table'),
|
36 |
$c->get('wpra/logging/log_table_columns'),
|
37 |
$c->get('wpra/logging/log_table_extra')
|
38 |
);
|
39 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
/*
|
41 |
* The table where logs are stored.
|
42 |
*
|
@@ -111,7 +151,7 @@ class LoggerModule implements ModuleInterface
|
|
111 |
];
|
112 |
},
|
113 |
/*
|
114 |
-
* The data set that contains the logger instances for each feed source
|
115 |
*
|
116 |
* @since 4.13
|
117 |
*/
|
@@ -125,10 +165,13 @@ class LoggerModule implements ModuleInterface
|
|
125 |
*/
|
126 |
'wpra/logging/feed_logger_factory' => function (ContainerInterface $c) {
|
127 |
return function ($feedId) use ($c) {
|
128 |
-
return new
|
129 |
-
|
130 |
-
|
131 |
-
|
|
|
|
|
|
|
132 |
);
|
133 |
};
|
134 |
},
|
@@ -170,14 +213,67 @@ class LoggerModule implements ModuleInterface
|
|
170 |
'wpra/logging/trunc_logs_cron/first_run' => function (ContainerInterface $c) {
|
171 |
return time() + DAY_IN_SECONDS;
|
172 |
},
|
173 |
-
|
174 |
-
* The
|
175 |
-
* Logs older than this number in days are deleted.
|
176 |
*
|
177 |
-
* @since 4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
*/
|
179 |
-
'wpra/logging/
|
180 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
},
|
182 |
/*
|
183 |
* The handler for the log truncation cron job.
|
@@ -187,7 +283,7 @@ class LoggerModule implements ModuleInterface
|
|
187 |
'wpra/logging/trunc_logs_cron/handler' => function (ContainerInterface $c) {
|
188 |
return new TruncateLogsCronHandler(
|
189 |
$c->get('wpra/logging/log_table'),
|
190 |
-
$c->get('wpra/
|
191 |
);
|
192 |
},
|
193 |
/*
|
@@ -208,7 +304,19 @@ class LoggerModule implements ModuleInterface
|
|
208 |
*/
|
209 |
public function getExtensions()
|
210 |
{
|
211 |
-
return [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
}
|
213 |
|
214 |
/**
|
@@ -220,5 +328,26 @@ class LoggerModule implements ModuleInterface
|
|
220 |
{
|
221 |
// Hook in the scheduler for the truncate logs cron job
|
222 |
add_action('init', $c->get('wpra/logging/trunc_logs_cron/scheduler'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
}
|
224 |
}
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
use RebelCode\Wpra\Core\Database\NullTable;
|
7 |
use RebelCode\Wpra\Core\Database\WpdbTable;
|
8 |
+
use RebelCode\Wpra\Core\Handlers\Logger\ClearLogHandler;
|
9 |
+
use RebelCode\Wpra\Core\Handlers\Logger\DownloadLogHandler;
|
10 |
+
use RebelCode\Wpra\Core\Handlers\Logger\RenderLogHandler;
|
11 |
+
use RebelCode\Wpra\Core\Handlers\Logger\SaveLogOptionsHandler;
|
12 |
+
use RebelCode\Wpra\Core\Handlers\Logger\TruncateLogsCronHandler;
|
13 |
+
use RebelCode\Wpra\Core\Handlers\ScheduleCronJobHandler;
|
14 |
+
use RebelCode\Wpra\Core\Logger\ConditionalLogger;
|
15 |
use RebelCode\Wpra\Core\Logger\FeedLoggerDataSet;
|
16 |
use RebelCode\Wpra\Core\Logger\WpdbLogger;
|
|
|
|
|
17 |
|
18 |
/**
|
19 |
* A module that adds a logger to WP RSS Aggregator.
|
30 |
public function getFactories()
|
31 |
{
|
32 |
return [
|
33 |
+
/*
|
34 |
+
* Whether or not logging is enabled.
|
35 |
+
*
|
36 |
+
* @since 4.14
|
37 |
+
*/
|
38 |
+
'wpra/logging/enabled' => function (ContainerInterface $c) {
|
39 |
+
return $c->get('wpra/core/config')['logging/enabled'];
|
40 |
+
},
|
41 |
/*
|
42 |
* The main logger instance.
|
43 |
*
|
44 |
* @since 4.13
|
45 |
*/
|
46 |
'wpra/logging/logger' => function (ContainerInterface $c) {
|
47 |
+
return new ConditionalLogger(
|
48 |
+
$c->get('wpra/logging/wpdb_logger'),
|
49 |
+
$c->get('wpra/logging/enabled')
|
50 |
+
);
|
51 |
+
},
|
52 |
+
/*
|
53 |
+
* The WPDB logger instance.
|
54 |
+
*
|
55 |
+
* @since 4.13
|
56 |
+
*/
|
57 |
+
'wpra/logging/wpdb_logger' => function (ContainerInterface $c) {
|
58 |
return new WpdbLogger(
|
59 |
$c->get('wpra/logging/log_table'),
|
60 |
$c->get('wpra/logging/log_table_columns'),
|
61 |
$c->get('wpra/logging/log_table_extra')
|
62 |
);
|
63 |
},
|
64 |
+
/*
|
65 |
+
* The log reader instance.
|
66 |
+
*
|
67 |
+
* @since 4.14
|
68 |
+
*/
|
69 |
+
'wpra/logging/reader' => function (ContainerInterface $c) {
|
70 |
+
return $c->get('wpra/logging/wpdb_logger');
|
71 |
+
},
|
72 |
+
/*
|
73 |
+
* The log clearer instance.
|
74 |
+
*
|
75 |
+
* @since 4.14
|
76 |
+
*/
|
77 |
+
'wpra/logging/clearer' => function (ContainerInterface $c) {
|
78 |
+
return $c->get('wpra/logging/wpdb_logger');
|
79 |
+
},
|
80 |
/*
|
81 |
* The table where logs are stored.
|
82 |
*
|
151 |
];
|
152 |
},
|
153 |
/*
|
154 |
+
* The data set that contains the logger instances for each feed source.
|
155 |
*
|
156 |
* @since 4.13
|
157 |
*/
|
165 |
*/
|
166 |
'wpra/logging/feed_logger_factory' => function (ContainerInterface $c) {
|
167 |
return function ($feedId) use ($c) {
|
168 |
+
return new ConditionalLogger(
|
169 |
+
new WpdbLogger(
|
170 |
+
$c->get('wpra/logging/log_table'),
|
171 |
+
$c->get('wpra/logging/log_table_columns'),
|
172 |
+
['feed_id' => $feedId]
|
173 |
+
),
|
174 |
+
$c->get('wpra/logging/enabled')
|
175 |
);
|
176 |
};
|
177 |
},
|
213 |
'wpra/logging/trunc_logs_cron/first_run' => function (ContainerInterface $c) {
|
214 |
return time() + DAY_IN_SECONDS;
|
215 |
},
|
216 |
+
/**
|
217 |
+
* The URL of the page where the log is found.
|
|
|
218 |
*
|
219 |
+
* @since 4.14
|
220 |
+
*/
|
221 |
+
'wpra/logging/page/url' => function () {
|
222 |
+
return admin_url('edit.php?post_type=wprss_feed&page=wprss-debugging');
|
223 |
+
},
|
224 |
+
/**
|
225 |
+
* The name of the nonce used in the debug page to verify the referer of log-related requests.
|
226 |
+
*
|
227 |
+
* @since 4.14
|
228 |
*/
|
229 |
+
'wpra/logging/page/nonce_name' => function () {
|
230 |
+
return 'wprss-debug-log';
|
231 |
+
},
|
232 |
+
/**
|
233 |
+
* The handler that renders the log.
|
234 |
+
*
|
235 |
+
* @since 4.14
|
236 |
+
*/
|
237 |
+
'wpra/logging/handlers/render_log' => function (ContainerInterface $c) {
|
238 |
+
return new RenderLogHandler(
|
239 |
+
$c->get('wpra/logging/reader'),
|
240 |
+
$c->get('wpra/twig/collection')['admin/debug/log.twig'],
|
241 |
+
$c->get('wpra/core/config'),
|
242 |
+
$c->get('wpra/logging/page/nonce_name')
|
243 |
+
);
|
244 |
+
},
|
245 |
+
/**
|
246 |
+
* TThe handler that processes the clear log request.
|
247 |
+
*
|
248 |
+
* @since 4.14
|
249 |
+
*/
|
250 |
+
'wpra/logging/handlers/clear_log' => function (ContainerInterface $c) {
|
251 |
+
return new ClearLogHandler(
|
252 |
+
$c->get('wpra/logging/clearer'),
|
253 |
+
$c->get('wpra/logging/page/nonce_name')
|
254 |
+
);
|
255 |
+
},
|
256 |
+
/**
|
257 |
+
* The handler that processes the log download request.
|
258 |
+
*
|
259 |
+
* @since 4.14
|
260 |
+
*/
|
261 |
+
'wpra/logging/handlers/download_log' => function (ContainerInterface $c) {
|
262 |
+
return new DownloadLogHandler(
|
263 |
+
$c->get('wpra/logging/reader'),
|
264 |
+
$c->get('wpra/logging/page/nonce_name')
|
265 |
+
);
|
266 |
+
},
|
267 |
+
/**
|
268 |
+
* The handler that processes log option saving request.
|
269 |
+
*
|
270 |
+
* @since 4.14
|
271 |
+
*/
|
272 |
+
'wpra/logging/handlers/save_options' => function (ContainerInterface $c) {
|
273 |
+
return new SaveLogOptionsHandler(
|
274 |
+
$c->get('wpra/core/config'),
|
275 |
+
$c->get('wpra/logging/page/nonce_name')
|
276 |
+
);
|
277 |
},
|
278 |
/*
|
279 |
* The handler for the log truncation cron job.
|
283 |
'wpra/logging/trunc_logs_cron/handler' => function (ContainerInterface $c) {
|
284 |
return new TruncateLogsCronHandler(
|
285 |
$c->get('wpra/logging/log_table'),
|
286 |
+
$c->get('wpra/core/config')
|
287 |
);
|
288 |
},
|
289 |
/*
|
304 |
*/
|
305 |
public function getExtensions()
|
306 |
{
|
307 |
+
return [
|
308 |
+
/*
|
309 |
+
* Adds the logging options to the plugin config.
|
310 |
+
*
|
311 |
+
* @since 4.14
|
312 |
+
*/
|
313 |
+
'wpra/core/config/options' => function (ContainerInterface $c, $options) {
|
314 |
+
$options['logging/enabled'] = true;
|
315 |
+
$options['logging/limit_days'] = 3;
|
316 |
+
|
317 |
+
return $options;
|
318 |
+
},
|
319 |
+
];
|
320 |
}
|
321 |
|
322 |
/**
|
328 |
{
|
329 |
// Hook in the scheduler for the truncate logs cron job
|
330 |
add_action('init', $c->get('wpra/logging/trunc_logs_cron/scheduler'));
|
331 |
+
|
332 |
+
// Renders the log on the debugging page
|
333 |
+
add_filter('wprss_debug_operations', function ($operations) use ($c) {
|
334 |
+
$operations['render-error-log'] = apply_filters(
|
335 |
+
'wprss_render_error_log_operation',
|
336 |
+
[
|
337 |
+
'nonce' => null,
|
338 |
+
'run' => null,
|
339 |
+
'render' => $c->get('wpra/logging/handlers/render_log'),
|
340 |
+
]
|
341 |
+
);
|
342 |
+
|
343 |
+
return $operations;
|
344 |
+
});
|
345 |
+
|
346 |
+
// Register the clear log handler
|
347 |
+
add_action('admin_init', $c->get('wpra/logging/handlers/clear_log'));
|
348 |
+
// Register the download log handler
|
349 |
+
add_action('admin_init', $c->get('wpra/logging/handlers/download_log'));
|
350 |
+
// Register the save log options handler
|
351 |
+
add_action('admin_init', $c->get('wpra/logging/handlers/save_options'));
|
352 |
}
|
353 |
}
|
@@ -5,11 +5,6 @@ namespace RebelCode\Wpra\Core\Modules;
|
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
use RebelCode\Wpra\Core\RestApi\Auth\AuthUserIsAdmin;
|
7 |
use RebelCode\Wpra\Core\RestApi\EndPointManager;
|
8 |
-
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\CreateUpdateTemplateEndPoint;
|
9 |
-
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\DeleteTemplateEndPoint;
|
10 |
-
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\GetTemplatesEndPoint;
|
11 |
-
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\PatchTemplateEndPoint;
|
12 |
-
use RebelCode\Wpra\Core\RestApi\EndPoints\FeedTemplates\RenderTemplateEndPoint;
|
13 |
|
14 |
/**
|
15 |
* The REST API module for WP RSS Aggregator.
|
5 |
use Psr\Container\ContainerInterface;
|
6 |
use RebelCode\Wpra\Core\RestApi\Auth\AuthUserIsAdmin;
|
7 |
use RebelCode\Wpra\Core\RestApi\EndPointManager;
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
/**
|
10 |
* The REST API module for WP RSS Aggregator.
|
@@ -53,7 +53,9 @@ class TwigModule implements ModuleInterface
|
|
53 |
* @since 4.13
|
54 |
*/
|
55 |
'wpra/twig/paths' => function (ContainerInterface $c) {
|
56 |
-
return [
|
|
|
|
|
57 |
},
|
58 |
/*
|
59 |
* The twig template collection.
|
53 |
* @since 4.13
|
54 |
*/
|
55 |
'wpra/twig/paths' => function (ContainerInterface $c) {
|
56 |
+
return [
|
57 |
+
$c->get('wpra/core/templates_dir_path')
|
58 |
+
];
|
59 |
},
|
60 |
/*
|
61 |
* The twig template collection.
|
@@ -1,157 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace RebelCode\Wpra\Core\Query;
|
4 |
-
|
5 |
-
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
6 |
-
use RebelCode\Wpra\Core\Feeds\Models\WpPostFeedItem;
|
7 |
-
use WP_Post;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* A query iterator implementation for retrieving imported feed items.
|
11 |
-
*
|
12 |
-
* @since 4.13
|
13 |
-
*/
|
14 |
-
class FeedItemsQueryIterator extends AbstractWpQueryIterator
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* An array of feed source IDs to limit the query to.
|
18 |
-
*
|
19 |
-
* @since 4.13
|
20 |
-
*
|
21 |
-
* @var int[]|string[]
|
22 |
-
*/
|
23 |
-
protected $sources;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* An array of feed source IDs to exclude from the query.
|
27 |
-
*
|
28 |
-
* @since 4.13
|
29 |
-
*
|
30 |
-
* @var int[]|string[]
|
31 |
-
*/
|
32 |
-
protected $excludes;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Optional number of items to return, or null to return all items.
|
36 |
-
*
|
37 |
-
* @since 4.13
|
38 |
-
*
|
39 |
-
* @var int|null
|
40 |
-
*/
|
41 |
-
protected $numItems;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Optional index of the results page to return or null to get the first page.
|
45 |
-
*
|
46 |
-
* @since 4.13
|
47 |
-
*
|
48 |
-
* @var int|null
|
49 |
-
*/
|
50 |
-
protected $page;
|
51 |
-
|
52 |
-
/**
|
53 |
-
* A callable that receives a WP Post object and returns a feed item data set.
|
54 |
-
*
|
55 |
-
* @see WP_Post
|
56 |
-
* @see DataSetInterface
|
57 |
-
*
|
58 |
-
* @since 4.13
|
59 |
-
*
|
60 |
-
* @var callable
|
61 |
-
*/
|
62 |
-
protected $factory;
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Constructor.
|
66 |
-
*
|
67 |
-
* @since 4.13
|
68 |
-
*
|
69 |
-
* @see WP_Post
|
70 |
-
* @see DataSetInterface
|
71 |
-
*
|
72 |
-
* @param array $sources An array of feed source IDs to limit the query to.
|
73 |
-
* @param array $excludes An array of feed source IDs to exclude from the query.
|
74 |
-
* @param int|null $numItems Optional number of items to return, or null to return all items.
|
75 |
-
* @param int|null $page Optional index of the results page to return or null to get the first page.
|
76 |
-
* @param callable|null $factory Optional callable that receives a WP Post object and returns a feed item instance.
|
77 |
-
* If null, defaults to {@link FeedItem::getFactory()}.
|
78 |
-
*/
|
79 |
-
public function __construct(
|
80 |
-
array $sources = [],
|
81 |
-
array $excludes = [],
|
82 |
-
$numItems = null,
|
83 |
-
$page = null,
|
84 |
-
callable $factory = null
|
85 |
-
) {
|
86 |
-
$this->sources = $sources;
|
87 |
-
$this->excludes = $excludes;
|
88 |
-
$this->numItems = $numItems;
|
89 |
-
$this->page = $page;
|
90 |
-
$this->factory = $factory;
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* {@inheritdoc}
|
95 |
-
*
|
96 |
-
* @since 4.13
|
97 |
-
*/
|
98 |
-
public function current()
|
99 |
-
{
|
100 |
-
$post = parent::current();
|
101 |
-
$item = ($this->factory !== null)
|
102 |
-
? call_user_func_array($this->factory, [$post])
|
103 |
-
: new WpPostFeedItem($post);
|
104 |
-
|
105 |
-
return $item;
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* {@inheritdoc}
|
110 |
-
*
|
111 |
-
* @since 4.13
|
112 |
-
*/
|
113 |
-
protected function getQueryArgs()
|
114 |
-
{
|
115 |
-
$numItems = ($this->numItems !== null)
|
116 |
-
? (int) $this->numItems
|
117 |
-
: -1;
|
118 |
-
$paged = ($this->page !== null)
|
119 |
-
? (int) $this->page
|
120 |
-
: 1;
|
121 |
-
|
122 |
-
$query = [
|
123 |
-
'post_type' => get_post_types([], 'names'),
|
124 |
-
'orderby' => 'date',
|
125 |
-
'order' => 'DESC',
|
126 |
-
'suppress_filters' => true,
|
127 |
-
'posts_per_page' => $numItems,
|
128 |
-
'paged' => $paged,
|
129 |
-
'meta_query' => [
|
130 |
-
'relation' => 'AND',
|
131 |
-
[
|
132 |
-
'key' => 'wprss_feed_id',
|
133 |
-
'type' => 'numeric',
|
134 |
-
'compare' => 'EXISTS',
|
135 |
-
],
|
136 |
-
],
|
137 |
-
];
|
138 |
-
|
139 |
-
if (!empty($this->sources)) {
|
140 |
-
$query['meta_query'][] = [
|
141 |
-
'key' => 'wprss_feed_id',
|
142 |
-
'value' => $this->sources,
|
143 |
-
'compare' => 'IN',
|
144 |
-
];
|
145 |
-
}
|
146 |
-
|
147 |
-
if (!empty($this->excludes)) {
|
148 |
-
$query['meta_query'][] = [
|
149 |
-
'key' => 'wprss_feed_id',
|
150 |
-
'value' => $this->excludes,
|
151 |
-
'compare' => 'NOT IN',
|
152 |
-
];
|
153 |
-
}
|
154 |
-
|
155 |
-
return $query;
|
156 |
-
}
|
157 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -23,16 +23,27 @@ class RenderTemplateEndPoint extends AbstractRestApiEndPoint
|
|
23 |
*/
|
24 |
protected $template;
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
/**
|
27 |
* Constructor.
|
28 |
*
|
29 |
* @since 4.13
|
30 |
*
|
31 |
-
* @param TemplateInterface $template
|
|
|
32 |
*/
|
33 |
-
public function __construct(TemplateInterface $template)
|
34 |
{
|
35 |
$this->template = $template;
|
|
|
36 |
}
|
37 |
|
38 |
/**
|
@@ -45,12 +56,19 @@ class RenderTemplateEndPoint extends AbstractRestApiEndPoint
|
|
45 |
$args = $request->get_params();
|
46 |
$args = is_array($args) ? $args : [];
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
// Render the template
|
49 |
$result = $this->template->render($args);
|
50 |
|
51 |
// Filter the result and return it
|
52 |
return new WP_REST_Response([
|
53 |
-
'html' => apply_filters('wprss_shortcode_output', $result)
|
54 |
]);
|
55 |
}
|
56 |
}
|
23 |
*/
|
24 |
protected $template;
|
25 |
|
26 |
+
/**
|
27 |
+
* The template to use for rendering previews.
|
28 |
+
*
|
29 |
+
* @since 4.14
|
30 |
+
*
|
31 |
+
* @var TemplateInterface
|
32 |
+
*/
|
33 |
+
protected $previewTemplate;
|
34 |
+
|
35 |
/**
|
36 |
* Constructor.
|
37 |
*
|
38 |
* @since 4.13
|
39 |
*
|
40 |
+
* @param TemplateInterface $template The template to render.
|
41 |
+
* @param TemplateInterface $previewTemplate The template to use for rendering previews.
|
42 |
*/
|
43 |
+
public function __construct(TemplateInterface $template, TemplateInterface $previewTemplate)
|
44 |
{
|
45 |
$this->template = $template;
|
46 |
+
$this->previewTemplate = $previewTemplate;
|
47 |
}
|
48 |
|
49 |
/**
|
56 |
$args = $request->get_params();
|
57 |
$args = is_array($args) ? $args : [];
|
58 |
|
59 |
+
// If template ID is 0, render as a preview
|
60 |
+
if (empty($args['template']) || $args['template'] === 0) {
|
61 |
+
return new WP_REST_Response([
|
62 |
+
'html' => $this->previewTemplate->render($args),
|
63 |
+
]);
|
64 |
+
}
|
65 |
+
|
66 |
// Render the template
|
67 |
$result = $this->template->render($args);
|
68 |
|
69 |
// Filter the result and return it
|
70 |
return new WP_REST_Response([
|
71 |
+
'html' => apply_filters('wprss_shortcode_output', $result),
|
72 |
]);
|
73 |
}
|
74 |
}
|
@@ -102,13 +102,13 @@ class MasterFeedsTemplate implements TemplateInterface
|
|
102 |
protected $feedItemCollection;
|
103 |
|
104 |
/**
|
105 |
-
* The
|
106 |
*
|
107 |
-
* @since 4.
|
108 |
*
|
109 |
-
* @var
|
110 |
*/
|
111 |
-
protected $
|
112 |
|
113 |
/**
|
114 |
* The template to use for legacy-mode rendering.
|
@@ -137,7 +137,7 @@ class MasterFeedsTemplate implements TemplateInterface
|
|
137 |
* @param array $templateTypes The available template types.
|
138 |
* @param CollectionInterface $templateCollection The collection of templates.
|
139 |
* @param CollectionInterface $feedItemCollection The collection of feed items.
|
140 |
-
* @param
|
141 |
* @param TemplateInterface $legacyTemplate The template to use for legacy-mode rendering.
|
142 |
* @param LoggerInterface $logger The logger instance to use for recording errors.
|
143 |
*/
|
@@ -146,7 +146,7 @@ class MasterFeedsTemplate implements TemplateInterface
|
|
146 |
$templateTypes,
|
147 |
CollectionInterface $templateCollection,
|
148 |
CollectionInterface $feedItemCollection,
|
149 |
-
|
150 |
TemplateInterface $legacyTemplate,
|
151 |
LoggerInterface $logger
|
152 |
) {
|
@@ -154,7 +154,7 @@ class MasterFeedsTemplate implements TemplateInterface
|
|
154 |
$this->default = $default;
|
155 |
$this->templateCollection = $templateCollection;
|
156 |
$this->feedItemCollection = $feedItemCollection;
|
157 |
-
$this->
|
158 |
$this->legacyTemplate = $legacyTemplate;
|
159 |
$this->logger = $logger;
|
160 |
}
|
@@ -198,7 +198,7 @@ class MasterFeedsTemplate implements TemplateInterface
|
|
198 |
'items' => $itemsCollection,
|
199 |
]);
|
200 |
|
201 |
-
return $this->
|
202 |
'ctx' => base64_encode(json_encode($argCtx)),
|
203 |
'slug' => $model['slug'],
|
204 |
'template' => $rendered,
|
102 |
protected $feedItemCollection;
|
103 |
|
104 |
/**
|
105 |
+
* The template to use to render the container.
|
106 |
*
|
107 |
+
* @since 4.14
|
108 |
*
|
109 |
+
* @var TemplateInterface
|
110 |
*/
|
111 |
+
protected $containerTemplate;
|
112 |
|
113 |
/**
|
114 |
* The template to use for legacy-mode rendering.
|
137 |
* @param array $templateTypes The available template types.
|
138 |
* @param CollectionInterface $templateCollection The collection of templates.
|
139 |
* @param CollectionInterface $feedItemCollection The collection of feed items.
|
140 |
+
* @param TemplateInterface $containerTemplate The template to use for rendering the container.
|
141 |
* @param TemplateInterface $legacyTemplate The template to use for legacy-mode rendering.
|
142 |
* @param LoggerInterface $logger The logger instance to use for recording errors.
|
143 |
*/
|
146 |
$templateTypes,
|
147 |
CollectionInterface $templateCollection,
|
148 |
CollectionInterface $feedItemCollection,
|
149 |
+
TemplateInterface $containerTemplate,
|
150 |
TemplateInterface $legacyTemplate,
|
151 |
LoggerInterface $logger
|
152 |
) {
|
154 |
$this->default = $default;
|
155 |
$this->templateCollection = $templateCollection;
|
156 |
$this->feedItemCollection = $feedItemCollection;
|
157 |
+
$this->containerTemplate = $containerTemplate;
|
158 |
$this->legacyTemplate = $legacyTemplate;
|
159 |
$this->logger = $logger;
|
160 |
}
|
198 |
'items' => $itemsCollection,
|
199 |
]);
|
200 |
|
201 |
+
return $this->containerTemplate->render([
|
202 |
'ctx' => base64_encode(json_encode($argCtx)),
|
203 |
'slug' => $model['slug'],
|
204 |
'template' => $rendered,
|
@@ -1,190 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace RebelCode\Wpra\Core\Templates\Feeds\Models;
|
4 |
-
|
5 |
-
use Dhii\Exception\CreateInvalidArgumentExceptionCapableTrait;
|
6 |
-
use Dhii\I18n\StringTranslatingTrait;
|
7 |
-
use Dhii\Util\Normalization\NormalizeIterableCapableTrait;
|
8 |
-
use InvalidArgumentException;
|
9 |
-
use OutOfRangeException;
|
10 |
-
use RebelCode\Wpra\Core\Data\AliasingDataSet;
|
11 |
-
use RebelCode\Wpra\Core\Data\ArrayDataSet;
|
12 |
-
use RebelCode\Wpra\Core\Data\CompositeDataSet;
|
13 |
-
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
14 |
-
use RebelCode\Wpra\Core\Data\MaskingDataSet;
|
15 |
-
use RebelCode\Wpra\Core\Data\MergedDataSet;
|
16 |
-
use RebelCode\Wpra\Core\Data\Wp\WpArrayOptionDataSet;
|
17 |
-
use RebelCode\Wpra\Core\Data\Wp\WpPostArrayMetaDataSet;
|
18 |
-
use RebelCode\Wpra\Core\Templates\Feeds\Types\ListTemplateType;
|
19 |
-
use WP_Post;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* A specialized feed template model implementation that uses the old WP RSS Aggregator display settings as the
|
23 |
-
* template options.
|
24 |
-
*
|
25 |
-
* @since 4.13
|
26 |
-
*/
|
27 |
-
class BuiltInFeedTemplate extends WpPostFeedTemplate
|
28 |
-
{
|
29 |
-
/* @since 4.13 */
|
30 |
-
use NormalizeIterableCapableTrait;
|
31 |
-
|
32 |
-
/* @since 4.13 */
|
33 |
-
use CreateInvalidArgumentExceptionCapableTrait;
|
34 |
-
|
35 |
-
/* @since 4.13 */
|
36 |
-
use StringTranslatingTrait;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* The name of the option from which to retrieve the template settings.
|
40 |
-
*
|
41 |
-
* @since 4.13
|
42 |
-
*/
|
43 |
-
const WP_OPTION_NAME = 'wprss_settings_general';
|
44 |
-
|
45 |
-
/**
|
46 |
-
* The key to which to map the settings options.
|
47 |
-
*
|
48 |
-
* @since 4.13
|
49 |
-
*/
|
50 |
-
const OPTIONS_KEY = 'options';
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Constructor.
|
54 |
-
*
|
55 |
-
* @since 4.13
|
56 |
-
*
|
57 |
-
* @param int|string|WP_Post $postOrId The post instance or ID.
|
58 |
-
*/
|
59 |
-
public function __construct($postOrId)
|
60 |
-
{
|
61 |
-
parent::__construct($postOrId);
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* {@inheritdoc}
|
66 |
-
*
|
67 |
-
* @since 4.13
|
68 |
-
*/
|
69 |
-
protected function createMetaDataSet($postOrId)
|
70 |
-
{
|
71 |
-
// Create the settings options dataset
|
72 |
-
$settingsOpts = $this->createSettingsOptionsDataSet();
|
73 |
-
// Get the data set for the posts's template "options" meta key
|
74 |
-
$metaOpts = new WpPostArrayMetaDataSet($postOrId, static::META_PREFIX . static::OPTIONS_KEY);
|
75 |
-
// Merge the meta and settings options with a composite data set.
|
76 |
-
// Data reading prioritizes meta data. If not found, an option will be read from the settings.
|
77 |
-
// Writing is done on both data sets. Iteration is unique.
|
78 |
-
$fullOpts = new CompositeDataSet([$metaOpts, $settingsOpts]);
|
79 |
-
|
80 |
-
// Retrieve the full original template meta
|
81 |
-
$fullPostMeta = parent::createMetaDataSet($postOrId);
|
82 |
-
// Create a dataset specifically for the template options
|
83 |
-
$overrideOpts = new ArrayDataSet([
|
84 |
-
static::OPTIONS_KEY => $fullOpts,
|
85 |
-
]);
|
86 |
-
// Override the original meta's `options` with the combined Settings-Meta dataset
|
87 |
-
$final = new MergedDataSet($fullPostMeta, $overrideOpts, [static::OPTIONS_KEY => true]);
|
88 |
-
|
89 |
-
return $final;
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Creates the dataset for the template options that are saved in the WPRA general settings.
|
94 |
-
*
|
95 |
-
* @since 4.13
|
96 |
-
*
|
97 |
-
* @return DataSetInterface
|
98 |
-
*/
|
99 |
-
protected function createSettingsOptionsDataSet()
|
100 |
-
{
|
101 |
-
// Get the default options as a static array dataset
|
102 |
-
$defaultOpts = new ArrayDataSet(wprss_get_default_settings_general());
|
103 |
-
// Get the saved settings options
|
104 |
-
$savedOpts = new WpArrayOptionDataSet(static::WP_OPTION_NAME);
|
105 |
-
// Merge the defaults and the saved options
|
106 |
-
$allOpts = new MergedDataSet($savedOpts, $defaultOpts);
|
107 |
-
// Alias the old settings options to the new template option names
|
108 |
-
$aliasedOpts = new AliasingDataSet($allOpts, $this->getSettingsOptionsAliases());
|
109 |
-
// Mask the options to hide the other non-template general settings
|
110 |
-
$maskedOpts = new MaskingDataSet($aliasedOpts, $this->getSettingsOptionsMask(), false);
|
111 |
-
|
112 |
-
return $maskedOpts;
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* {@inheritdoc}
|
117 |
-
*
|
118 |
-
* @since 4.13
|
119 |
-
*/
|
120 |
-
protected function set($key, $value)
|
121 |
-
{
|
122 |
-
if ($key !== self::OPTIONS_KEY) {
|
123 |
-
parent::set($key, $value);
|
124 |
-
|
125 |
-
return;
|
126 |
-
}
|
127 |
-
|
128 |
-
try {
|
129 |
-
$iterable = $this->_normalizeIterable($value);
|
130 |
-
// If the key is the options key and the value is a collection, override the default behavior to set
|
131 |
-
// each collection entry individually to the template options dataset
|
132 |
-
$dataset = $this->get(self::OPTIONS_KEY);
|
133 |
-
foreach ($iterable as $subKey => $subVal) {
|
134 |
-
$dataset[$subKey] = $subVal;
|
135 |
-
}
|
136 |
-
} catch (InvalidArgumentException $exception) {
|
137 |
-
throw new OutOfRangeException('Cannot set non-collection values to "options"');
|
138 |
-
}
|
139 |
-
}
|
140 |
-
|
141 |
-
/**
|
142 |
-
* Retrieves the settings options aliases.
|
143 |
-
*
|
144 |
-
* @since 4.13
|
145 |
-
*
|
146 |
-
* @return string[]
|
147 |
-
*/
|
148 |
-
protected function getSettingsOptionsAliases()
|
149 |
-
{
|
150 |
-
return [
|
151 |
-
'limit' => 'feed_limit',
|
152 |
-
'title_max_length' => 'title_limit',
|
153 |
-
'title_is_link' => 'title_link',
|
154 |
-
'pagination_type' => 'pagination',
|
155 |
-
'source_enabled' => 'source_enable',
|
156 |
-
'source_prefix' => 'text_preceding_source',
|
157 |
-
'source_is_link' => 'source_link',
|
158 |
-
'author_enabled' => 'authors_enable',
|
159 |
-
'date_enabled' => 'date_enable',
|
160 |
-
'date_prefix' => 'text_preceding_date',
|
161 |
-
'date_format' => 'date_format',
|
162 |
-
'date_use_time_ago' => 'time_ago_format_enable',
|
163 |
-
'links_behavior' => 'open_dd',
|
164 |
-
'links_nofollow' => 'follow_dd',
|
165 |
-
'links_video_embed_page' => 'video_link',
|
166 |
-
];
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* Retrieves the mask for which settings option keys to retain in the dataset.
|
171 |
-
*
|
172 |
-
* @since 4.13
|
173 |
-
*
|
174 |
-
* @return bool[]
|
175 |
-
*/
|
176 |
-
protected function getSettingsOptionsMask()
|
177 |
-
{
|
178 |
-
// Dummy list template type, used to get the options
|
179 |
-
$listType = new ListTemplateType(new ArrayDataSet([]));
|
180 |
-
$listOptions = $listType->getOptions();
|
181 |
-
|
182 |
-
// Use a "true" mask for every list template type option available
|
183 |
-
$mask = [];
|
184 |
-
foreach ($listOptions as $key => $schema) {
|
185 |
-
$mask[$key] = true;
|
186 |
-
}
|
187 |
-
|
188 |
-
return $mask;
|
189 |
-
}
|
190 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace RebelCode\Wpra\Core\Templates\Feeds;
|
4 |
+
|
5 |
+
use Dhii\Exception\CreateInvalidArgumentExceptionCapableTrait;
|
6 |
+
use Dhii\I18n\StringTranslatingTrait;
|
7 |
+
use Dhii\Output\TemplateInterface;
|
8 |
+
use Dhii\Util\Normalization\NormalizeArrayCapableTrait;
|
9 |
+
use InvalidArgumentException;
|
10 |
+
use RebelCode\Wpra\Core\Data\Collections\CollectionInterface;
|
11 |
+
use RebelCode\Wpra\Core\Templates\Feeds\Types\FeedTemplateTypeInterface;
|
12 |
+
use RebelCode\Wpra\Core\Util\ParseArgsWithSchemaCapableTrait;
|
13 |
+
use stdClass;
|
14 |
+
use Traversable;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* A template that can render any template type with a list of options, unbound from any post.
|
18 |
+
*
|
19 |
+
* @since 4.14
|
20 |
+
*/
|
21 |
+
class TemplateTypeTemplate implements TemplateInterface
|
22 |
+
{
|
23 |
+
/* @since 4.14 */
|
24 |
+
use ParseArgsWithSchemaCapableTrait;
|
25 |
+
|
26 |
+
/* @since 4.14 */
|
27 |
+
use NormalizeArrayCapableTrait;
|
28 |
+
|
29 |
+
/* @since 4.14 */
|
30 |
+
use CreateInvalidArgumentExceptionCapableTrait;
|
31 |
+
|
32 |
+
/* @since 4.14 */
|
33 |
+
use StringTranslatingTrait;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* An associative array of template type instances.
|
37 |
+
*
|
38 |
+
* @since 4.14
|
39 |
+
*
|
40 |
+
* @var FeedTemplateTypeInterface[]
|
41 |
+
*/
|
42 |
+
protected $types;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* The key of the default template type to use.
|
46 |
+
*
|
47 |
+
* @since 4.14
|
48 |
+
*
|
49 |
+
* @var string
|
50 |
+
*/
|
51 |
+
protected $defType;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* The collection of feed items to render.
|
55 |
+
*
|
56 |
+
* @since 4.14
|
57 |
+
*
|
58 |
+
* @var CollectionInterface
|
59 |
+
*/
|
60 |
+
protected $itemsCollection;
|
61 |
+
|
62 |
+
/**
|
63 |
+
* The template to use to render the container.
|
64 |
+
*
|
65 |
+
* @since 4.14
|
66 |
+
*
|
67 |
+
* @var TemplateInterface
|
68 |
+
*/
|
69 |
+
protected $containerTemplate;
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Constructor.
|
73 |
+
*
|
74 |
+
* @since 4.14
|
75 |
+
*
|
76 |
+
* @param string $defType The name of the template to use by default.
|
77 |
+
* @param array $templateTypes The available template types.
|
78 |
+
* @param CollectionInterface $itemsCollection The collection of feed items.
|
79 |
+
* @param TemplateInterface $containerTemplate The template to use for rendering the container.
|
80 |
+
*/
|
81 |
+
public function __construct(
|
82 |
+
$defType,
|
83 |
+
$templateTypes,
|
84 |
+
CollectionInterface $itemsCollection,
|
85 |
+
TemplateInterface $containerTemplate
|
86 |
+
) {
|
87 |
+
$this->types = $templateTypes;
|
88 |
+
$this->defType = $defType;
|
89 |
+
$this->itemsCollection = $itemsCollection;
|
90 |
+
$this->containerTemplate = $containerTemplate;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* @inheritdoc
|
95 |
+
*
|
96 |
+
* @since 4.14
|
97 |
+
*/
|
98 |
+
public function render($argCtx = null)
|
99 |
+
{
|
100 |
+
// Parse the context
|
101 |
+
$ctx = $this->parseContext($argCtx);
|
102 |
+
// Get the template type
|
103 |
+
$typeKey = $ctx['type'];
|
104 |
+
$templateType = array_key_exists($typeKey, $this->types)
|
105 |
+
? $this->types[$typeKey]
|
106 |
+
: $this->types[$this->defType];
|
107 |
+
|
108 |
+
$options = $ctx['options'];
|
109 |
+
$options['page'] = $ctx['page'];
|
110 |
+
|
111 |
+
$rendered = $templateType->render([
|
112 |
+
'options' => $options,
|
113 |
+
'items' => $ctx['items'],
|
114 |
+
]);
|
115 |
+
|
116 |
+
return $this->containerTemplate->render([
|
117 |
+
'ctx' => base64_encode(json_encode($argCtx)),
|
118 |
+
'template' => $rendered,
|
119 |
+
]);
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Parses the render context, normalizing it to an array and filtering it against the schema.
|
124 |
+
*
|
125 |
+
* @since 4.14
|
126 |
+
*
|
127 |
+
* @param array|stdClass|Traversable $ctx The render context.
|
128 |
+
*
|
129 |
+
* @return array The parsed context.
|
130 |
+
*/
|
131 |
+
protected function parseContext($ctx)
|
132 |
+
{
|
133 |
+
try {
|
134 |
+
$normCtx = $this->_normalizeArray($ctx);
|
135 |
+
} catch (InvalidArgumentException $exception) {
|
136 |
+
$normCtx = [];
|
137 |
+
}
|
138 |
+
|
139 |
+
// Parse the context, putting all non-schema data in an "options" key
|
140 |
+
$schema = $this->getContextSchema();
|
141 |
+
$pCtx = $this->parseArgsWithSchema($normCtx, $schema, '/');
|
142 |
+
|
143 |
+
return $pCtx;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Retrieves the standard WP RSS Aggregator template context schema.
|
148 |
+
*
|
149 |
+
* @since 4.14
|
150 |
+
*
|
151 |
+
* @see ParseArgsWithSchemaCapableTrait::parseArgsWithSchema()
|
152 |
+
*
|
153 |
+
* @return array
|
154 |
+
*/
|
155 |
+
protected function getContextSchema()
|
156 |
+
{
|
157 |
+
return [
|
158 |
+
'type' => [
|
159 |
+
'default' => $this->defType,
|
160 |
+
'filter' => FILTER_SANITIZE_STRING,
|
161 |
+
],
|
162 |
+
'options' => [
|
163 |
+
'default' => [],
|
164 |
+
'filter' => function ($options) {
|
165 |
+
if (is_array($options)) {
|
166 |
+
return $options;
|
167 |
+
}
|
168 |
+
|
169 |
+
return [];
|
170 |
+
},
|
171 |
+
],
|
172 |
+
'items' => [
|
173 |
+
'default' => $this->itemsCollection,
|
174 |
+
'filter' => function ($items) {
|
175 |
+
if ($items instanceof CollectionInterface) {
|
176 |
+
return $items;
|
177 |
+
}
|
178 |
+
|
179 |
+
throw new InvalidArgumentException(__('The "items" must be a collection instance', 'wprss'));
|
180 |
+
},
|
181 |
+
],
|
182 |
+
'page' => [
|
183 |
+
'default' => 1,
|
184 |
+
'filter' => FILTER_VALIDATE_INT,
|
185 |
+
'options' => ['min_range' => 0],
|
186 |
+
],
|
187 |
+
];
|
188 |
+
}
|
189 |
+
}
|
@@ -131,15 +131,20 @@ abstract class AbstractWpraFeedTemplateType extends AbstractFeedTemplateType
|
|
131 |
$items = $items->filter($stdOpts['pagination']);
|
132 |
// Calculate the total number of pages and items per page
|
133 |
$perPage = empty($stdOpts['pagination']['num_items']) ? 0 : $stdOpts['pagination']['num_items'];
|
134 |
-
$numPages = $perPage ? ceil($count / $perPage) :
|
135 |
$page = empty($stdOpts['pagination']['page']) ? 1 : $stdOpts['pagination']['page'];
|
136 |
|
137 |
// Parse the template-type's own options
|
138 |
$ttOpts = $this->parseArgsWithSchema($pOpts, $this->getOptions());
|
139 |
|
|
|
|
|
|
|
|
|
|
|
140 |
return [
|
141 |
'items' => $items,
|
142 |
-
'options' => $
|
143 |
'pagination' => [
|
144 |
'page' => $page,
|
145 |
'total_num_items' => $count,
|
@@ -206,25 +211,30 @@ abstract class AbstractWpraFeedTemplateType extends AbstractFeedTemplateType
|
|
206 |
'filter' => FILTER_VALIDATE_BOOLEAN,
|
207 |
],
|
208 |
'links_behavior' => [
|
209 |
-
'key' => 'links_open_behavior',
|
210 |
'filter' => 'enum',
|
211 |
'options' => ['self', 'blank', 'lightbox'],
|
212 |
'default' => 'blank',
|
213 |
],
|
214 |
'links_nofollow' => [
|
215 |
-
'key' => 'links_rel_nofollow',
|
216 |
-
'filter' =>
|
217 |
-
|
|
|
|
|
218 |
],
|
219 |
-
'
|
|
|
220 |
'filter' => FILTER_VALIDATE_BOOLEAN,
|
221 |
'default' => false,
|
222 |
],
|
223 |
'custom_css_classname' => [
|
|
|
224 |
'filter' => FILTER_DEFAULT,
|
225 |
'default' => '',
|
226 |
],
|
227 |
'className' => [
|
|
|
228 |
'filter' => FILTER_DEFAULT,
|
229 |
'default' => '',
|
230 |
],
|
131 |
$items = $items->filter($stdOpts['pagination']);
|
132 |
// Calculate the total number of pages and items per page
|
133 |
$perPage = empty($stdOpts['pagination']['num_items']) ? 0 : $stdOpts['pagination']['num_items'];
|
134 |
+
$numPages = ($perPage > 0) ? ceil($count / $perPage) : 1;
|
135 |
$page = empty($stdOpts['pagination']['page']) ? 1 : $stdOpts['pagination']['page'];
|
136 |
|
137 |
// Parse the template-type's own options
|
138 |
$ttOpts = $this->parseArgsWithSchema($pOpts, $this->getOptions());
|
139 |
|
140 |
+
// Get all options by merging std options with template type options
|
141 |
+
$allOpts = ( isset($stdOpts['options']) && !empty($stdOpts['options']) )
|
142 |
+
? array_merge_recursive($stdOpts['options'], $ttOpts)
|
143 |
+
: $ttOpts;
|
144 |
+
|
145 |
return [
|
146 |
'items' => $items,
|
147 |
+
'options' => $allOpts,
|
148 |
'pagination' => [
|
149 |
'page' => $page,
|
150 |
'total_num_items' => $count,
|
211 |
'filter' => FILTER_VALIDATE_BOOLEAN,
|
212 |
],
|
213 |
'links_behavior' => [
|
214 |
+
'key' => 'options/links_open_behavior',
|
215 |
'filter' => 'enum',
|
216 |
'options' => ['self', 'blank', 'lightbox'],
|
217 |
'default' => 'blank',
|
218 |
],
|
219 |
'links_nofollow' => [
|
220 |
+
'key' => 'options/links_rel_nofollow',
|
221 |
+
'filter' => function ($val) {
|
222 |
+
return $val === 'no_follow' || filter_var($val, FILTER_VALIDATE_BOOLEAN);
|
223 |
+
},
|
224 |
+
'default' => true,
|
225 |
],
|
226 |
+
'link_to_embed' => [
|
227 |
+
'key' => 'options/link_to_embed',
|
228 |
'filter' => FILTER_VALIDATE_BOOLEAN,
|
229 |
'default' => false,
|
230 |
],
|
231 |
'custom_css_classname' => [
|
232 |
+
'key' => 'options/custom_css_classname',
|
233 |
'filter' => FILTER_DEFAULT,
|
234 |
'default' => '',
|
235 |
],
|
236 |
'className' => [
|
237 |
+
'key' => 'options/className',
|
238 |
'filter' => FILTER_DEFAULT,
|
239 |
'default' => '',
|
240 |
],
|
@@ -42,8 +42,8 @@ class ListTemplateType extends AbstractWpraFeedTemplateType
|
|
42 |
wp_enqueue_script('jquery.colorbox-min', WPRSS_JS . 'jquery.colorbox-min.js', ['jquery']);
|
43 |
wp_enqueue_script('wprss_custom', WPRSS_JS . 'custom.js', ['jquery', 'jquery.colorbox-min']);
|
44 |
|
45 |
-
wp_enqueue_script('wpra-manifest', WPRSS_APP_JS . 'wpra-manifest.min.js', ['jquery']);
|
46 |
-
wp_enqueue_script('wpra-pagination', WPRSS_APP_JS . 'pagination.min.js', ['wpra-manifest']);
|
47 |
|
48 |
wp_localize_script('wpra-pagination', 'WpraPagination', [
|
49 |
'baseUri' => rest_url('/wpra/v1/templates/%s/render/'),
|
@@ -52,7 +52,7 @@ class ListTemplateType extends AbstractWpraFeedTemplateType
|
|
52 |
if (empty($general_settings['styles_disable'])) {
|
53 |
wp_enqueue_style('colorbox', WPRSS_CSS . 'colorbox.css', [], '1.4.33');
|
54 |
wp_enqueue_style('wpra-list-template-styles', WPRSS_CSS . 'templates/list/styles.css', [], WPRSS_VERSION);
|
55 |
-
wp_enqueue_style('wpra-pagination', WPRSS_APP_CSS . 'pagination.min.css');
|
56 |
}
|
57 |
}
|
58 |
|
42 |
wp_enqueue_script('jquery.colorbox-min', WPRSS_JS . 'jquery.colorbox-min.js', ['jquery']);
|
43 |
wp_enqueue_script('wprss_custom', WPRSS_JS . 'custom.js', ['jquery', 'jquery.colorbox-min']);
|
44 |
|
45 |
+
wp_enqueue_script('wpra-manifest', WPRSS_APP_JS . 'wpra-manifest.min.js', ['jquery'], WPRSS_VERSION);
|
46 |
+
wp_enqueue_script('wpra-pagination', WPRSS_APP_JS . 'pagination.min.js', ['wpra-manifest'], WPRSS_VERSION);
|
47 |
|
48 |
wp_localize_script('wpra-pagination', 'WpraPagination', [
|
49 |
'baseUri' => rest_url('/wpra/v1/templates/%s/render/'),
|
52 |
if (empty($general_settings['styles_disable'])) {
|
53 |
wp_enqueue_style('colorbox', WPRSS_CSS . 'colorbox.css', [], '1.4.33');
|
54 |
wp_enqueue_style('wpra-list-template-styles', WPRSS_CSS . 'templates/list/styles.css', [], WPRSS_VERSION);
|
55 |
+
wp_enqueue_style('wpra-pagination', WPRSS_APP_CSS . 'pagination.min.css', [], WPRSS_VERSION);
|
56 |
}
|
57 |
}
|
58 |
|
@@ -2,8 +2,12 @@
|
|
2 |
|
3 |
namespace RebelCode\Wpra\Core\Twig\Extensions;
|
4 |
|
|
|
|
|
5 |
use Twig\Extension\AbstractExtension;
|
6 |
use Twig\TwigFilter;
|
|
|
|
|
7 |
|
8 |
/**
|
9 |
* Twig extension for custom WP RSS Aggregator filters.
|
@@ -20,11 +24,106 @@ class WpraExtension extends AbstractExtension
|
|
20 |
public function getFilters()
|
21 |
{
|
22 |
return [
|
|
|
23 |
$this->getWpraLinkFilter(),
|
24 |
-
$this->
|
|
|
25 |
];
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
/**
|
29 |
* Retrieves the "wpralink" filter.
|
30 |
*
|
@@ -40,27 +139,46 @@ class WpraExtension extends AbstractExtension
|
|
40 |
return $text;
|
41 |
}
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
61 |
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
};
|
|
|
64 |
$options = [
|
65 |
'is_safe' => ['html'],
|
66 |
];
|
@@ -68,10 +186,26 @@ class WpraExtension extends AbstractExtension
|
|
68 |
return new TwigFilter($name, $callback, $options);
|
69 |
}
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
/**
|
72 |
* Retrieves the "base64_encode" filter.
|
73 |
*
|
74 |
-
* @since 4.
|
75 |
*
|
76 |
* @return TwigFilter The filter instance.
|
77 |
*/
|
@@ -85,4 +219,62 @@ class WpraExtension extends AbstractExtension
|
|
85 |
|
86 |
return new TwigFilter($name, $callback);
|
87 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
namespace RebelCode\Wpra\Core\Twig\Extensions;
|
4 |
|
5 |
+
use ArrayAccess;
|
6 |
+
use RebelCode\Wpra\Core\Data\DataSetInterface;
|
7 |
use Twig\Extension\AbstractExtension;
|
8 |
use Twig\TwigFilter;
|
9 |
+
use Twig\TwigFunction;
|
10 |
+
use WPRSS_Help;
|
11 |
|
12 |
/**
|
13 |
* Twig extension for custom WP RSS Aggregator filters.
|
24 |
public function getFilters()
|
25 |
{
|
26 |
return [
|
27 |
+
$this->getBase64EncodeFilter(),
|
28 |
$this->getWpraLinkFilter(),
|
29 |
+
$this->getWordsLimitFilter(),
|
30 |
+
$this->getCloseTagsFilter(),
|
31 |
];
|
32 |
}
|
33 |
|
34 |
+
/**
|
35 |
+
* @inheritdoc
|
36 |
+
*
|
37 |
+
* @since 4.14
|
38 |
+
*/
|
39 |
+
public function getFunctions()
|
40 |
+
{
|
41 |
+
return [
|
42 |
+
$this->getWpraFunction(),
|
43 |
+
$this->getWpraLinkAttrsFunction(),
|
44 |
+
$this->getWpNonceFieldFunction(),
|
45 |
+
$this->getWpraTooltipFunction(),
|
46 |
+
$this->getHtmlEntitiesDecodeFunction(),
|
47 |
+
$this->getWpraItemUrlFunction(),
|
48 |
+
];
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Retrieves the wpra twig function.
|
53 |
+
*
|
54 |
+
* @since 4.14
|
55 |
+
*
|
56 |
+
* @return TwigFunction
|
57 |
+
*/
|
58 |
+
protected function getWpraFunction()
|
59 |
+
{
|
60 |
+
return new TwigFunction('wpra', 'wpra_container');
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Retrieves the wp_nonce_field twig function.
|
65 |
+
*
|
66 |
+
* @since 4.14
|
67 |
+
*
|
68 |
+
* @return TwigFunction
|
69 |
+
*/
|
70 |
+
protected function getWpNonceFieldFunction()
|
71 |
+
{
|
72 |
+
return new TwigFunction('wp_nonce_field', 'wp_nonce_field', [
|
73 |
+
'is_safe' => ['html'],
|
74 |
+
]);
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Retrieves the WPRA tooltip twig function.
|
79 |
+
*
|
80 |
+
* @since 4.14
|
81 |
+
*
|
82 |
+
* @return TwigFunction
|
83 |
+
*/
|
84 |
+
protected function getWpraTooltipFunction()
|
85 |
+
{
|
86 |
+
$options = [
|
87 |
+
'is_safe' => ['html'],
|
88 |
+
];
|
89 |
+
|
90 |
+
return new TwigFunction('wpra_tooltip', function ($id, $text = '') {
|
91 |
+
$help = WPRSS_Help::get_instance();
|
92 |
+
|
93 |
+
if ($help->has_tooltip($id)) {
|
94 |
+
return $help->do_tooltip($id);
|
95 |
+
}
|
96 |
+
|
97 |
+
return $help->tooltip($id, $text);
|
98 |
+
}, $options);
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Retrieves the "wpra_item_url" Twig function.
|
103 |
+
*
|
104 |
+
* @since 4.14
|
105 |
+
*
|
106 |
+
* @return TwigFunction
|
107 |
+
*/
|
108 |
+
protected function getWpraItemUrlFunction()
|
109 |
+
{
|
110 |
+
$name = 'wpra_item_url';
|
111 |
+
$callback = function ($item, $options) {
|
112 |
+
if (!is_array($item) && !$item instanceof DataSetInterface && !$item instanceof ArrayAccess) {
|
113 |
+
return '';
|
114 |
+
}
|
115 |
+
|
116 |
+
if ($options['link_to_embed'] && !empty($item['embed_url'])) {
|
117 |
+
return $item['embed_url'];
|
118 |
+
}
|
119 |
+
|
120 |
+
return $item['url'];
|
121 |
+
};
|
122 |
+
$options = [];
|
123 |
+
|
124 |
+
return new TwigFunction($name, $callback, $options);
|
125 |
+
}
|
126 |
+
|
127 |
/**
|
128 |
* Retrieves the "wpralink" filter.
|
129 |
*
|
139 |
return $text;
|
140 |
}
|
141 |
|
142 |
+
return sprintf('<a %s>%s</a>', $this->prepareLinkAttrs($url, $options), $text);
|
143 |
+
};
|
144 |
+
$options = [
|
145 |
+
'is_safe' => ['html'],
|
146 |
+
];
|
147 |
+
|
148 |
+
return new TwigFilter($name, $callback, $options);
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Retrieves the "wpra_link_attrs" Twig function.
|
153 |
+
*
|
154 |
+
* @since 4.14
|
155 |
+
*
|
156 |
+
* @return TwigFunction The filter instance.
|
157 |
+
*/
|
158 |
+
protected function getWpraLinkAttrsFunction()
|
159 |
+
{
|
160 |
+
$name = 'wpra_link_attrs';
|
161 |
|
162 |
+
return new TwigFunction($name, function ($url, $options, $className = '') {
|
163 |
+
return $this->prepareLinkAttrs($url, $options, $className);
|
164 |
+
});
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Retrieves the "wpra_word_limit" Twig filter.
|
169 |
+
*
|
170 |
+
* @since 4.14
|
171 |
+
*
|
172 |
+
* @return TwigFilter The filter instance.
|
173 |
+
*/
|
174 |
+
protected function getWordsLimitFilter()
|
175 |
+
{
|
176 |
+
$name = 'wpra_word_limit';
|
177 |
+
|
178 |
+
$callback = function ($text, $wordsCount) {
|
179 |
+
return wprss_trim_words($text, $wordsCount);
|
180 |
};
|
181 |
+
|
182 |
$options = [
|
183 |
'is_safe' => ['html'],
|
184 |
];
|
186 |
return new TwigFilter($name, $callback, $options);
|
187 |
}
|
188 |
|
189 |
+
/**
|
190 |
+
* Retrieves the "html_decode" Twig function.
|
191 |
+
*
|
192 |
+
* @since 4.14
|
193 |
+
*
|
194 |
+
* @return TwigFunction The filter instance.
|
195 |
+
*/
|
196 |
+
protected function getHtmlEntitiesDecodeFunction()
|
197 |
+
{
|
198 |
+
$name = 'html_decode';
|
199 |
+
|
200 |
+
return new TwigFunction($name, function ($text) {
|
201 |
+
return strip_tags(html_entity_decode($text));
|
202 |
+
});
|
203 |
+
}
|
204 |
+
|
205 |
/**
|
206 |
* Retrieves the "base64_encode" filter.
|
207 |
*
|
208 |
+
* @since 4.14
|
209 |
*
|
210 |
* @return TwigFilter The filter instance.
|
211 |
*/
|
219 |
|
220 |
return new TwigFilter($name, $callback);
|
221 |
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Prepares an HTML link element's attributes, based on the WPRA template options for links.
|
225 |
+
*
|
226 |
+
* @since 4.14
|
227 |
+
*
|
228 |
+
* @param string $url The link URL.
|
229 |
+
* @param array $options The template options.
|
230 |
+
* @param string $className The HTML class(es) to add.
|
231 |
+
*
|
232 |
+
* @return string The attributes as a string.
|
233 |
+
*/
|
234 |
+
public function prepareLinkAttrs($url, $options, $className = '')
|
235 |
+
{
|
236 |
+
$openBehavior = isset($options['links_open_behavior'])
|
237 |
+
? $options['links_open_behavior']
|
238 |
+
: '';
|
239 |
+
$relNoFollow = isset($options['links_rel_nofollow'])
|
240 |
+
? $options['links_rel_nofollow']
|
241 |
+
: '';
|
242 |
+
|
243 |
+
$hrefAttr = sprintf('href="%s"', esc_attr($url));
|
244 |
+
$relAttr = ($relNoFollow == 'no_follow')
|
245 |
+
? 'rel="nofollow"'
|
246 |
+
: '';
|
247 |
+
|
248 |
+
$targetAttr = ($openBehavior === 'blank')
|
249 |
+
? 'target="_blank"'
|
250 |
+
: '';
|
251 |
+
|
252 |
+
if ($openBehavior === 'lightbox') {
|
253 |
+
$className = trim($className . ' colorbox');
|
254 |
+
}
|
255 |
+
|
256 |
+
return sprintf('%s %s %s class="%s"', $hrefAttr, $targetAttr, $relAttr, $className);
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Retrieves the "close_tags
|