Version Description
Nov 17 2022 =
Cookies enhancements , StrongTestimonials plugin integration , let Woocommerce orders interface to report spam, checking existing users and comments improvements and some minor issues fixed
- New. Cookies. Do not run cookies setting process if no access key provided.
- New. Cookies. NoCookie mode now support SFW, Anti-Crawler and AntiFlood modes.
- New. Integrations. StrongTestimonials for POST and AJAX requests.
- New. Woocommerce. Orders interface now can manage spam.
- New. UserChecker. User can be approved and unapproved from spam list
- Mod. Checking comments. Lot of improvements.
- Mod. Synchronization process frontend improvements.
- Mod. httpPing. Ping now uses curl if fsockopen is disabled.
- Mod. Removed Google Fonts from die pages
- Mod. Public JS. Iframes check refactoring.
- Fix. Common. Rotating m-servers fixed.
- Fix. AltCookies enhancements. Now can place zero values correct.
- Fix. Registration check. Fix request type and submittime graylisting on Avada Fusion register forms.
- Fix. Public JS. Skip GiveWP iframe generated forms because of direct integration.
- Fix. Integration. GiveWP protection improved.
- Fix. Skip ninja form PRO service requests with nonce.
- Fix. Integration. Abandoned Cart Recovery for WooCommerce requests excluded.
- Fix. Code style enhancements.
Download this release
Release Info
Developer | alexandergull |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.189 |
Comparing to | |
See all releases |
Code changes from version 5.188 to 5.189
- cleantalk.php +12 -5
- css/cleantalk-admin-settings-page.min.css +1 -1
- inc/cleantalk-admin.php +8 -5
- inc/cleantalk-ajax.php +2 -1
- inc/cleantalk-pluggable.php +13 -0
- inc/cleantalk-public-integrations.php +181 -0
- inc/cleantalk-public.php +2 -1
- inc/cleantalk-settings.php +91 -67
- js/apbct-public-bundle.min.js +1 -1
- js/apbct-public-bundle.min.js.map +1 -1
- js/cleantalk-admin-settings-page.min.js +1 -1
- js/cleantalk-admin-settings-page.min.js.map +1 -1
- js/cleantalk-comments-checkspam.min.js +1 -1
- js/cleantalk-comments-checkspam.min.js.map +1 -1
- lib/Cleantalk/Antispam/Cleantalk.php +19 -4
- lib/Cleantalk/Antispam/Integrations.php +3 -1
- lib/Cleantalk/Antispam/Integrations/GiveWP.php +1 -1
- lib/Cleantalk/Antispam/Integrations/StrongTestimonials.php +44 -0
- lib/Cleantalk/ApbctWP/Escape.php +1 -1
- lib/Cleantalk/ApbctWP/FindSpam/CommentsChecker.php +319 -151
- lib/Cleantalk/ApbctWP/FindSpam/CommentsScanParameters.php +99 -0
- lib/Cleantalk/ApbctWP/FindSpam/CommentsScanResponse.php +179 -0
- lib/Cleantalk/ApbctWP/FindSpam/ListTable/BadUsers.php +12 -1
- lib/Cleantalk/ApbctWP/FindSpam/ListTable/Users.php +46 -1
- lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersLogs.php +1 -0
- lib/Cleantalk/ApbctWP/FindSpam/UsersChecker.php +6 -0
- lib/Cleantalk/ApbctWP/Firewall/die_page_anticrawler.html +2 -2
- lib/Cleantalk/ApbctWP/Firewall/die_page_antiflood.html +1 -1
- lib/Cleantalk/ApbctWP/Firewall/die_page_sfw.html +1 -1
- lib/Cleantalk/ApbctWP/Variables/AltSessions.php +5 -1
- lib/Cleantalk/ApbctWP/Variables/Cookie.php +31 -8
- lib/Cleantalk/Common/DNS.php +20 -4
- lib/Cleantalk/Variables/Request.php +0 -3
- readme.txt +22 -1
cleantalk.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Anti-Spam by CleanTalk
|
5 |
Plugin URI: https://cleantalk.org
|
6 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
7 |
-
Version: 5.
|
8 |
Author: СleanTalk <welcome@cleantalk.org>
|
9 |
Author URI: https://cleantalk.org
|
10 |
Text Domain: cleantalk-spam-protect
|
@@ -383,6 +383,12 @@ $apbct_active_integrations = array(
|
|
383 |
'setting' => 'data__protect_logged_in',
|
384 |
'ajax' => false
|
385 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
);
|
387 |
new \Cleantalk\Antispam\Integrations($apbct_active_integrations, (array)$apbct->settings);
|
388 |
|
@@ -771,7 +777,7 @@ function apbct_sfw__check()
|
|
771 |
)
|
772 |
);
|
773 |
|
774 |
-
if ( $apbct->settings['sfw__anti_crawler'] && $apbct->stats['sfw']['entries'] > 50
|
775 |
$firewall->loadFwModule(
|
776 |
new \Cleantalk\ApbctWP\Firewall\AntiCrawler(
|
777 |
APBCT_TBL_FIREWALL_LOG,
|
@@ -2275,7 +2281,8 @@ function apbct_cookie()
|
|
2275 |
|
2276 |
if (
|
2277 |
! empty($apbct->flags__cookies_setuped) || // Cookies already set
|
2278 |
-
! empty($apbct->headers_sent)
|
|
|
2279 |
) {
|
2280 |
return false;
|
2281 |
}
|
@@ -2496,7 +2503,7 @@ function ct_mail_send_connection_report()
|
|
2496 |
</tr>
|
2497 |
';
|
2498 |
$counter = 0;
|
2499 |
-
foreach ( $apbct->connection_reports['negative_report'] as $
|
2500 |
if ( !$report['is_sent'] ) {
|
2501 |
$message .= '<tr>'
|
2502 |
. '<td>' . ( ++$counter ) . '.</td>'
|
@@ -2528,7 +2535,7 @@ function ct_mail_send_connection_report()
|
|
2528 |
$headers .= 'From: ' . ct_get_admin_email();
|
2529 |
/** @psalm-suppress UnusedFunctionCall */
|
2530 |
if ( wp_mail($to, $subject, $message, $headers) ) {
|
2531 |
-
foreach ( $apbct->storage['connection_reports']['negative_report'] as $
|
2532 |
$report['is_sent'] = true;
|
2533 |
}
|
2534 |
unset($report);
|
4 |
Plugin Name: Anti-Spam by CleanTalk
|
5 |
Plugin URI: https://cleantalk.org
|
6 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
7 |
+
Version: 5.189
|
8 |
Author: СleanTalk <welcome@cleantalk.org>
|
9 |
Author URI: https://cleantalk.org
|
10 |
Text Domain: cleantalk-spam-protect
|
383 |
'setting' => 'data__protect_logged_in',
|
384 |
'ajax' => false
|
385 |
),
|
386 |
+
'StrongTestimonials' => array(
|
387 |
+
'hook' => array('wpmtst_form_submission','wpmtst_form2'),
|
388 |
+
'setting' => 'forms__contact_forms_test',
|
389 |
+
'ajax' => true,
|
390 |
+
'ajax_and_post' => true
|
391 |
+
),
|
392 |
);
|
393 |
new \Cleantalk\Antispam\Integrations($apbct_active_integrations, (array)$apbct->settings);
|
394 |
|
777 |
)
|
778 |
);
|
779 |
|
780 |
+
if ( $apbct->settings['sfw__anti_crawler'] && $apbct->stats['sfw']['entries'] > 50 ) {
|
781 |
$firewall->loadFwModule(
|
782 |
new \Cleantalk\ApbctWP\Firewall\AntiCrawler(
|
783 |
APBCT_TBL_FIREWALL_LOG,
|
2281 |
|
2282 |
if (
|
2283 |
! empty($apbct->flags__cookies_setuped) || // Cookies already set
|
2284 |
+
! empty($apbct->headers_sent) || // Headers sent
|
2285 |
+
Post::get('fusion_login_box') // Avada Fusion registration form exclusion
|
2286 |
) {
|
2287 |
return false;
|
2288 |
}
|
2503 |
</tr>
|
2504 |
';
|
2505 |
$counter = 0;
|
2506 |
+
foreach ( $apbct->connection_reports['negative_report'] as $_key => $report ) {
|
2507 |
if ( !$report['is_sent'] ) {
|
2508 |
$message .= '<tr>'
|
2509 |
. '<td>' . ( ++$counter ) . '.</td>'
|
2535 |
$headers .= 'From: ' . ct_get_admin_email();
|
2536 |
/** @psalm-suppress UnusedFunctionCall */
|
2537 |
if ( wp_mail($to, $subject, $message, $headers) ) {
|
2538 |
+
foreach ( $apbct->storage['connection_reports']['negative_report'] as $_key => &$report ) {
|
2539 |
$report['is_sent'] = true;
|
2540 |
}
|
2541 |
unset($report);
|
css/cleantalk-admin-settings-page.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.apbct_settings-field_content,.apbct_settings-field_title--radio,.cleantalk_link-auto,.cleantalk_link-manual,.ct-warning-test-failed,.ct_rate_block,.ct_settings_banner,i.animate-spin{display:inline-block}#apbctTopWarning{margin-bottom:5px}#apbctTopWarning h3{margin:10px 0 5px}#apbctTopWarning h4{margin:10px}#apbctTopWarning h4 span{margin-top:5px}.apbct_settings-subtitle{position:relative;top:-15px;margin:0}.apbct_settings-field_wrapper{margin:15px 0}.apbct_settings-field_wrapper--sub{margin-left:30px!important}.apbct_settings__label{margin-right:10px;font-size:17px;vertical-align:text-bottom}.apbct_settings-field_content--radio,.apbct_settings-field_wrapper>.apbct_settings-field_description{width:70%}.apbct_settings-field_title--radio{margin:0;width:210px;padding-right:10px;font-size:14px;vertical-align:top}.apbct_input_text{min-width:255px;width:400px}.apbct_settings-field--api_key{font-size:14pt}.apbct_settings-long_description---show:hover{color:#aaa;cursor:pointer}.apbct_setting_textarea{min-width:300px}.cleantalk_link{text-decoration:none;font-size:13px;line-height:26px;margin:10px 0 0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cleantalk_link-auto{background:#ccc;border-color:#999;-webkit-box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);color:#000;height:28px;-webkit-border-radius:2px;border-radius:2px}.cleantalk_link-auto:hover{color:#fff}.cleantalk_link-manual{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;-webkit-border-radius:3px;border-radius:3px;text-align:center}.cleantalk_link-manual:hover{color:#000}.cleantalk_link[disabled=disabled]{background:#5d9db5;color:#000}.apbct_status_icon{vertical-align:text-bottom;margin:0 5px 0 8px}a.ct_support_link{color:#666;margin-right:.5em;font-size:10pt;font-weight:400}.ct-warning-test-failed{position:relative;padding:5px;margin:4px;border:3px solid rgba(240,50,50,1);border-radius:5px;background-color:rgba(255,200,200,1)}.ct_settings_banner{text-align:right;width:100%;margin:1em 0;vertical-align:top}#cleantalk-modal-content,.ct_rate_block{text-align:center}#ct_translate_plugin{margin-left:0}.ct_rate_block{width:370px;margin-right:3em;padding:.8em .8em 15px;border:1px dashed #666}#ct_translate_plugin .apbct_button_rate{margin-bottom:10px}.apbct_long_desc{position:absolute;background:#5a5a5a;min-width:80px;min-height:80px;max-width:500px;padding:10px;color:#fff;z-index:10}.apbct_long_desc a,i.animate-spin{color:rgba(120,200,230,1)}i.animate-spin{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;font-size:25px;line-height:20px;margin:25px}@keyframes spin{to{transform:rotate(359deg)}}.apbct_long_desc__cancel{position:absolute;top:5px;right:5px;color:rgba(255,255,255,.5)}.apbct_long_desc__cancel:hover{color:#fff}.apbct_long_desc__angle{position:absolute;top:5px;left:-17px;width:10px;height:10px;background:#5a5a5a;-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.apbct_long_desc__title{color:rgba(120,200,230,1);margin:0}.--hide{display:none}.apbct_preloader_button{height:15px;margin-left:5px;vertical-align:text-top;display:none}#cleantalk-modal-content>*{display:block;width:100%}button.ct_support_link{border:none;background:0 0;color:#666;text-decoration:underline;cursor:pointer}.apbct-btn-as-link{padding:0;margin:0;vertical-align:baseline;color:gray;border:0;border-bottom:1px solid;cursor:pointer}#apbct-account-email[contenteditable=true]{padding:6px;background-color:#fff;border:1px solid #ccc}button[value=save_changes]:disabled{color:#2271b1;border-color:#2271b1;background:#f6f7f7}#apbct_settings__advanced_settings{position:relative}#apbct_settings__advanced_settings_inner{width:70%}#apbct_hidden_section_nav{position:absolute;top:0;right:20px}#apbct_settings__after_advanced_settings{margin-bottom:20px}#apbct_settings__button_section{position:fixed;z-index:9999;width:100%;padding-bottom:40px}#cleantalk_notice_review .caption{margin:0 0 15px;color:gray}#cleantalk_notice_review .button{margin-bottom:20px}.apbct_highlighted{outline-offset:5px;outline-color:red;outline-width:3px!important;outline-style:solid!important}.apbct_notice_inner{display:flex;margin-top:10px!important}
|
1 |
+
.apbct_settings-field_content,.apbct_settings-field_title--radio,.cleantalk_link-auto,.cleantalk_link-manual,.ct-warning-test-failed,.ct_rate_block,.ct_settings_banner,i.animate-spin{display:inline-block}#apbctTopWarning{margin-bottom:5px}#apbctTopWarning h3{margin:10px 0 5px}#apbctTopWarning h4{margin:10px}#apbctTopWarning h4 span{margin-top:5px}.apbct_settings-subtitle{position:relative;top:-15px;margin:0}.apbct_settings-field_wrapper{margin:15px 0}.apbct_settings-field_wrapper--sub{margin-left:30px!important}.apbct_settings__label{margin-right:10px;font-size:17px;vertical-align:text-bottom}.apbct_settings-field_content--radio,.apbct_settings-field_wrapper>.apbct_settings-field_description{width:70%}.apbct_settings-field_title--radio{margin:0;width:210px;padding-right:10px;font-size:14px;vertical-align:top}.apbct_input_text{min-width:255px;width:400px}.apbct_settings-field--api_key{font-size:14pt}.apbct_settings-long_description---show:hover{color:#aaa;cursor:pointer}.apbct_setting_textarea{min-width:300px}.cleantalk_link{text-decoration:none;font-size:13px;line-height:26px;margin:10px 0 0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cleantalk_link-auto{background:#ccc;border-color:#999;-webkit-box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);color:#000;height:28px;-webkit-border-radius:2px;border-radius:2px}.cleantalk_link-auto:hover{color:#fff}.cleantalk_link-manual{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;-webkit-border-radius:3px;border-radius:3px;text-align:center}.cleantalk_link-manual:hover{color:#000}.cleantalk_link[disabled=disabled]{background:#5d9db5;color:#000}.apbct_status_icon{vertical-align:text-bottom;margin:0 5px 0 8px}a.ct_support_link{color:#666;margin-right:.5em;font-size:10pt;font-weight:400}.ct-warning-test-failed{position:relative;padding:5px;margin:4px;border:3px solid rgba(240,50,50,1);border-radius:5px;background-color:rgba(255,200,200,1)}.ct_settings_banner{text-align:right;width:100%;margin:1em 0;vertical-align:top}#cleantalk-modal-content,.ct_rate_block{text-align:center}#ct_translate_plugin{margin-left:0}.ct_rate_block{width:370px;margin-right:3em;padding:.8em .8em 15px;border:1px dashed #666}#ct_translate_plugin .apbct_button_rate{margin-bottom:10px}.apbct_long_desc{position:absolute;background:#5a5a5a;min-width:80px;min-height:80px;max-width:500px;padding:10px;color:#fff;z-index:10}.apbct_long_desc a,i.animate-spin{color:rgba(120,200,230,1)}i.animate-spin{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;font-size:25px;line-height:20px;margin:25px}@keyframes spin{to{transform:rotate(359deg)}}.apbct_long_desc__cancel{position:absolute;top:5px;right:5px;color:rgba(255,255,255,.5)}.apbct_long_desc__cancel:hover{color:#fff}.apbct_long_desc__angle{position:absolute;top:5px;left:-17px;width:10px;height:10px;background:#5a5a5a;-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.apbct_long_desc__title{color:rgba(120,200,230,1);margin:0}.--hide{display:none}.--invisible{visibility:hidden}.apbct_preloader_button{height:15px;margin-left:5px;vertical-align:text-top;display:none}.apbct_preloader{height:1em;width:1em;margin-left:.5em;display:inline-block}.key_changed_success,.key_changed_sync{font-size:1.5em;line-height:2em;vertical-align:middle}.--upper-case{text-transform:uppercase}#cleantalk-modal-content>*{display:block;width:100%}button.ct_support_link{border:none;background:0 0;color:#666;text-decoration:underline;cursor:pointer}.apbct-btn-as-link{padding:0;margin:0;vertical-align:baseline;color:gray;border:0;border-bottom:1px solid;cursor:pointer}#apbct-account-email[contenteditable=true]{padding:6px;background-color:#fff;border:1px solid #ccc}button[value=save_changes]:disabled{color:#2271b1;border-color:#2271b1;background:#f6f7f7}#apbct_settings__advanced_settings{position:relative}#apbct_settings__advanced_settings_inner{width:70%}#apbct_hidden_section_nav{position:absolute;top:0;right:20px}#apbct_settings__after_advanced_settings{margin-bottom:20px}#apbct_settings__button_section{position:fixed;z-index:9999;width:100%;padding-bottom:40px}#cleantalk_notice_review .caption{margin:0 0 15px;color:gray}#cleantalk_notice_review .button{margin-bottom:20px}.apbct_highlighted{outline-offset:5px;outline-color:red;outline-width:3px!important;outline-style:solid!important}.apbct_notice_inner{display:flex;margin-top:10px!important}
|
inc/cleantalk-admin.php
CHANGED
@@ -25,11 +25,14 @@ add_action('admin_head', 'apbct_admin_set_cookie_for_anti_bot');
|
|
25 |
function apbct_admin_set_cookie_for_anti_bot()
|
26 |
{
|
27 |
global $apbct;
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
|
25 |
function apbct_admin_set_cookie_for_anti_bot()
|
26 |
{
|
27 |
global $apbct;
|
28 |
+
|
29 |
+
if ( $apbct->data['key_is_ok'] ) {
|
30 |
+
echo
|
31 |
+
'<script ' . (class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '') . '>
|
32 |
+
var ctSecure = location.protocol === "https:" ? "; secure" : "";
|
33 |
+
document.cookie = "wordpress_apbct_antibot=' . hash('sha256', $apbct->api_key . $apbct->data['salt']) . '; path=/; expires=0; samesite=lax" + ctSecure;
|
34 |
+
</script>';
|
35 |
+
}
|
36 |
}
|
37 |
|
38 |
|
inc/cleantalk-ajax.php
CHANGED
@@ -408,7 +408,8 @@ function ct_ajax_hook($message_obj = null)
|
|
408 |
//profilegrid addon
|
409 |
'pm_check_user_exist',
|
410 |
//Cartbounty plugin (saves every action on the page to keep abandoned carts)
|
411 |
-
'cartbounty_pro_save', 'cartbounty_save'
|
|
|
412 |
);
|
413 |
|
414 |
global $apbct;
|
408 |
//profilegrid addon
|
409 |
'pm_check_user_exist',
|
410 |
//Cartbounty plugin (saves every action on the page to keep abandoned carts)
|
411 |
+
'cartbounty_pro_save', 'cartbounty_save',
|
412 |
+
'wpmtst_form2' //has direct integration StrongTestimonials
|
413 |
);
|
414 |
|
415 |
global $apbct;
|
inc/cleantalk-pluggable.php
CHANGED
@@ -808,6 +808,19 @@ function apbct_is_skip_request($ajax = false)
|
|
808 |
) {
|
809 |
return 'Smart Quiz Builder - skip some requests';
|
810 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
811 |
} else {
|
812 |
/*****************************************/
|
813 |
/* Here is non-ajax requests skipping */
|
808 |
) {
|
809 |
return 'Smart Quiz Builder - skip some requests';
|
810 |
}
|
811 |
+
|
812 |
+
// Abandoned Cart Recovery for WooCommerce requests
|
813 |
+
if (
|
814 |
+
apbct_is_plugin_active('woo-abandoned-cart-recovery/woo-abandoned-cart-recovery.php') &&
|
815 |
+
Post::hasString('action', 'wacv_') &&
|
816 |
+
(
|
817 |
+
wp_verify_nonce(Post::get('nonce'), 'wacv_nonce') ||
|
818 |
+
wp_verify_nonce(Get::get('nonce'), 'wacv_nonce') ||
|
819 |
+
wp_verify_nonce(Post::get('security'), 'wacv_nonce')
|
820 |
+
)
|
821 |
+
) {
|
822 |
+
return 'Abandoned Cart Recovery for WooCommerce: skipped ' . Post::get('action');
|
823 |
+
}
|
824 |
} else {
|
825 |
/*****************************************/
|
826 |
/* Here is non-ajax requests skipping */
|
inc/cleantalk-public-integrations.php
CHANGED
@@ -1512,6 +1512,13 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
|
|
1512 |
$reg_flag = empty(Post::get('signup_profile_field_ids'));
|
1513 |
}
|
1514 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1515 |
$base_call_array = array(
|
1516 |
'sender_email' => $user_email,
|
1517 |
'sender_nickname' => $sanitized_user_login,
|
@@ -2072,6 +2079,13 @@ function apbct_form__ninjaForms__testSpam()
|
|
2072 |
return;
|
2073 |
}
|
2074 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2075 |
$checkjs = apbct_js_test(Cookie::get('ct_checkjs'), true);
|
2076 |
|
2077 |
/**
|
@@ -3485,3 +3499,170 @@ function apbct_advanced_classifieds_directory_pro__check_register($response, $_f
|
|
3485 |
|
3486 |
return $response;
|
3487 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1512 |
$reg_flag = empty(Post::get('signup_profile_field_ids'));
|
1513 |
}
|
1514 |
|
1515 |
+
/**
|
1516 |
+
* Changing the type of check for Avada Fusion
|
1517 |
+
*/
|
1518 |
+
if ( Post::get('fusion_login_box') ) {
|
1519 |
+
$reg_flag = true;
|
1520 |
+
}
|
1521 |
+
|
1522 |
$base_call_array = array(
|
1523 |
'sender_email' => $user_email,
|
1524 |
'sender_nickname' => $sanitized_user_login,
|
2079 |
return;
|
2080 |
}
|
2081 |
|
2082 |
+
//skip ninja PRO service requests
|
2083 |
+
if ( Post::get('nonce_ts') ) {
|
2084 |
+
do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
|
2085 |
+
|
2086 |
+
return;
|
2087 |
+
}
|
2088 |
+
|
2089 |
$checkjs = apbct_js_test(Cookie::get('ct_checkjs'), true);
|
2090 |
|
2091 |
/**
|
3499 |
|
3500 |
return $response;
|
3501 |
}
|
3502 |
+
|
3503 |
+
/**
|
3504 |
+
* Woocommerce able add orders to spam
|
3505 |
+
*/
|
3506 |
+
add_filter('manage_edit-shop_order_columns', 'apbct__wc_add_orders_to_spam'); // add column
|
3507 |
+
function apbct__wc_add_orders_to_spam_get_column()
|
3508 |
+
{
|
3509 |
+
if (get_post_status() === 'wc-spamorder') {
|
3510 |
+
return [
|
3511 |
+
'k' => 'not_spam_order',
|
3512 |
+
'v' => __('Mark as not spam', 'cleantalk-spam-protect')
|
3513 |
+
];
|
3514 |
+
}
|
3515 |
+
|
3516 |
+
return [
|
3517 |
+
'k' => 'spam_order',
|
3518 |
+
'v' => __('Mark as spam', 'cleantalk-spam-protect')
|
3519 |
+
];
|
3520 |
+
}
|
3521 |
+
|
3522 |
+
function apbct__wc_add_orders_to_spam($columns)
|
3523 |
+
{
|
3524 |
+
$reordered_columns = array();
|
3525 |
+
|
3526 |
+
foreach ($columns as $key => $column) {
|
3527 |
+
$reordered_columns[$key] = $column;
|
3528 |
+
|
3529 |
+
if ($key === 'order_status') {
|
3530 |
+
$column_key_value = apbct__wc_add_orders_to_spam_get_column();
|
3531 |
+
$reordered_columns[$column_key_value['k']] = $column_key_value['v'];
|
3532 |
+
}
|
3533 |
+
}
|
3534 |
+
|
3535 |
+
return $reordered_columns;
|
3536 |
+
}
|
3537 |
+
|
3538 |
+
add_filter('woocommerce_register_shop_order_post_statuses', 'apbct__wc_add_orders_spam_status'); // add order spam status
|
3539 |
+
|
3540 |
+
function apbct__wc_add_orders_spam_status($order_statuses)
|
3541 |
+
{
|
3542 |
+
$order_statuses['wc-spamorder'] = array(
|
3543 |
+
'label' => 'Spam',
|
3544 |
+
'public' => false,
|
3545 |
+
'exclude_from_search' => false,
|
3546 |
+
'show_in_admin_all_list' => true,
|
3547 |
+
'show_in_admin_status_list' => true,
|
3548 |
+
'label_count' => _n_noop(
|
3549 |
+
'Spam <span class="count">(%s)</span>',
|
3550 |
+
'Spam <span class="count">(%s)</span>',
|
3551 |
+
'cleantalk-spam-protect'
|
3552 |
+
),
|
3553 |
+
);
|
3554 |
+
return $order_statuses;
|
3555 |
+
}
|
3556 |
+
|
3557 |
+
add_filter('wc_order_statuses', 'apbct__wc_add_orders_spam_status_select'); // make spam selectable
|
3558 |
+
function apbct__wc_add_orders_spam_status_select($order_statuses)
|
3559 |
+
{
|
3560 |
+
$order_statuses['wc-spamorder'] = 'Spam';
|
3561 |
+
return $order_statuses;
|
3562 |
+
}
|
3563 |
+
|
3564 |
+
add_action('parse_query', 'apbct__wc_add_orders_spam_status_hide_from_list'); // hide spam orders from total list
|
3565 |
+
function apbct__wc_add_orders_spam_status_hide_from_list($query)
|
3566 |
+
{
|
3567 |
+
global $pagenow;
|
3568 |
+
|
3569 |
+
$query_vars = &$query->query_vars;
|
3570 |
+
|
3571 |
+
if ( $pagenow == 'edit.php' && $query_vars['post_type'] == 'shop_order' &&
|
3572 |
+
is_array($query_vars['post_status']) &&
|
3573 |
+
( $key = array_search('wc-spamorder', $query_vars['post_status']) ) !== false
|
3574 |
+
) {
|
3575 |
+
unset($query_vars['post_status'][$key]);
|
3576 |
+
}
|
3577 |
+
}
|
3578 |
+
|
3579 |
+
add_filter('bulk_actions-edit-shop_order', 'apbct__wc_add_spam_action_to_bulk'); // add spam action to bulk
|
3580 |
+
function apbct__wc_add_spam_action_to_bulk($actions)
|
3581 |
+
{
|
3582 |
+
$actions['spamorder'] = __('Mark as spam', 'cleantalk-spam-protect');
|
3583 |
+
return $actions;
|
3584 |
+
}
|
3585 |
+
|
3586 |
+
add_filter('handle_bulk_actions-edit-shop_order', 'apbct__wc_add_spam_action_to_bulk_handle', 10, 3); // handle bulk action
|
3587 |
+
/**
|
3588 |
+
* @param $redirect
|
3589 |
+
* @param $action
|
3590 |
+
* @param $ids
|
3591 |
+
*
|
3592 |
+
* @return mixed|string
|
3593 |
+
* @psalm-suppress UndefinedClass
|
3594 |
+
*/
|
3595 |
+
function apbct__wc_add_spam_action_to_bulk_handle($redirect, $action, $ids)
|
3596 |
+
{
|
3597 |
+
if ($action !== 'spamorder') {
|
3598 |
+
return $redirect;
|
3599 |
+
}
|
3600 |
+
|
3601 |
+
foreach ($ids as $order_id) {
|
3602 |
+
$order = new WC_Order((int)$order_id);
|
3603 |
+
$order->update_status('wc-spamorder');
|
3604 |
+
}
|
3605 |
+
|
3606 |
+
return add_query_arg(
|
3607 |
+
array(
|
3608 |
+
'bulk_action' => 'marked_spamorder',
|
3609 |
+
'changed' => count($ids),
|
3610 |
+
),
|
3611 |
+
$redirect
|
3612 |
+
);
|
3613 |
+
}
|
3614 |
+
|
3615 |
+
add_action('manage_shop_order_posts_custom_column', 'apbct__wc_add_orders_to_spam_button'); // add button
|
3616 |
+
|
3617 |
+
function apbct__wc_add_orders_to_spam_button_render($id, $action, $name)
|
3618 |
+
{
|
3619 |
+
$uurl = [
|
3620 |
+
'url' => wp_nonce_url(add_query_arg(['post' => $id, 'action' => $action]), $action),
|
3621 |
+
'name' => __($name, 'cleantalk-spam-protect')
|
3622 |
+
];
|
3623 |
+
|
3624 |
+
echo "<a href=" . $uurl['url'] . ">" . $uurl['name'] . "</a>";
|
3625 |
+
}
|
3626 |
+
|
3627 |
+
function apbct__wc_add_orders_to_spam_button($column)
|
3628 |
+
{
|
3629 |
+
global $the_order;
|
3630 |
+
|
3631 |
+
if (isset($the_order) && $column === 'spam_order') {
|
3632 |
+
apbct__wc_add_orders_to_spam_button_render($the_order->id, 'spamorder', 'spam');
|
3633 |
+
}
|
3634 |
+
|
3635 |
+
if (isset($the_order) && $column === 'not_spam_order') {
|
3636 |
+
apbct__wc_add_orders_to_spam_button_render($the_order->id, 'unspamorder', 'not spam');
|
3637 |
+
}
|
3638 |
+
}
|
3639 |
+
|
3640 |
+
add_action('wp_loaded', 'apbct__wc_add_orders_to_spam_button_handle'); // handle spam button
|
3641 |
+
/**
|
3642 |
+
* @param $action
|
3643 |
+
* @param $status
|
3644 |
+
*
|
3645 |
+
* @return void
|
3646 |
+
* @psalm-suppress UndefinedClass
|
3647 |
+
*/
|
3648 |
+
function apbct__wc_add_orders_to_spam_button_handle_check($action, $status)
|
3649 |
+
{
|
3650 |
+
if (isset($_GET['action'])
|
3651 |
+
&& $_GET['action'] === $action
|
3652 |
+
&& isset($_GET['_wpnonce'])
|
3653 |
+
&& wp_verify_nonce($_GET['_wpnonce'], $action)
|
3654 |
+
&& isset($_GET['post'])
|
3655 |
+
) {
|
3656 |
+
$order = new WC_Order((int)$_GET['post']);
|
3657 |
+
$order->update_status($status);
|
3658 |
+
|
3659 |
+
wp_redirect(esc_url_raw(remove_query_arg(array('post', 'action', '_wpnonce'))));
|
3660 |
+
exit();
|
3661 |
+
}
|
3662 |
+
}
|
3663 |
+
|
3664 |
+
function apbct__wc_add_orders_to_spam_button_handle()
|
3665 |
+
{
|
3666 |
+
apbct__wc_add_orders_to_spam_button_handle_check('spamorder', "wc-spamorder");
|
3667 |
+
apbct__wc_add_orders_to_spam_button_handle_check('unspamorder', "wc-processing");
|
3668 |
+
}
|
inc/cleantalk-public.php
CHANGED
@@ -604,7 +604,7 @@ function ct_add_hidden_fields(
|
|
604 |
else elem.attachEvent(event, callback);
|
605 |
}
|
606 |
apbct_attach_event_handler__backend(document, 'DOMContentLoaded', function(){
|
607 |
-
if (typeof apbctLocalStorage === \"object\") {
|
608 |
apbctLocalStorage.set('{$field_name}', '{$ct_checkjs_key}', true );
|
609 |
} else {
|
610 |
console.log('APBCT ERROR: apbctLocalStorage object is not loaded.');
|
@@ -1369,6 +1369,7 @@ function apbct_enqueue_and_localize_public_scripts()
|
|
1369 |
'pixel__url' => $apbct->pixel_url,
|
1370 |
'data__email_check_before_post' => $apbct->settings['data__email_check_before_post'],
|
1371 |
'data__cookies_type' => $apbct->data['cookies_type'],
|
|
|
1372 |
'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1,
|
1373 |
'data__to_local_storage' => \Cleantalk\ApbctWP\Variables\NoCookie::preloadForScripts()
|
1374 |
));
|
604 |
else elem.attachEvent(event, callback);
|
605 |
}
|
606 |
apbct_attach_event_handler__backend(document, 'DOMContentLoaded', function(){
|
607 |
+
if (typeof apbctLocalStorage === \"object\" && ctPublic.data__key_is_ok) {
|
608 |
apbctLocalStorage.set('{$field_name}', '{$ct_checkjs_key}', true );
|
609 |
} else {
|
610 |
console.log('APBCT ERROR: apbctLocalStorage object is not loaded.');
|
1369 |
'pixel__url' => $apbct->pixel_url,
|
1370 |
'data__email_check_before_post' => $apbct->settings['data__email_check_before_post'],
|
1371 |
'data__cookies_type' => $apbct->data['cookies_type'],
|
1372 |
+
'data__key_is_ok' => $apbct->data['key_is_ok'],
|
1373 |
'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1,
|
1374 |
'data__to_local_storage' => \Cleantalk\ApbctWP\Variables\NoCookie::preloadForScripts()
|
1375 |
));
|
inc/cleantalk-settings.php
CHANGED
@@ -1130,13 +1130,29 @@ function apbct_settings__display()
|
|
1130 |
($apbct->network_settings['multisite__work_mode'] != 2 || is_main_site())
|
1131 |
) {
|
1132 |
// Sync button
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1140 |
}
|
1141 |
|
1142 |
// Output spam count
|
@@ -1575,25 +1591,30 @@ function apbct_settings__field__apikey()
|
|
1575 |
return;
|
1576 |
}
|
1577 |
|
1578 |
-
|
1579 |
-
'
|
1580 |
-
|
1581 |
-
|
|
|
|
|
|
|
1582 |
echo '<input
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
|
|
|
|
1589 |
? str_repeat('*', strlen($apbct->api_key))
|
1590 |
: Escape::escHtml($apbct->api_key)
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
|
1598 |
// Show account name associated with the Access key
|
1599 |
if ( ! empty($apbct->data['account_name_ob']) ) {
|
@@ -1606,65 +1627,68 @@ function apbct_settings__field__apikey()
|
|
1606 |
};
|
1607 |
|
1608 |
// Show Access key button
|
1609 |
-
if (
|
1610 |
echo '<a id="apbct_showApiKey" class="ct_support_link" style="display: block" href="#">'
|
1611 |
. __('Show the Access key', 'cleantalk-spam-protect')
|
1612 |
. '</a>';
|
1613 |
}
|
1614 |
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
echo '<br /><br />';
|
1619 |
|
1620 |
-
|
1621 |
-
if ( ! $apbct->ip_license ) {
|
1622 |
-
echo '<button class="cleantalk_link cleantalk_link-manual apbct_setting---get_key_auto" id="apbct_button__get_key_auto" name="submit" type="button" value="get_key_auto">'
|
1623 |
-
. __('Get Access Key Automatically', 'cleantalk-spam-protect')
|
1624 |
-
. '<img style="margin-left: 10px;" class="apbct_preloader_button" src="' . Escape::escUrl(APBCT_URL_PATH . '/inc/images/preloader2.gif') . '" />'
|
1625 |
-
. '<img style="margin-left: 10px;" class="apbct_success --hide" src="' . Escape::escUrl(APBCT_URL_PATH . '/inc/images/yes.png') . '" />'
|
1626 |
-
. '</button>';
|
1627 |
-
echo '<input type="hidden" id="ct_admin_timezone" name="ct_admin_timezone" value="null" />';
|
1628 |
-
echo '<br />';
|
1629 |
-
echo '<br />';
|
1630 |
-
}
|
1631 |
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
. sprintf(
|
1644 |
-
'https://cleantalk.org/register?platform=wordpress&email=%s&website=%s',
|
1645 |
-
urlencode(ct_get_admin_email()),
|
1646 |
-
urlencode(get_bloginfo('url'))
|
1647 |
-
)
|
1648 |
-
. '">',
|
1649 |
-
'</a>'
|
1650 |
-
);
|
1651 |
|
1652 |
-
|
1653 |
-
if ( ! $apbct->ip_license ) {
|
1654 |
-
echo '<div>';
|
1655 |
-
echo '<input checked type="checkbox" id="license_agreed" onclick="apbctSettingsDependencies(\'apbct_setting---get_key_auto\');"/>';
|
1656 |
-
echo '<label for="spbc_license_agreed">';
|
1657 |
printf(
|
1658 |
-
__(
|
1659 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1660 |
'</a>'
|
1661 |
);
|
1662 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1663 |
echo '</div>';
|
1664 |
}
|
1665 |
|
1666 |
echo '</div>';
|
1667 |
-
echo '</div>';
|
1668 |
}
|
1669 |
|
1670 |
function apbct_field_service_utilization()
|
1130 |
($apbct->network_settings['multisite__work_mode'] != 2 || is_main_site())
|
1131 |
) {
|
1132 |
// Sync button
|
1133 |
+
if ( apbct_api_key__is_correct($apbct->api_key) && $apbct->key_is_ok ) {
|
1134 |
+
echo '<button type="button" class="cleantalk_link cleantalk_link-auto" id="apbct_button__sync" title="Synchronizing account status, SpamFireWall database, all kind of journals.">'
|
1135 |
+
. '<i class="apbct-icon-upload-cloud"></i> '
|
1136 |
+
. __('Synchronize with Cloud', 'cleantalk-spam-protect')
|
1137 |
+
. '<img style="margin-left: 10px;" class="apbct_preloader_button" src="' . Escape::escUrl(APBCT_URL_PATH . '/inc/images/preloader2.gif') . '" />'
|
1138 |
+
. '<img style="margin-left: 10px;" class="apbct_success --hide" src="' . Escape::escUrl(APBCT_URL_PATH . '/inc/images/yes.png') . '" />'
|
1139 |
+
. '</button>';
|
1140 |
+
echo ' ';
|
1141 |
+
} else {
|
1142 |
+
echo '<button type="button" class="--invisible" id="apbct_button__sync"></button><br>';
|
1143 |
+
echo '<div class="key_changed_wrapper">'
|
1144 |
+
. '<p class="key_changed_sync">'
|
1145 |
+
. __('Syncing data with the cloud. Usually, it takes a few seconds.', 'cleantalk-spam-protect')
|
1146 |
+
. '<img class="apbct_preloader" src="' . Escape::escUrl(APBCT_URL_PATH . '/inc/images/preloader2.gif') . '" />'
|
1147 |
+
. '</p>'
|
1148 |
+
. '<p class="key_changed_success --hide">'
|
1149 |
+
. sprintf(
|
1150 |
+
__('Done! Ready to protect %s.', 'cleantalk-spam-protect'),
|
1151 |
+
'<span class="--upper-case">' . Server::get('HTTP_HOST') . '</span>'
|
1152 |
+
)
|
1153 |
+
. '</p>'
|
1154 |
+
. '</div>';
|
1155 |
+
}
|
1156 |
}
|
1157 |
|
1158 |
// Output spam count
|
1591 |
return;
|
1592 |
}
|
1593 |
|
1594 |
+
if ( ! (apbct_api_key__is_correct($apbct->api_key) && $apbct->data["key_changed"]) ) {
|
1595 |
+
echo '<label class="apbct_settings__label" for="cleantalk_apkey">' . __(
|
1596 |
+
'Access key',
|
1597 |
+
'cleantalk-spam-protect'
|
1598 |
+
) . '</label>';
|
1599 |
+
}
|
1600 |
+
|
1601 |
echo '<input
|
1602 |
+
id="apbct_setting_apikey"
|
1603 |
+
class="apbct_setting_text apbct_setting---apikey"
|
1604 |
+
type="'
|
1605 |
+
. ( ! (apbct_api_key__is_correct($apbct->api_key) && $apbct->data["key_changed"]) ? 'text' : 'hidden')
|
1606 |
+
. '"
|
1607 |
+
name="cleantalk_settings[apikey]"
|
1608 |
+
value="'
|
1609 |
+
. ($apbct->key_is_ok
|
1610 |
? str_repeat('*', strlen($apbct->api_key))
|
1611 |
: Escape::escHtml($apbct->api_key)
|
1612 |
+
)
|
1613 |
+
. '"
|
1614 |
+
key="' . $apbct->api_key . '"
|
1615 |
+
size="20"
|
1616 |
+
placeholder="' . __('Enter the Access key', 'cleantalk-spam-protect') . '"'
|
1617 |
+
. ' />';
|
1618 |
|
1619 |
// Show account name associated with the Access key
|
1620 |
if ( ! empty($apbct->data['account_name_ob']) ) {
|
1627 |
};
|
1628 |
|
1629 |
// Show Access key button
|
1630 |
+
if ( apbct_api_key__is_correct($apbct->api_key) && $apbct->key_is_ok && ! $apbct->data["key_changed"] ) {
|
1631 |
echo '<a id="apbct_showApiKey" class="ct_support_link" style="display: block" href="#">'
|
1632 |
. __('Show the Access key', 'cleantalk-spam-protect')
|
1633 |
. '</a>';
|
1634 |
}
|
1635 |
|
1636 |
+
if ( ! (apbct_api_key__is_correct($apbct->api_key) && $apbct->data["key_changed"]) ) {
|
1637 |
+
// "Auto Get Key" buttons. License agreement
|
1638 |
+
echo '<div id="apbct_button__get_key_auto__wrapper">';
|
|
|
1639 |
|
1640 |
+
echo '<br /><br />';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1641 |
|
1642 |
+
// Auto get key
|
1643 |
+
if ( ! $apbct->ip_license ) {
|
1644 |
+
echo '<button class="cleantalk_link cleantalk_link-manual apbct_setting---get_key_auto" id="apbct_button__get_key_auto" name="submit" type="button" value="get_key_auto">'
|
1645 |
+
. __('Get Access Key Automatically', 'cleantalk-spam-protect')
|
1646 |
+
. '<img style="margin-left: 10px;" class="apbct_preloader_button" src="' . Escape::escUrl(APBCT_URL_PATH . '/inc/images/preloader2.gif') . '" />'
|
1647 |
+
. '<img style="margin-left: 10px;" class="apbct_success --hide" src="' . Escape::escUrl(APBCT_URL_PATH . '/inc/images/yes.png') . '" />'
|
1648 |
+
. '</button>';
|
1649 |
+
echo '<input type="hidden" id="ct_admin_timezone" name="ct_admin_timezone" value="null" />';
|
1650 |
+
echo '<br />';
|
1651 |
+
echo '<br />';
|
1652 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1653 |
|
1654 |
+
// Warnings and GDPR
|
|
|
|
|
|
|
|
|
1655 |
printf(
|
1656 |
+
__(
|
1657 |
+
'Admin e-mail %s %s will be used for registration оr click here to %sGet Access Key Manually%s.',
|
1658 |
+
'cleantalk-spam-protect'
|
1659 |
+
),
|
1660 |
+
'<span id="apbct-account-email">'
|
1661 |
+
. ct_get_admin_email() .
|
1662 |
+
'</span>',
|
1663 |
+
apbct_settings__btn_change_account_email_html(),
|
1664 |
+
'<a class="apbct_color--gray" target="__blank" id="apbct-key-manually-link" href="'
|
1665 |
+
. sprintf(
|
1666 |
+
'https://cleantalk.org/register?platform=wordpress&email=%s&website=%s',
|
1667 |
+
urlencode(ct_get_admin_email()),
|
1668 |
+
urlencode(get_bloginfo('url'))
|
1669 |
+
)
|
1670 |
+
. '">',
|
1671 |
'</a>'
|
1672 |
);
|
1673 |
+
|
1674 |
+
// License agreement
|
1675 |
+
if ( ! $apbct->ip_license ) {
|
1676 |
+
echo '<div>';
|
1677 |
+
echo '<input checked type="checkbox" id="license_agreed" onclick="apbctSettingsDependencies(\'apbct_setting---get_key_auto\');"/>';
|
1678 |
+
echo '<label for="spbc_license_agreed">';
|
1679 |
+
printf(
|
1680 |
+
__('I accept %sLicense Agreement%s.', 'cleantalk-spam-protect'),
|
1681 |
+
'<a class = "apbct_color--gray" href="https://cleantalk.org/publicoffer" target="_blank">',
|
1682 |
+
'</a>'
|
1683 |
+
);
|
1684 |
+
echo "</label>";
|
1685 |
+
echo '</div>';
|
1686 |
+
}
|
1687 |
+
|
1688 |
echo '</div>';
|
1689 |
}
|
1690 |
|
1691 |
echo '</div>';
|
|
|
1692 |
}
|
1693 |
|
1694 |
function apbct_field_service_utilization()
|
js/apbct-public-bundle.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,i,r=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(r.push(n.value),!t||r.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(c)throw i}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(o){var n=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(o);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var o,n,i,r,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return n=!(o=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return o=e.done,e},e:function(e){n=!0,i=e},f:function(){try{o||null==a.return||a.return()}finally{if(n)throw i}}};if(Array.isArray(e)||(a=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var ApbctCore=function(){function t(e){_classCallCheck(this,t),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"rest_parameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(e)}return _createClass(t,[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t|=!1,"object"===_typeof(e)){for(var o in e)for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),i=0;i<this.elements.length;i++)this.elements[i].style[n]=e[o];return this}var r;if("string"==typeof e)return void 0!==(r=getComputedStyle(this.elements[0])[e])&&!t&&(r=r.replace(/(\d)(em|pt|%|px){1,2}$/,"$1"),Number(r)==r)?Number(r):r}},{key:"hide",value:function(){this.prop("prev-display",this.css("display")),this.css({display:"none"})}},{key:"show",value:function(){this.css({display:this.prop("prev-display")})}},{key:"addClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.add(className)}},{key:"removeClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.remove(className)}},{key:"toggleClass",value:function(e){for(var t=0;t<this.elements.length;t++)this.elements[t].classList.toggle(e)}},{key:"ajax",value:function(e){return this.ajax_parameters=e,new ApbctAjax(e)}},{key:"rest",value:function(e){return this.rest_parameters=e,new ApbctRest(e)}},{key:"on",value:function(){this.event=arguments.length<=0?void 0:arguments[0],this.eventCallback=(arguments.length<=2?void 0:arguments[2])||(arguments.length<=1?void 0:arguments[1]),this.eventSelector="string"==typeof(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:null;for(var e=0;e<this.elements.length;e++)this.elements[e].addEventListener(this.event,null!==this.eventSelector?this.onChecker.bind(this):this.eventCallback)}},{key:"onChecker",value:function(e){if(e.target===document.querySelector(this.eventSelector))return e.stopPropagation(),this.eventCallback(e)}},{key:"ready",value:function(e){document.addEventListener("DOMContentLoaded",e)}},{key:"change",value:function(e){this.on("change",e)}},{key:"attr",value:function(e){for(var t=[],o=0;o<this.elements.length;o++)void 0!==_typeof(this.elements[o][e])?t.push(this.elements[o][e]):t.push(this.elements[o].getAttribute(e));return 1===t.length?t[0]:t}},{key:"prop",value:function(e,t){if(void 0!==t){for(var o=0;o<this.elements.length;o++)this.elements[o][e]=t;return this}for(var n=[],i=0;i<this.elements.length;i++)n.push(this.elements[i][e]);return 1===n.length?n[0]:n}},{key:"html",value:function(e){return void 0!==e?this.prop("innerHTML",e):this.prop("innerHTML")}},{key:"val",value:function(e){return void 0!==e?this.prop("value",e):this.prop("value")}},{key:"data",value:function(e,t){return void 0!==t?this.prop("apbct-data",e,t):this.prop("apbct-data")}},{key:"is",value:function(e){var t,o=!1,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)var i=t.value,o=o||this.isElem(i,e)}catch(e){n.e(e)}finally{n.f()}return o}},{key:"isElem",value:function(e,t){var o=!1;return"function"==typeof t&&(o=o||t.call(this,e)),o="string"==typeof t?t.match(/^[a-z]/)&&function(e){e=document.createElement(e).constructor;return!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))}(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,i=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(i.s();!(o=i.n()).done;)var r=o.value,n=n||e===r}catch(e){i.e(e)}finally{i.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(this.elements[t],e)||this.elements.splice(Number(t),1);return this}},{key:"parent",value:function(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}},{key:"children",value:function(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}},{key:"siblings",value:function(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}},{key:"remove",value:function(){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)e.value.remove()}catch(e){t.e(e)}finally{t.f()}}},{key:"after",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.after(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"append",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.append(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"fadeIn",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=0,t.style.display="block",+new Date);(function e(){t.style.opacity=+t.style.opacity+(new Date-o)/n,o=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))})()}()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=1,+new Date);(function e(){t.style.opacity=+t.style.opacity-(new Date-o)/n,o=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"})()}()}catch(e){t.e(e)}finally{t.f()}}}]),t}();function apbct(e){return(new ApbctCore).select(e)}var ApbctXhr=function(){function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",new XMLHttpRequest),_defineProperty(this,"method","POST"),_defineProperty(this,"url",""),_defineProperty(this,"async",!0),_defineProperty(this,"user",null),_defineProperty(this,"password",null),_defineProperty(this,"data",{}),_defineProperty(this,"button",null),_defineProperty(this,"spinner",null),_defineProperty(this,"progressbar",null),_defineProperty(this,"context",this),_defineProperty(this,"callback",null),_defineProperty(this,"onErrorCallback",null),_defineProperty(this,"responseType","json"),_defineProperty(this,"headers",{}),_defineProperty(this,"timeout",15e3),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),console.log("%cXHR%c started","color: red; font-weight: bold;","color: grey; font-weight: normal;"),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),Object.keys(this.data).length&&(this.deleteDoubleJSONEncoding(this.data),this.convertData()),!this.url)return console.log("%cXHR%c not URL provided","color: red; font-weight: bold;","color: grey; font-weight: normal;"),!1;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=this.xhr.statusText,this.button&&(this.button.removeAttribute("disabled"),this.button.style.cursor="auto"),this.spinner&&(this.spinner.style.display="none"),this.progressbar&&this.progressbar.fadeOut("slow")}},{key:"onReadyStateChange",value:function(){null!==this.on_ready_state_change&&"function"==typeof this.on_ready_state_change&&this.on_ready_state_change()}},{key:"onProgress",value:function(e){null!==this.on_progress&&"function"==typeof this.on_progress&&this.on_progress()}},{key:"onError",value:function(){console.log("error"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"error",value:function(e,t,o){var n="";"timeout"===t?n+="Server response timeout":200===e?"parsererror"===t?n+="Unexpected response from server. See console for details.":(n+="Unexpected error. Status: "+t+".",void 0!==o&&(n+=" Additional error info: "+o)):n+=500===e?"Internal server error.":"Unexpected response code:"+e,this.errorOutput(n)}},{key:"errorOutput",value:function(e){console.log("%c ctXHR error: %c"+e,"color: red;","color: grey;")}},{key:"setHeaders",value:function(){for(var e in this.headers)void 0!==this.headers[e]&&this.xhr.setRequestHeader(e,this.headers[e])}},{key:"convertData",value:function(){return~this.methods_to_convert_data_to_URL.indexOf(this.method)?this.convertDataToURL():this.convertDataToBody()}},{key:"convertDataToURL",value:function(){var e=new URLSearchParams(this.data).toString(),t=this.url.match(/^(https?:\/{2})?[a-z0-9.]+\?/)?"&":"?";return this.url+=t+e,this.url}},{key:"convertDataToBody",value:function(){for(var e in this.body=new FormData,this.data)this.body.append(e,"object"===_typeof(this.data[e])?JSON.stringify(this.data[e]):this.data[e]);return this.body}},{key:"deleteDoubleJSONEncoding",value:function(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=this.deleteDoubleJSONEncoding(e[t])),"string"==typeof e[t]&&null!==e[t].match(/^[\[{].*?[\]}]$/)&&"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}}]),o}(),ApbctAjax=function(){_inherits(t,ApbctXhr);var e=_createSuper(t);function t(){return _classCallCheck(this,t),e.call(this,arguments.length<=0?void 0:arguments[0])}return _createClass(t)}(),ApbctRest=function(){_inherits(r,ApbctXhr);var i=_createSuper(r);function r(){for(var e,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return _classCallCheck(this,r),(o=o[0]).url=r.default_route+o.route,o.headers={"X-WP-Nonce":ctPublicFunctions._rest_nonce},_defineProperty(_assertThisInitialized(e=i.call(this,o)),"route",""),e}return _createClass(r)}();function ctSetCookie(e,t,o){var n;if(("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(n="ct_pointer_data"===e,e=[[e,t,o]]),"none"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){apbctLocalStorage.set(e[0],encodeURIComponent(e[1]))}),ctNoCookieAttachHiddenFieldsToForms();else if("native"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){var n=void 0!==e[2]?"expires="+n+"; ":"",i="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+n+"path=/; samesite=lax"+i});else if("alternative"===ctPublicFunctions.data__cookies_type&&!n){"function"==typeof getJavascriptClientData?e=getJavascriptClientData(e):console.log("APBCT ERROR: getJavascriptClientData() is not loaded");try{JSON.parse(e)}catch(e){return void console.log("APBCT ERROR: JSON parse error:"+e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})}}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(e,t,o){var n=[];n.callback=t.callback||null,n.onErrorCallback=t.onErrorCallback||null,n.callback_context=t.callback_context||null,n.callback_params=t.callback_params||null,n.async=t.async||!0,n.notJson=t.notJson||null,n.timeout=t.timeout||15e3,n.obj=o||null,n.button=t.button||null,n.progressbar=t.progressbar||null,n.silent=t.silent||null,n.no_nonce=t.no_nonce||null,n.data=e,n.url=ctPublicFunctions._ajax_url,"string"==typeof e?(n.no_nonce||(n.data=n.data+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce),n.data=n.data+"&no_cache="+Math.random()):(n.no_nonce||(n.data._ajax_nonce=ctPublicFunctions._ajax_nonce),n.data.no_cache=Math.random()),(new ApbctCore).ajax(n)}function apbct_public_sendREST(e,t){var o=[];o.route=e,o.callback=t.callback||null,o.onErrorCallback=t.onErrorCallback||null,o.data=t.data||[],o.method=t.method||"POST",(new ApbctCore).rest(o)}_defineProperty(ApbctRest,"default_route",ctPublicFunctions._rest_url+"cleantalk-antispam/v1/");var apbctLocalStorage={get:function(t,e){void 0===e&&(e="value");t=localStorage.getItem(t);if(null!==t)try{var o=JSON.parse(t);return o.hasOwnProperty(e)?JSON.parse(o[e]):o}catch(e){return t}return!1},set:function(e,t){var o;!(2<arguments.length&&void 0!==arguments[2])||arguments[2]?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t<localStorage.length;t++){var o=localStorage.key(t);-1===o.indexOf("ct_")&&-1===o.indexOf("apbct_")||(e[o.toString()]=apbctLocalStorage.get(o))}return e}},ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter)&&ctMouseStopData()};function ctMouseStopData(){apbct_remove_event_handler(document,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(document,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(e){var t;ctSetCookie("apbct_pixel_url",e),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")&&((t=document.createElement("img")).setAttribute("alt","CleanTalk Pixel"),t.setAttribute("id","apbct_pixel"),t.setAttribute("style","display: none; left: 99999px;"),t.setAttribute("src",e),apbct("body").append(t))}function ctGetPixelUrl(){var e=apbctLocalStorage.get("apbct_pixel_url");if(!1!==e){if(!apbctLocalStorage.isAlive("apbct_pixel_url",10800))return void ctSetPixelImg(e);apbctLocalStorage.delete("apbct_pixel_url")}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function ctPreloadLocalStorage(){ctPublic.data__to_local_storage&&Object.entries(ctPublic.data__to_local_storage).forEach(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];apbctLocalStorage.set(t,e)})}function apbct_ready(){ctPreloadLocalStorage();var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if(apbctLocalStorage.set("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),apbctLocalStorage.set("ct_fkp_timestamp","0"),apbctLocalStorage.set("ct_pointer_data","0"),apbctLocalStorage.set("ct_timezone",ct_date.getTimezoneOffset()/60*-1),apbctLocalStorage.set("ct_screen_info",apbctGetScreenInfo()),apbctLocalStorage.set("apbct_headless",navigator.webdriver),"native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var n=t[o].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),apbct("input[type = 'email'], #email").on("blur",checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){ctNoCookieAttachHiddenFieldsToForms();for(var e=0;e<document.forms.length;e++){var t,o,n=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===n.method.toString().toLowerCase()||n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"===n.id||n.classList&&n.classList.contains("tinkoffPayRow")||n.classList&&n.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.toString().indexOf("calculatedfields")||n.id&&-1!==n.id.toString().indexOf("sac-form")||n.id&&-1!==n.id.toString().indexOf("cp_tslotsbooking_pform")||n.name&&-1!==n.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===n.action.toString()||n.name&&-1!==n.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(n),t.value=btoa(JSON.stringify(o)),n.append(t),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=e,n.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3);var i=document.querySelectorAll("[data-original-string]");if(i.length)for(var r=0;r<i.length;++r)i[r].parentElement.href||i[r].parentElement.parentElement.href||i[r].addEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler),apbctAjaxEmailDecode(e,this)}function apbctAjaxEmailDecode(e,t){var o=e.target,n={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer},i=(void 0!==t.href&&0===t.href.indexOf("mailto:")&&e.preventDefault(),o.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),o.style.cursor="progress",document.createElement("div")),r=(i.setAttribute("class","apbct-tooltip"),document.createElement("div")),a=(r.setAttribute("class","apbct-tooltip--text"),document.createElement("div")),r=(a.setAttribute("class","apbct-tooltip--arrow"),apbct(o).append(i),apbct(i).append(r),apbct(i).append(a),ctShowDecodeComment(o,ctPublicFunctions.text__wait_for_decoding),e.target.dataset.originalString);void 0!==t.href&&0===t.href.indexOf("mailto:")&&(r=t.dataset.originalString),n.encodedEmail=r,"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:n,method:"POST",callback:function(e){apbctEmailEncoderCallback(e,t,o)},onErrorCallback:function(e){o.addEventListener("click",ctFillDecodedEmailHandler),o.removeAttribute("style"),ctShowDecodeComment(o,"Error occurred: "+e)}}):(n.action="apbct_decode_email",apbct_public_sendAJAX(n,{notJson:!0,callback:function(e){apbctEmailEncoderCallback(e,t,o)},onErrorCallback:function(e){o.addEventListener("click",ctFillDecodedEmailHandler),o.removeAttribute("style"),ctShowDecodeComment(o,"Error occurred: "+e)}}))}function apbctEmailEncoderCallback(e,t,o){var n,i;e.success?void 0!==t.href&&0===t.href.indexOf("mailto:")?(n=t.href.replace("mailto:",""),i=t.innerHTML,t.innerHTML=i.replace(n,e.data.decoded_email),t.href="mailto:"+e.data.decoded_email,t.click()):setTimeout(function(){ctProcessDecodedDataResult(e.data,o)},3e3):(o.removeAttribute("style"),ctShowDecodeComment(o,e.data.comment))}function getJavascriptClientData(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t={},o=(t.apbct_headless=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless"),t.apbct_pixel_url=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),t.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),t.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),t.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),t.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),t.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),t.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),t.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone"),apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved")),n=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),i=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),r=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),a=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type");if(t.ct_mouse_moved=void 0!==o?o:r,t.ct_has_scrolled=void 0!==n?n:a,t.ct_cookies_type=void 0!==i?i:c,"object"===_typeof(e)&&e!==[])for(var l=0;l<e.length;++l)"object"===_typeof(e[l][1])?t[e[l][1][0]]=e[l][1][1]:t[e[l][0]]=e[l][1];else console.log("APBCT JS ERROR: Collecting data type mismatch");return t=removeDoubleJsonEncoding(t),JSON.stringify(t)}function removeDoubleJsonEncoding(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=removeDoubleJsonEncoding(e[t])),"string"==typeof e[t]&&null!==e[t].match(/^[\[{].*?[\]}]$/)&&"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),e.is_allowed&&ctFillDecodedEmail(t,e.decoded_email),e.show_comment&&ctShowDecodeComment(t,e.comment)}function ctFillDecodedEmail(e,t){apbct(e).html(apbct(e).html().replace(/.+?(<div class=["']apbct-tooltip["'].+?<\/div>)/,t+"$1"))}function ctShowDecodeComment(e,t){t&&(apbct(e.getElementsByClassName("apbct-tooltip")).fadeIn(300),apbct(e.getElementsByClassName("apbct-tooltip--text")).html(t),setTimeout(function(){apbct(e.getElementsByClassName("apbct-tooltip")).fadeOut(700)},5e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",i=0,r="",a=0,c=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===c.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(c.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),i++):(r+=" "+e.getAttribute("name"),a++))}),r=r.trim(),{visible_fields:n=n.trim(),visible_fields_count:i,invisible_fields:r,invisible_fields_count:a}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10<n)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(o[n]))}else"none"===ctPublic.data__cookies_type?ctSetCookie("apbct_visible_fields",JSON.stringify(o[0])):ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var i=document.querySelectorAll("[name^=ct_checkjs]"),r=0;r<i.length;r++)i[r].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}function ctParseBlockMessage(e){void 0!==e.apbct&&(e=e.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:e.comment}})),cleantalkModal.loaded=e.comment,cleantalkModal.open(),1==+e.stop_script)&&window.stop()}function ctSetPixelUrlLocalstorage(e){ctSetCookie("apbct_pixel_url",e)}function ctNoCookieConstructHiddenField(){var e="",t=apbctLocalStorage.getCleanTalkData(),t=JSON.stringify(t);return t=btoa(t),(e=document.createElement("input")).setAttribute("id","ct_no_cookie_hidden_field"),e.setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",t),e.setAttribute("type","hidden"),e}function ctNoCookieGetForms(){var e=document.forms;return e||!1}function ctNoCookieAttachHiddenFieldsToForms(){if("none"===ctPublic.data__cookies_type){var e=ctNoCookieGetForms();if(e){var t=document.getElementsByName("ct_no_cookie_hidden_field");if(t)for(var o=0;o<t.length;o++)t[o].parentNode.removeChild(t[o]);for(var n=0;n<e.length;n++)null!==document.forms[n].getAttribute("method")&&"post"!==document.forms[n].getAttribute("method").toLowerCase()||document.forms[n].append(ctNoCookieConstructHiddenField())}}}apbct_attach_event_handler(document,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(document,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(document,"scroll",ctSetHasScrolled),"loading"!==document.readyState?apbct_ready():apbct_attach_event_handler(document,"DOMContentLoaded",apbct_ready),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var n=JSON.parse(t.responseText)}catch(e){return void console.log(e.toString())}ctParseBlockMessage(n)}});var cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e,t="";for(e in this.styles)t+=e+":"+this.styles[e]+";";return t}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},i={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},r={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},a={styles:{overflow:"hidden"},toString:e},c=document.createElement("style"),a=(c.setAttribute("id","cleantalk-modal-styles"),c.innerHTML="body.cleantalk-modal-opened{"+a+"}",c.innerHTML+="#cleantalk-modal-overlay{"+t+"}",c.innerHTML+="#cleantalk-modal-close{"+n+"}",c.innerHTML+="#cleantalk-modal-close:before{"+i+"}",c.innerHTML+="#cleantalk-modal-close:after{"+r+"}",document.body.append(c),document.createElement("div")),t=(a.setAttribute("id","cleantalk-modal-overlay"),document.body.append(a),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),a.append(t),document.createElement("div")),i=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?i.innerHTML=this.loaded:(i.innerHTML="Loading...",this.load("get_options_template")),i.setAttribute("id","cleantalk-modal-content"),t.append(i),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},buttons_to_handle=(document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),[]);function apbct_gdpr_handle_buttons(){try{buttons_to_handle!==[]&&buttons_to_handle.forEach(function(e){var t='[id="apbct_gdpr_'+e.index+'"]',t=jQuery(t);jQuery(t).prop("checked")?(e.button.disabled=!1,jQuery(e.button).prop("title",e.old_notice)):(e.button.disabled=!0,jQuery(e.button).prop("title",gdpr_notice_for_button))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not handle form buttons "+e)}}function ct_protect_external(){for(var e=0;e<document.forms.length;e++)if(void 0===document.forms[e].cleantalk_hidden_action&&void 0===document.forms[e].cleantalk_hidden_method){var t,o=document.forms[e];if(o.parentElement&&0<o.parentElement.classList.length&&-1!==o.parentElement.classList[0].indexOf("mewtwo"))return;"string"==typeof o.action&&(isIntegratedForm(o)?apbctProcessExternalForm(o,e,document):-1===o.action.indexOf("http://")&&-1===o.action.indexOf("https://")||o.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((t=document.createElement("input")).name="cleantalk_hidden_action",t.value=o.action,t.type="hidden",o.appendChild(t),(t=document.createElement("input")).name="cleantalk_hidden_method",t.value=o.method,t.type="hidden",o.method="POST",o.appendChild(t),o.action=document.location))}var n=document.getElementsByTagName("iframe");if(0<n.length)for(var i=0;i<n.length;i++)if(null!=n[i].contentDocument){var r=n[i].contentDocument.forms;if(0===r.length)return;for(var a=0;a<r.length;a++)apbctProcessExternalForm(r[a],a,n[i].contentDocument)}}function apbctProcessExternalForm(e,n,i){var t=document.createElement("i"),t=(t.className="cleantalk_placeholder",t.style="display: none",e.parentElement.insertBefore(t,e),e.previousSibling),o=e.outerHTML,r=e,e=(e.parentElement.removeChild(e),document.createElement("div")),o=(e.innerHTML=o,t.after(e.firstElementChild),document.createElement("input")),a=(o.name="action",o.value="cleantalk_force_ajax_check",o.type="hidden",i.forms[n]),c=(a.appendChild(o),a.apbctPrev=t,a.apbctFormOriginal=r,!1);void 0!==a.classList&&["newsletterform","ml-block-form"].forEach(function(e){a.classList.contains(e)&&(c=e)}),c?void 0!==(e=jQuery("form."+c).find('button[type="submit"]'))&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(e.currentTarget)}):i.forms[n].onsubmit=function(e){var t,o;e.preventDefault(),-1!==i.forms[n].id.indexOf("mauticform")&&0<(t=jQuery(i.forms[n]).find('input[id*="checkbox_rgpd"]')).length&&!0===t.prop("checked")&&0<(o=jQuery(".cleantalk_placeholder")).length&&o[0].setAttribute("mautic_hidden_gdpr_id",t.prop("id")),jQuery(e.currentTarget).prev(),jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget)}}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,n){var i=jQuery(n);o.each(function(e,t){var o=jQuery(t);n.outerHTML===t.outerHTML&&o.val(i.val())})})}function isIntegratedForm(e){var t=e.action,o=e.id;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_"))}function sendAjaxCheckingFormData(d,e,t){var o={},n=(o[0]=apbct_collect_visible_fields(d),apbct_visible_fields_set_cookie(o),{}),o=d.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,o,n){if(void 0===e.apbct||!+e.apbct.blocked){var i=jQuery(d).detach(),r=d.apbctPrev,a=d.apbctFormOriginal,c=!1,l=(apbct_replace_inputs_values_from_other_form(i,a),-1!==a.id.indexOf("mautic")&&(c=!0),document.getElementsByClassName("cleantalk_placeholder"));if(l)for(var s=0;s<l.length;s++){var u=l[s].getAttribute("mautic_hidden_gdpr_id");void 0!==u&&void 0!==(u=jQuery(a).find("#"+u))&&u.prop("checked",!0)}r.after(a),jQuery(a).find('input[name="apbct_visible_fields"]').remove(),jQuery(a).find('input[value="cleantalk_force_ajax_check"]').remove();i=jQuery(a).find("button[type=submit]");if(0!==i.length)return i[0].click(),void(c&&setTimeout(function(){ct_protect_external()},1500));if(0!==(i=jQuery(a).find("input[type=submit]")).length)return void i[0].click();if(0!==(i=jQuery(a).find('button[data-element="submit"]')).length)return void i[0].click();0!==(i=jQuery(a).find('input[type="image"][name="submit"]')).length&&i[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function ct_check_internal(t){var e,o={},n=t.elements;for(e in n)"submit"!=n[e].type&&null!=n[e].value&&""!=n[e].value&&(o[n[e].name]=t.elements[e].value);o.action="ct_check_internal",apbct_public_sendAJAX(o,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.submit()}})}function ct_check_internal__is_exclude_form(t){return["wp-login.php","wp-comments-post.php"].some(function(e){return null!==t.match(new RegExp(ctPublic.blog_home+".*"+e))})}document.addEventListener("DOMContentLoaded",function(){if("undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms.length){var i=ctPublicGDPR.gdpr_title;if("undefined"!=typeof jQuery)try{ctPublicGDPR.gdpr_forms.forEach(function(e,t){var o=jQuery("#"+e+", ."+e),e=(o.is("form")||(o.find("form")[0]?o=o.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?o=jQuery(".wpcf7[role=form]").children("form"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?o=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(o=jQuery(".wpforms-form"))),!1),n=o.find('input[type|="submit"],button[type|="submit"]');n.length&&(!1!==(e=n[0])&&(e.disabled=!0,n=jQuery(e).prop("title")?jQuery(e).prop("title"):"",buttons_to_handle.push({index:t,button:e,old_notice:n}),jQuery(e).prop("title",i)),!o.is("form")&&"form"!==o.attr("role")||o.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required" style=" margin-right: 10px;" onchange="apbct_gdpr_handle_buttons()">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>"))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not add GDPR notice"+e)}}}),window.onload=function(){+ctPublic.settings__forms__check_external&&"undefined"!=typeof jQuery&&setTimeout(function(){ct_protect_external()},1500)},document.addEventListener("DOMContentLoaded",function(){var e,t="";if(+ctPublic.settings__forms__check_internal)for(var o=0;o<document.forms.length;o++)"string"!=typeof document.forms[o].action||null===(t=(e=document.forms[o]).action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(e.click,"undefined"!=typeof jQuery&&(jQuery(e).off("**"),jQuery(e).off(),jQuery(e).on("submit",function(e){return ct_check_internal(e.target),!1})))});
|
1 |
+
"use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,i,r=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(r.push(n.value),!t||r.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{a||null==o.return||o.return()}finally{if(c)throw i}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(o){var n=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(o);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var o,n,i,r,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return n=!(o=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return o=e.done,e},e:function(e){n=!0,i=e},f:function(){try{o||null==a.return||a.return()}finally{if(n)throw i}}};if(Array.isArray(e)||(a=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var ApbctCore=function(){function t(e){_classCallCheck(this,t),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"rest_parameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(e)}return _createClass(t,[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t|=!1,"object"===_typeof(e)){for(var o in e)for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),i=0;i<this.elements.length;i++)this.elements[i].style[n]=e[o];return this}var r;if("string"==typeof e)return void 0!==(r=getComputedStyle(this.elements[0])[e])&&!t&&(r=r.replace(/(\d)(em|pt|%|px){1,2}$/,"$1"),Number(r)==r)?Number(r):r}},{key:"hide",value:function(){this.prop("prev-display",this.css("display")),this.css({display:"none"})}},{key:"show",value:function(){this.css({display:this.prop("prev-display")})}},{key:"addClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.add(className)}},{key:"removeClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.remove(className)}},{key:"toggleClass",value:function(e){for(var t=0;t<this.elements.length;t++)this.elements[t].classList.toggle(e)}},{key:"ajax",value:function(e){return this.ajax_parameters=e,new ApbctAjax(e)}},{key:"rest",value:function(e){return this.rest_parameters=e,new ApbctRest(e)}},{key:"on",value:function(){this.event=arguments.length<=0?void 0:arguments[0],this.eventCallback=(arguments.length<=2?void 0:arguments[2])||(arguments.length<=1?void 0:arguments[1]),this.eventSelector="string"==typeof(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:null;for(var e=0;e<this.elements.length;e++)this.elements[e].addEventListener(this.event,null!==this.eventSelector?this.onChecker.bind(this):this.eventCallback)}},{key:"onChecker",value:function(e){if(e.target===document.querySelector(this.eventSelector))return e.stopPropagation(),this.eventCallback(e)}},{key:"ready",value:function(e){document.addEventListener("DOMContentLoaded",e)}},{key:"change",value:function(e){this.on("change",e)}},{key:"attr",value:function(e){for(var t=[],o=0;o<this.elements.length;o++)void 0!==_typeof(this.elements[o][e])?t.push(this.elements[o][e]):t.push(this.elements[o].getAttribute(e));return 1===t.length?t[0]:t}},{key:"prop",value:function(e,t){if(void 0!==t){for(var o=0;o<this.elements.length;o++)this.elements[o][e]=t;return this}for(var n=[],i=0;i<this.elements.length;i++)n.push(this.elements[i][e]);return 1===n.length?n[0]:n}},{key:"html",value:function(e){return void 0!==e?this.prop("innerHTML",e):this.prop("innerHTML")}},{key:"val",value:function(e){return void 0!==e?this.prop("value",e):this.prop("value")}},{key:"data",value:function(e,t){return void 0!==t?this.prop("apbct-data",e,t):this.prop("apbct-data")}},{key:"is",value:function(e){var t,o=!1,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)var i=t.value,o=o||this.isElem(i,e)}catch(e){n.e(e)}finally{n.f()}return o}},{key:"isElem",value:function(e,t){var o=!1;return"function"==typeof t&&(o=o||t.call(this,e)),o="string"==typeof t?t.match(/^[a-z]/)&&function(e){e=document.createElement(e).constructor;return!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))}(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,i=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(i.s();!(o=i.n()).done;)var r=o.value,n=n||e===r}catch(e){i.e(e)}finally{i.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(this.elements[t],e)||this.elements.splice(Number(t),1);return this}},{key:"parent",value:function(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}},{key:"children",value:function(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}},{key:"siblings",value:function(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}},{key:"remove",value:function(){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)e.value.remove()}catch(e){t.e(e)}finally{t.f()}}},{key:"after",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.after(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"append",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.append(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"fadeIn",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=0,t.style.display="block",+new Date);(function e(){t.style.opacity=+t.style.opacity+(new Date-o)/n,o=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))})()}()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=1,+new Date);(function e(){t.style.opacity=+t.style.opacity-(new Date-o)/n,o=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"})()}()}catch(e){t.e(e)}finally{t.f()}}}]),t}();function apbct(e){return(new ApbctCore).select(e)}var ApbctXhr=function(){function o(e){for(var t in _classCallCheck(this,o),_defineProperty(this,"xhr",new XMLHttpRequest),_defineProperty(this,"method","POST"),_defineProperty(this,"url",""),_defineProperty(this,"async",!0),_defineProperty(this,"user",null),_defineProperty(this,"password",null),_defineProperty(this,"data",{}),_defineProperty(this,"button",null),_defineProperty(this,"spinner",null),_defineProperty(this,"progressbar",null),_defineProperty(this,"context",this),_defineProperty(this,"callback",null),_defineProperty(this,"onErrorCallback",null),_defineProperty(this,"responseType","json"),_defineProperty(this,"headers",{}),_defineProperty(this,"timeout",15e3),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),console.log("%cXHR%c started","color: red; font-weight: bold;","color: grey; font-weight: normal;"),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),Object.keys(this.data).length&&(this.deleteDoubleJSONEncoding(this.data),this.convertData()),!this.url)return console.log("%cXHR%c not URL provided","color: red; font-weight: bold;","color: grey; font-weight: normal;"),!1;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(o,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=this.xhr.statusText,this.button&&(this.button.removeAttribute("disabled"),this.button.style.cursor="auto"),this.spinner&&(this.spinner.style.display="none"),this.progressbar&&this.progressbar.fadeOut("slow")}},{key:"onReadyStateChange",value:function(){null!==this.on_ready_state_change&&"function"==typeof this.on_ready_state_change&&this.on_ready_state_change()}},{key:"onProgress",value:function(e){null!==this.on_progress&&"function"==typeof this.on_progress&&this.on_progress()}},{key:"onError",value:function(){console.log("error"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"error",value:function(e,t,o){var n="";"timeout"===t?n+="Server response timeout":200===e?"parsererror"===t?n+="Unexpected response from server. See console for details.":(n+="Unexpected error. Status: "+t+".",void 0!==o&&(n+=" Additional error info: "+o)):n+=500===e?"Internal server error.":"Unexpected response code:"+e,this.errorOutput(n)}},{key:"errorOutput",value:function(e){console.log("%c ctXHR error: %c"+e,"color: red;","color: grey;")}},{key:"setHeaders",value:function(){for(var e in this.headers)void 0!==this.headers[e]&&this.xhr.setRequestHeader(e,this.headers[e])}},{key:"convertData",value:function(){return~this.methods_to_convert_data_to_URL.indexOf(this.method)?this.convertDataToURL():this.convertDataToBody()}},{key:"convertDataToURL",value:function(){var e=new URLSearchParams(this.data).toString(),t=this.url.match(/^(https?:\/{2})?[a-z0-9.]+\?/)?"&":"?";return this.url+=t+e,this.url}},{key:"convertDataToBody",value:function(){for(var e in this.body=new FormData,this.data)this.body.append(e,"object"===_typeof(this.data[e])?JSON.stringify(this.data[e]):this.data[e]);return this.body}},{key:"deleteDoubleJSONEncoding",value:function(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=this.deleteDoubleJSONEncoding(e[t])),"string"==typeof e[t]&&null!==e[t].match(/^[\[{].*?[\]}]$/)&&"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}}]),o}(),ApbctAjax=function(){_inherits(t,ApbctXhr);var e=_createSuper(t);function t(){return _classCallCheck(this,t),e.call(this,arguments.length<=0?void 0:arguments[0])}return _createClass(t)}(),ApbctRest=function(){_inherits(r,ApbctXhr);var i=_createSuper(r);function r(){for(var e,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return _classCallCheck(this,r),(o=o[0]).url=r.default_route+o.route,o.headers={"X-WP-Nonce":ctPublicFunctions._rest_nonce},_defineProperty(_assertThisInitialized(e=i.call(this,o)),"route",""),e}return _createClass(r)}();function ctSetCookie(e,t,o){var n,i,r=["ct_sfw_pass_key","ct_sfw_passed","wordpress_apbct_antibot","apbct_anticrawler_passed","apbct_antiflood_passed"];("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(n="ct_pointer_data"===e,e=[[e,t,o]]),"none"===ctPublicFunctions.data__cookies_type?(i=[],e.forEach(function(e,t,o){-1!==r.indexOf(e[0])?i.push(e):apbctLocalStorage.set(e[0],encodeURIComponent(e[1]))}),0<i.length&&ctSetAlternativeCookie(i),ctNoCookieAttachHiddenFieldsToForms()):"native"===ctPublicFunctions.data__cookies_type?e.forEach(function(e,t,o){var n=void 0!==e[2]?"expires="+n+"; ":"",i="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+n+"path=/; samesite=lax"+i}):"alternative"!==ctPublicFunctions.data__cookies_type||n||ctSetAlternativeCookie(e)}function ctSetAlternativeCookie(e){"function"==typeof getJavascriptClientData?e=getJavascriptClientData(e):console.log("APBCT ERROR: getJavascriptClientData() is not loaded");try{JSON.parse(e)}catch(e){return void console.log("APBCT ERROR: JSON parse error:"+e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(e,t,o){var n=[];n.callback=t.callback||null,n.onErrorCallback=t.onErrorCallback||null,n.callback_context=t.callback_context||null,n.callback_params=t.callback_params||null,n.async=t.async||!0,n.notJson=t.notJson||null,n.timeout=t.timeout||15e3,n.obj=o||null,n.button=t.button||null,n.progressbar=t.progressbar||null,n.silent=t.silent||null,n.no_nonce=t.no_nonce||null,n.data=e,n.url=ctPublicFunctions._ajax_url,"string"==typeof e?(n.no_nonce||(n.data=n.data+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce),n.data=n.data+"&no_cache="+Math.random()):(n.no_nonce||(n.data._ajax_nonce=ctPublicFunctions._ajax_nonce),n.data.no_cache=Math.random()),(new ApbctCore).ajax(n)}function apbct_public_sendREST(e,t){var o=[];o.route=e,o.callback=t.callback||null,o.onErrorCallback=t.onErrorCallback||null,o.data=t.data||[],o.method=t.method||"POST",(new ApbctCore).rest(o)}_defineProperty(ApbctRest,"default_route",ctPublicFunctions._rest_url+"cleantalk-antispam/v1/");var apbctLocalStorage={get:function(t,e){void 0===e&&(e="value");t=localStorage.getItem(t);if(null!==t)try{var o=JSON.parse(t);return o.hasOwnProperty(e)?JSON.parse(o[e]):o}catch(e){return t}return!1},set:function(e,t){var o;!(2<arguments.length&&void 0!==arguments[2])||arguments[2]?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t<localStorage.length;t++){var o=localStorage.key(t);-1===o.indexOf("ct_")&&-1===o.indexOf("apbct_")||(e[o.toString()]=apbctLocalStorage.get(o))}return e}},ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctMouseReadInterval,ctMouseWriteDataInterval,ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctFunctionMouseMove=(ctPublic.data__key_is_ok&&(ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200)),function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter)&&ctMouseStopData()});function ctMouseStopData(){apbct_remove_event_handler(document,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(document,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(e){var t;ctSetCookie("apbct_pixel_url",e),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")&&((t=document.createElement("img")).setAttribute("alt","CleanTalk Pixel"),t.setAttribute("id","apbct_pixel"),t.setAttribute("style","display: none; left: 99999px;"),t.setAttribute("src",e),apbct("body").append(t))}function ctGetPixelUrl(){var e=apbctLocalStorage.get("apbct_pixel_url");if(!1!==e){if(!apbctLocalStorage.isAlive("apbct_pixel_url",10800))return void ctSetPixelImg(e);apbctLocalStorage.delete("apbct_pixel_url")}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function ctPreloadLocalStorage(){ctPublic.data__to_local_storage&&Object.entries(ctPublic.data__to_local_storage).forEach(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];apbctLocalStorage.set(t,e)})}function apbct_ready(){ctPreloadLocalStorage();var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if(apbctLocalStorage.set("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),apbctLocalStorage.set("ct_fkp_timestamp","0"),apbctLocalStorage.set("ct_pointer_data","0"),apbctLocalStorage.set("ct_timezone",ct_date.getTimezoneOffset()/60*-1),apbctLocalStorage.set("ct_screen_info",apbctGetScreenInfo()),apbctLocalStorage.set("apbct_headless",navigator.webdriver),"native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var n=t[o].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),apbct("input[type = 'email'], #email").on("blur",checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){ctNoCookieAttachHiddenFieldsToForms();for(var e=0;e<document.forms.length;e++){var t,o,n=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===n.method.toString().toLowerCase()||n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"===n.id||n.classList&&n.classList.contains("tinkoffPayRow")||n.classList&&n.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.toString().indexOf("calculatedfields")||n.id&&-1!==n.id.toString().indexOf("sac-form")||n.id&&-1!==n.id.toString().indexOf("cp_tslotsbooking_pform")||n.name&&-1!==n.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===n.action.toString()||n.name&&-1!==n.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(n),t.value=btoa(JSON.stringify(o)),n.append(t),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=e,n.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3);var i=document.querySelectorAll("[data-original-string]");if(i.length)for(var r=0;r<i.length;++r)i[r].parentElement.href||i[r].parentElement.parentElement.href||i[r].addEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler),apbctAjaxEmailDecode(e,this)}function apbctAjaxEmailDecode(e,t){var o=e.target,n={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer},i=(void 0!==t.href&&0===t.href.indexOf("mailto:")&&e.preventDefault(),o.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),o.style.cursor="progress",document.createElement("div")),r=(i.setAttribute("class","apbct-tooltip"),document.createElement("div")),a=(r.setAttribute("class","apbct-tooltip--text"),document.createElement("div")),r=(a.setAttribute("class","apbct-tooltip--arrow"),apbct(o).append(i),apbct(i).append(r),apbct(i).append(a),ctShowDecodeComment(o,ctPublicFunctions.text__wait_for_decoding),e.target.dataset.originalString);void 0!==t.href&&0===t.href.indexOf("mailto:")&&(r=t.dataset.originalString),n.encodedEmail=r,"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:n,method:"POST",callback:function(e){apbctEmailEncoderCallback(e,t,o)},onErrorCallback:function(e){o.addEventListener("click",ctFillDecodedEmailHandler),o.removeAttribute("style"),ctShowDecodeComment(o,"Error occurred: "+e)}}):(n.action="apbct_decode_email",apbct_public_sendAJAX(n,{notJson:!0,callback:function(e){apbctEmailEncoderCallback(e,t,o)},onErrorCallback:function(e){o.addEventListener("click",ctFillDecodedEmailHandler),o.removeAttribute("style"),ctShowDecodeComment(o,"Error occurred: "+e)}}))}function apbctEmailEncoderCallback(e,t,o){var n,i;e.success?void 0!==t.href&&0===t.href.indexOf("mailto:")?(n=t.href.replace("mailto:",""),i=t.innerHTML,t.innerHTML=i.replace(n,e.data.decoded_email),t.href="mailto:"+e.data.decoded_email,t.click()):setTimeout(function(){ctProcessDecodedDataResult(e.data,o)},3e3):(o.removeAttribute("style"),ctShowDecodeComment(o,e.data.comment))}function getJavascriptClientData(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t={},o=(t.apbct_headless=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless"),t.apbct_pixel_url=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),t.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),t.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),t.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),t.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),t.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),t.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),t.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone"),apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved")),n=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),i=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),r=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),a=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type");if(t.ct_mouse_moved=void 0!==o?o:r,t.ct_has_scrolled=void 0!==n?n:a,t.ct_cookies_type=void 0!==i?i:c,"object"===_typeof(e)&&e!==[])for(var l=0;l<e.length;++l)"object"===_typeof(e[l][1])?t[e[l][1][0]]=e[l][1][1]:t[e[l][0]]=e[l][1];else console.log("APBCT JS ERROR: Collecting data type mismatch");return t=removeDoubleJsonEncoding(t),JSON.stringify(t)}function removeDoubleJsonEncoding(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=removeDoubleJsonEncoding(e[t])),"string"==typeof e[t]&&null!==e[t].match(/^[\[{].*?[\]}]$/)&&"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),e.is_allowed&&ctFillDecodedEmail(t,e.decoded_email),e.show_comment&&ctShowDecodeComment(t,e.comment)}function ctFillDecodedEmail(e,t){apbct(e).html(apbct(e).html().replace(/.+?(<div class=["']apbct-tooltip["'].+?<\/div>)/,t+"$1"))}function ctShowDecodeComment(e,t){t&&(apbct(e.getElementsByClassName("apbct-tooltip")).fadeIn(300),apbct(e.getElementsByClassName("apbct-tooltip--text")).html(t),setTimeout(function(){apbct(e.getElementsByClassName("apbct-tooltip")).fadeOut(700)},5e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",i=0,r="",a=0,c=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===c.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(c.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),i++):(r+=" "+e.getAttribute("name"),a++))}),r=r.trim(),{visible_fields:n=n.trim(),visible_fields_count:i,invisible_fields:r,invisible_fields_count:a}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10<n)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(o[n]))}else"none"===ctPublic.data__cookies_type?ctSetCookie("apbct_visible_fields",JSON.stringify(o[0])):ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var i=document.querySelectorAll("[name^=ct_checkjs]"),r=0;r<i.length;r++)i[r].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}function ctParseBlockMessage(e){void 0!==e.apbct&&(e=e.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:e.comment}})),cleantalkModal.loaded=e.comment,cleantalkModal.open(),1==+e.stop_script)&&window.stop()}function ctSetPixelUrlLocalstorage(e){ctSetCookie("apbct_pixel_url",e)}function ctNoCookieConstructHiddenField(){var e="",t=apbctLocalStorage.getCleanTalkData(),t=JSON.stringify(t);return t=btoa(t),(e=document.createElement("input")).setAttribute("id","ct_no_cookie_hidden_field"),e.setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",t),e.setAttribute("type","hidden"),e}function ctNoCookieGetForms(){var e=document.forms;return e||!1}function ctNoCookieAttachHiddenFieldsToForms(){if("none"===ctPublic.data__cookies_type){var e=ctNoCookieGetForms();if(e){var t=document.getElementsByName("ct_no_cookie_hidden_field");if(t)for(var o=0;o<t.length;o++)t[o].parentNode.removeChild(t[o]);for(var n=0;n<e.length;n++)null!==document.forms[n].getAttribute("method")&&"post"!==document.forms[n].getAttribute("method").toLowerCase()||document.forms[n].append(ctNoCookieConstructHiddenField())}}}ctPublic.data__key_is_ok&&(apbct_attach_event_handler(document,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(document,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(document,"scroll",ctSetHasScrolled)),ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbct_ready():apbct_attach_event_handler(document,"DOMContentLoaded",apbct_ready)),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var n=JSON.parse(t.responseText)}catch(e){return void console.log(e.toString())}ctParseBlockMessage(n)}});var cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e,t="";for(e in this.styles)t+=e+":"+this.styles[e]+";";return t}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},i={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},r={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},a={styles:{overflow:"hidden"},toString:e},c=document.createElement("style"),a=(c.setAttribute("id","cleantalk-modal-styles"),c.innerHTML="body.cleantalk-modal-opened{"+a+"}",c.innerHTML+="#cleantalk-modal-overlay{"+t+"}",c.innerHTML+="#cleantalk-modal-close{"+n+"}",c.innerHTML+="#cleantalk-modal-close:before{"+i+"}",c.innerHTML+="#cleantalk-modal-close:after{"+r+"}",document.body.append(c),document.createElement("div")),t=(a.setAttribute("id","cleantalk-modal-overlay"),document.body.append(a),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),a.append(t),document.createElement("div")),i=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?i.innerHTML=this.loaded:(i.innerHTML="Loading...",this.load("get_options_template")),i.setAttribute("id","cleantalk-modal-content"),t.append(i),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},buttons_to_handle=(document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),[]);function apbct_gdpr_handle_buttons(){try{buttons_to_handle!==[]&&buttons_to_handle.forEach(function(e){var t='[id="apbct_gdpr_'+e.index+'"]',t=jQuery(t);jQuery(t).prop("checked")?(e.button.disabled=!1,jQuery(e.button).prop("title",e.old_notice)):(e.button.disabled=!0,jQuery(e.button).prop("title",gdpr_notice_for_button))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not handle form buttons "+e)}}function ct_protect_external(){for(var e,t,o=0;o<document.forms.length;o++)void 0===document.forms[o].cleantalk_hidden_action&&void 0===document.forms[o].cleantalk_hidden_method&&"string"==typeof(e=document.forms[o]).action&&(isIntegratedForm(e)?apbctProcessExternalForm(e,o,document):-1===e.action.indexOf("http://")&&-1===e.action.indexOf("https://")||e.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((t=document.createElement("input")).name="cleantalk_hidden_action",t.value=e.action,t.type="hidden",e.appendChild(t),(t=document.createElement("input")).name="cleantalk_hidden_method",t.value=e.method,t.type="hidden",e.method="POST",e.appendChild(t),e.action=document.location));apbctProcessIframes()}function formIsExclusion(t){var o=!1;return t.parentElement&&0<t.parentElement.classList.length&&-1!==t.parentElement.classList[0].indexOf("mewtwo")&&(o=!0),["give-form"].forEach(function(e){void 0!==t.id&&-1!==t.id.indexOf(e)&&(o=!0)}),o}function apbctProcessIframes(){var e=document.getElementsByTagName("iframe");if(0<e.length)for(var t=0;t<e.length;t++)if(null!=e[t].contentDocument){var o=e[t].contentDocument.forms;if(0===o.length)return;for(var n=0;n<o.length;n++)apbctProcessExternalForm(o[n],n,e[t].contentDocument)}}function apbctProcessExternalForm(e,n,i){var t,o,r,a,c;formIsExclusion(e)||((t=document.createElement("i")).className="cleantalk_placeholder",t.style="display: none",e.parentElement.insertBefore(t,e),t=e.previousSibling,r=e.outerHTML,(o=e).parentElement.removeChild(e),(e=document.createElement("div")).innerHTML=r,t.after(e.firstElementChild),(r=document.createElement("input")).name="action",r.value="cleantalk_force_ajax_check",r.type="hidden",(a=i.forms[n]).appendChild(r),a.apbctPrev=t,a.apbctFormOriginal=o,c=!1,void 0!==a.classList&&["newsletterform","ml-block-form"].forEach(function(e){a.classList.contains(e)&&(c=e)}),c?void 0!==(e=jQuery("form."+c).find('button[type="submit"]'))&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(e.currentTarget)}):i.forms[n].onsubmit=function(e){var t,o;e.preventDefault(),-1!==i.forms[n].id.indexOf("mauticform")&&0<(t=jQuery(i.forms[n]).find('input[id*="checkbox_rgpd"]')).length&&!0===t.prop("checked")&&0<(o=jQuery(".cleantalk_placeholder")).length&&o[0].setAttribute("mautic_hidden_gdpr_id",t.prop("id")),jQuery(e.currentTarget).prev(),jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget)})}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,n){var i=jQuery(n);o.each(function(e,t){var o=jQuery(t);n.outerHTML===t.outerHTML&&o.val(i.val())})})}function isIntegratedForm(e){var t=e.action,o=e.id;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_"))}function sendAjaxCheckingFormData(d,e,t){var o={},n=(o[0]=apbct_collect_visible_fields(d),apbct_visible_fields_set_cookie(o),{}),o=d.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,o,n){if(void 0===e.apbct||!+e.apbct.blocked){var i=jQuery(d).detach(),r=d.apbctPrev,a=d.apbctFormOriginal,c=!1,l=(apbct_replace_inputs_values_from_other_form(i,a),-1!==a.id.indexOf("mautic")&&(c=!0),document.getElementsByClassName("cleantalk_placeholder"));if(l)for(var s=0;s<l.length;s++){var u=l[s].getAttribute("mautic_hidden_gdpr_id");void 0!==u&&void 0!==(u=jQuery(a).find("#"+u))&&u.prop("checked",!0)}r.after(a),jQuery(a).find('input[name="apbct_visible_fields"]').remove(),jQuery(a).find('input[value="cleantalk_force_ajax_check"]').remove();i=jQuery(a).find("button[type=submit]");if(0!==i.length)return i[0].click(),void(c&&setTimeout(function(){ct_protect_external()},1500));if(0!==(i=jQuery(a).find("input[type=submit]")).length)return void i[0].click();if(0!==(i=jQuery(a).find('button[data-element="submit"]')).length)return void i[0].click();0!==(i=jQuery(a).find('input[type="image"][name="submit"]')).length&&i[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function ct_check_internal(t){var e,o={},n=t.elements;for(e in n)"submit"!=n[e].type&&null!=n[e].value&&""!=n[e].value&&(o[n[e].name]=t.elements[e].value);o.action="ct_check_internal",apbct_public_sendAJAX(o,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.submit()}})}function ct_check_internal__is_exclude_form(t){return["wp-login.php","wp-comments-post.php"].some(function(e){return null!==t.match(new RegExp(ctPublic.blog_home+".*"+e))})}document.addEventListener("DOMContentLoaded",function(){if("undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms.length){var i=ctPublicGDPR.gdpr_title;if("undefined"!=typeof jQuery)try{ctPublicGDPR.gdpr_forms.forEach(function(e,t){var o=jQuery("#"+e+", ."+e),e=(o.is("form")||(o.find("form")[0]?o=o.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?o=jQuery(".wpcf7[role=form]").children("form"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?o=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(o=jQuery(".wpforms-form"))),!1),n=o.find('input[type|="submit"],button[type|="submit"]');n.length&&(!1!==(e=n[0])&&(e.disabled=!0,n=jQuery(e).prop("title")?jQuery(e).prop("title"):"",buttons_to_handle.push({index:t,button:e,old_notice:n}),jQuery(e).prop("title",i)),!o.is("form")&&"form"!==o.attr("role")||o.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required" style=" margin-right: 10px;" onchange="apbct_gdpr_handle_buttons()">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>"))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not add GDPR notice"+e)}}}),window.onload=function(){+ctPublic.settings__forms__check_external&&"undefined"!=typeof jQuery&&setTimeout(function(){ct_protect_external()},1500)},document.addEventListener("DOMContentLoaded",function(){var e,t="";if(+ctPublic.settings__forms__check_internal)for(var o=0;o<document.forms.length;o++)"string"!=typeof document.forms[o].action||null===(t=(e=document.forms[o]).action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(e.click,"undefined"!=typeof jQuery&&(jQuery(e).off("**"),jQuery(e).off(),jQuery(e).on("submit",function(e){return ct_check_internal(e.target),!1})))});
|
js/apbct-public-bundle.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"apbct-public-bundle.min.js","sources":["apbct-public-bundle.js"],"sourcesContent":["class ApbctCore{\n\n ajax_parameters = {};\n rest_parameters = {};\n\n selector = null;\n elements = [];\n\n // Event properties\n eventCallback;\n eventSelector;\n event;\n\n /**\n * Default constructor\n */\n constructor(selector){\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param selector\n * @returns {*}\n */\n select(selector) {\n\n if(selector instanceof HTMLCollection){\n this.selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n }else if( typeof selector === 'object' ){\n this.selector = null;\n this.elements = [];\n this.elements[0] = selector;\n }else if( typeof selector === 'string' ){\n this.selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n }else{\n this.deselect();\n }\n\n return this;\n }\n\n addElement(elemToAdd){\n if( typeof elemToAdd === 'object' ){\n this.elements.push(elemToAdd);\n }else if( typeof elemToAdd === 'string' ){\n this.selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n }else{\n this.deselect();\n }\n }\n\n push(elem){\n this.elements.push(elem);\n }\n\n reduce(){\n this.elements = this.elements.slice(0,-1);\n }\n\n deselect(){\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param style\n * @param getRaw\n *\n * @returns {boolean|*}\n */\n css(style, getRaw){\n\n getRaw = getRaw | false;\n\n // Set style\n if(typeof style === \"object\"){\n\n const stringToCamelCase = str =>\n str.replace(/([-_][a-z])/g, group =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', '')\n );\n\n // Apply multiple styles\n for(let style_name in style){\n let DOM_style_name = stringToCamelCase(style_name);\n\n // Apply to multiple elements (currently selected)\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].style[DOM_style_name] = style[style_name];\n }\n }\n\n return this;\n }\n\n // Get style of first currently selected element\n if(typeof style === 'string'){\n\n let computedStyle = getComputedStyle(this.elements[0])[style];\n\n // Process\n if( typeof computedStyle !== 'undefined' && ! getRaw){\n computedStyle = computedStyle.replace(/(\\d)(em|pt|%|px){1,2}$/, '$1'); // Cut of units\n computedStyle = Number(computedStyle) == computedStyle ? Number(computedStyle) : computedStyle; // Cast to INT\n return computedStyle;\n }\n\n // Return unprocessed\n return computedStyle;\n }\n }\n\n hide(){\n this.prop('prev-display', this.css('display'));\n this.css({'display': 'none'});\n }\n\n show(){\n this.css({'display': this.prop('prev-display')});\n }\n\n addClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.add(className);\n }\n }\n\n removeClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.remove(className);\n }\n }\n\n toggleClass(className){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.toggle(className);\n }\n }\n\n /**\n * Wrapper for apbctAJAX class\n *\n * @param ajax_parameters\n * @returns {ApbctAjax}\n */\n ajax(ajax_parameters){\n this.ajax_parameters = ajax_parameters;\n return new ApbctAjax(ajax_parameters);\n }\n\n /**\n * Wrapper for apbctREST class\n *\n * @param rest_parameters\n * @returns {ApbctRest}\n */\n rest(rest_parameters){\n this.rest_parameters = rest_parameters;\n return new ApbctRest(rest_parameters);\n }\n\n /************** EVENTS **************/\n\n /**\n *\n * Why the mess with arguments?\n *\n * Because we need to support the following function signatures:\n * on('click', function(){ alert('some'); });\n * on('click', 'inner_selector', function(){ alert('some'); });\n *\n * @param args\n */\n on(...args){\n\n this.event = args[0];\n this.eventCallback = args[2] || args[1];\n this.eventSelector = typeof args[1] === \"string\" ? args[1] : null;\n\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].addEventListener(\n this.event,\n this.eventSelector !== null\n ? this.onChecker.bind(this)\n : this.eventCallback\n );\n }\n }\n\n /**\n * Check if a selector of an event matches current target\n *\n * @param event\n * @returns {*}\n */\n onChecker(event){\n if(event.target === document.querySelector(this.eventSelector)){\n event.stopPropagation();\n return this.eventCallback(event);\n }\n }\n\n ready(callback){\n document.addEventListener('DOMContentLoaded', callback);\n }\n\n change(callback){\n this.on('change', callback);\n }\n\n /************** ATTRIBUTES **************/\n\n /**\n * Get an attribute or property of an element\n *\n * @param attrName\n * @returns {*|*[]}\n */\n attr(attrName){\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n\n // Use property instead of attribute if possible\n if(typeof this.elements[i][attrName] !== undefined){\n outputValue.push(this.elements[i][attrName]);\n }else{\n outputValue.push(this.elements[i].getAttribute(attrName));\n }\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n\n prop(propName, value){\n\n // Setting values\n if(typeof value !== \"undefined\"){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i][propName] = value;\n }\n\n return this;\n\n // Getting values\n }else{\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n outputValue.push(this.elements[i][propName]);\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n }\n\n /**\n * Set or get inner HTML\n *\n * @param value\n * @returns {*|*[]}\n */\n html(value){\n return typeof value !== 'undefined'\n ? this.prop('innerHTML', value)\n : this.prop('innerHTML');\n }\n\n /**\n * Set or get value of input tags\n *\n * @param value\n * @returns {*|*[]|undefined}\n */\n val(value){\n return typeof value !== 'undefined'\n ? this.prop('value', value)\n : this.prop('value');\n }\n\n data(name, value){\n return typeof value !== 'undefined'\n ? this.prop('apbct-data', name, value)\n : this.prop('apbct-data');\n }\n\n /************** END OF ATTRIBUTES **************/\n\n /************** FILTERS **************/\n\n /**\n * Check if the current elements are corresponding to filter\n *\n * @param filter\n * @returns {boolean}\n */\n is(filter){\n\n let outputValue = false;\n\n for(let elem of this.elements){\n outputValue ||= this.isElem(elem, filter);\n }\n\n return outputValue;\n }\n\n isElem(elemToCheck, filter){\n\n let is = false;\n let isRegisteredTagName = function(name){\n let newlyCreatedElement = document.createElement(name).constructor;\n return ! Boolean( ~[HTMLElement, HTMLUnknownElement].indexOf(newlyCreatedElement) );\n };\n\n // Check for filter function\n if(typeof filter === 'function') {\n is ||= filter.call(this, elemToCheck);\n }\n\n // Check for filter function\n if(typeof filter === 'string') {\n\n // Filter is tag name\n if( filter.match(/^[a-z]/) && isRegisteredTagName(filter) ){\n is ||= elemToCheck.tagName.toLowerCase() === filter.toLowerCase();\n\n // Filter is property\n }else if( filter.match(/^[a-z]/) ){\n is ||= Boolean(elemToCheck[filter]);\n\n // Filter is CSS selector\n }else {\n is ||= this.selector !== null\n ? document.querySelector(this.selector + filter) !== null // If possible\n : this.isWithoutSelector(elemToCheck, filter); // Search through all elems with such selector\n }\n }\n\n return is;\n }\n\n isWithoutSelector(elemToCheck, filter){\n\n let elems = document.querySelectorAll(filter);\n let outputValue = false;\n\n for(let elem of elems){\n outputValue ||= elemToCheck === elem;\n }\n\n return outputValue;\n }\n\n filter(filter){\n\n this.selector = null;\n\n for( let i = this.elements.length - 1; i >= 0; i-- ){\n if( ! this.isElem(this.elements[i], filter) ){\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /************** NODES **************/\n\n parent(filter){\n\n this.select(this.elements[0].parentElement);\n\n if( typeof filter !== 'undefined' && ! this.is(filter) ){\n this.deselect();\n }\n\n return this;\n }\n\n parents(filter){\n\n this.select(this.elements[0]);\n\n for ( ; this.elements[ this.elements.length - 1].parentElement !== null ; ) {\n this.push(this.elements[ this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0,1); // Deleting initial element from the set\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n children(filter){\n\n this.select(this.elements[0].children);\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n siblings(filter){\n\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /************** DOM MANIPULATIONS **************/\n remove(){\n for(let elem of this.elements){\n elem.remove();\n }\n }\n\n after(content){\n for(let elem of this.elements){\n elem.after(content);\n }\n }\n\n append(content){\n for(let elem of this.elements){\n elem.append(content);\n }\n }\n\n /************** ANIMATION **************/\n fadeIn(time) {\n for(let elem of this.elements){\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n fadeOut(time) {\n for(let elem of this.elements){\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * Enter point to ApbctCore class\n *\n * @param params\n * @returns {*}\n */\nfunction apbct(params){\n return new ApbctCore()\n .select(params);\n}\nclass ApbctXhr{\n\n xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n body = null;\n http_code = 0;\n status_text = '';\n\n constructor(parameters){\n\n console.log('%cXHR%c started', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n\n // Set class properties\n for( let key in parameters ){\n if( typeof this[key] !== 'undefined' ){\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if( ! this.url ){\n console.log('%cXHR%c not URL provided', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;')\n return false;\n }\n\n // Configure the request\n this.xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.xhr.responseType = this.responseType;\n this.xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.xhr.onreadystatechange = function(){\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.xhr.onload = function(){\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.xhr.onprogress = function(event){\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.xhr.onerror = function(){\n this.onError();\n }.bind(this);\n\n this.xhr.ontimeout = function(){\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.xhr.send(this.body);\n }\n\n prepare(){\n\n // Disable button\n if(this.button){\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n complete(){\n\n this.http_code = this.xhr.status;\n this.status_text = this.xhr.statusText;\n\n // Disable button\n if(this.button){\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n onReadyStateChange(){\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function'){\n this.on_ready_state_change();\n }\n }\n\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function'){\n this.on_progress();\n }\n }\n\n onError(){\n\n console.log('error');\n\n this.complete();\n this.error(\n this.http_code,\n this.status_text\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback(this.status_text);\n }\n }\n\n onTimeout(){\n this.complete();\n this.error(\n 0,\n 'timeout'\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback('Timeout');\n }\n }\n\n onLoad(){\n\n this.complete();\n\n if (this.responseType === 'json' ){\n if(this.xhr.response === null){\n this.error(this.http_code, this.status_text, 'No response');\n return false;\n }else if( typeof this.xhr.response.error !== 'undefined') {\n this.error(this.http_code, this.status_text, this.xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.xhr.response, this.data);\n }\n }\n\n error(http_code, status_text, additional_msg){\n\n let error_string = '';\n\n if( status_text === 'timeout' ){\n error_string += 'Server response timeout'\n\n }else if( http_code === 200 ){\n\n if( status_text === 'parsererror' ){\n error_string += 'Unexpected response from server. See console for details.';\n }else {\n error_string += 'Unexpected error. Status: ' + status_text + '.';\n if( typeof additional_msg !== 'undefined' )\n error_string += ' Additional error info: ' + additional_msg;\n }\n\n }else if(http_code === 500){\n error_string += 'Internal server error.';\n\n }else {\n error_string += 'Unexpected response code:' + http_code;\n }\n\n this.errorOutput( error_string );\n }\n\n errorOutput(error_msg){\n console.log( '%c ctXHR error: %c' + error_msg, 'color: red;', 'color: grey;' );\n }\n\n setHeaders(){\n // Set headers if passed\n for( let header_name in this.headers ){\n if( typeof this.headers[header_name] !== 'undefined' ){\n this.xhr.setRequestHeader(header_name, this.headers[header_name]);\n }\n }\n }\n\n convertData()\n {\n // GET, HEAD request-type\n if( ~this.methods_to_convert_data_to_URL.indexOf( this.method ) ){\n return this.convertDataToURL();\n\n // POST request-type\n }else{\n return this.convertDataToBody()\n }\n }\n\n convertDataToURL(){\n let params_appendix = new URLSearchParams(this.data).toString();\n let params_prefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += params_prefix + params_appendix;\n\n return this.url;\n }\n\n /**\n *\n * @returns {null}\n */\n convertDataToBody()\n {\n this.body = new FormData();\n\n for (let dataKey in this.data) {\n this.body.append(\n dataKey,\n typeof this.data[dataKey] === 'object'\n ? JSON.stringify(this.data[dataKey])\n : this.data[dataKey]\n );\n }\n\n return this.body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\n deleteDoubleJSONEncoding(object){\n\n if( typeof object === 'object'){\n\n for (let objectKey in object) {\n\n // Recursion\n if( typeof object[objectKey] === 'object'){\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if(\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ){\n let parsedValue = JSON.parse(object[objectKey]);\n if( typeof parsedValue === 'object' ){\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n }\n}\nclass ApbctAjax extends ApbctXhr{\n\n constructor(...args) {\n super(args[0]);\n }\n}\nclass ApbctRest extends ApbctXhr{\n\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n constructor(...args) {\n args = args[0];\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n \"X-WP-Nonce\": ctPublicFunctions._rest_nonce\n };\n super(args);\n }\n}\n\nfunction ctSetCookie( cookies, value, expires ){\n\n if( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){\n var skip_alt = cookies === 'ct_pointer_data';\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n cookies.forEach( function (item, i, arr\t) {\n apbctLocalStorage.set(item[0], encodeURIComponent(item[1]))\n });\n ctNoCookieAttachHiddenFieldsToForms()\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n cookies.forEach( function (item, i, arr\t) {\n var expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix + item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' && ! skip_alt ){\n\n if (typeof (getJavascriptClientData) === \"function\"){\n //reprocess already gained cookies data\n cookies = getJavascriptClientData(cookies);\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded')\n }\n\n try {\n JSON.parse(cookies)\n } catch (e){\n console.log('APBCT ERROR: JSON parse error:' + e)\n return\n }\n\n // Using REST API handler\n if( ctPublicFunctions.data__ajax_type === 'rest' ){\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: { cookies: cookies }\n }\n );\n\n // Using AJAX request and handler\n } else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n }\n );\n }\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n return;\n\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + \"=\\\"\\\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax\" + ctSecure;\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' ){\n // @ToDo implement this logic\n }\n}\n\nfunction apbct_public_sendAJAX(data, params, obj){\n\n // Default params\n let _params = [];\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"callback_context\"] = params.callback_context || null;\n _params[\"callback_params\"] = params.callback_params || null;\n _params[\"async\"] = params.async || true;\n _params[\"notJson\"] = params.notJson || null;\n _params[\"timeout\"] = params.timeout || 15000;\n _params[\"obj\"] = obj || null;\n _params[\"button\"] = params.button || null;\n _params[\"progressbar\"] = params.progressbar || null;\n _params[\"silent\"] = params.silent || null;\n _params[\"no_nonce\"] = params.no_nonce || null;\n _params[\"data\"] = data;\n _params[\"url\"] = ctPublicFunctions._ajax_url;\n\n if(typeof (data) === 'string') {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"] = _params[\"data\"] + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"] = _params[\"data\"] + '&no_cache=' + Math.random()\n } else {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"]._ajax_nonce = ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n let _params = [];\n _params[\"route\"] = route;\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"data\"] = params.data || [];\n _params[\"method\"] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\nlet apbctLocalStorage = {\n get : function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n return json.hasOwnProperty(property) ? JSON.parse(json[property]) : json;\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set : function(key, value, is_json = true) {\n if (is_json){\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive : function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet : function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete : function (key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData : function () {\n let data = {}\n for(let i=0; i<localStorage.length; i++) {\n let key = localStorage.key(i);\n if (key.indexOf('ct_') !==-1 || key.indexOf('apbct_') !==-1){\n data[key.toString()] = apbctLocalStorage.get(key)\n }\n }\n return data\n },\n\n}\nvar ct_date = new Date(),\n\tctTimeMs = new Date().getTime(),\n\tctMouseEventTimerFlag = true, //Reading interval flag\n\tctMouseData = [],\n\tctMouseDataCounter = 0,\n\tctCheckedEmails = {};\n\nfunction apbct_attach_event_handler(elem, event, callback){\n\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\telse elem.attachEvent(event, callback);\n}\n\nfunction apbct_remove_event_handler(elem, event, callback){\n\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\telse elem.detachEvent(event, callback);\n}\n\n//Writing first key press timestamp\nvar ctFunctionFirstKey = function output(event){\n\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\tctKeyStopStopListening();\n};\n\n//Reading interval\nvar ctMouseReadInterval = setInterval(function(){\n\tctMouseEventTimerFlag = true;\n}, 150);\n\n//Writting interval\nvar ctMouseWriteDataInterval = setInterval(function(){\n\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n}, 1200);\n\n//Logging mouse position each 150 ms\nvar ctFunctionMouseMove = function output(event){\n\tctSetMouseMoved();\n\tif(ctMouseEventTimerFlag === true){\n\n\t\tctMouseData.push([\n\t\t\tMath.round(event.clientY),\n\t\t\tMath.round(event.clientX),\n\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t]);\n\n\t\tctMouseDataCounter++;\n\t\tctMouseEventTimerFlag = false;\n\t\tif(ctMouseDataCounter >= 50){\n\t\t\tctMouseStopData();\n\t\t}\n\t}\n};\n\n//Stop mouse observing function\nfunction ctMouseStopData(){\n\tapbct_remove_event_handler(document, \"mousemove\", ctFunctionMouseMove);\n\tclearInterval(ctMouseReadInterval);\n\tclearInterval(ctMouseWriteDataInterval);\n}\n\n//Stop key listening function\nfunction ctKeyStopStopListening(){\n\tapbct_remove_event_handler(document, \"mousedown\", ctFunctionFirstKey);\n\tapbct_remove_event_handler(document, \"keydown\", ctFunctionFirstKey);\n}\n\nfunction checkEmail(e) {\n\tvar current_email = e.target.value;\n\tif (current_email && !(current_email in ctCheckedEmails)) {\n\t\t// Using REST API handler\n\t\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\t\tapbct_public_sendREST(\n\t\t\t\t'check_email_before_post',\n\t\t\t\t{\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {'email' : current_email},\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t\t// Using AJAX request and handler\n\t\t} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n\t\t\tapbct_public_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\temail : current_email,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction ctSetPixelImg(pixelUrl) {\n\tctSetCookie('apbct_pixel_url', pixelUrl);\n\tif( +ctPublic.pixel__enabled ){\n\t\tif( ! document.getElementById('apbct_pixel') ) {\n\t\t\tlet insertedImg = document.createElement('img');\n\t\t\tinsertedImg.setAttribute('alt', 'CleanTalk Pixel');\n\t\t\tinsertedImg.setAttribute('id', 'apbct_pixel');\n\t\t\tinsertedImg.setAttribute('style', 'display: none; left: 99999px;');\n\t\t\tinsertedImg.setAttribute('src', pixelUrl);\n\t\t\tapbct('body').append(insertedImg);\n\t\t}\n\t}\n}\n\nfunction ctGetPixelUrl() {\n\t// Check if pixel is already in localstorage and is not outdated\n\tlet local_storage_pixel_url = apbctLocalStorage.get('apbct_pixel_url');\n\tif ( local_storage_pixel_url !== false ) {\n\t\tif ( apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n\t\t\tapbctLocalStorage.delete('apbct_pixel_url')\n\t\t} else {\n\t\t\t//if so - load pixel from localstorage and draw it skipping AJAX\n\t\t\tctSetPixelImg(local_storage_pixel_url);\n\t\t\treturn;\n\t\t}\n\t}\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_get_pixel_url',\n\t\t\t{\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\t// Using AJAX request and handler\n\t}else{\n\t\tapbct_public_sendAJAX(\n\t\t\t{\n\t\t\t\taction: 'apbct_get_pixel_url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction ctSetHasScrolled() {\n\tif( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n\t\tctSetCookie(\"ct_has_scrolled\", 'true');\n\t\tapbctLocalStorage.set('ct_has_scrolled', true);\n\t}\n}\n\nfunction ctSetMouseMoved() {\n\tif( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n\t\tctSetCookie(\"ct_mouse_moved\", 'true');\n\t\tapbctLocalStorage.set('ct_mouse_moved', true);\n\t}\n}\n\nfunction ctPreloadLocalStorage(){\n\tif (ctPublic.data__to_local_storage){\n\t\tlet data = Object.entries(ctPublic.data__to_local_storage)\n\t\tdata.forEach(([key, value]) => {\n\t\t\tapbctLocalStorage.set(key,value)\n\t\t});\n\t}\n}\n\napbct_attach_event_handler(document, \"mousemove\", ctFunctionMouseMove);\napbct_attach_event_handler(document, \"mousedown\", ctFunctionFirstKey);\napbct_attach_event_handler(document, \"keydown\", ctFunctionFirstKey);\napbct_attach_event_handler(document, \"scroll\", ctSetHasScrolled);\n\n// Ready function\nfunction apbct_ready(){\n\n\tctPreloadLocalStorage()\n\n\tlet cookiesType = apbctLocalStorage.get('ct_cookies_type');\n\tif ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n\t\tapbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n\t\tapbctLocalStorage.delete('ct_mouse_moved');\n\t\tapbctLocalStorage.delete('ct_has_scrolled');\n\t}\n\n\t// Collect scrolling info\n\tvar initCookies = [\n\t\t[\"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000)],\n\t\t[\"ct_fkp_timestamp\", \"0\"],\n\t\t[\"ct_pointer_data\", \"0\"],\n\t\t[\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t[\"ct_screen_info\", apbctGetScreenInfo()],\n\t\t[\"apbct_headless\", navigator.webdriver],\n\t];\n\n\tapbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n\tapbctLocalStorage.set('ct_fkp_timestamp', \"0\");\n\tapbctLocalStorage.set('ct_pointer_data', \"0\");\n\tapbctLocalStorage.set('ct_timezone', ct_date.getTimezoneOffset()/60*(-1) );\n\tapbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n\tapbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n\tif( ctPublic.data__cookies_type !== 'native' ) {\n\t\tinitCookies.push(['apbct_visible_fields', '0']);\n\t} else {\n\t\t// Delete all visible fields cookies on load the page\n\t\tvar cookiesArray = document.cookie.split(\";\");\n\t\tif( cookiesArray.length !== 0 ) {\n\t\t\tfor ( var i = 0; i < cookiesArray.length; i++ ) {\n\t\t\t\tvar currentCookie = cookiesArray[i].trim();\n\t\t\t\tvar cookieName = currentCookie.split(\"=\")[0];\n\t\t\t\tif( cookieName.indexOf(\"apbct_visible_fields_\") === 0 ) {\n\t\t\t\t\tctDeleteCookie(cookieName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif( +ctPublic.pixel__setting ){\n\t\tif( +ctPublic.pixel__enabled ){\n\t\t\tctGetPixelUrl()\n\t\t} else {\n\t\t\tinitCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n\t\t}\n\t}\n\n\tif ( +ctPublic.data__email_check_before_post) {\n\t\tinitCookies.push(['ct_checked_emails', '0']);\n\t\tapbct(\"input[type = 'email'], #email\").on('blur', checkEmail);\n\t}\n\n\tif (apbctLocalStorage.isSet('ct_checkjs')) {\n\t\tinitCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n\t} else {\n\t\tinitCookies.push(['ct_checkjs', 0]);\n\t}\n\n\tctSetCookie(initCookies);\n\n\tsetTimeout(function(){\n\n\t\tctNoCookieAttachHiddenFieldsToForms()\n\n\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\tvar form = document.forms[i];\n\n\t\t\t//Exclusion for forms\n\t\t\tif (\n\t\t\t\t+ctPublic.data__visible_fields_required === 0 ||\n\t\t\t\tform.method.toString().toLowerCase() === 'get' ||\n\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t(form.id && form.id === 'caspioform') || //Caspio Form\n\t\t\t\t(form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t(form.classList && form.classList.contains('give-form')) || // GiveWP\n\t\t\t\t(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password\n\t\t\t\t(form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n\t\t\t\t(form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n\t\t\t\t(form.id && form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\t(form.name && form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\tform.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n\t\t\t\t(form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) // The Events Calendar\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar hiddenInput = document.createElement( 'input' );\n\t\t\thiddenInput.setAttribute( 'type', 'hidden' );\n\t\t\thiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n\t\t\thiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n\t\t\tvar visibleFieldsToInput = {};\n\t\t\tvisibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n\t\t\thiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));\n\t\t\tform.append( hiddenInput );\n\n\t\t\tform.onsubmit_prev = form.onsubmit;\n\n\t\t\tform.ctFormIndex = i;\n\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\tif ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );\n\t\t\t\t}\n\n\t\t\t\t// Call previous submit action\n\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t}, 1000);\n\n\t// Listen clicks on encoded emails\n\tlet decodedEmailNodes = document.querySelectorAll(\"[data-original-string]\");\n\tif (decodedEmailNodes.length) {\n\t\tfor (let i = 0; i < decodedEmailNodes.length; ++i) {\n\t\t\tif (\n\t\t\t\tdecodedEmailNodes[i].parentElement.href ||\n\t\t\t\tdecodedEmailNodes[i].parentElement.parentElement.href\n\t\t\t) {\n\t\t\t\t// Skip listening click on hyperlinks\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdecodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n\t\t}\n\t}\n}\nif (document.readyState !== 'loading') {\n\tapbct_ready();\n} else {\n\tapbct_attach_event_handler(document, \"DOMContentLoaded\", apbct_ready);\n}\n\nfunction ctFillDecodedEmailHandler(event) {\n\tthis.removeEventListener('click', ctFillDecodedEmailHandler);\n\tapbctAjaxEmailDecode(event, this);\n}\n\nfunction apbctAjaxEmailDecode(event, baseElement){\n\tconst element = event.target;\n\tconst javascriptClientData = getJavascriptClientData();\n\tlet data = {\n\t\tevent_javascript_data: javascriptClientData,\n\t\tpost_url: document.location.href,\n\t\treferrer: document.referrer,\n\t};\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tevent.preventDefault();\n\t}\n\n\telement.setAttribute('title', ctPublicFunctions.text__wait_for_decoding);\n\telement.style.cursor = 'progress';\n\n\t// Adding a tooltip\n\tlet apbctTooltip = document.createElement('div');\n\tapbctTooltip.setAttribute('class', 'apbct-tooltip');\n\tlet apbctTooltipText = document.createElement('div');\n\tapbctTooltipText.setAttribute('class', 'apbct-tooltip--text');\n\tlet apbctTooltipArrow = document.createElement('div');\n\tapbctTooltipArrow.setAttribute('class', 'apbct-tooltip--arrow');\n\tapbct(element).append(apbctTooltip);\n\tapbct(apbctTooltip).append(apbctTooltipText);\n\tapbct(apbctTooltip).append(apbctTooltipArrow);\n\tctShowDecodeComment(element, ctPublicFunctions.text__wait_for_decoding);\n\n\tlet encodedEmail = event.target.dataset.originalString;\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tencodedEmail = baseElement.dataset.originalString;\n\t}\n\n\tdata.encodedEmail = encodedEmail;\n\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_decode_email',\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function(result) {\n\t\t\t\t\tapbctEmailEncoderCallback(result, baseElement, element);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\n\t// Using AJAX request and handler\n\t}else{\n\t\tdata.action = 'apbct_decode_email';\n\t\tapbct_public_sendAJAX(\n\t\t\tdata,\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result) {\n\t\t\t\t\tapbctEmailEncoderCallback(result, baseElement, element);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction apbctEmailEncoderCallback(result, baseElement, element) {\n\tif (result.success) {\n\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\tbaseElement.click();\n\t\t} else {\n\t\t\tsetTimeout(function(){\n\t\t\t\tctProcessDecodedDataResult(result.data, element);\n\t\t\t}, 3000);\n\t\t}\n\t} else {\n\t\telement.removeAttribute('style');\n\t\tctShowDecodeComment(element, result.data.comment);\n\t}\n}\n\nfunction getJavascriptClientData(common_cookies = []) {\n\tlet resultDataJson = {};\n\n\tresultDataJson.apbct_headless = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\tresultDataJson.apbct_pixel_url = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n\tresultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n\tresultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n\tresultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n\tresultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n\tresultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n\tresultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n\tresultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n\t// collecting data from localstorage\n\tconst ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\t// collecting data from cookies\n\tconst ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\tresultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ? ctMouseMovedLocalStorage : ctMouseMovedCookie;\n\tresultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ? ctHasScrolledLocalStorage : ctHasScrolledCookie;\n\tresultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ? ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n\n\tif (\n\t\ttypeof (common_cookies) === \"object\"\n\t\t&& common_cookies !== []\n\t){\n\t\tfor (let i = 0; i < common_cookies.length; ++i){\n\t\t\tif ( typeof (common_cookies[i][1]) === \"object\" ){\n\t\t\t\t//this is for handle SFW cookies\n\t\t\t\tresultDataJson[common_cookies[i][1][0]] = common_cookies[i][1][1]\n\t\t\t} else {\n\t\t\t\tresultDataJson[common_cookies[i][0]] = common_cookies[i][1]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconsole.log('APBCT JS ERROR: Collecting data type mismatch')\n\t}\n\n\t// Parse JSON properties to prevent double JSON encoding\n\tresultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\treturn JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\nfunction removeDoubleJsonEncoding(object){\n\n\tif( typeof object === 'object'){\n\n\t\tfor (let objectKey in object) {\n\n\t\t\t// Recursion\n\t\t\tif( typeof object[objectKey] === 'object'){\n\t\t\t\tobject[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n\t\t\t}\n\n\t\t\t// Common case (out)\n\t\t\tif(\n\t\t\t\ttypeof object[objectKey] === 'string' &&\n\t\t\t\tobject[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n\t\t\t){\n\t\t\t\tlet parsedValue = JSON.parse(object[objectKey]);\n\t\t\t\tif( typeof parsedValue === 'object' ){\n\t\t\t\t\tobject[objectKey] = parsedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction ctProcessDecodedDataResult(response, targetElement) {\n\n\ttargetElement.setAttribute('title', '');\n\ttargetElement.removeAttribute('style');\n\n\tif( !! response.is_allowed) {\n\t\tctFillDecodedEmail(targetElement, response.decoded_email);\n\t}\n\n\tif( !! response.show_comment ){\n\t\tctShowDecodeComment(targetElement, response.comment);\n\t}\n}\n\nfunction ctFillDecodedEmail(target, email){\n\tapbct(target).html(\n\t\tapbct(target)\n\t\t\t.html()\n\t\t\t.replace(/.+?(<div class=[\"']apbct-tooltip[\"'].+?<\\/div>)/, email + \"$1\")\n\t);\n}\n\nfunction ctShowDecodeComment(target, comment){\n\n\tif( ! comment ){\n\t\treturn;\n\t}\n\n\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeIn(300);\n\tapbct(target.getElementsByClassName('apbct-tooltip--text')).html(comment);\n\tsetTimeout(function(){\n\t\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t}, 5000);\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_invisible = '',\n\t\tinputs_invisible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter already added fields\n\t\tif( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){\n\t\t\treturn false;\n\t\t}\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\t// Unnecessary fields\n\t\tif(\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\telem.getAttribute('name') === null ||\n\t\t\telem.getAttribute('name') === 'ct_checkjs'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t// Invisible fields\n\t\tif(\n\t\t\tgetComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" // type == hidden\n\t\t) {\n\t\t\tif( elem.classList.contains(\"wp-editor-area\") ) {\n\t\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_visible_count++;\n\t\t\t} else {\n\t\t\t\tinputs_invisible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_invisible_count++;\n\t\t\t}\n\t\t}\n\t\t// Visible fields\n\t\telse {\n\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\tinputs_visible_count++;\n\t\t}\n\n\t});\n\n\tinputs_invisible = inputs_invisible.trim();\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t\tinvisible_fields : inputs_invisible,\n\t\tinvisible_fields_count : inputs_invisible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tif( ctPublic.data__cookies_type === 'native' ) {\n\t\tfor ( var i in collection ) {\n\t\t\tif ( i > 10 ) {\n\t\t\t\t// Do not generate more than 10 cookies\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar collectionIndex = form_id !== undefined ? form_id : i;\n\t\t\tctSetCookie(\"apbct_visible_fields_\" + collectionIndex, JSON.stringify( collection[i] ) );\n\t\t}\n\t} else {\n\t\tif (ctPublic.data__cookies_type === 'none'){\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection[0] ) );\n\t\t} else {\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\t\t}\n\n\t}\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbctGetScreenInfo() {\n\treturn JSON.stringify({\n\t\tfullWidth : document.documentElement.scrollWidth,\n\t\tfullHeight : Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t),\n\t\tvisibleWidth : document.documentElement.clientWidth,\n\t\tvisibleHeight : document.documentElement.clientHeight,\n\t});\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\ttry {\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e.toString());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tctParseBlockMessage(response);\n\t\t}\n\t});\n}\n\nfunction ctParseBlockMessage(response) {\n\n\tif (typeof response.apbct !== 'undefined') {\n\t\tresponse = response.apbct;\n\t\tif (response.blocked) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\t// Show the result by modal\n\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\tcleantalkModal.open();\n\n\t\t\tif(+response.stop_script == 1)\n\t\t\t\twindow.stop();\n\t\t}\n\t}\n}\n\nfunction ctSetPixelUrlLocalstorage(ajax_pixel_url) {\n\t//set pixel to the storage\n\tctSetCookie('apbct_pixel_url', ajax_pixel_url)\n}\n\nfunction ctNoCookieConstructHiddenField(){\n\tlet field = ''\n\tlet no_cookie_data = apbctLocalStorage.getCleanTalkData()\n\tno_cookie_data = JSON.stringify(no_cookie_data)\n\tno_cookie_data = btoa(no_cookie_data)\n\tfield = document.createElement('input')\n\tfield.setAttribute('id','ct_no_cookie_hidden_field')\n\tfield.setAttribute('name','ct_no_cookie_hidden_field')\n\tfield.setAttribute('value', no_cookie_data)\n\tfield.setAttribute('type', 'hidden')\n\treturn field\n}\n\nfunction ctNoCookieGetForms(){\n\tlet forms = document.forms\n\tif (forms) {\n\t\treturn forms\n\t}\n\treturn false\n}\n\nfunction ctNoCookieAttachHiddenFieldsToForms(){\n\n\tif (ctPublic.data__cookies_type !== 'none'){\n\t\treturn\n\t}\n\n\tlet forms = ctNoCookieGetForms()\n\n\tif (forms){\n\t\t//clear previous hidden set\n\t\tlet elements = document.getElementsByName('ct_no_cookie_hidden_field')\n\t\tif (elements){\n\t\t\tfor (let j = 0; j < elements.length; j++) {\n\t\t\t\telements[j].parentNode.removeChild(elements[j])\n\t\t\t}\n\t\t}\n\t\tfor ( let i = 0; i < forms.length; i++ ){\n\t\t\t//ignore forms with get method @todo We need to think about this\n\t\t\tif (document.forms[i].getAttribute('method') === null ||\n\t\t\t\tdocument.forms[i].getAttribute('method').toLowerCase() === 'post'){\n\t\t\t\t// add new set\n\t\t\t\tdocument.forms[i].append(ctNoCookieConstructHiddenField())\n\t\t\t}\n\t\t}\n\t}\n\n}\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( let key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\nlet buttons_to_handle = [];\n\ndocument.addEventListener('DOMContentLoaded', function(){\n\n\tif(\n\t\ttypeof ctPublicGDPR === 'undefined' ||\n\t\t! ctPublicGDPR.gdpr_forms.length\n\t) {\n\t\treturn;\n\t}\n\n\tlet gdpr_notice_for_button = ctPublicGDPR.gdpr_title;\n\n\tif ( typeof jQuery === 'undefined' ) {\n\t\treturn;\n\t}\n\ttry {\n\t\tctPublicGDPR.gdpr_forms.forEach(function(item, i){\n\n\t\t\tlet elem = jQuery('#'+item+', .'+item);\n\n\t\t\t// Filter forms\n\t\t\tif (!elem.is('form')){\n\t\t\t\t// Caldera\n\t\t\t\tif (elem.find('form')[0])\n\t\t\t\t\telem = elem.children('form').first();\n\t\t\t\t// Contact Form 7\n\t\t\t\telse if(\n\t\t\t\t\tjQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]')\n\t\t\t\t\t\t.attr('id')\n\t\t\t\t\t\t.indexOf('wpcf7-f'+item) !== -1\n\t\t\t\t) {\n\t\t\t\t\telem = jQuery('.wpcf7[role=form]').children('form');\n\t\t\t\t}\n\n\t\t\t\t// Formidable\n\t\t\t\telse if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)\n\t\t\t\t\telem = jQuery('.frm_forms').first().children('form');\n\t\t\t\t// WPForms\n\t\t\t\telse if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)\n\t\t\t\t\telem = jQuery('.wpforms-form');\n\t\t\t}\n\n\t\t\t//disable forms buttons\n\t\t\tlet button = false\n\t\t\tlet buttons_collection= elem.find('input[type|=\"submit\"],button[type|=\"submit\"]')\n\n\t\t\tif (!buttons_collection.length) {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tbutton = buttons_collection[0]\n\t\t\t}\n\n\t\t\tif (button !== false){\n\t\t\t\tbutton.disabled = true\n\t\t\t\tlet old_notice = jQuery(button).prop('title') ? jQuery(button).prop('title') : ''\n\t\t\t\tbuttons_to_handle.push({index:i,button:button,old_notice:old_notice})\n\t\t\t\tjQuery(button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\n\t\t\t// Adding notice and checkbox\n\t\t\tif(elem.is('form') || elem.attr('role') === 'form'){\n\t\t\t\telem.append('<input id=\"apbct_gdpr_'+i+'\" type=\"checkbox\" required=\"required\" style=\" margin-right: 10px;\" onchange=\"apbct_gdpr_handle_buttons()\">')\n\t\t\t\t\t.append('<label style=\"display: inline;\" for=\"apbct_gdpr_'+i+'\">'+ctPublicGDPR.gdpr_text+'</label>');\n\t\t\t}\n\t\t});\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not add GDPR notice' + e)\n\t}\n});\n\nfunction apbct_gdpr_handle_buttons(){\n\n\ttry {\n\n\t\tif (buttons_to_handle === []){\n\t\t\treturn\n\t\t}\n\n\t\tbuttons_to_handle.forEach((button) => {\n\t\t\tlet selector = '[id=\"apbct_gdpr_' + button.index + '\"]'\n\t\t\tlet apbct_gdpr_item = jQuery(selector)\n\t\t\t//chek if apbct_gdpr checkbox is set\n\t\t\tif (jQuery(apbct_gdpr_item).prop(\"checked\")){\n\t\t\t\tbutton.button.disabled = false\n\t\t\t\tjQuery(button.button).prop('title', button.old_notice)\n\t\t\t} else {\n\t\t\t\tbutton.button.disabled = true\n\t\t\t\tjQuery(button.button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\t\t})\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not handle form buttons ' + e)\n\t}\n}\n/**\n * Handle external forms\n */\nfunction ct_protect_external() {\n for(var i = 0; i < document.forms.length; i++) {\n\n if (document.forms[i].cleantalk_hidden_action === undefined && document.forms[i].cleantalk_hidden_method === undefined) {\n\n // current form\n var currentForm = document.forms[i];\n\n if (currentForm.parentElement && currentForm.parentElement.classList.length > 0 && currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1){\n return\n }\n\n if(typeof(currentForm.action) == 'string') {\n\n // Ajax checking for the integrated forms\n if(isIntegratedForm(currentForm)) {\n\n apbctProcessExternalForm(currentForm, i, document);\n\n // Common flow - modify form's action\n }else if(currentForm.action.indexOf('http://') !== -1 || currentForm.action.indexOf('https://') !== -1) {\n\n var tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n var host = tmp[0].toLowerCase();\n\n if(host !== location.hostname.toLowerCase()){\n\n var ct_action = document.createElement(\"input\");\n ct_action.name = 'cleantalk_hidden_action';\n ct_action.value = currentForm.action;\n ct_action.type = 'hidden';\n currentForm.appendChild(ct_action);\n\n var ct_method = document.createElement(\"input\");\n ct_method.name = 'cleantalk_hidden_method';\n ct_method.value = currentForm.method;\n ct_method.type = 'hidden';\n\n currentForm.method = 'POST'\n\n currentForm.appendChild(ct_method);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n\n }\n\n // Trying to process external form into an iframe\n const frames = document.getElementsByTagName('iframe');\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) { continue; }\n\n const iframeForms = frames[j].contentDocument.forms;\n if ( iframeForms.length === 0 ) { return; }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n let currentForm = iframeForms[y];\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n\n const cleantalk_placeholder = document.createElement(\"i\");\n cleantalk_placeholder.className = 'cleantalk_placeholder';\n cleantalk_placeholder.style = 'display: none';\n\n currentForm.parentElement.insertBefore(cleantalk_placeholder, currentForm);\n\n // Deleting form to prevent submit event\n let prev = currentForm.previousSibling,\n form_html = currentForm.outerHTML,\n form_original = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement(\"div\");\n placeholder.innerHTML = form_html;\n prev.after(placeholder.firstElementChild);\n\n var force_action = document.createElement(\"input\");\n force_action.name = 'action';\n force_action.value = 'cleantalk_force_ajax_check';\n force_action.type = 'hidden';\n\n let reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(force_action);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = form_original;\n\n // mailerlite integration - disable click on submit button\n let mailerlite_detected_class = false\n if (reUseCurrentForm.classList !== undefined) {\n //list there all the mailerlite classes\n let mailerlite_classes = ['newsletterform', 'ml-block-form']\n mailerlite_classes.forEach(function(mailerlite_class) {\n if (reUseCurrentForm.classList.contains(mailerlite_class)){\n mailerlite_detected_class = mailerlite_class\n }\n });\n }\n if ( mailerlite_detected_class ) {\n let mailerliteSubmitButton = jQuery('form.' + mailerlite_detected_class).find('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.click(function (event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n });\n }\n } else {\n documentObject.forms[iterator].onsubmit = function ( event ){\n event.preventDefault();\n\n //mautic integration\n if (documentObject.forms[iterator].id.indexOf('mauticform') !== -1) {\n let checkbox = jQuery(documentObject.forms[iterator]).find('input[id*=\"checkbox_rgpd\"]')\n if (checkbox.length > 0){\n if (checkbox.prop(\"checked\") === true){\n let placeholder = jQuery('.cleantalk_placeholder')\n if (placeholder.length > 0) {\n placeholder[0].setAttribute('mautic_hidden_gdpr_id', checkbox.prop(\"id\"))\n }\n }\n }\n }\n\n const prev = jQuery(event.currentTarget).prev();\n const form_original = jQuery(event.currentTarget).clone();\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n }\n}\n\nfunction apbct_replace_inputs_values_from_other_form( form_source, form_target ){\n\n var\tinputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),\n inputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );\n\n inputs_source.each( function( index, elem_source ){\n\n var source = jQuery( elem_source );\n\n inputs_target.each( function( index2, elem_target ){\n\n var target = jQuery( elem_target );\n\n if( elem_source.outerHTML === elem_target.outerHTML ){\n\n target.val( source.val() );\n }\n });\n });\n\n}\nwindow.onload = function () {\n\n if( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n if ( typeof jQuery === 'undefined' ) {\n return;\n }\n\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};\n\n/**\n * Checking the form integration\n */\nfunction isIntegratedForm(formObj) {\n var formAction = formObj.action;\n let formId = formObj.id;\n\n if(\n formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n ( formObj.firstChild.classList !== undefined && formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('webto.salesforce.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Sending Ajax for checking form data\n */\nfunction sendAjaxCheckingFormData(form, prev, formOriginal) {\n // Get visible fields and set cookie\n var visible_fields = {};\n visible_fields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visible_fields );\n\n var data = {};\n var elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ){\n\n if( result.apbct === undefined || ! +result.apbct.blocked ) {\n\n let form_new = jQuery(form).detach();\n let prev = form.apbctPrev;\n let formOriginal = form.apbctFormOriginal;\n let mautic_integration = false;\n\n apbct_replace_inputs_values_from_other_form(form_new, formOriginal);\n\n //mautic forms integration\n if (formOriginal.id.indexOf('mautic') !== -1) {\n mautic_integration = true\n }\n let placeholders = document.getElementsByClassName('cleantalk_placeholder')\n if (placeholders) {\n for (let i = 0; i < placeholders.length; i++) {\n let mautic_hidden_gdpr_id = placeholders[i].getAttribute(\"mautic_hidden_gdpr_id\")\n if (typeof(mautic_hidden_gdpr_id) !== 'undefined') {\n let mautic_gdpr_radio = jQuery(formOriginal).find('#' + mautic_hidden_gdpr_id)\n if (typeof(mautic_gdpr_radio) !== 'undefined') {\n mautic_gdpr_radio.prop(\"checked\", true);\n }\n }\n }\n }\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n jQuery(formOriginal).find('input[name=\"apbct_visible_fields\"]').remove();\n jQuery(formOriginal).find('input[value=\"cleantalk_force_ajax_check\"]').remove();\n\n\n //Common click event\n var subm_button = jQuery(formOriginal).find('button[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n if (mautic_integration) {\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n }\n return;\n }\n\n subm_button = jQuery(formOriginal).find('input[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // ConvertKit direct integration\n subm_button = jQuery(formOriginal).find('button[data-element=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // Paypal integration\n subm_button = jQuery(formOriginal).find('input[type=\"image\"][name=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n }\n\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n }\n }\n );\n}\n\nfunction ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n //AJAX Request\n apbct_public_sendAJAX(\n ct_data,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function (data) {\n if(data.success === true){\n currForm.submit();\n }else{\n alert(data.data);\n return false;\n }\n }\n }\n );\n}\n\ndocument.addEventListener('DOMContentLoaded',function(){\n let ct_currAction = '',\n ct_currForm = '';\n\n if( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n let ctPrevHandler;\n\tfor( let i=0; i<document.forms.length; i++ ){\n\t\tif ( typeof(document.forms[i].action) == 'string' ){\n ct_currForm = document.forms[i];\n\t\t\tct_currAction = ct_currForm.action;\n if (\n ct_currAction.indexOf('https?://') !== null && // The protocol is obligatory\n ct_currAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ct_check_internal__is_exclude_form(ct_currAction) // Exclude WordPress native scripts from processing\n ) {\n ctPrevHandler = ct_currForm.click;\n if ( typeof jQuery !== 'undefined' ) {\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(event){\n ct_check_internal(event.target);\n return false;\n });\n }\n }\n\t\t}\n\t}\n});\n\n/**\n * Check by action to exclude the form checking\n * @param action string\n * @return boolean\n */\nfunction ct_check_internal__is_exclude_form(action) {\n // An array contains forms action need to be excluded.\n let ct_internal_script_exclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ct_internal_script_exclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}"],"names":["ApbctCore","ajax_parameters","rest_parameters","selector","elements","eventCallback","eventSelector","event","constructor","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","deselect","addElement","elemToAdd","push","elem","reduce","css","style","getRaw","let","style_name","DOM_style_name","replace","group","toUpperCase","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ApbctAjax","rest","ApbctRest","on","args","addEventListener","onChecker","bind","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","propName","value","html","val","data","name","is","filter","isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","apbct","params","ApbctXhr","xhr","XMLHttpRequest","method","url","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","methods_to_convert_data_to_URL","body","http_code","status_text","parameters","key","console","log","prepare","Object","keys","deleteDoubleJSONEncoding","convertData","open","setHeaders","onreadystatechange","onReadyStateChange","onload","onLoad","onprogress","onProgress","onerror","onError","ontimeout","onTimeout","send","setAttribute","cursor","complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","error","response","additional_msg","error_string","errorOutput","error_msg","header_name","setRequestHeader","convertDataToURL","convertDataToBody","params_appendix","URLSearchParams","toString","params_prefix","dataKey","FormData","JSON","stringify","object","objectKey","parsedValue","parse","super","default_route","ctPublicFunctions","_rest_url","route","X-WP-Nonce","_rest_nonce","ctSetCookie","cookies","expires","skip_alt","data__cookies_type","forEach","item","arr","apbctLocalStorage","set","encodeURIComponent","ctNoCookieAttachHiddenFieldsToForms","ctSecure","location","protocol","cookie","cookiePrefix","getJavascriptClientData","e","data__ajax_type","apbct_public_sendREST","apbct_public_sendAJAX","action","notJson","ctGetCookie","matches","RegExp","decodeURIComponent","undefined","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","_ajax_nonce","Math","random","no_cache","get","property","storageValue","localStorage","getItem","json","hasOwnProperty","is_json","objToSave","timestamp","floor","getTime","setItem","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","ct_date","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","apbct_attach_event_handler","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","clearInterval","checkEmail","current_email","email","result","now","ctSetPixelImg","pixelUrl","insertedImg","ctPublic","pixel__enabled","getElementById","ctGetPixelUrl","local_storage_pixel_url","ctSetHasScrolled","ctPreloadLocalStorage","data__to_local_storage","entries","apbct_ready","cookiesType","initCookies","getTimezoneOffset","apbctGetScreenInfo","navigator","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","forms","hiddenInput","visibleFieldsToInput","form","data__visible_fields_required","contains","id","apbct_collect_visible_fields","btoa","onsubmit_prev","onsubmit","ctFormIndex","visible_fields","apbct_visible_fields_set_cookie","Function","decodedEmailNodes","href","ctFillDecodedEmailHandler","apbctAjaxEmailDecode","baseElement","element","event_javascript_data","post_url","referrer","apbctTooltip","preventDefault","text__wait_for_decoding","apbctTooltipText","apbctTooltipArrow","ctShowDecodeComment","encodedEmail","dataset","originalString","apbctEmailEncoderCallback","res","baseElementContent","success","innerHTML","decoded_email","click","ctProcessDecodedDataResult","comment","common_cookies","resultDataJson","apbct_headless","apbct_pixel_url","ct_checked_emails","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","removeDoubleJsonEncoding","targetElement","is_allowed","ctFillDecodedEmail","show_comment","getElementsByClassName","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","isNaN","getAttribute","visibility","visible_fields_count","invisible_fields","invisible_fields_count","visible_fields_collection","form_id","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","ctParseBlockMessage","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajax_pixel_url","ctNoCookieConstructHiddenField","field","no_cookie_data","ctNoCookieGetForms","getElementsByName","j","parentNode","removeChild","readyState","jQuery","ajaxComplete","settings","responseText","loading","opened","opening","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","top","left","width","height","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","right","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","buttons_to_handle","apbct_gdpr_handle_buttons","index","apbct_gdpr_item","disabled","old_notice","gdpr_notice_for_button","info","ct_protect_external","cleantalk_hidden_action","cleantalk_hidden_method","ct_method","currentForm","isIntegratedForm","apbctProcessExternalForm","hostname","ct_action","type","appendChild","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalk_placeholder","prev","insertBefore","previousSibling","form_html","outerHTML","form_original","placeholder","force_action","firstElementChild","reUseCurrentForm","mailerlite_detected_class","apbctPrev","apbctFormOriginal","mailerlite_class","mailerliteSubmitButton","find","sendAjaxCheckingFormData","currentTarget","checkbox","clone","apbct_replace_inputs_values_from_other_form","form_source","form_target","inputs_source","inputs_target","each","elem_source","source","index2","elem_target","formObj","formAction","formId","firstChild","formOriginal","elems","form_new","detach","mautic_integration","placeholders","mautic_hidden_gdpr_id","mautic_gdpr_radio","subm_button","ct_check_internal","currForm","ct_data","alert","submit","ct_check_internal__is_exclude_form","some","blog_home","ctPublicGDPR","gdpr_forms","gdpr_title","first","buttons_collection","gdpr_text","settings__forms__check_external","ct_currForm","ct_currAction","settings__forms__check_internal","off"],"mappings":"MAAMA,UAEFC,gBAAkB,GAClBC,gBAAkB,GAElBC,SAAW,KACXC,SAAW,GAGXC,cACAC,cACAC,MAKAC,YAAYL,GACRM,KAAKC,OAAOP,CAAQ,CACxB,CAQAO,OAAOP,GAkBH,OAhBGA,aAAoBQ,gBACnBF,KAAKN,SAAc,KACnBM,KAAKL,SAAc,GACnBK,KAAKL,SAAWQ,MAAMC,UAAUC,MA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OAAOA,EAAO2V,WAAWA,CAAU,CAAC,EACpE5C,OAAO/S,CAAM,EAAE/E,KAAK,QAAS2a,CAAsB,GAIjD5b,CAAAA,EAAKoD,GAAG,MAAM,GAA2B,SAAtBpD,EAAK2C,KAAK,MAAM,GACrC3C,EAAK2E,OAAO,yBAAyBhE,EAAE,4GAA4G,EACjJgE,OAAO,mDAAmDhE,EAAE,KAAKyf,aAAaK,UAAU,UAAU,EAEtG,CAAC,CAGF,CAFE,MAAOhV,GACR3E,QAAQ+U,KAAK,+CAAiDpQ,CAAC,CAChE,CA3DA,CA4DD,CAAC,EAkMDvG,OAAOuC,OAAS,WAEN,CAAC0I,SAASuQ,iCAIO,aAAlB,OAAO3H,QAIZ3T,WAAW,WACP0W,oBAAoB,CACxB,EAAG,IAAI,CACX,EAoKApc,SAASwC,iBAAiB,mBAAmB,WACzC7B,IACIsgB,EADAC,EAAgB,GAGpB,GAAM,CAACzQ,SAAS0Q,gCAKnB,IAAKxgB,IAAIM,EAAE,EAAGA,EAAEjB,SAAS+R,MAAM7Q,OAAQD,CAAC,GACE,UAApC,OAAOjB,SAAS+R,MAAM9Q,GAAS,QAIiB,QAFpDigB,GADSD,EAAcjhB,SAAS+R,MAAM9Q,IACVkL,QAED/H,QAAQ,WAAW,GACwB,OAAzD8c,EAAcpd,MAAM2M,SAASgQ,UAAY,SAAU,GACjDF,mCAAmCW,CAAa,IAElCD,EAAY3M,MACL,aAAlB,OAAO+E,SACRA,OAAO4H,CAAW,EAAEG,IAAI,IAAI,EAC5B/H,OAAO4H,CAAW,EAAEG,IAAI,EACxB/H,OAAO4H,CAAW,EAAE3e,GAAG,SAAU,SAAS/C,GAEtC,OADA2gB,kBAAkB3gB,EAAMoD,MAAM,EACvB,CAAA,CACX,CAAC,GAKrB,CAAC"}
|
1 |
+
{"version":3,"file":"apbct-public-bundle.min.js","sources":["apbct-public-bundle.js"],"sourcesContent":["class ApbctCore{\n\n ajax_parameters = {};\n rest_parameters = {};\n\n selector = null;\n elements = [];\n\n // Event properties\n eventCallback;\n eventSelector;\n event;\n\n /**\n * Default constructor\n */\n constructor(selector){\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param selector\n * @returns {*}\n */\n select(selector) {\n\n if(selector instanceof HTMLCollection){\n this.selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n }else if( typeof selector === 'object' ){\n this.selector = null;\n this.elements = [];\n this.elements[0] = selector;\n }else if( typeof selector === 'string' ){\n this.selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n }else{\n this.deselect();\n }\n\n return this;\n }\n\n addElement(elemToAdd){\n if( typeof elemToAdd === 'object' ){\n this.elements.push(elemToAdd);\n }else if( typeof elemToAdd === 'string' ){\n this.selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n }else{\n this.deselect();\n }\n }\n\n push(elem){\n this.elements.push(elem);\n }\n\n reduce(){\n this.elements = this.elements.slice(0,-1);\n }\n\n deselect(){\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param style\n * @param getRaw\n *\n * @returns {boolean|*}\n */\n css(style, getRaw){\n\n getRaw = getRaw | false;\n\n // Set style\n if(typeof style === \"object\"){\n\n const stringToCamelCase = str =>\n str.replace(/([-_][a-z])/g, group =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', '')\n );\n\n // Apply multiple styles\n for(let style_name in style){\n let DOM_style_name = stringToCamelCase(style_name);\n\n // Apply to multiple elements (currently selected)\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].style[DOM_style_name] = style[style_name];\n }\n }\n\n return this;\n }\n\n // Get style of first currently selected element\n if(typeof style === 'string'){\n\n let computedStyle = getComputedStyle(this.elements[0])[style];\n\n // Process\n if( typeof computedStyle !== 'undefined' && ! getRaw){\n computedStyle = computedStyle.replace(/(\\d)(em|pt|%|px){1,2}$/, '$1'); // Cut of units\n computedStyle = Number(computedStyle) == computedStyle ? Number(computedStyle) : computedStyle; // Cast to INT\n return computedStyle;\n }\n\n // Return unprocessed\n return computedStyle;\n }\n }\n\n hide(){\n this.prop('prev-display', this.css('display'));\n this.css({'display': 'none'});\n }\n\n show(){\n this.css({'display': this.prop('prev-display')});\n }\n\n addClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.add(className);\n }\n }\n\n removeClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.remove(className);\n }\n }\n\n toggleClass(className){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.toggle(className);\n }\n }\n\n /**\n * Wrapper for apbctAJAX class\n *\n * @param ajax_parameters\n * @returns {ApbctAjax}\n */\n ajax(ajax_parameters){\n this.ajax_parameters = ajax_parameters;\n return new ApbctAjax(ajax_parameters);\n }\n\n /**\n * Wrapper for apbctREST class\n *\n * @param rest_parameters\n * @returns {ApbctRest}\n */\n rest(rest_parameters){\n this.rest_parameters = rest_parameters;\n return new ApbctRest(rest_parameters);\n }\n\n /************** EVENTS **************/\n\n /**\n *\n * Why the mess with arguments?\n *\n * Because we need to support the following function signatures:\n * on('click', function(){ alert('some'); });\n * on('click', 'inner_selector', function(){ alert('some'); });\n *\n * @param args\n */\n on(...args){\n\n this.event = args[0];\n this.eventCallback = args[2] || args[1];\n this.eventSelector = typeof args[1] === \"string\" ? args[1] : null;\n\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].addEventListener(\n this.event,\n this.eventSelector !== null\n ? this.onChecker.bind(this)\n : this.eventCallback\n );\n }\n }\n\n /**\n * Check if a selector of an event matches current target\n *\n * @param event\n * @returns {*}\n */\n onChecker(event){\n if(event.target === document.querySelector(this.eventSelector)){\n event.stopPropagation();\n return this.eventCallback(event);\n }\n }\n\n ready(callback){\n document.addEventListener('DOMContentLoaded', callback);\n }\n\n change(callback){\n this.on('change', callback);\n }\n\n /************** ATTRIBUTES **************/\n\n /**\n * Get an attribute or property of an element\n *\n * @param attrName\n * @returns {*|*[]}\n */\n attr(attrName){\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n\n // Use property instead of attribute if possible\n if(typeof this.elements[i][attrName] !== undefined){\n outputValue.push(this.elements[i][attrName]);\n }else{\n outputValue.push(this.elements[i].getAttribute(attrName));\n }\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n\n prop(propName, value){\n\n // Setting values\n if(typeof value !== \"undefined\"){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i][propName] = value;\n }\n\n return this;\n\n // Getting values\n }else{\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n outputValue.push(this.elements[i][propName]);\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n }\n\n /**\n * Set or get inner HTML\n *\n * @param value\n * @returns {*|*[]}\n */\n html(value){\n return typeof value !== 'undefined'\n ? this.prop('innerHTML', value)\n : this.prop('innerHTML');\n }\n\n /**\n * Set or get value of input tags\n *\n * @param value\n * @returns {*|*[]|undefined}\n */\n val(value){\n return typeof value !== 'undefined'\n ? this.prop('value', value)\n : this.prop('value');\n }\n\n data(name, value){\n return typeof value !== 'undefined'\n ? this.prop('apbct-data', name, value)\n : this.prop('apbct-data');\n }\n\n /************** END OF ATTRIBUTES **************/\n\n /************** FILTERS **************/\n\n /**\n * Check if the current elements are corresponding to filter\n *\n * @param filter\n * @returns {boolean}\n */\n is(filter){\n\n let outputValue = false;\n\n for(let elem of this.elements){\n outputValue ||= this.isElem(elem, filter);\n }\n\n return outputValue;\n }\n\n isElem(elemToCheck, filter){\n\n let is = false;\n let isRegisteredTagName = function(name){\n let newlyCreatedElement = document.createElement(name).constructor;\n return ! Boolean( ~[HTMLElement, HTMLUnknownElement].indexOf(newlyCreatedElement) );\n };\n\n // Check for filter function\n if(typeof filter === 'function') {\n is ||= filter.call(this, elemToCheck);\n }\n\n // Check for filter function\n if(typeof filter === 'string') {\n\n // Filter is tag name\n if( filter.match(/^[a-z]/) && isRegisteredTagName(filter) ){\n is ||= elemToCheck.tagName.toLowerCase() === filter.toLowerCase();\n\n // Filter is property\n }else if( filter.match(/^[a-z]/) ){\n is ||= Boolean(elemToCheck[filter]);\n\n // Filter is CSS selector\n }else {\n is ||= this.selector !== null\n ? document.querySelector(this.selector + filter) !== null // If possible\n : this.isWithoutSelector(elemToCheck, filter); // Search through all elems with such selector\n }\n }\n\n return is;\n }\n\n isWithoutSelector(elemToCheck, filter){\n\n let elems = document.querySelectorAll(filter);\n let outputValue = false;\n\n for(let elem of elems){\n outputValue ||= elemToCheck === elem;\n }\n\n return outputValue;\n }\n\n filter(filter){\n\n this.selector = null;\n\n for( let i = this.elements.length - 1; i >= 0; i-- ){\n if( ! this.isElem(this.elements[i], filter) ){\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /************** NODES **************/\n\n parent(filter){\n\n this.select(this.elements[0].parentElement);\n\n if( typeof filter !== 'undefined' && ! this.is(filter) ){\n this.deselect();\n }\n\n return this;\n }\n\n parents(filter){\n\n this.select(this.elements[0]);\n\n for ( ; this.elements[ this.elements.length - 1].parentElement !== null ; ) {\n this.push(this.elements[ this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0,1); // Deleting initial element from the set\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n children(filter){\n\n this.select(this.elements[0].children);\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n siblings(filter){\n\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /************** DOM MANIPULATIONS **************/\n remove(){\n for(let elem of this.elements){\n elem.remove();\n }\n }\n\n after(content){\n for(let elem of this.elements){\n elem.after(content);\n }\n }\n\n append(content){\n for(let elem of this.elements){\n elem.append(content);\n }\n }\n\n /************** ANIMATION **************/\n fadeIn(time) {\n for(let elem of this.elements){\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n fadeOut(time) {\n for(let elem of this.elements){\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * Enter point to ApbctCore class\n *\n * @param params\n * @returns {*}\n */\nfunction apbct(params){\n return new ApbctCore()\n .select(params);\n}\nclass ApbctXhr{\n\n xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n body = null;\n http_code = 0;\n status_text = '';\n\n constructor(parameters){\n\n console.log('%cXHR%c started', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n\n // Set class properties\n for( let key in parameters ){\n if( typeof this[key] !== 'undefined' ){\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if( ! this.url ){\n console.log('%cXHR%c not URL provided', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;')\n return false;\n }\n\n // Configure the request\n this.xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.xhr.responseType = this.responseType;\n this.xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.xhr.onreadystatechange = function(){\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.xhr.onload = function(){\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.xhr.onprogress = function(event){\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.xhr.onerror = function(){\n this.onError();\n }.bind(this);\n\n this.xhr.ontimeout = function(){\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.xhr.send(this.body);\n }\n\n prepare(){\n\n // Disable button\n if(this.button){\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n complete(){\n\n this.http_code = this.xhr.status;\n this.status_text = this.xhr.statusText;\n\n // Disable button\n if(this.button){\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n onReadyStateChange(){\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function'){\n this.on_ready_state_change();\n }\n }\n\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function'){\n this.on_progress();\n }\n }\n\n onError(){\n\n console.log('error');\n\n this.complete();\n this.error(\n this.http_code,\n this.status_text\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback(this.status_text);\n }\n }\n\n onTimeout(){\n this.complete();\n this.error(\n 0,\n 'timeout'\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback('Timeout');\n }\n }\n\n onLoad(){\n\n this.complete();\n\n if (this.responseType === 'json' ){\n if(this.xhr.response === null){\n this.error(this.http_code, this.status_text, 'No response');\n return false;\n }else if( typeof this.xhr.response.error !== 'undefined') {\n this.error(this.http_code, this.status_text, this.xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.xhr.response, this.data);\n }\n }\n\n error(http_code, status_text, additional_msg){\n\n let error_string = '';\n\n if( status_text === 'timeout' ){\n error_string += 'Server response timeout'\n\n }else if( http_code === 200 ){\n\n if( status_text === 'parsererror' ){\n error_string += 'Unexpected response from server. See console for details.';\n }else {\n error_string += 'Unexpected error. Status: ' + status_text + '.';\n if( typeof additional_msg !== 'undefined' )\n error_string += ' Additional error info: ' + additional_msg;\n }\n\n }else if(http_code === 500){\n error_string += 'Internal server error.';\n\n }else {\n error_string += 'Unexpected response code:' + http_code;\n }\n\n this.errorOutput( error_string );\n }\n\n errorOutput(error_msg){\n console.log( '%c ctXHR error: %c' + error_msg, 'color: red;', 'color: grey;' );\n }\n\n setHeaders(){\n // Set headers if passed\n for( let header_name in this.headers ){\n if( typeof this.headers[header_name] !== 'undefined' ){\n this.xhr.setRequestHeader(header_name, this.headers[header_name]);\n }\n }\n }\n\n convertData()\n {\n // GET, HEAD request-type\n if( ~this.methods_to_convert_data_to_URL.indexOf( this.method ) ){\n return this.convertDataToURL();\n\n // POST request-type\n }else{\n return this.convertDataToBody()\n }\n }\n\n convertDataToURL(){\n let params_appendix = new URLSearchParams(this.data).toString();\n let params_prefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += params_prefix + params_appendix;\n\n return this.url;\n }\n\n /**\n *\n * @returns {null}\n */\n convertDataToBody()\n {\n this.body = new FormData();\n\n for (let dataKey in this.data) {\n this.body.append(\n dataKey,\n typeof this.data[dataKey] === 'object'\n ? JSON.stringify(this.data[dataKey])\n : this.data[dataKey]\n );\n }\n\n return this.body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\n deleteDoubleJSONEncoding(object){\n\n if( typeof object === 'object'){\n\n for (let objectKey in object) {\n\n // Recursion\n if( typeof object[objectKey] === 'object'){\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if(\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ){\n let parsedValue = JSON.parse(object[objectKey]);\n if( typeof parsedValue === 'object' ){\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n }\n}\nclass ApbctAjax extends ApbctXhr{\n\n constructor(...args) {\n super(args[0]);\n }\n}\nclass ApbctRest extends ApbctXhr{\n\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n constructor(...args) {\n args = args[0];\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n \"X-WP-Nonce\": ctPublicFunctions._rest_nonce\n };\n super(args);\n }\n}\n\nfunction ctSetCookie( cookies, value, expires ){\n\n let force_alternative_method_for_cookies = [\n 'ct_sfw_pass_key',\n 'ct_sfw_passed',\n 'wordpress_apbct_antibot',\n 'apbct_anticrawler_passed',\n 'apbct_antiflood_passed'\n ]\n\n if( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){\n var skip_alt = cookies === 'ct_pointer_data';\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n let forced_alt_cookies_set = []\n cookies.forEach( function (item, i, arr\t) {\n if (force_alternative_method_for_cookies.indexOf(item[0]) !== -1) {\n forced_alt_cookies_set.push(item)\n } else {\n apbctLocalStorage.set(item[0], encodeURIComponent(item[1]))\n }\n });\n if ( forced_alt_cookies_set.length > 0 ){\n ctSetAlternativeCookie(forced_alt_cookies_set)\n }\n ctNoCookieAttachHiddenFieldsToForms()\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n cookies.forEach( function (item, i, arr\t) {\n var expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix + item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' && ! skip_alt ) {\n ctSetAlternativeCookie(cookies)\n }\n}\n\nfunction ctSetAlternativeCookie(cookies){\n if (typeof (getJavascriptClientData) === \"function\"){\n //reprocess already gained cookies data\n cookies = getJavascriptClientData(cookies);\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded')\n }\n\n try {\n JSON.parse(cookies)\n } catch (e){\n console.log('APBCT ERROR: JSON parse error:' + e)\n return\n }\n\n // Using REST API handler\n if( ctPublicFunctions.data__ajax_type === 'rest' ){\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: { cookies: cookies }\n }\n );\n\n // Using AJAX request and handler\n } else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n }\n );\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n return;\n\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + \"=\\\"\\\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax\" + ctSecure;\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' ){\n // @ToDo implement this logic\n }\n}\n\nfunction apbct_public_sendAJAX(data, params, obj){\n\n // Default params\n let _params = [];\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"callback_context\"] = params.callback_context || null;\n _params[\"callback_params\"] = params.callback_params || null;\n _params[\"async\"] = params.async || true;\n _params[\"notJson\"] = params.notJson || null;\n _params[\"timeout\"] = params.timeout || 15000;\n _params[\"obj\"] = obj || null;\n _params[\"button\"] = params.button || null;\n _params[\"progressbar\"] = params.progressbar || null;\n _params[\"silent\"] = params.silent || null;\n _params[\"no_nonce\"] = params.no_nonce || null;\n _params[\"data\"] = data;\n _params[\"url\"] = ctPublicFunctions._ajax_url;\n\n if(typeof (data) === 'string') {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"] = _params[\"data\"] + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"] = _params[\"data\"] + '&no_cache=' + Math.random()\n } else {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"]._ajax_nonce = ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n let _params = [];\n _params[\"route\"] = route;\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"data\"] = params.data || [];\n _params[\"method\"] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\nlet apbctLocalStorage = {\n get : function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n return json.hasOwnProperty(property) ? JSON.parse(json[property]) : json;\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set : function(key, value, is_json = true) {\n if (is_json){\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive : function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet : function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete : function (key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData : function () {\n let data = {}\n for(let i=0; i<localStorage.length; i++) {\n let key = localStorage.key(i);\n if (key.indexOf('ct_') !==-1 || key.indexOf('apbct_') !==-1){\n data[key.toString()] = apbctLocalStorage.get(key)\n }\n }\n return data\n },\n\n}\nvar ct_date = new Date(),\n\tctTimeMs = new Date().getTime(),\n\tctMouseEventTimerFlag = true, //Reading interval flag\n\tctMouseData = [],\n\tctMouseDataCounter = 0,\n\tctCheckedEmails = {};\n\nfunction apbct_attach_event_handler(elem, event, callback){\n\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\telse elem.attachEvent(event, callback);\n}\n\nfunction apbct_remove_event_handler(elem, event, callback){\n\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\telse elem.detachEvent(event, callback);\n}\n\n//Writing first key press timestamp\nvar ctFunctionFirstKey = function output(event){\n\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\tctKeyStopStopListening();\n};\n\nif (ctPublic.data__key_is_ok) {\n\t//Reading interval\n\tvar ctMouseReadInterval = setInterval(function(){\n\t\tctMouseEventTimerFlag = true;\n\t}, 150);\n\n\t//Writting interval\n\tvar ctMouseWriteDataInterval = setInterval(function(){\n\t\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n\t}, 1200);\n}\n\n\n//Logging mouse position each 150 ms\nvar ctFunctionMouseMove = function output(event){\n\tctSetMouseMoved();\n\tif(ctMouseEventTimerFlag === true){\n\n\t\tctMouseData.push([\n\t\t\tMath.round(event.clientY),\n\t\t\tMath.round(event.clientX),\n\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t]);\n\n\t\tctMouseDataCounter++;\n\t\tctMouseEventTimerFlag = false;\n\t\tif(ctMouseDataCounter >= 50){\n\t\t\tctMouseStopData();\n\t\t}\n\t}\n};\n\n//Stop mouse observing function\nfunction ctMouseStopData(){\n\tapbct_remove_event_handler(document, \"mousemove\", ctFunctionMouseMove);\n\tclearInterval(ctMouseReadInterval);\n\tclearInterval(ctMouseWriteDataInterval);\n}\n\n//Stop key listening function\nfunction ctKeyStopStopListening(){\n\tapbct_remove_event_handler(document, \"mousedown\", ctFunctionFirstKey);\n\tapbct_remove_event_handler(document, \"keydown\", ctFunctionFirstKey);\n}\n\nfunction checkEmail(e) {\n\tvar current_email = e.target.value;\n\tif (current_email && !(current_email in ctCheckedEmails)) {\n\t\t// Using REST API handler\n\t\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\t\tapbct_public_sendREST(\n\t\t\t\t'check_email_before_post',\n\t\t\t\t{\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {'email' : current_email},\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t\t// Using AJAX request and handler\n\t\t} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n\t\t\tapbct_public_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\temail : current_email,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction ctSetPixelImg(pixelUrl) {\n\tctSetCookie('apbct_pixel_url', pixelUrl);\n\tif( +ctPublic.pixel__enabled ){\n\t\tif( ! document.getElementById('apbct_pixel') ) {\n\t\t\tlet insertedImg = document.createElement('img');\n\t\t\tinsertedImg.setAttribute('alt', 'CleanTalk Pixel');\n\t\t\tinsertedImg.setAttribute('id', 'apbct_pixel');\n\t\t\tinsertedImg.setAttribute('style', 'display: none; left: 99999px;');\n\t\t\tinsertedImg.setAttribute('src', pixelUrl);\n\t\t\tapbct('body').append(insertedImg);\n\t\t}\n\t}\n}\n\nfunction ctGetPixelUrl() {\n\t// Check if pixel is already in localstorage and is not outdated\n\tlet local_storage_pixel_url = apbctLocalStorage.get('apbct_pixel_url');\n\tif ( local_storage_pixel_url !== false ) {\n\t\tif ( apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n\t\t\tapbctLocalStorage.delete('apbct_pixel_url')\n\t\t} else {\n\t\t\t//if so - load pixel from localstorage and draw it skipping AJAX\n\t\t\tctSetPixelImg(local_storage_pixel_url);\n\t\t\treturn;\n\t\t}\n\t}\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_get_pixel_url',\n\t\t\t{\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\t// Using AJAX request and handler\n\t}else{\n\t\tapbct_public_sendAJAX(\n\t\t\t{\n\t\t\t\taction: 'apbct_get_pixel_url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction ctSetHasScrolled() {\n\tif( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n\t\tctSetCookie(\"ct_has_scrolled\", 'true');\n\t\tapbctLocalStorage.set('ct_has_scrolled', true);\n\t}\n}\n\nfunction ctSetMouseMoved() {\n\tif( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n\t\tctSetCookie(\"ct_mouse_moved\", 'true');\n\t\tapbctLocalStorage.set('ct_mouse_moved', true);\n\t}\n}\n\nfunction ctPreloadLocalStorage(){\n\tif (ctPublic.data__to_local_storage){\n\t\tlet data = Object.entries(ctPublic.data__to_local_storage)\n\t\tdata.forEach(([key, value]) => {\n\t\t\tapbctLocalStorage.set(key,value)\n\t\t});\n\t}\n}\n\nif (ctPublic.data__key_is_ok) {\n\tapbct_attach_event_handler(document, \"mousemove\", ctFunctionMouseMove);\n\tapbct_attach_event_handler(document, \"mousedown\", ctFunctionFirstKey);\n\tapbct_attach_event_handler(document, \"keydown\", ctFunctionFirstKey);\n\tapbct_attach_event_handler(document, \"scroll\", ctSetHasScrolled);\n}\n\n// Ready function\nfunction apbct_ready(){\n\n\tctPreloadLocalStorage()\n\n\tlet cookiesType = apbctLocalStorage.get('ct_cookies_type');\n\tif ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n\t\tapbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n\t\tapbctLocalStorage.delete('ct_mouse_moved');\n\t\tapbctLocalStorage.delete('ct_has_scrolled');\n\t}\n\n\t// Collect scrolling info\n\tvar initCookies = [\n\t\t[\"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000)],\n\t\t[\"ct_fkp_timestamp\", \"0\"],\n\t\t[\"ct_pointer_data\", \"0\"],\n\t\t[\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t[\"ct_screen_info\", apbctGetScreenInfo()],\n\t\t[\"apbct_headless\", navigator.webdriver],\n\t];\n\n\tapbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n\tapbctLocalStorage.set('ct_fkp_timestamp', \"0\");\n\tapbctLocalStorage.set('ct_pointer_data', \"0\");\n\tapbctLocalStorage.set('ct_timezone', ct_date.getTimezoneOffset()/60*(-1) );\n\tapbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n\tapbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n\tif( ctPublic.data__cookies_type !== 'native' ) {\n\t\tinitCookies.push(['apbct_visible_fields', '0']);\n\t} else {\n\t\t// Delete all visible fields cookies on load the page\n\t\tvar cookiesArray = document.cookie.split(\";\");\n\t\tif( cookiesArray.length !== 0 ) {\n\t\t\tfor ( var i = 0; i < cookiesArray.length; i++ ) {\n\t\t\t\tvar currentCookie = cookiesArray[i].trim();\n\t\t\t\tvar cookieName = currentCookie.split(\"=\")[0];\n\t\t\t\tif( cookieName.indexOf(\"apbct_visible_fields_\") === 0 ) {\n\t\t\t\t\tctDeleteCookie(cookieName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif( +ctPublic.pixel__setting ){\n\t\tif( +ctPublic.pixel__enabled ){\n\t\t\tctGetPixelUrl()\n\t\t} else {\n\t\t\tinitCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n\t\t}\n\t}\n\n\tif ( +ctPublic.data__email_check_before_post) {\n\t\tinitCookies.push(['ct_checked_emails', '0']);\n\t\tapbct(\"input[type = 'email'], #email\").on('blur', checkEmail);\n\t}\n\n\tif (apbctLocalStorage.isSet('ct_checkjs')) {\n\t\tinitCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n\t} else {\n\t\tinitCookies.push(['ct_checkjs', 0]);\n\t}\n\n\tctSetCookie(initCookies);\n\n\tsetTimeout(function(){\n\n\t\tctNoCookieAttachHiddenFieldsToForms()\n\n\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\tvar form = document.forms[i];\n\n\t\t\t//Exclusion for forms\n\t\t\tif (\n\t\t\t\t+ctPublic.data__visible_fields_required === 0 ||\n\t\t\t\tform.method.toString().toLowerCase() === 'get' ||\n\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t(form.id && form.id === 'caspioform') || //Caspio Form\n\t\t\t\t(form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t(form.classList && form.classList.contains('give-form')) || // GiveWP\n\t\t\t\t(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password\n\t\t\t\t(form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n\t\t\t\t(form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n\t\t\t\t(form.id && form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\t(form.name && form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\tform.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n\t\t\t\t(form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) // The Events Calendar\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar hiddenInput = document.createElement( 'input' );\n\t\t\thiddenInput.setAttribute( 'type', 'hidden' );\n\t\t\thiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n\t\t\thiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n\t\t\tvar visibleFieldsToInput = {};\n\t\t\tvisibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n\t\t\thiddenInput.value = btoa(JSON.stringify(visibleFieldsToInput));\n\t\t\tform.append( hiddenInput );\n\n\t\t\tform.onsubmit_prev = form.onsubmit;\n\n\t\t\tform.ctFormIndex = i;\n\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\tif ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );\n\t\t\t\t}\n\n\t\t\t\t// Call previous submit action\n\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t}, 1000);\n\n\t// Listen clicks on encoded emails\n\tlet decodedEmailNodes = document.querySelectorAll(\"[data-original-string]\");\n\tif (decodedEmailNodes.length) {\n\t\tfor (let i = 0; i < decodedEmailNodes.length; ++i) {\n\t\t\tif (\n\t\t\t\tdecodedEmailNodes[i].parentElement.href ||\n\t\t\t\tdecodedEmailNodes[i].parentElement.parentElement.href\n\t\t\t) {\n\t\t\t\t// Skip listening click on hyperlinks\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdecodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n\t\t}\n\t}\n}\nif (ctPublic.data__key_is_ok) {\n\tif (document.readyState !== 'loading') {\n\t\tapbct_ready();\n\t} else {\n\t\tapbct_attach_event_handler(document, \"DOMContentLoaded\", apbct_ready);\n\t}\n}\n\nfunction ctFillDecodedEmailHandler(event) {\n\tthis.removeEventListener('click', ctFillDecodedEmailHandler);\n\tapbctAjaxEmailDecode(event, this);\n}\n\nfunction apbctAjaxEmailDecode(event, baseElement){\n\tconst element = event.target;\n\tconst javascriptClientData = getJavascriptClientData();\n\tlet data = {\n\t\tevent_javascript_data: javascriptClientData,\n\t\tpost_url: document.location.href,\n\t\treferrer: document.referrer,\n\t};\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tevent.preventDefault();\n\t}\n\n\telement.setAttribute('title', ctPublicFunctions.text__wait_for_decoding);\n\telement.style.cursor = 'progress';\n\n\t// Adding a tooltip\n\tlet apbctTooltip = document.createElement('div');\n\tapbctTooltip.setAttribute('class', 'apbct-tooltip');\n\tlet apbctTooltipText = document.createElement('div');\n\tapbctTooltipText.setAttribute('class', 'apbct-tooltip--text');\n\tlet apbctTooltipArrow = document.createElement('div');\n\tapbctTooltipArrow.setAttribute('class', 'apbct-tooltip--arrow');\n\tapbct(element).append(apbctTooltip);\n\tapbct(apbctTooltip).append(apbctTooltipText);\n\tapbct(apbctTooltip).append(apbctTooltipArrow);\n\tctShowDecodeComment(element, ctPublicFunctions.text__wait_for_decoding);\n\n\tlet encodedEmail = event.target.dataset.originalString;\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tencodedEmail = baseElement.dataset.originalString;\n\t}\n\n\tdata.encodedEmail = encodedEmail;\n\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_decode_email',\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function(result) {\n\t\t\t\t\tapbctEmailEncoderCallback(result, baseElement, element);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\n\t// Using AJAX request and handler\n\t}else{\n\t\tdata.action = 'apbct_decode_email';\n\t\tapbct_public_sendAJAX(\n\t\t\tdata,\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result) {\n\t\t\t\t\tapbctEmailEncoderCallback(result, baseElement, element);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction apbctEmailEncoderCallback(result, baseElement, element) {\n\tif (result.success) {\n\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\tbaseElement.click();\n\t\t} else {\n\t\t\tsetTimeout(function(){\n\t\t\t\tctProcessDecodedDataResult(result.data, element);\n\t\t\t}, 3000);\n\t\t}\n\t} else {\n\t\telement.removeAttribute('style');\n\t\tctShowDecodeComment(element, result.data.comment);\n\t}\n}\n\nfunction getJavascriptClientData(common_cookies = []) {\n\tlet resultDataJson = {};\n\n\tresultDataJson.apbct_headless = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\tresultDataJson.apbct_pixel_url = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n\tresultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n\tresultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n\tresultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n\tresultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n\tresultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n\tresultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n\tresultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n\t// collecting data from localstorage\n\tconst ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\t// collecting data from cookies\n\tconst ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\tresultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ? ctMouseMovedLocalStorage : ctMouseMovedCookie;\n\tresultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ? ctHasScrolledLocalStorage : ctHasScrolledCookie;\n\tresultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ? ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n\n\tif (\n\t\ttypeof (common_cookies) === \"object\"\n\t\t&& common_cookies !== []\n\t){\n\t\tfor (let i = 0; i < common_cookies.length; ++i){\n\t\t\tif ( typeof (common_cookies[i][1]) === \"object\" ){\n\t\t\t\t//this is for handle SFW cookies\n\t\t\t\tresultDataJson[common_cookies[i][1][0]] = common_cookies[i][1][1]\n\t\t\t} else {\n\t\t\t\tresultDataJson[common_cookies[i][0]] = common_cookies[i][1]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconsole.log('APBCT JS ERROR: Collecting data type mismatch')\n\t}\n\n\t// Parse JSON properties to prevent double JSON encoding\n\tresultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\treturn JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\nfunction removeDoubleJsonEncoding(object){\n\n\tif( typeof object === 'object'){\n\n\t\tfor (let objectKey in object) {\n\n\t\t\t// Recursion\n\t\t\tif( typeof object[objectKey] === 'object'){\n\t\t\t\tobject[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n\t\t\t}\n\n\t\t\t// Common case (out)\n\t\t\tif(\n\t\t\t\ttypeof object[objectKey] === 'string' &&\n\t\t\t\tobject[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n\t\t\t){\n\t\t\t\tlet parsedValue = JSON.parse(object[objectKey]);\n\t\t\t\tif( typeof parsedValue === 'object' ){\n\t\t\t\t\tobject[objectKey] = parsedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction ctProcessDecodedDataResult(response, targetElement) {\n\n\ttargetElement.setAttribute('title', '');\n\ttargetElement.removeAttribute('style');\n\n\tif( !! response.is_allowed) {\n\t\tctFillDecodedEmail(targetElement, response.decoded_email);\n\t}\n\n\tif( !! response.show_comment ){\n\t\tctShowDecodeComment(targetElement, response.comment);\n\t}\n}\n\nfunction ctFillDecodedEmail(target, email){\n\tapbct(target).html(\n\t\tapbct(target)\n\t\t\t.html()\n\t\t\t.replace(/.+?(<div class=[\"']apbct-tooltip[\"'].+?<\\/div>)/, email + \"$1\")\n\t);\n}\n\nfunction ctShowDecodeComment(target, comment){\n\n\tif( ! comment ){\n\t\treturn;\n\t}\n\n\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeIn(300);\n\tapbct(target.getElementsByClassName('apbct-tooltip--text')).html(comment);\n\tsetTimeout(function(){\n\t\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t}, 5000);\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_invisible = '',\n\t\tinputs_invisible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter already added fields\n\t\tif( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){\n\t\t\treturn false;\n\t\t}\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\t// Unnecessary fields\n\t\tif(\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\telem.getAttribute('name') === null ||\n\t\t\telem.getAttribute('name') === 'ct_checkjs'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t// Invisible fields\n\t\tif(\n\t\t\tgetComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" // type == hidden\n\t\t) {\n\t\t\tif( elem.classList.contains(\"wp-editor-area\") ) {\n\t\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_visible_count++;\n\t\t\t} else {\n\t\t\t\tinputs_invisible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_invisible_count++;\n\t\t\t}\n\t\t}\n\t\t// Visible fields\n\t\telse {\n\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\tinputs_visible_count++;\n\t\t}\n\n\t});\n\n\tinputs_invisible = inputs_invisible.trim();\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t\tinvisible_fields : inputs_invisible,\n\t\tinvisible_fields_count : inputs_invisible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tif( ctPublic.data__cookies_type === 'native' ) {\n\t\tfor ( var i in collection ) {\n\t\t\tif ( i > 10 ) {\n\t\t\t\t// Do not generate more than 10 cookies\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar collectionIndex = form_id !== undefined ? form_id : i;\n\t\t\tctSetCookie(\"apbct_visible_fields_\" + collectionIndex, JSON.stringify( collection[i] ) );\n\t\t}\n\t} else {\n\t\tif (ctPublic.data__cookies_type === 'none'){\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection[0] ) );\n\t\t} else {\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\t\t}\n\n\t}\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbctGetScreenInfo() {\n\treturn JSON.stringify({\n\t\tfullWidth : document.documentElement.scrollWidth,\n\t\tfullHeight : Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t),\n\t\tvisibleWidth : document.documentElement.clientWidth,\n\t\tvisibleHeight : document.documentElement.clientHeight,\n\t});\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\ttry {\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e.toString());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tctParseBlockMessage(response);\n\t\t}\n\t});\n}\n\nfunction ctParseBlockMessage(response) {\n\n\tif (typeof response.apbct !== 'undefined') {\n\t\tresponse = response.apbct;\n\t\tif (response.blocked) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\t// Show the result by modal\n\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\tcleantalkModal.open();\n\n\t\t\tif(+response.stop_script == 1)\n\t\t\t\twindow.stop();\n\t\t}\n\t}\n}\n\nfunction ctSetPixelUrlLocalstorage(ajax_pixel_url) {\n\t//set pixel to the storage\n\tctSetCookie('apbct_pixel_url', ajax_pixel_url)\n}\n\nfunction ctNoCookieConstructHiddenField(){\n\tlet field = ''\n\tlet no_cookie_data = apbctLocalStorage.getCleanTalkData()\n\tno_cookie_data = JSON.stringify(no_cookie_data)\n\tno_cookie_data = btoa(no_cookie_data)\n\tfield = document.createElement('input')\n\tfield.setAttribute('id','ct_no_cookie_hidden_field')\n\tfield.setAttribute('name','ct_no_cookie_hidden_field')\n\tfield.setAttribute('value', no_cookie_data)\n\tfield.setAttribute('type', 'hidden')\n\treturn field\n}\n\nfunction ctNoCookieGetForms(){\n\tlet forms = document.forms\n\tif (forms) {\n\t\treturn forms\n\t}\n\treturn false\n}\n\nfunction ctNoCookieAttachHiddenFieldsToForms(){\n\n\tif (ctPublic.data__cookies_type !== 'none'){\n\t\treturn\n\t}\n\n\tlet forms = ctNoCookieGetForms()\n\n\tif (forms){\n\t\t//clear previous hidden set\n\t\tlet elements = document.getElementsByName('ct_no_cookie_hidden_field')\n\t\tif (elements){\n\t\t\tfor (let j = 0; j < elements.length; j++) {\n\t\t\t\telements[j].parentNode.removeChild(elements[j])\n\t\t\t}\n\t\t}\n\t\tfor ( let i = 0; i < forms.length; i++ ){\n\t\t\t//ignore forms with get method @todo We need to think about this\n\t\t\tif (document.forms[i].getAttribute('method') === null ||\n\t\t\t\tdocument.forms[i].getAttribute('method').toLowerCase() === 'post'){\n\t\t\t\t// add new set\n\t\t\t\tdocument.forms[i].append(ctNoCookieConstructHiddenField())\n\t\t\t}\n\t\t}\n\t}\n\n}\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( let key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\nlet buttons_to_handle = [];\n\ndocument.addEventListener('DOMContentLoaded', function(){\n\n\tif(\n\t\ttypeof ctPublicGDPR === 'undefined' ||\n\t\t! ctPublicGDPR.gdpr_forms.length\n\t) {\n\t\treturn;\n\t}\n\n\tlet gdpr_notice_for_button = ctPublicGDPR.gdpr_title;\n\n\tif ( typeof jQuery === 'undefined' ) {\n\t\treturn;\n\t}\n\ttry {\n\t\tctPublicGDPR.gdpr_forms.forEach(function(item, i){\n\n\t\t\tlet elem = jQuery('#'+item+', .'+item);\n\n\t\t\t// Filter forms\n\t\t\tif (!elem.is('form')){\n\t\t\t\t// Caldera\n\t\t\t\tif (elem.find('form')[0])\n\t\t\t\t\telem = elem.children('form').first();\n\t\t\t\t// Contact Form 7\n\t\t\t\telse if(\n\t\t\t\t\tjQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]')\n\t\t\t\t\t\t.attr('id')\n\t\t\t\t\t\t.indexOf('wpcf7-f'+item) !== -1\n\t\t\t\t) {\n\t\t\t\t\telem = jQuery('.wpcf7[role=form]').children('form');\n\t\t\t\t}\n\n\t\t\t\t// Formidable\n\t\t\t\telse if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)\n\t\t\t\t\telem = jQuery('.frm_forms').first().children('form');\n\t\t\t\t// WPForms\n\t\t\t\telse if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)\n\t\t\t\t\telem = jQuery('.wpforms-form');\n\t\t\t}\n\n\t\t\t//disable forms buttons\n\t\t\tlet button = false\n\t\t\tlet buttons_collection= elem.find('input[type|=\"submit\"],button[type|=\"submit\"]')\n\n\t\t\tif (!buttons_collection.length) {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tbutton = buttons_collection[0]\n\t\t\t}\n\n\t\t\tif (button !== false){\n\t\t\t\tbutton.disabled = true\n\t\t\t\tlet old_notice = jQuery(button).prop('title') ? jQuery(button).prop('title') : ''\n\t\t\t\tbuttons_to_handle.push({index:i,button:button,old_notice:old_notice})\n\t\t\t\tjQuery(button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\n\t\t\t// Adding notice and checkbox\n\t\t\tif(elem.is('form') || elem.attr('role') === 'form'){\n\t\t\t\telem.append('<input id=\"apbct_gdpr_'+i+'\" type=\"checkbox\" required=\"required\" style=\" margin-right: 10px;\" onchange=\"apbct_gdpr_handle_buttons()\">')\n\t\t\t\t\t.append('<label style=\"display: inline;\" for=\"apbct_gdpr_'+i+'\">'+ctPublicGDPR.gdpr_text+'</label>');\n\t\t\t}\n\t\t});\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not add GDPR notice' + e)\n\t}\n});\n\nfunction apbct_gdpr_handle_buttons(){\n\n\ttry {\n\n\t\tif (buttons_to_handle === []){\n\t\t\treturn\n\t\t}\n\n\t\tbuttons_to_handle.forEach((button) => {\n\t\t\tlet selector = '[id=\"apbct_gdpr_' + button.index + '\"]'\n\t\t\tlet apbct_gdpr_item = jQuery(selector)\n\t\t\t//chek if apbct_gdpr checkbox is set\n\t\t\tif (jQuery(apbct_gdpr_item).prop(\"checked\")){\n\t\t\t\tbutton.button.disabled = false\n\t\t\t\tjQuery(button.button).prop('title', button.old_notice)\n\t\t\t} else {\n\t\t\t\tbutton.button.disabled = true\n\t\t\t\tjQuery(button.button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\t\t})\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not handle form buttons ' + e)\n\t}\n}\n/**\n * Handle external forms\n */\nfunction ct_protect_external() {\n for(var i = 0; i < document.forms.length; i++) {\n\n if (document.forms[i].cleantalk_hidden_action === undefined && document.forms[i].cleantalk_hidden_method === undefined) {\n\n // current form\n var currentForm = document.forms[i];\n\n if(typeof(currentForm.action) == 'string') {\n\n // Ajax checking for the integrated forms\n if(isIntegratedForm(currentForm)) {\n\n apbctProcessExternalForm(currentForm, i, document);\n\n // Common flow - modify form's action\n }else if(currentForm.action.indexOf('http://') !== -1 || currentForm.action.indexOf('https://') !== -1) {\n\n var tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n var host = tmp[0].toLowerCase();\n\n if(host !== location.hostname.toLowerCase()){\n\n var ct_action = document.createElement(\"input\");\n ct_action.name = 'cleantalk_hidden_action';\n ct_action.value = currentForm.action;\n ct_action.type = 'hidden';\n currentForm.appendChild(ct_action);\n\n var ct_method = document.createElement(\"input\");\n ct_method.name = 'cleantalk_hidden_method';\n ct_method.value = currentForm.method;\n ct_method.type = 'hidden';\n\n currentForm.method = 'POST'\n\n currentForm.appendChild(ct_method);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n\n }\n // Trying to process external form into an iframe\n apbctProcessIframes()\n}\n\nfunction formIsExclusion(currentForm)\n{\n let exclusions_by_id = [\n 'give-form' //give form exclusion because of direct integration\n ]\n\n let result = false\n\n //mewto forms exclusion\n if (currentForm.parentElement\n && currentForm.parentElement.classList.length > 0\n && currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1) {\n result = true\n }\n\n exclusions_by_id.forEach(function (id) {\n if ( typeof (currentForm.id) !== 'undefined' && currentForm.id.indexOf(id) !== -1 ) {\n result = true\n }\n })\n\n return result\n}\n\nfunction apbctProcessIframes()\n{\n const frames = document.getElementsByTagName('iframe');\n\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) {\n continue;\n }\n\n const iframeForms = frames[j].contentDocument.forms;\n\n if ( iframeForms.length === 0 ) {\n return;\n }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n let currentForm = iframeForms[y];\n\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n\n //process forms exclusions\n if ( formIsExclusion(currentForm)) {\n return\n }\n\n const cleantalk_placeholder = document.createElement(\"i\");\n cleantalk_placeholder.className = 'cleantalk_placeholder';\n cleantalk_placeholder.style = 'display: none';\n\n currentForm.parentElement.insertBefore(cleantalk_placeholder, currentForm);\n\n // Deleting form to prevent submit event\n let prev = currentForm.previousSibling,\n form_html = currentForm.outerHTML,\n form_original = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement(\"div\");\n placeholder.innerHTML = form_html;\n prev.after(placeholder.firstElementChild);\n\n var force_action = document.createElement(\"input\");\n force_action.name = 'action';\n force_action.value = 'cleantalk_force_ajax_check';\n force_action.type = 'hidden';\n\n let reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(force_action);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = form_original;\n\n // mailerlite integration - disable click on submit button\n let mailerlite_detected_class = false\n if (reUseCurrentForm.classList !== undefined) {\n //list there all the mailerlite classes\n let mailerlite_classes = ['newsletterform', 'ml-block-form']\n mailerlite_classes.forEach(function(mailerlite_class) {\n if (reUseCurrentForm.classList.contains(mailerlite_class)){\n mailerlite_detected_class = mailerlite_class\n }\n });\n }\n if ( mailerlite_detected_class ) {\n let mailerliteSubmitButton = jQuery('form.' + mailerlite_detected_class).find('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.click(function (event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n });\n }\n } else {\n documentObject.forms[iterator].onsubmit = function ( event ){\n event.preventDefault();\n\n //mautic integration\n if (documentObject.forms[iterator].id.indexOf('mauticform') !== -1) {\n let checkbox = jQuery(documentObject.forms[iterator]).find('input[id*=\"checkbox_rgpd\"]')\n if (checkbox.length > 0){\n if (checkbox.prop(\"checked\") === true){\n let placeholder = jQuery('.cleantalk_placeholder')\n if (placeholder.length > 0) {\n placeholder[0].setAttribute('mautic_hidden_gdpr_id', checkbox.prop(\"id\"))\n }\n }\n }\n }\n\n const prev = jQuery(event.currentTarget).prev();\n const form_original = jQuery(event.currentTarget).clone();\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n }\n}\n\nfunction apbct_replace_inputs_values_from_other_form( form_source, form_target ){\n\n var\tinputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),\n inputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );\n\n inputs_source.each( function( index, elem_source ){\n\n var source = jQuery( elem_source );\n\n inputs_target.each( function( index2, elem_target ){\n\n var target = jQuery( elem_target );\n\n if( elem_source.outerHTML === elem_target.outerHTML ){\n\n target.val( source.val() );\n }\n });\n });\n\n}\nwindow.onload = function () {\n\n if( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n if ( typeof jQuery === 'undefined' ) {\n return;\n }\n\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};\n\n/**\n * Checking the form integration\n */\nfunction isIntegratedForm(formObj) {\n var formAction = formObj.action;\n let formId = formObj.id;\n\n if(\n formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n ( formObj.firstChild.classList !== undefined && formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('webto.salesforce.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Sending Ajax for checking form data\n */\nfunction sendAjaxCheckingFormData(form, prev, formOriginal) {\n // Get visible fields and set cookie\n var visible_fields = {};\n visible_fields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visible_fields );\n\n var data = {};\n var elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ){\n\n if( result.apbct === undefined || ! +result.apbct.blocked ) {\n\n let form_new = jQuery(form).detach();\n let prev = form.apbctPrev;\n let formOriginal = form.apbctFormOriginal;\n let mautic_integration = false;\n\n apbct_replace_inputs_values_from_other_form(form_new, formOriginal);\n\n //mautic forms integration\n if (formOriginal.id.indexOf('mautic') !== -1) {\n mautic_integration = true\n }\n let placeholders = document.getElementsByClassName('cleantalk_placeholder')\n if (placeholders) {\n for (let i = 0; i < placeholders.length; i++) {\n let mautic_hidden_gdpr_id = placeholders[i].getAttribute(\"mautic_hidden_gdpr_id\")\n if (typeof(mautic_hidden_gdpr_id) !== 'undefined') {\n let mautic_gdpr_radio = jQuery(formOriginal).find('#' + mautic_hidden_gdpr_id)\n if (typeof(mautic_gdpr_radio) !== 'undefined') {\n mautic_gdpr_radio.prop(\"checked\", true);\n }\n }\n }\n }\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n jQuery(formOriginal).find('input[name=\"apbct_visible_fields\"]').remove();\n jQuery(formOriginal).find('input[value=\"cleantalk_force_ajax_check\"]').remove();\n\n\n //Common click event\n var subm_button = jQuery(formOriginal).find('button[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n if (mautic_integration) {\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n }\n return;\n }\n\n subm_button = jQuery(formOriginal).find('input[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // ConvertKit direct integration\n subm_button = jQuery(formOriginal).find('button[data-element=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // Paypal integration\n subm_button = jQuery(formOriginal).find('input[type=\"image\"][name=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n }\n\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n }\n }\n );\n}\n\nfunction ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n //AJAX Request\n apbct_public_sendAJAX(\n ct_data,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function (data) {\n if(data.success === true){\n currForm.submit();\n }else{\n alert(data.data);\n return false;\n }\n }\n }\n );\n}\n\ndocument.addEventListener('DOMContentLoaded',function(){\n let ct_currAction = '',\n ct_currForm = '';\n\n if( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n let ctPrevHandler;\n\tfor( let i=0; i<document.forms.length; i++ ){\n\t\tif ( typeof(document.forms[i].action) == 'string' ){\n ct_currForm = document.forms[i];\n\t\t\tct_currAction = ct_currForm.action;\n if (\n ct_currAction.indexOf('https?://') !== null && // The protocol is obligatory\n ct_currAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ct_check_internal__is_exclude_form(ct_currAction) // Exclude WordPress native scripts from processing\n ) {\n ctPrevHandler = ct_currForm.click;\n if ( typeof jQuery !== 'undefined' ) {\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(event){\n ct_check_internal(event.target);\n return false;\n });\n }\n }\n\t\t}\n\t}\n});\n\n/**\n * Check by action to exclude the form checking\n * @param action string\n * @return boolean\n */\nfunction ct_check_internal__is_exclude_form(action) {\n // An array contains forms action need to be excluded.\n let ct_internal_script_exclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ct_internal_script_exclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}"],"names":["ApbctCore","ajax_parameters","rest_parameters","selector","elements","eventCallback","eventSelector","event","constructor","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","deselect","addElement","elemToAdd","push","elem","reduce","css","style","getRaw","let","style_name","DOM_style_name","replace","group","toUpperCase","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ApbctAjax","rest","ApbctRest","on","args","addEventListener","onChecker","bind","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","propName","value","html","val","data","name","is","filter","isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","apbct","params","ApbctXhr","xhr","XMLHttpRequest","method","url","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","methods_to_convert_data_to_URL","body","http_code","status_text","parameters","key","console","log","prepare","Object","keys","deleteDoubleJSONEncoding","convertData","open","setHeaders","onreadystatechange","onReadyStateChange","onload","onLoad","onprogress","onProgress","onerror","onError","ontimeout","onTimeout","send","setAttribute","cursor","complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","error","response","additional_msg","error_string","errorOutput","error_msg","header_name","setRequestHeader","convertDataToURL","convertDataToBody","params_appendix","URLSearchParams","toString","params_prefix","dataKey","FormData","JSON","stringify","object","objectKey","parsedValue","parse","super","default_route","ctPublicFunctions","_rest_url","route","X-WP-Nonce","_rest_nonce","ctSetCookie","cookies","expires","force_alternative_method_for_cookies","skip_alt","data__cookies_type","forced_alt_cookies_set","forEach","item","arr","apbctLocalStorage","set","encodeURIComponent","ctSetAlternativeCookie","ctNoCookieAttachHiddenFieldsToForms","ctSecure","location","protocol","cookie","cookiePrefix","getJavascriptClientData","e","data__ajax_type","apbct_public_sendREST","apbct_public_sendAJAX","action","notJson","ctGetCookie","matches","RegExp","decodeURIComponent","undefined","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","_ajax_nonce","Math","random","no_cache","get","property","storageValue","localStorage","getItem","json","hasOwnProperty","is_json","objToSave","timestamp","floor","getTime","setItem","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","ct_date","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","apbct_attach_event_handler","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctMouseReadInterval","ctMouseWriteDataInterval","ctFunctionFirstKey","ctKeyStopStopListening","ctFunctionMouseMove","ctPublic","data__key_is_ok","setInterval","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","clearInterval","checkEmail","current_email","email","result","now","ctSetPixelImg","pixelUrl","insertedImg","pixel__enabled","getElementById","ctGetPixelUrl","local_storage_pixel_url","ctSetHasScrolled","ctPreloadLocalStorage","data__to_local_storage","entries","apbct_ready","cookiesType","initCookies","getTimezoneOffset","apbctGetScreenInfo","navigator","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","forms","hiddenInput","visibleFieldsToInput","form","data__visible_fields_required","contains","id","apbct_collect_visible_fields","btoa","onsubmit_prev","onsubmit","ctFormIndex","visible_fields","apbct_visible_fields_set_cookie","Function","decodedEmailNodes","href","ctFillDecodedEmailHandler","apbctAjaxEmailDecode","baseElement","element","event_javascript_data","post_url","referrer","apbctTooltip","preventDefault","text__wait_for_decoding","apbctTooltipText","apbctTooltipArrow","ctShowDecodeComment","encodedEmail","dataset","originalString","apbctEmailEncoderCallback","res","baseElementContent","success","innerHTML","decoded_email","click","ctProcessDecodedDataResult","comment","common_cookies","resultDataJson","apbct_headless","apbct_pixel_url","ct_checked_emails","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","removeDoubleJsonEncoding","targetElement","is_allowed","ctFillDecodedEmail","show_comment","getElementsByClassName","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","isNaN","getAttribute","visibility","visible_fields_count","invisible_fields","invisible_fields_count","visible_fields_collection","form_id","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","ctParseBlockMessage","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajax_pixel_url","ctNoCookieConstructHiddenField","field","no_cookie_data","ctNoCookieGetForms","getElementsByName","j","parentNode","removeChild","readyState","jQuery","ajaxComplete","settings","responseText","loading","opened","opening","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","top","left","width","height","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","right","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","buttons_to_handle","apbct_gdpr_handle_buttons","index","apbct_gdpr_item","disabled","old_notice","gdpr_notice_for_button","info","ct_protect_external","currentForm","ct_method","cleantalk_hidden_action","cleantalk_hidden_method","isIntegratedForm","apbctProcessExternalForm","hostname","ct_action","type","appendChild","apbctProcessIframes","formIsExclusion","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalk_placeholder","prev","insertBefore","previousSibling","form_html","outerHTML","form_original","placeholder","force_action","firstElementChild","reUseCurrentForm","mailerlite_detected_class","apbctPrev","apbctFormOriginal","mailerlite_class","mailerliteSubmitButton","find","sendAjaxCheckingFormData","currentTarget","checkbox","clone","apbct_replace_inputs_values_from_other_form","form_source","form_target","inputs_source","inputs_target","each","elem_source","source","index2","elem_target","formObj","formAction","formId","firstChild","formOriginal","elems","form_new","detach","mautic_integration","placeholders","mautic_hidden_gdpr_id","mautic_gdpr_radio","subm_button","ct_check_internal","currForm","ct_data","alert","submit","ct_check_internal__is_exclude_form","some","blog_home","ctPublicGDPR","gdpr_forms","gdpr_title","first","buttons_collection","gdpr_text","settings__forms__check_external","ct_currForm","ct_currAction","settings__forms__check_internal","off"],"mappings":"MAAMA,UAEFC,gBAAkB,GAClBC,gBAAkB,GAElBC,SAAW,KACXC,SAAW,GAGXC,cACAC,cACAC,MAKAC,YAAYL,GACRM,KAAKC,OAAOP,CAAQ,CACxB,CAQAO,OAAOP,GAkBH,OAhBGA,aAAoBQ,gBACnBF,KAAKN,SAAc,KACnBM,KAAKL,SAAc,GACnBK,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKZ,CAAQ,GACzB,UAApB,OAAOA,GACbM,KAAKN,SAAc,KACnBM,KAAKL,SAAc,GACnBK,KAAKL,SAAS,GAAKD,GACO,UAApB,OAAOA,GACbM,KAAKN,SAAWA,EAChBM,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBd,CAAQ,CAAC,GAG9EM,KAAKS,SAAS,EAGXT,IACX,CAEAU,WAAWC,GACkB,UAArB,OAAOA,EACPX,KAAKL,SAASiB,KAAKD,CAAS,EACD,UAArB,OAAOA,GACbX,KAAKN,SAAWiB,EAChBX,KAAKL,SAAWQ,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBG,CAAS,CAAC,GAE/EX,KAAKS,SAAS,CAEtB,CAEAG,KAAKC,GACDb,KAAKL,SAASiB,KAAKC,CAAI,CAC3B,CAEAC,SACId,KAAKL,SAAWK,KAAKL,SAASU,MAAM,EAAE,CAAC,CAAC,CAC5C,CAEAI,WACIT,KAAKL,SAAW,EACpB,CAUAoB,IAAIC,EAAOC,GAKP,GAHAA,GAAkB,CAAA,EAGE,UAAjB,OAAOD,EAAmB,CAWzB,IAAIE,IAAIC,KAAcH,EAAM,CACxBE,IAAIE,EAAmCD,EATnCE,QAAQ,eAAgBC,GACxBA,EACKC,YAAY,EACZF,QAAQ,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K,UAAU,UAAU,EAEtG,CAAC,CAGF,CAFE,MAAOnV,GACR9E,QAAQmV,KAAK,+CAAiDrQ,CAAC,CAChE,CA3DA,CA4DD,CAAC,EAsOD1G,OAAOuC,OAAS,WAEN,CAAC8H,SAASyR,iCAIO,aAAlB,OAAO7H,QAIZ/T,WAAW,WACP8W,oBAAoB,CACxB,EAAG,IAAI,CACX,EAoKAxc,SAASwC,iBAAiB,mBAAmB,WACzC7B,IACI4gB,EADAC,EAAgB,GAGpB,GAAM,CAAC3R,SAAS4R,gCAKnB,IAAK9gB,IAAIM,EAAE,EAAGA,EAAEjB,SAASmS,MAAMjR,OAAQD,CAAC,GACE,UAApC,OAAOjB,SAASmS,MAAMlR,GAAS,QAIiB,QAFpDugB,GADSD,EAAcvhB,SAASmS,MAAMlR,IACVqL,QAEDlI,QAAQ,WAAW,GACwB,OAAzDod,EAAc1d,MAAM+L,SAASkR,UAAY,SAAU,GACjDF,mCAAmCW,CAAa,IAElCD,EAAY7M,MACL,aAAlB,OAAO+E,SACRA,OAAO8H,CAAW,EAAEG,IAAI,IAAI,EAC5BjI,OAAO8H,CAAW,EAAEG,IAAI,EACxBjI,OAAO8H,CAAW,EAAEjf,GAAG,SAAU,SAAS/C,GAEtC,OADAihB,kBAAkBjhB,EAAMoD,MAAM,EACvB,CAAA,CACX,CAAC,GAKrB,CAAC"}
|
js/cleantalk-admin-settings-page.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
function apbct_banner_check(){var c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbct_get_elems(t){for(var e,n=0,a=(t=t.split(",")).length;n<a;n++)e=jQuery("#"+t[n]),t[n]=0===e.length?jQuery("."+t[n]):e;return t}function apbct_get_elems__native(t){"string"==typeof t&&(t=t.split(","));var c=[];return t.forEach(function(t,e,n){var a=document.getElementById(t);if(null!==a)c.push(a[key]);else if(null!==(a=document.getElementsByClassName(t))&&0!==a.length)for(key in a)0<=+key&&c.push(a[key])}),c}function apbct_show_hide_elem(t){for(var e=0,n=(t=apbct_get_elems(t)).length;e<n;e++)t[e].each(function(t,e){var n=(e=jQuery(e)).next("label")||e.prev("label")||null;e.is(":visible")?(e.hide(),n&&n.hide()):(e.show(),n&&n.show())})}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbct_get_elems__native(t).forEach(function(t,e,n){var a;1===(c=null===c?null===t.getAttribute("disabled")?0:1:c)?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null!==t.getAttribute("apbct_children")&&null!==(a=apbctSettingsDependencies_getState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependencies_getState(t){var e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbct_settings__showDescription(t,e){function c(t){void 0!==t&&(0!=jQuery(t.target).parent(".apbct_long_desc").length&&!jQuery(t.target).hasClass("apbct_long_desc__cancel")||jQuery(t.target).hasClass("apbct_long_description__show"))||(jQuery(".apbct_long_desc").remove(),jQuery(document).off("click",c))}c(),t.after("<div id='apbct_long_desc__"+e+"' class='apbct_long_desc'></div>");var n=jQuery("#apbct_long_desc__"+e);n.append("<i class= 'apbct-icon-spin1 animate-spin'></i>").append("<div class='apbct_long_desc__angle'></div>").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){a.empty().append("<div class='apbct_long_desc__angle'></div>").append("<i class='apbct_long_desc__cancel apbct-icon-cancel'></i>").append("<h3 class='apbct_long_desc__title'>"+t.title+"</h3>").append("<p>"+t.desc+"</p>"),jQuery(document).on("click",c)}},n)}function apbct_save_button_position(){var t,e,n,a,c,s,i,o;null!==document.getElementById("apbct_settings__before_advanced_settings")&&null!==document.getElementById("apbct_settings__after_advanced_settings")&&null!==document.getElementById("apbct_settings__button_section")&&null!==document.getElementById("apbct_settings__advanced_settings")&&null!==document.getElementById("apbct_hidden_section_nav")&&(t=window.innerHeight,n=(e=document.getElementById("apbct_settings__advanced_settings")).getBoundingClientRect().top,c=(a=document.getElementById("apbct_settings__button_section")).getBoundingClientRect().height,i=(s=document.getElementById("apbct_hidden_section_nav")).getBoundingClientRect().top,o=s.getBoundingClientRect().height,"none"!==getComputedStyle(e).display?(jQuery("#apbct_settings__main_save_button").hide(),t<i+o+c?(a.style.bottom="",a.style.top=i+o+20+"px"):(a.style.bottom=0,a.style.top="")):jQuery("#apbct_settings__main_save_button").show(),s.style.top=n<=0?30-n+"px":0)}function apbct_highlight_element(t,e){e=e-1||0;let n=jQuery("#"+t);jQuery("html, body").animate({scrollTop:n.offset().top-100},"slow"),n.addClass("apbct_highlighted"),n.animate({opacity:0},400,"linear",function(){n.animate({opacity:1},400,"linear",function(){0<e?apbct_highlight_element(t,e):n.removeClass("apbct_highlighted")})})}jQuery(document).ready(function(){jQuery(".apbct_setting---data__email_decoder").on("click",t=>{var e;"checkbox"===t.target.type?(e=t.target.checked?"__On":"__Off",document.getElementById("apbct_setting_data__email_decoder"+e).checked=!0):document.getElementById("apbct_setting_data__email_decoder").checked=1===parseInt(t.target.value)}),document.getElementsByClassName("apbct_settings-title")[0]&&"rtl"===getComputedStyle(document.getElementsByClassName("apbct_settings-title")[0]).direction&&jQuery(".apbct_switchers").css("text-align","right"),jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});var t=new Date;jQuery("#ct_admin_timezone").val(t.getTimezoneOffset()/60*-1),jQuery("#apbct_button__get_key_auto").on("click",function(){apbct_admin_sendAJAX({action:"apbct_get_key_auto"},{timeout:25e3,button:document.getElementById("apbct_button__get_key_auto"),spinner:jQuery("#apbct_button__get_key_auto .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__get_key_auto .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__get_key_auto .apbct_success").hide(300)},2e3),t.reload&&document.location.reload(),t.getTemplates&&(cleantalkModal.loaded=t.getTemplates,cleantalkModal.open(),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}))}})}),jQuery(document).on("click","#apbct_settings_templates_import_button",function(){jQuery("#apbct-ajax-result").remove();var c,t=jQuery("option:selected",jQuery("#apbct_settings_templates_import"));jQuery("#apbct_settings_templates_import_name").css("border-color","inherit"),void 0===t.data("id")?console.log('Attribute "data-id" not set for the option.'):(t={template_id:t.data("id"),template_name:t.data("name"),settings:t.data("settings")},c=this,apbct_admin_sendAJAX({action:"settings_templates_import",data:t},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_import_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}}))}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");if(e.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{if("new_template"===t.data("id")){var n=e.val();if(""===n)return void e.css("border-color","red");n={template_name:n}}else n={template_id:t.data("id")};var c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:n},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){var c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&document.location.reload()}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){apbct_settings__showDescription(self=jQuery(this),self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbct_banner_check(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()}),apbct_save_button_position(),window.addEventListener("scroll",apbct_save_button_position),jQuery("#ct_adv_showhide a").on("click",apbct_save_button_position),jQuery("#apbct-change-account-email").on("click",function(t){t.preventDefault();var t=jQuery(this),e=jQuery("#apbct-account-email"),n=e.text();t.toggleClass("active"),t.hasClass("active")?(t.text(t.data("save-text")),e.attr("contenteditable","true"),e.on("keydown",function(t){"Enter"===t.code&&t.preventDefault()}),e.on("input",function(t){"insertParagraph"===t.inputType&&t.preventDefault()})):(apbct_admin_sendAJAX({action:"apbct_update_account_email",accountEmail:n},{timeout:5e3,callback:function(t,e,n,a){void 0!==t.success&&"ok"===t.success&&void 0!==t.manuallyLink&&jQuery("#apbct-key-manually-link").attr("href",t.manuallyLink),void 0!==t.error&&jQuery("#apbct-account-email").css("border-color","red")}}),e.attr("contenteditable","false"),t.text(t.data("default-text")))}),jQuery("#apbct_setting_apikey").on("input",function(){var t=jQuery(this).val();jQuery('button.cleantalk_link[value="save_changes"]').off("click"),""!==t&&null===t.match(/^[a-z\d]{3,30}\s*$/)&&(jQuery("#apbct_button__get_key_auto__wrapper").show(),jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#apbct_bad_key_notice").length||jQuery("<div class='apbct_notice_inner error'><h4 id='apbct_bad_key_notice'>Please, insert a correct access key before saving changes!</h4></div>").insertAfter(jQuery("#apbct_setting_apikey")),apbct_highlight_element("apbct_setting_apikey",3)}))}),jQuery("#apbct_setting_apikey").val()&&ctSettingsPage.key_is_ok&&jQuery("#apbct_button__get_key_auto__wrapper").hide(),ctSettingsPage.key_is_ok||jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#sync_required_notice").length||jQuery("<div class='apbct_notice_inner error'><h4 id='sync_required_notice'>Synchronization process failed. Please, check the acces key and restart the synch.<h4></div>").insertAfter(jQuery("#apbct_button__sync")),apbct_highlight_element("apbct_setting_apikey",3),apbct_highlight_element("apbct_button__sync",3),jQuery("#apbct_button__get_key_auto__wrapper").show()}),jQuery("#apbct-custom-logo-open-gallery").click(function(t){t.preventDefault();const e=jQuery(this),n=wp.media({library:{type:"image"},multiple:!1});n.on("select",function(){var t=n.state().get("selection").first().toJSON();e.parent().prev().attr("src",t.url),jQuery("#cleantalk_custom_logo").val(t.id)}),n.open()}),jQuery("#apbct-custom-logo-remove-image").click(function(t){t.preventDefault(),!0===confirm("Sure?")&&(t=jQuery(this).parent().prev().data("src"),jQuery(this).parent().prev().attr("src",t),jQuery(this).prev().prev().val(""))})});
|
2 |
//# sourceMappingURL=cleantalk-admin-settings-page.min.js.map
|
1 |
+
function apbct_banner_check(){var c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbct_get_elems(t){for(var e,n=0,a=(t=t.split(",")).length;n<a;n++)e=jQuery("#"+t[n]),t[n]=0===e.length?jQuery("."+t[n]):e;return t}function apbct_get_elems__native(t){"string"==typeof t&&(t=t.split(","));var c=[];return t.forEach(function(t,e,n){var a=document.getElementById(t);if(null!==a)c.push(a[key]);else if(null!==(a=document.getElementsByClassName(t))&&0!==a.length)for(key in a)0<=+key&&c.push(a[key])}),c}function apbct_show_hide_elem(t){for(var e=0,n=(t=apbct_get_elems(t)).length;e<n;e++)t[e].each(function(t,e){var n=(e=jQuery(e)).next("label")||e.prev("label")||null;e.is(":visible")?(e.hide(),n&&n.hide()):(e.show(),n&&n.show())})}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbct_get_elems__native(t).forEach(function(t,e,n){var a;1===(c=null===c?null===t.getAttribute("disabled")?0:1:c)?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null!==t.getAttribute("apbct_children")&&null!==(a=apbctSettingsDependencies_getState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependencies_getState(t){var e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbct_settings__showDescription(t,e){function c(t){void 0!==t&&(0!=jQuery(t.target).parent(".apbct_long_desc").length&&!jQuery(t.target).hasClass("apbct_long_desc__cancel")||jQuery(t.target).hasClass("apbct_long_description__show"))||(jQuery(".apbct_long_desc").remove(),jQuery(document).off("click",c))}c(),t.after("<div id='apbct_long_desc__"+e+"' class='apbct_long_desc'></div>");var n=jQuery("#apbct_long_desc__"+e);n.append("<i class= 'apbct-icon-spin1 animate-spin'></i>").append("<div class='apbct_long_desc__angle'></div>").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){a.empty().append("<div class='apbct_long_desc__angle'></div>").append("<i class='apbct_long_desc__cancel apbct-icon-cancel'></i>").append("<h3 class='apbct_long_desc__title'>"+t.title+"</h3>").append("<p>"+t.desc+"</p>"),jQuery(document).on("click",c)}},n)}function apbct_save_button_position(){var t,e,n,a,c,s,i,o;null!==document.getElementById("apbct_settings__before_advanced_settings")&&null!==document.getElementById("apbct_settings__after_advanced_settings")&&null!==document.getElementById("apbct_settings__button_section")&&null!==document.getElementById("apbct_settings__advanced_settings")&&null!==document.getElementById("apbct_hidden_section_nav")&&(t=window.innerHeight,n=(e=document.getElementById("apbct_settings__advanced_settings")).getBoundingClientRect().top,c=(a=document.getElementById("apbct_settings__button_section")).getBoundingClientRect().height,i=(s=document.getElementById("apbct_hidden_section_nav")).getBoundingClientRect().top,o=s.getBoundingClientRect().height,"none"!==getComputedStyle(e).display?(jQuery("#apbct_settings__main_save_button").hide(),t<i+o+c?(a.style.bottom="",a.style.top=i+o+20+"px"):(a.style.bottom=0,a.style.top="")):jQuery("#apbct_settings__main_save_button").show(),s.style.top=n<=0?30-n+"px":0)}function apbct_highlight_element(t,e){e=e-1||0;let n=jQuery("#"+t);jQuery("html, body").animate({scrollTop:n.offset().top-100},"slow"),n.addClass("apbct_highlighted"),n.animate({opacity:0},400,"linear",function(){n.animate({opacity:1},400,"linear",function(){0<e?apbct_highlight_element(t,e):n.removeClass("apbct_highlighted")})})}jQuery(document).ready(function(){jQuery(".apbct_setting---data__email_decoder").on("click",t=>{var e;"checkbox"===t.target.type?(e=t.target.checked?"__On":"__Off",document.getElementById("apbct_setting_data__email_decoder"+e).checked=!0):document.getElementById("apbct_setting_data__email_decoder").checked=1===parseInt(t.target.value)}),document.getElementsByClassName("apbct_settings-title")[0]&&"rtl"===getComputedStyle(document.getElementsByClassName("apbct_settings-title")[0]).direction&&jQuery(".apbct_switchers").css("text-align","right"),jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});var t=new Date;jQuery("#ct_admin_timezone").val(t.getTimezoneOffset()/60*-1),jQuery("#apbct_button__get_key_auto").on("click",function(){apbct_admin_sendAJAX({action:"apbct_get_key_auto"},{timeout:25e3,button:document.getElementById("apbct_button__get_key_auto"),spinner:jQuery("#apbct_button__get_key_auto .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__get_key_auto .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__get_key_auto .apbct_success").hide(300)},2e3),t.reload&&document.location.reload(),t.getTemplates&&(cleantalkModal.loaded=t.getTemplates,cleantalkModal.open(),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}))}})}),jQuery(document).on("click","#apbct_settings_templates_import_button",function(){jQuery("#apbct-ajax-result").remove();var c,t=jQuery("option:selected",jQuery("#apbct_settings_templates_import"));jQuery("#apbct_settings_templates_import_name").css("border-color","inherit"),void 0===t.data("id")?console.log('Attribute "data-id" not set for the option.'):(t={template_id:t.data("id"),template_name:t.data("name"),settings:t.data("settings")},c=this,apbct_admin_sendAJAX({action:"settings_templates_import",data:t},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_import_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}}))}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");if(e.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{if("new_template"===t.data("id")){var n=e.val();if(""===n)return void e.css("border-color","red");n={template_name:n}}else n={template_id:t.data("id")};var c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:n},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){var c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&(ctSettingsPage.key_changed?(jQuery(".key_changed_sync").hide(300),jQuery(".key_changed_success").show(300),setTimeout(function(){document.location.reload()},3e3)):document.location.reload())}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){apbct_settings__showDescription(self=jQuery(this),self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbct_banner_check(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()}),apbct_save_button_position(),window.addEventListener("scroll",apbct_save_button_position),jQuery("#ct_adv_showhide a").on("click",apbct_save_button_position),jQuery("#apbct-change-account-email").on("click",function(t){t.preventDefault();var t=jQuery(this),e=jQuery("#apbct-account-email"),n=e.text();t.toggleClass("active"),t.hasClass("active")?(t.text(t.data("save-text")),e.attr("contenteditable","true"),e.on("keydown",function(t){"Enter"===t.code&&t.preventDefault()}),e.on("input",function(t){"insertParagraph"===t.inputType&&t.preventDefault()})):(apbct_admin_sendAJAX({action:"apbct_update_account_email",accountEmail:n},{timeout:5e3,callback:function(t,e,n,a){void 0!==t.success&&"ok"===t.success&&void 0!==t.manuallyLink&&jQuery("#apbct-key-manually-link").attr("href",t.manuallyLink),void 0!==t.error&&jQuery("#apbct-account-email").css("border-color","red")}}),e.attr("contenteditable","false"),t.text(t.data("default-text")))}),jQuery("#apbct_setting_apikey").on("input",function(){var t=jQuery(this).val();jQuery('button.cleantalk_link[value="save_changes"]').off("click"),""!==t&&null===t.match(/^[a-z\d]{3,30}\s*$/)&&(jQuery("#apbct_button__get_key_auto__wrapper").show(),jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#apbct_bad_key_notice").length||jQuery("<div class='apbct_notice_inner error'><h4 id='apbct_bad_key_notice'>Please, insert a correct access key before saving changes!</h4></div>").insertAfter(jQuery("#apbct_setting_apikey")),apbct_highlight_element("apbct_setting_apikey",3)}))}),jQuery("#apbct_setting_apikey").val()&&ctSettingsPage.key_is_ok&&jQuery("#apbct_button__get_key_auto__wrapper").hide(),ctSettingsPage.key_is_ok||jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#sync_required_notice").length||jQuery("<div class='apbct_notice_inner error'><h4 id='sync_required_notice'>Synchronization process failed. Please, check the acces key and restart the synch.<h4></div>").insertAfter(jQuery("#apbct_button__sync")),apbct_highlight_element("apbct_setting_apikey",3),apbct_highlight_element("apbct_button__sync",3),jQuery("#apbct_button__get_key_auto__wrapper").show()}),jQuery("#apbct-custom-logo-open-gallery").click(function(t){t.preventDefault();const e=jQuery(this),n=wp.media({library:{type:"image"},multiple:!1});n.on("select",function(){var t=n.state().get("selection").first().toJSON();e.parent().prev().attr("src",t.url),jQuery("#cleantalk_custom_logo").val(t.id)}),n.open()}),jQuery("#apbct-custom-logo-remove-image").click(function(t){t.preventDefault(),!0===confirm("Sure?")&&(t=jQuery(this).parent().prev().data("src"),jQuery(this).parent().prev().attr("src",t),jQuery(this).prev().prev().val(""))})});
|
2 |
//# sourceMappingURL=cleantalk-admin-settings-page.min.js.map
|
js/cleantalk-admin-settings-page.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-admin-settings-page.min.js","sources":["cleantalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function(){\n\n\t// Top level settings\n\tjQuery('.apbct_setting---data__email_decoder').on('click', (event) => {\n\t\tif ( event.target.type === 'checkbox' ) {\n\t\t\tconst postFix = event.target.checked ? '__On' : '__Off';\n\t\t\tdocument.getElementById('apbct_setting_data__email_decoder' + postFix).checked = true;\n\t\t} else {\n\t\t\tdocument.getElementById('apbct_setting_data__email_decoder').checked = parseInt(event.target.value) === 1;\n\t\t}\n\t});\n\n\t// Crunch for Right to Left direction languages\n\tif(document.getElementsByClassName('apbct_settings-title')[0]) {\n\t\tif(getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl'){\n\t\t\tjQuery('.apbct_switchers').css('text-align', 'right');\n\t\t}\n\t}\n\n\t// Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function(){\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\n jQuery('.apbct_setting---apikey+div').show();\n jQuery(this).fadeOut(300);\n });\n\n\tvar d = new Date();\n\tjQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\n\n\t// Key KEY automatically\n\tjQuery('#apbct_button__get_key_auto').on('click', function(){\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_get_key_auto'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__get_key_auto' ),\n\t\t\t\tspinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__get_key_auto .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload)\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\tif(result.getTemplates) {\n\t\t\t\t\t\tcleantalkModal.loaded = result.getTemplates;\n\t\t\t\t\t\tcleantalkModal.open();\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Import settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_import_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_import_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tvar data = {\n\t\t\t'template_id' : optionSelected.data('id'),\n\t\t\t'template_name' : optionSelected.data('name'),\n\t\t\t'settings' : optionSelected.data('settings')\n\t\t};\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_import', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Export settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_export_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_export_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tif( optionSelected.data('id') === 'new_template' ) {\n\t\t\tvar templateName = templateNameInput.val();\n\t\t\tif( templateName === '' ) {\n\t\t\t\ttemplateNameInput.css('border-color', 'red');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar data = {\n\t\t\t\t'template_name' : templateName\n\t\t\t}\n\t\t} else {\n\t\t\tvar data = {\n\t\t\t\t'template_id' : optionSelected.data('id')\n\t\t\t}\n\t\t}\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_export', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Reset settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_reset_button', function(){\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_reset'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Sync button\n\tjQuery('#apbct_button__sync').on('click', function(){\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_sync'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__sync' ),\n\t\t\t\tspinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__sync .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__sync .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload)\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\tif( ctSettingsPage.key_changed )\n\t\tjQuery('#apbct_button__sync').click();\n\n\tjQuery(document).on('click', '.apbct_settings-long_description---show', function(){\n\t\tself = jQuery(this);\n\t\tapbct_settings__showDescription(self, self.attr('setting'));\n\t});\n\n\tif (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length)\n\t\tapbct_banner_check();\n\n\tjQuery(document).on('change', '#apbct_settings_templates_export',function(){\n\t\tvar optionSelected = jQuery(\"option:selected\", this);\n\t\tif ( optionSelected.data(\"id\") === 'new_template' ) {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\n\t\t} else {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\n\t\t}\n\t});\n\n\tapbct_save_button_position();\n\twindow.addEventListener('scroll', apbct_save_button_position);\n\tjQuery('#ct_adv_showhide a').on('click', apbct_save_button_position);\n\n\n\t/**\n\t * Change cleantalk account email\n\t */\n\tjQuery('#apbct-change-account-email').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\tvar $this = jQuery(this);\n\t\tvar accountEmailField = jQuery('#apbct-account-email');\n\t\tvar accountEmail = accountEmailField.text();\n\n\t\t$this.toggleClass('active');\n\n\t\tif ($this.hasClass('active')) {\n\t\t\t$this.text($this.data('save-text'));\n\t\t\taccountEmailField.attr('contenteditable', 'true');\n\t\t\taccountEmailField.on('keydown', function (e) {\n\t\t\t\tif (e.code === 'Enter') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}\n\t\t\t})\n\t\t\taccountEmailField.on('input', function (e) {\n\t\t\t\tif (e.inputType === 'insertParagraph') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tapbct_admin_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_update_account_email',\n\t\t\t\t\taccountEmail: accountEmail\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttimeout: 5000,\n\t\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\t\tif (result.success !== undefined && result.success === 'ok') {\n\t\t\t\t\t\t\tif (result.manuallyLink !== undefined) {\n\t\t\t\t\t\t\t\tjQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (result.error !== undefined) {\n\t\t\t\t\t\t\tjQuery('#apbct-account-email').css('border-color', 'red');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\taccountEmailField.attr('contenteditable', 'false');\n\t\t\t$this.text($this.data('default-text'));\n\t\t}\n\t});\n\n\t/**\n\t * Validate apkikey and hide get auto btn\n\t */\n\tjQuery('#apbct_setting_apikey').on('input', function () {\n\t\tvar enteredValue = jQuery(this).val();\n\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').off('click')\n\t\tif (enteredValue !== '' && enteredValue.match(/^[a-z\\d]{3,30}\\s*$/) === null) {\n\t\t\tjQuery('#apbct_button__get_key_auto__wrapper').show();\n\t\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n\t\t\t\t\tfunction (e) {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tif (!jQuery('#apbct_bad_key_notice').length){\n\t\t\t\t\t\t\tjQuery( \"<div class='apbct_notice_inner error'><h4 id='apbct_bad_key_notice'>\" +\n\t\t\t\t\t\t\t\t\"Please, insert a correct access key before saving changes!\" +\n\t\t\t\t\t\t\t\t\"</h4></div>\" ).insertAfter( jQuery('#apbct_setting_apikey') );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tapbct_highlight_element('apbct_setting_apikey',3)\n\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\treturn;\n\t\t}\n\n\t});\n\n\tif ( jQuery('#apbct_setting_apikey').val() && ctSettingsPage.key_is_ok) {\n\t\tjQuery('#apbct_button__get_key_auto__wrapper').hide();\n\t}\n\n\t/**\n\t * Handle synchronization errors when key is no ok to force user check the key and restart the sync\n\t */\n\tif( !ctSettingsPage.key_is_ok ){\n\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n\t\t\tfunction (e) {\n\t\t\t\te.preventDefault()\n\t\t\t\tif (!jQuery('#sync_required_notice').length){\n\t\t\t\t\tjQuery( \"<div class='apbct_notice_inner error'><h4 id='sync_required_notice'>\" +\n\t\t\t\t\t\t\"Synchronization process failed. Please, check the acces key and restart the synch.\" +\n\t\t\t\t\t\t\"<h4></div>\" ).insertAfter( jQuery('#apbct_button__sync') );\n\t\t\t\t}\n\t\t\t\tapbct_highlight_element('apbct_setting_apikey',3)\n\t\t\t\tapbct_highlight_element('apbct_button__sync',3)\n\t\t\t\tjQuery('#apbct_button__get_key_auto__wrapper').show();\n\t\t\t}\n\t\t)\n\t}\n\n\t/**\n\t * Open WP gallery for adding custom logo\n\t */\n\tjQuery('#apbct-custom-logo-open-gallery').click(function (e) {\n\t\te.preventDefault();\n\n\t\tconst button = jQuery(this);\n\n\t\tconst customUploader = wp.media({\n\t\t\tlibrary : {\n\t\t\t\ttype : 'image'\n\t\t\t},\n\t\t\tmultiple: false\n\t\t});\n\n\t\tcustomUploader.on('select', function() {\n\t\t\tconst image = customUploader.state().get('selection').first().toJSON();\n\n\t\t\tbutton.parent().prev().attr( 'src', image.url );\n\t\t\tjQuery('#cleantalk_custom_logo').val( image.id );\n\t\t});\n\n\t\tcustomUploader.open();\n\t});\n\n\t/**\n\t * Remove selected logo\n\t */\n\tjQuery('#apbct-custom-logo-remove-image').click(function (e) {\n\t\te.preventDefault();\n\n\t\tif ( true === confirm( \"Sure?\" ) ) {\n\t\t\tconst src = jQuery(this).parent().prev().data('src');\n\t\t\tjQuery(this).parent().prev().attr('src', src);\n\t\t\tjQuery(this).prev().prev().val('');\n\t\t}\n\t});\n\n});\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbct_banner_check() {\n\tvar bannerChecker = setInterval( function() {\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_settings__check_renew_banner'},\n\t\t\t{\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif (result.close_renew_banner) {\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_renew').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_renew').hide('slow');\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_trial').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_trial').hide('slow');\n\t\t\t\t\t\tclearInterval(bannerChecker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}, 900000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param elems\n * @returns {*}\n */\nfunction apbct_get_elems(elems){\n elems = elems.split(',');\n for( var i=0, len = elems.length, tmp; i < len; i++){\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param elems string|array\n * @returns array\n */\nfunction apbct_get_elems__native(elems){\n\n\t// Make array from a string\n\tif(typeof elems === 'string')\n\t\telems = elems.split(',');\n\n\tvar out = [];\n\n\telems.forEach(function(elem, i, arr) {\n\n\t\t// try to get elements with such IDs\n\t\tvar tmp = document.getElementById(elem);\n\t\tif (tmp !== null){\n\t\t\tout.push( tmp[key] );\n\t\t\treturn;\n\t\t}\n\n\t\t// try to get elements with such class name\n\t\t// write each elem from collection to new element of output array\n\t\ttmp = document.getElementsByClassName(elem);\n\t\tif (tmp !== null && tmp.length !==0 ){\n\t\t\tfor(key in tmp){\n\t\t\t\tif( +key >= 0 ){\n\t\t\t\t\tout.push( tmp[key] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\treturn out;\n}\n\nfunction apbct_show_hide_elem(elems){\n\telems = apbct_get_elems(elems);\n for( var i=0, len = elems.length; i < len; i++){\n elems[i].each(function (i, elem) {\n elem = jQuery(elem);\n var label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(\":visible\")) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param ids string|array Selectors\n * @param enable\n */\nfunction apbctSettingsDependencies(ids, enable){\n\n\n\tenable = ! isNaN(enable) ? enable : null;\n\n\t// Get elements\n\tvar elems = apbct_get_elems__native( ids );\n\n\telems.forEach(function(elem, i, arr){\n\n\t\tvar do_disable = function(){elem.setAttribute('disabled', 'disabled');},\n\t\t\tdo_enable = function(){elem.removeAttribute('disabled');};\n\n\t\t// Set defined state\n\t\tif(enable === null) // Set\n\t\t\tenable = elem.getAttribute('disabled') === null ? 0 : 1;\n\n\t\tenable === 1 ? do_enable() : do_disable();\n\n\t\tif( elem.getAttribute('apbct_children') !== null){\n\t\t\tvar state = apbctSettingsDependencies_getState( elem ) && enable;\n\t\t\tif( state !== null ) {\n\t\t\t\tapbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\n\t\t\t}\n\t\t}\n\n\t});\n}\n\nfunction apbctSettingsDependencies_getState( elem ){\n\n\tvar state;\n\n\tswitch ( elem.getAttribute( 'type' ) ){\n\t\tcase 'checkbox':\n\t\t\tstate = +elem.checked;\n\t\t\tbreak;\n\t\tcase 'radio':\n\t\t\tstate = +(+elem.getAttribute('value') === 1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstate = null;\n\t}\n\n\treturn state;\n}\n\nfunction apbct_settings__showDescription(label, setting_id){\n\n\tvar remove_desc_func = function(e){\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.apbct_long_desc').length == 0 || jQuery(e.target).hasClass('apbct_long_desc__cancel')) && !jQuery(e.target).hasClass('apbct_long_description__show'))){\n\t\t\tjQuery('.apbct_long_desc').remove();\n\t\t\tjQuery(document).off('click', remove_desc_func);\n\t\t}\n\t};\n\n\tremove_desc_func();\n\n\tlabel.after(\"<div id='apbct_long_desc__\"+setting_id+\"' class='apbct_long_desc'></div>\");\n\tvar obj = jQuery('#apbct_long_desc__'+setting_id);\n\tobj.append(\"<i class= 'apbct-icon-spin1 animate-spin'></i>\")\n\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t.css({\n\t\t\ttop: label.position().top - 5,\n\t\t\tleft: label.position().left + 25\n\t\t});\n\n\n\tapbct_admin_sendAJAX(\n\t\t{action: 'apbct_settings__get__long_description', setting_id: setting_id},\n\t\t{\n\t\t\tspinner: obj.children('img'),\n\t\t\tcallback: function(result, data, params, obj){\n\n\t\t\t\tobj.empty()\n\t\t\t\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t\t\t\t.append(\"<i class='apbct_long_desc__cancel apbct-icon-cancel'></i>\")\n\t\t\t\t\t.append(\"<h3 class='apbct_long_desc__title'>\"+result.title+\"</h3>\")\n\t\t\t\t\t.append(\"<p>\"+result.desc+\"</p>\");\n\n\t\t\t\tjQuery(document).on('click', remove_desc_func);\n\t\t\t}\n\t\t},\n\t\tobj\n\t);\n}\n\nfunction apbct_save_button_position() {\n\tif (\n\t\tdocument.getElementById('apbct_settings__before_advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_settings__after_advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_settings__button_section') === null ||\n\t\tdocument.getElementById('apbct_settings__advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_hidden_section_nav') === null\n\t) {\n\t\treturn;\n\t}\n\tvar docInnerHeight = window.innerHeight;\n\tvar advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');\n\tvar advSettingsOffset = advSettingsBlock.getBoundingClientRect().top;\n\tvar buttonBlock = document.getElementById('apbct_settings__button_section');\n\tvar buttonHeight = buttonBlock.getBoundingClientRect().height;\n\tvar navBlock = document.getElementById('apbct_hidden_section_nav');\n\tvar navBlockOffset = navBlock.getBoundingClientRect().top;\n\tvar navBlockHeight = navBlock.getBoundingClientRect().height;\n\n\t// Set Save button position\n\tif ( getComputedStyle(advSettingsBlock).display !== \"none\" ) {\n\t\tjQuery('#apbct_settings__main_save_button').hide();\n\t\tif ( docInnerHeight < navBlockOffset + navBlockHeight + buttonHeight ) {\n\t\t\tbuttonBlock.style.bottom = '';\n\t\t\tbuttonBlock.style.top = navBlockOffset + navBlockHeight + 20 + 'px';\n\t\t} else {\n\t\t\tbuttonBlock.style.bottom = 0;\n\t\t\tbuttonBlock.style.top = '';\n\t\t}\n\t} else {\n\t\tjQuery('#apbct_settings__main_save_button').show();\n\t}\n\n\t// Set nav position\n\tif ( advSettingsOffset <= 0 ) {\n\t\tnavBlock.style.top = - advSettingsOffset + 30 + 'px';\n\t} else {\n\t\tnavBlock.style.top = 0;\n\t}\n}\n\n// Hightlights element\nfunction apbct_highlight_element(id, times){\n\ttimes = times-1 || 0;\n\tlet key_field = jQuery('#'+id)\n\tjQuery(\"html, body\").animate({ scrollTop: key_field.offset().top - 100 }, \"slow\");\n\tkey_field.addClass('apbct_highlighted');\n\tkey_field.animate({opacity: 0 }, 400, 'linear', function(){\n\t\tkey_field.animate({opacity: 1 }, 400, 'linear', function(){\n\t\t\tif(times>0){\n\t\t\t\tapbct_highlight_element(id, times);\n\t\t\t}else{\n\t\t\t\tkey_field.removeClass('apbct_highlighted');\n\t\t\t}\n\t\t});\n\t});\n}"],"names":["apbct_banner_check","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbct_get_elems","elems","tmp","i","len","split","apbct_get_elems__native","out","forEach","elem","arr","document","getElementById","push","key","getElementsByClassName","apbct_show_hide_elem","each","label","next","prev","is","show","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependencies_getState","checked","apbct_settings__showDescription","setting_id","remove_desc_func","e","target","parent","hasClass","remove","off","after","append","css","top","position","left","spinner","children","empty","title","desc","on","apbct_save_button_position","docInnerHeight","advSettingsBlock","advSettingsOffset","buttonBlock","buttonHeight","navBlock","navBlockOffset","navBlockHeight","window","innerHeight","getBoundingClientRect","height","getComputedStyle","display","style","bottom","apbct_highlight_element","id","times","let","key_field","animate","scrollTop","offset","addClass","opacity","removeClass","ready","postFix","event","type","parseInt","value","direction","val","attr","this","fadeOut","d","Date","getTimezoneOffset","timeout","button","setTimeout","reload","location","getTemplates","cleantalkModal","loaded","open","addEventListener","optionSelected","console","log","template_id","template_name","settings","notJson","success","insertAfter","close","templateNameInput","templateName","ctSettingsPage","key_changed","click","self","find","preventDefault","$this","accountEmailField","accountEmail","text","toggleClass","code","inputType","undefined","manuallyLink","error","enteredValue","match","key_is_ok","customUploader","wp","media","library","multiple","image","get","first","toJSON","url","confirm","src"],"mappings":"AAoWA,SAASA,qBACR,IAAIC,EAAgBC,YAAa,WAChCC,qBACC,CAACC,OAAQ,oCAAoC,EA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":3,"file":"cleantalk-admin-settings-page.min.js","sources":["cleantalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function(){\n\n\t// Top level settings\n\tjQuery('.apbct_setting---data__email_decoder').on('click', (event) => {\n\t\tif ( event.target.type === 'checkbox' ) {\n\t\t\tconst postFix = event.target.checked ? '__On' : '__Off';\n\t\t\tdocument.getElementById('apbct_setting_data__email_decoder' + postFix).checked = true;\n\t\t} else {\n\t\t\tdocument.getElementById('apbct_setting_data__email_decoder').checked = parseInt(event.target.value) === 1;\n\t\t}\n\t});\n\n\t// Crunch for Right to Left direction languages\n\tif(document.getElementsByClassName('apbct_settings-title')[0]) {\n\t\tif(getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl'){\n\t\t\tjQuery('.apbct_switchers').css('text-align', 'right');\n\t\t}\n\t}\n\n\t// Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function(){\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\n jQuery('.apbct_setting---apikey+div').show();\n jQuery(this).fadeOut(300);\n });\n\n\tvar d = new Date();\n\tjQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\n\n\t// Key KEY automatically\n\tjQuery('#apbct_button__get_key_auto').on('click', function(){\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_get_key_auto'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__get_key_auto' ),\n\t\t\t\tspinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__get_key_auto .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload)\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\tif(result.getTemplates) {\n\t\t\t\t\t\tcleantalkModal.loaded = result.getTemplates;\n\t\t\t\t\t\tcleantalkModal.open();\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Import settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_import_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_import_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tvar data = {\n\t\t\t'template_id' : optionSelected.data('id'),\n\t\t\t'template_name' : optionSelected.data('name'),\n\t\t\t'settings' : optionSelected.data('settings')\n\t\t};\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_import', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Export settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_export_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_export_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tif( optionSelected.data('id') === 'new_template' ) {\n\t\t\tvar templateName = templateNameInput.val();\n\t\t\tif( templateName === '' ) {\n\t\t\t\ttemplateNameInput.css('border-color', 'red');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar data = {\n\t\t\t\t'template_name' : templateName\n\t\t\t}\n\t\t} else {\n\t\t\tvar data = {\n\t\t\t\t'template_id' : optionSelected.data('id')\n\t\t\t}\n\t\t}\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_export', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Reset settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_reset_button', function(){\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_reset'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Sync button\n\tjQuery('#apbct_button__sync').on('click', function(){\n\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_sync'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__sync' ),\n\t\t\t\tspinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__sync .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__sync .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload) {\n\t\t\t\t\t\tif( ctSettingsPage.key_changed ) {\n\t\t\t\t\t\t\tjQuery('.key_changed_sync').hide(300);\n\t\t\t\t\t\t\tjQuery('.key_changed_success').show(300);\n\t\t\t\t\t\t\tsetTimeout(function(){document.location.reload();}, 3000);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\tif( ctSettingsPage.key_changed )\n\t\tjQuery('#apbct_button__sync').click();\n\n\tjQuery(document).on('click', '.apbct_settings-long_description---show', function(){\n\t\tself = jQuery(this);\n\t\tapbct_settings__showDescription(self, self.attr('setting'));\n\t});\n\n\tif (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length)\n\t\tapbct_banner_check();\n\n\tjQuery(document).on('change', '#apbct_settings_templates_export',function(){\n\t\tvar optionSelected = jQuery(\"option:selected\", this);\n\t\tif ( optionSelected.data(\"id\") === 'new_template' ) {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\n\t\t} else {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\n\t\t}\n\t});\n\n\tapbct_save_button_position();\n\twindow.addEventListener('scroll', apbct_save_button_position);\n\tjQuery('#ct_adv_showhide a').on('click', apbct_save_button_position);\n\n\n\t/**\n\t * Change cleantalk account email\n\t */\n\tjQuery('#apbct-change-account-email').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\tvar $this = jQuery(this);\n\t\tvar accountEmailField = jQuery('#apbct-account-email');\n\t\tvar accountEmail = accountEmailField.text();\n\n\t\t$this.toggleClass('active');\n\n\t\tif ($this.hasClass('active')) {\n\t\t\t$this.text($this.data('save-text'));\n\t\t\taccountEmailField.attr('contenteditable', 'true');\n\t\t\taccountEmailField.on('keydown', function (e) {\n\t\t\t\tif (e.code === 'Enter') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}\n\t\t\t})\n\t\t\taccountEmailField.on('input', function (e) {\n\t\t\t\tif (e.inputType === 'insertParagraph') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tapbct_admin_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_update_account_email',\n\t\t\t\t\taccountEmail: accountEmail\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttimeout: 5000,\n\t\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\t\tif (result.success !== undefined && result.success === 'ok') {\n\t\t\t\t\t\t\tif (result.manuallyLink !== undefined) {\n\t\t\t\t\t\t\t\tjQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (result.error !== undefined) {\n\t\t\t\t\t\t\tjQuery('#apbct-account-email').css('border-color', 'red');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\taccountEmailField.attr('contenteditable', 'false');\n\t\t\t$this.text($this.data('default-text'));\n\t\t}\n\t});\n\n\t/**\n\t * Validate apkikey and hide get auto btn\n\t */\n\tjQuery('#apbct_setting_apikey').on('input', function () {\n\t\tvar enteredValue = jQuery(this).val();\n\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').off('click')\n\t\tif (enteredValue !== '' && enteredValue.match(/^[a-z\\d]{3,30}\\s*$/) === null) {\n\t\t\tjQuery('#apbct_button__get_key_auto__wrapper').show();\n\t\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n\t\t\t\t\tfunction (e) {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tif (!jQuery('#apbct_bad_key_notice').length){\n\t\t\t\t\t\t\tjQuery( \"<div class='apbct_notice_inner error'><h4 id='apbct_bad_key_notice'>\" +\n\t\t\t\t\t\t\t\t\"Please, insert a correct access key before saving changes!\" +\n\t\t\t\t\t\t\t\t\"</h4></div>\" ).insertAfter( jQuery('#apbct_setting_apikey') );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tapbct_highlight_element('apbct_setting_apikey',3)\n\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\treturn;\n\t\t}\n\n\t});\n\n\tif ( jQuery('#apbct_setting_apikey').val() && ctSettingsPage.key_is_ok) {\n\t\tjQuery('#apbct_button__get_key_auto__wrapper').hide();\n\t}\n\n\t/**\n\t * Handle synchronization errors when key is no ok to force user check the key and restart the sync\n\t */\n\tif( !ctSettingsPage.key_is_ok ){\n\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n\t\t\tfunction (e) {\n\t\t\t\te.preventDefault()\n\t\t\t\tif (!jQuery('#sync_required_notice').length){\n\t\t\t\t\tjQuery( \"<div class='apbct_notice_inner error'><h4 id='sync_required_notice'>\" +\n\t\t\t\t\t\t\"Synchronization process failed. Please, check the acces key and restart the synch.\" +\n\t\t\t\t\t\t\"<h4></div>\" ).insertAfter( jQuery('#apbct_button__sync') );\n\t\t\t\t}\n\t\t\t\tapbct_highlight_element('apbct_setting_apikey',3)\n\t\t\t\tapbct_highlight_element('apbct_button__sync',3)\n\t\t\t\tjQuery('#apbct_button__get_key_auto__wrapper').show();\n\t\t\t}\n\t\t)\n\t}\n\n\t/**\n\t * Open WP gallery for adding custom logo\n\t */\n\tjQuery('#apbct-custom-logo-open-gallery').click(function (e) {\n\t\te.preventDefault();\n\n\t\tconst button = jQuery(this);\n\n\t\tconst customUploader = wp.media({\n\t\t\tlibrary : {\n\t\t\t\ttype : 'image'\n\t\t\t},\n\t\t\tmultiple: false\n\t\t});\n\n\t\tcustomUploader.on('select', function() {\n\t\t\tconst image = customUploader.state().get('selection').first().toJSON();\n\n\t\t\tbutton.parent().prev().attr( 'src', image.url );\n\t\t\tjQuery('#cleantalk_custom_logo').val( image.id );\n\t\t});\n\n\t\tcustomUploader.open();\n\t});\n\n\t/**\n\t * Remove selected logo\n\t */\n\tjQuery('#apbct-custom-logo-remove-image').click(function (e) {\n\t\te.preventDefault();\n\n\t\tif ( true === confirm( \"Sure?\" ) ) {\n\t\t\tconst src = jQuery(this).parent().prev().data('src');\n\t\t\tjQuery(this).parent().prev().attr('src', src);\n\t\t\tjQuery(this).prev().prev().val('');\n\t\t}\n\t});\n\n});\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbct_banner_check() {\n\tvar bannerChecker = setInterval( function() {\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_settings__check_renew_banner'},\n\t\t\t{\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif (result.close_renew_banner) {\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_renew').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_renew').hide('slow');\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_trial').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_trial').hide('slow');\n\t\t\t\t\t\tclearInterval(bannerChecker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}, 900000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param elems\n * @returns {*}\n */\nfunction apbct_get_elems(elems){\n elems = elems.split(',');\n for( var i=0, len = elems.length, tmp; i < len; i++){\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param elems string|array\n * @returns array\n */\nfunction apbct_get_elems__native(elems){\n\n\t// Make array from a string\n\tif(typeof elems === 'string')\n\t\telems = elems.split(',');\n\n\tvar out = [];\n\n\telems.forEach(function(elem, i, arr) {\n\n\t\t// try to get elements with such IDs\n\t\tvar tmp = document.getElementById(elem);\n\t\tif (tmp !== null){\n\t\t\tout.push( tmp[key] );\n\t\t\treturn;\n\t\t}\n\n\t\t// try to get elements with such class name\n\t\t// write each elem from collection to new element of output array\n\t\ttmp = document.getElementsByClassName(elem);\n\t\tif (tmp !== null && tmp.length !==0 ){\n\t\t\tfor(key in tmp){\n\t\t\t\tif( +key >= 0 ){\n\t\t\t\t\tout.push( tmp[key] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\treturn out;\n}\n\nfunction apbct_show_hide_elem(elems){\n\telems = apbct_get_elems(elems);\n for( var i=0, len = elems.length; i < len; i++){\n elems[i].each(function (i, elem) {\n elem = jQuery(elem);\n var label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(\":visible\")) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param ids string|array Selectors\n * @param enable\n */\nfunction apbctSettingsDependencies(ids, enable){\n\n\n\tenable = ! isNaN(enable) ? enable : null;\n\n\t// Get elements\n\tvar elems = apbct_get_elems__native( ids );\n\n\telems.forEach(function(elem, i, arr){\n\n\t\tvar do_disable = function(){elem.setAttribute('disabled', 'disabled');},\n\t\t\tdo_enable = function(){elem.removeAttribute('disabled');};\n\n\t\t// Set defined state\n\t\tif(enable === null) // Set\n\t\t\tenable = elem.getAttribute('disabled') === null ? 0 : 1;\n\n\t\tenable === 1 ? do_enable() : do_disable();\n\n\t\tif( elem.getAttribute('apbct_children') !== null){\n\t\t\tvar state = apbctSettingsDependencies_getState( elem ) && enable;\n\t\t\tif( state !== null ) {\n\t\t\t\tapbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\n\t\t\t}\n\t\t}\n\n\t});\n}\n\nfunction apbctSettingsDependencies_getState( elem ){\n\n\tvar state;\n\n\tswitch ( elem.getAttribute( 'type' ) ){\n\t\tcase 'checkbox':\n\t\t\tstate = +elem.checked;\n\t\t\tbreak;\n\t\tcase 'radio':\n\t\t\tstate = +(+elem.getAttribute('value') === 1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstate = null;\n\t}\n\n\treturn state;\n}\n\nfunction apbct_settings__showDescription(label, setting_id){\n\n\tvar remove_desc_func = function(e){\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.apbct_long_desc').length == 0 || jQuery(e.target).hasClass('apbct_long_desc__cancel')) && !jQuery(e.target).hasClass('apbct_long_description__show'))){\n\t\t\tjQuery('.apbct_long_desc').remove();\n\t\t\tjQuery(document).off('click', remove_desc_func);\n\t\t}\n\t};\n\n\tremove_desc_func();\n\n\tlabel.after(\"<div id='apbct_long_desc__\"+setting_id+\"' class='apbct_long_desc'></div>\");\n\tvar obj = jQuery('#apbct_long_desc__'+setting_id);\n\tobj.append(\"<i class= 'apbct-icon-spin1 animate-spin'></i>\")\n\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t.css({\n\t\t\ttop: label.position().top - 5,\n\t\t\tleft: label.position().left + 25\n\t\t});\n\n\n\tapbct_admin_sendAJAX(\n\t\t{action: 'apbct_settings__get__long_description', setting_id: setting_id},\n\t\t{\n\t\t\tspinner: obj.children('img'),\n\t\t\tcallback: function(result, data, params, obj){\n\n\t\t\t\tobj.empty()\n\t\t\t\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t\t\t\t.append(\"<i class='apbct_long_desc__cancel apbct-icon-cancel'></i>\")\n\t\t\t\t\t.append(\"<h3 class='apbct_long_desc__title'>\"+result.title+\"</h3>\")\n\t\t\t\t\t.append(\"<p>\"+result.desc+\"</p>\");\n\n\t\t\t\tjQuery(document).on('click', remove_desc_func);\n\t\t\t}\n\t\t},\n\t\tobj\n\t);\n}\n\nfunction apbct_save_button_position() {\n\tif (\n\t\tdocument.getElementById('apbct_settings__before_advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_settings__after_advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_settings__button_section') === null ||\n\t\tdocument.getElementById('apbct_settings__advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_hidden_section_nav') === null\n\t) {\n\t\treturn;\n\t}\n\tvar docInnerHeight = window.innerHeight;\n\tvar advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');\n\tvar advSettingsOffset = advSettingsBlock.getBoundingClientRect().top;\n\tvar buttonBlock = document.getElementById('apbct_settings__button_section');\n\tvar buttonHeight = buttonBlock.getBoundingClientRect().height;\n\tvar navBlock = document.getElementById('apbct_hidden_section_nav');\n\tvar navBlockOffset = navBlock.getBoundingClientRect().top;\n\tvar navBlockHeight = navBlock.getBoundingClientRect().height;\n\n\t// Set Save button position\n\tif ( getComputedStyle(advSettingsBlock).display !== \"none\" ) {\n\t\tjQuery('#apbct_settings__main_save_button').hide();\n\t\tif ( docInnerHeight < navBlockOffset + navBlockHeight + buttonHeight ) {\n\t\t\tbuttonBlock.style.bottom = '';\n\t\t\tbuttonBlock.style.top = navBlockOffset + navBlockHeight + 20 + 'px';\n\t\t} else {\n\t\t\tbuttonBlock.style.bottom = 0;\n\t\t\tbuttonBlock.style.top = '';\n\t\t}\n\t} else {\n\t\tjQuery('#apbct_settings__main_save_button').show();\n\t}\n\n\t// Set nav position\n\tif ( advSettingsOffset <= 0 ) {\n\t\tnavBlock.style.top = - advSettingsOffset + 30 + 'px';\n\t} else {\n\t\tnavBlock.style.top = 0;\n\t}\n}\n\n// Hightlights element\nfunction apbct_highlight_element(id, times){\n\ttimes = times-1 || 0;\n\tlet key_field = jQuery('#'+id)\n\tjQuery(\"html, body\").animate({ scrollTop: key_field.offset().top - 100 }, \"slow\");\n\tkey_field.addClass('apbct_highlighted');\n\tkey_field.animate({opacity: 0 }, 400, 'linear', function(){\n\t\tkey_field.animate({opacity: 1 }, 400, 'linear', function(){\n\t\t\tif(times>0){\n\t\t\t\tapbct_highlight_element(id, times);\n\t\t\t}else{\n\t\t\t\tkey_field.removeClass('apbct_highlighted');\n\t\t\t}\n\t\t});\n\t});\n}"],"names":["apbct_banner_check","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbct_get_elems","elems","tmp","i","len","split","apbct_get_elems__native","out","forEach","elem","arr","document","getElementById","push","key","getElementsByClassName","apbct_show_hide_elem","each","label","next","prev","is","show","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependencies_getState","checked","apbct_settings__showDescription","setting_id","remove_desc_func","e","target","parent","hasClass","remove","off","after","append","css","top","position","left","spinner","children","empty","title","desc","on","apbct_save_button_position","docInnerHeight","advSettingsBlock","advSettingsOffset","buttonBlock","buttonHeight","navBlock","navBlockOffset","navBlockHeight","window","innerHeight","getBoundingClientRect","height","getComputedStyle","display","style","bottom","apbct_highlight_element","id","times","let","key_field","animate","scrollTop","offset","addClass","opacity","removeClass","ready","postFix","event","type","parseInt","value","direction","val","attr","this","fadeOut","d","Date","getTimezoneOffset","timeout","button","setTimeout","reload","location","getTemplates","cleantalkModal","loaded","open","addEventListener","optionSelected","console","log","template_id","template_name","settings","notJson","success","insertAfter","close","templateNameInput","templateName","ctSettingsPage","key_changed","click","self","find","preventDefault","$this","accountEmailField","accountEmail","text","toggleClass","code","inputType","undefined","manuallyLink","error","enteredValue","match","key_is_ok","customUploader","wp","media","library","multiple","image","get","first","toJSON","url","confirm","src"],"mappings":"AA4WA,SAASA,qBACR,IAAIC,EAAgBC,YAAa,WAChCC,qBACC,CAACC,OAAQ,oCAAoC,EAC7C,CACCC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACpCH,EAAOI,qBAC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O+F,IAAI,EAAEvE,KAAK,EAAEA,KAAK,EAAEqE,IAAI,EAAE,EAEnC,CAAC,CAEF,CAAC"}
|
js/cleantalk-comments-checkspam.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
var ct_working=!(String.prototype.printf=function(){var e,t=this;for(e in arguments)var c=t.substring(0,t.indexOf("%s",0)),a=t.substring(t.indexOf("%s",0)+2,t.length),t=c+arguments[e]+a;return t}),ct_new_check=!0,ct_cooling_down_flag=!1,ct_close_animate=!0,ct_accurate_check=!1,ct_pause=!1,ct_prev_accurate=ctCommentsCheck.ct_prev_accurate,ct_prev_from=ctCommentsCheck.ct_prev_from,ct_prev_till=ctCommentsCheck.ct_prev_till,ct_cool_down_time=9e4,ct_requests_counter=0,ct_max_requests=60,ct_ajax_nonce=ctCommentsCheck.ct_ajax_nonce,ct_comments_total=0,ct_comments_checked=0,ct_comments_spam=0,ct_comments_bad=0,ct_unchecked="unset",ct_date_from=0,ct_date_till=0;function animate_comment(e,t){ct_close_animate?.3==e?jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(.3,t)}):ct_close_animate=!0}function ct_clear_comments(){var e=0,t=0,c=(jQuery("#ct_allow_date_range").is(":checked")&&(e=jQuery("#ct_date_range_from").val(),t=jQuery("#ct_date_range_till").val()),"https:"===location.protocol?"; secure":"");document.cookie="apbct_check_comments_offset=0; path=/; samesite=lax"+c,jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"ajax_clear_comments",security:ct_ajax_nonce,from:e,till:t},success:function(e){ct_show_info(),ct_send_comments()}})}function ct_cooling_down_toggle(){ct_cooling_down_flag=!1,ct_send_comments(),ct_show_info()}function ct_send_comments(){var e;!0!==ct_cooling_down_flag&&(ct_max_requests<=ct_requests_counter?(setTimeout(ct_cooling_down_toggle,ct_cool_down_time),ct_cooling_down_flag=!(ct_requests_counter=0)):(ct_requests_counter++,e={action:"ajax_check_comments",security:ct_ajax_nonce,new_check:ct_new_check,unchecked:ct_unchecked,offset:Number(ctGetCookie("apbct_check_comments_offset"))},ct_accurate_check&&(e.accurate_check=!0),ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){var t;e=jQuery.parseJSON(e),parseInt(e.error)?(ct_working=!1,confirm(e.error_message+". Do you want to proceed?")?ct_send_comments():(t="edit-comments.php?page=ct_check_spam",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t)):(ct_new_check=!1,1==parseInt(e.end)||!0===ct_pause?(1==parseInt(e.end)&&(document.cookie="ct_paused_spam_check=0; path=/; samesite=lax"),ct_working=!1,jQuery("#ct_working_message").hide(),t="edit-comments.php?page=ct_check_spam",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t):0==parseInt(e.end)&&(ct_comments_checked+=e.checked,ct_comments_spam+=e.spam,ct_comments_bad
|
2 |
//# sourceMappingURL=cleantalk-comments-checkspam.min.js.map
|
1 |
+
var ct_working=!(String.prototype.printf=function(){var e,t=this;for(e in arguments)var c=t.substring(0,t.indexOf("%s",0)),a=t.substring(t.indexOf("%s",0)+2,t.length),t=c+arguments[e]+a;return t}),ct_new_check=!0,ct_cooling_down_flag=!1,ct_close_animate=!0,ct_accurate_check=!1,ct_pause=!1,ct_prev_accurate=ctCommentsCheck.ct_prev_accurate,ct_prev_from=ctCommentsCheck.ct_prev_from,ct_prev_till=ctCommentsCheck.ct_prev_till,ct_cool_down_time=9e4,ct_requests_counter=0,ct_max_requests=60,ct_ajax_nonce=ctCommentsCheck.ct_ajax_nonce,ct_comments_total=0,ct_comments_checked=0,ct_comments_spam=0,ct_comments_bad=0,ct_unchecked="unset",ct_date_from=0,ct_date_till=0;function animate_comment(e,t){ct_close_animate?.3==e?jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(.3,t)}):ct_close_animate=!0}function ct_clear_comments(){var e=0,t=0,c=(jQuery("#ct_allow_date_range").is(":checked")&&(e=jQuery("#ct_date_range_from").val(),t=jQuery("#ct_date_range_till").val()),"https:"===location.protocol?"; secure":"");document.cookie="apbct_check_comments_offset=0; path=/; samesite=lax"+c,jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"ajax_clear_comments",security:ct_ajax_nonce,from:e,till:t},success:function(e){ct_show_info(),ct_send_comments()}})}function ct_cooling_down_toggle(){ct_cooling_down_flag=!1,ct_send_comments(),ct_show_info()}function ct_send_comments(){var e;!0!==ct_cooling_down_flag&&(ct_max_requests<=ct_requests_counter?(setTimeout(ct_cooling_down_toggle,ct_cool_down_time),ct_cooling_down_flag=!(ct_requests_counter=0)):(ct_requests_counter++,e={action:"ajax_check_comments",security:ct_ajax_nonce,new_check:ct_new_check,unchecked:ct_unchecked,offset:Number(ctGetCookie("apbct_check_comments_offset"))},ct_accurate_check&&(e.accurate_check=!0),ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){var t;e=jQuery.parseJSON(e),parseInt(e.error)?(ct_working=!1,confirm(e.error_message+". Do you want to proceed?")?ct_send_comments():(t="edit-comments.php?page=ct_check_spam",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t)):(ct_new_check=!1,1==parseInt(e.end)||!0===ct_pause?(1==parseInt(e.end)&&(document.cookie="ct_paused_spam_check=0; path=/; samesite=lax"),ct_working=!1,jQuery("#ct_working_message").hide(),t="edit-comments.php?page=ct_check_spam",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t):0==parseInt(e.end)&&(ct_comments_checked+=e.checked,ct_comments_spam+=e.spam,ct_comments_bad=e.bad,ct_comments_total+=e.total,ct_unchecked=ct_comments_total-ct_comments_checked-ct_comments_bad,t=(t=String(ctCommentsCheck.ct_status_string)).printf(ct_comments_checked,ct_comments_spam,ct_comments_bad),0<parseInt(ct_comments_spam)&&(t+=ctCommentsCheck.ct_status_string_warning),jQuery("#ct_checking_status").html(t),jQuery("#ct_error_message").hide(),+ct_comments_total<ct_comments_checked+ct_comments_bad&&(document.cookie="ct_comments_start_check=1; path=/; samesite=lax",location.href="edit-comments.php?page=ct_check_spam"),e=Number(ctGetCookie("apbct_check_comments_offset"))+100,document.cookie="apbct_check_comments_offset="+e+"; path=/; samesite=lax"+ctSecure,ct_send_comments()))},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_send_comments(),3e3)},timeout:25e3})))}function ct_show_info(){var e;ct_working&&(1==ct_cooling_down_flag?(jQuery("#ct_cooling_notice").html("Waiting for API to cool down. (About a minute)"),jQuery("#ct_cooling_notice").show()):(jQuery("#ct_cooling_notice").hide(),ct_comments_total||(e={action:"ajax_info_comments",security:ct_ajax_nonce},ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){e=jQuery.parseJSON(e),jQuery("#ct_checking_status").html(e.message),ct_comments_total=e.total,ct_comments_spam=e.spam,ct_comments_checked=e.checked,ct_comments_bad=e.bad},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_show_info(),3e3)},timeout:15e3}))))}function ct_toggle_depended(e,t){t=t||null;var c=jQuery(e.data("depended"));e.data("state")||t?(e.data("state",!1),c.prop("disabled",!0),c.removeProp("checked"),c.data("depended")&&ct_toggle_depended(c,!0)):(e.data("state",!0),c.removeProp("disabled"))}function ct_trash_all(a){var e={action:"ajax_trash_all",security:ct_ajax_nonce};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_comments_left").html(e),ct_trash_all(a)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="edit-comments.php?page=ct_check_spam")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_trash_all(a),3e3)},timeout:25e3})}function ct_spam_all(a){var e={action:"ajax_spam_all",security:ct_ajax_nonce};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_comments_left").html(e),ct_spam_all(a)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="edit-comments.php?page=ct_check_spam")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_spam_all(a),3e3)},timeout:25e3})}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}jQuery(document).ready(function(){ct_prev_accurate&&jQuery("#ct_accurate_check").prop("checked",!0),ct_prev_from&&(jQuery("#ct_allow_date_range").prop("checked",!0).data("state",!0),jQuery("#ct_date_range_from").removeProp("disabled").val(ct_prev_from),jQuery("#ct_date_range_till").removeProp("disabled").val(ct_prev_till)),jQuery("#ct_allow_date_range").on("change",function(){document.cookie="ct_spam_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_spam_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax",this.checked?(document.cookie="ct_spam_dates_allowed=1; path=/; samesite=lax",jQuery(".ct_date").prop("checked",!0).attr("disabled",!1)):(document.cookie="ct_spam_dates_allowed=0; path=/; samesite=lax",jQuery(".ct_date").prop("disabled",!0).attr("disabled",!0))}),jQuery.datepicker.setDefaults(jQuery.datepicker.regional.en);var a=jQuery("#ct_date_range_from, #ct_date_range_till").datepicker({dateFormat:"M d yy",maxDate:"+0D",changeMonth:!0,changeYear:!0,showAnim:"slideDown",onSelect:function(e){var t="ct_date_range_from"==this.id?"minDate":"maxDate",c=jQuery(this).data("datepicker"),e=jQuery.datepicker.parseDate(c.settings.dateFormat||jQuery.datepicker._defaults.dateFormat,e,c.settings);a.not(this).datepicker("option",t,e),document.cookie="ct_spam_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_spam_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax"}});function e(e){e=e||null,jQuery("#ct_allow_date_range").is(":checked")&&(ct_date_from=jQuery("#ct_date_range_from").val(),ct_date_till=jQuery("#ct_date_range_till").val(),""==ct_date_from||""==ct_date_till)?alert("Please, specify a date range."):(jQuery("#ct_accurate_check").is(":checked")&&(ct_accurate_check=!0),jQuery("#ct_accurate_check").is(":checked")&&!jQuery("#ct_allow_date_range").is(":checked")?alert("Please, select a date range."):(jQuery(".ct_to_hide").hide(),jQuery("#ct_working_message").show(),jQuery("#ct_preloader").show(),jQuery("#ct_pause").show(),ct_working=!0,(e?(ct_show_info(),ct_send_comments):ct_clear_comments)()))}jQuery("#ct_check_spam_button").click(function(){e(!(document.cookie="ct_paused_spam_check=0; path=/; samesite=lax"))}),jQuery("#ct_proceed_check_button").click(function(){e(!0)}),jQuery("#ct_pause").on("click",function(){ct_pause=!0;var e={accurate:ct_accurate_check,from:ct_date_from,till:ct_date_till};document.cookie="ct_paused_spam_check="+JSON.stringify(e)+"; path=/; samesite=lax"}),"1"===ctCommentsCheck.start&&(document.cookie="ct_comments_start_check=0; expires="+new Date(0).toUTCString()+"; path=/; samesite=lax",jQuery("#ct_check_spam_button").click()),jQuery(".ct_trash_all").click(function(e){if(!confirm(ctCommentsCheck.ct_confirm_trash_all))return!1;ct_trash_all(e)}),jQuery(".ct_spam_all").click(function(e){if(!confirm(ctCommentsCheck.ct_confirm_spam_all))return!1;ct_spam_all(e)}),jQuery("#ct_accurate_check").change(function(){this.checked&&(jQuery("#ct_allow_date_range").prop("checked",!0),jQuery(".ct_date").prop("checked",!0).attr("disabled",!1))})});
|
2 |
//# sourceMappingURL=cleantalk-comments-checkspam.min.js.map
|
js/cleantalk-comments-checkspam.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-comments-checkspam.min.js","sources":["cleantalk-comments-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctCommentsCheck.ct_prev_accurate,\n\tct_prev_from = ctCommentsCheck.ct_prev_from,\t\n\tct_prev_till = ctCommentsCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,\n\tct_comments_total = 0,\n\tct_comments_checked = 0,\n\tct_comments_spam = 0,\n\tct_comments_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to==0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_comments(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\t\n\tvar data = {\n\t\t'action' : 'ajax_clear_comments',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}\n\t});\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_comments();\n\tct_show_info();\n}\n\nfunction ct_send_comments(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\t\n\tvar data = {\n\t\t'action': 'ajax_check_comments',\n\t\t'security': ct_ajax_nonce,\n\t\t'new_check': ct_new_check,\n\t\t'unchecked': ct_unchecked,\n\t\t'offset' : Number(ctGetCookie('apbct_check_comments_offset'))\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_comments();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause === true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_comments_checked += msg.checked;\n\t\t\t\t\tct_comments_spam += msg.spam;\n\t\t\t\t\tct_comments_bad += msg.bad;\n\t\t\t\t\tct_comments_total += msg.total;\n\t\t\t\t\tct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;\n\t\t\t\t\tvar status_string = String(ctCommentsCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_comments_checked, ct_comments_spam, ct_comments_bad);\n\t\t\t\t\tif(parseInt(ct_comments_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctCommentsCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\t// If DB woks not properly\n\t\t\t\t\tif(+ct_comments_total < ct_comments_checked + ct_comments_bad){\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_start_check=1; path=/; samesite=lax';\n\t\t\t\t\t\tlocation.href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\t}\n\n\t\t\t\t\tvar offset = Number(ctGetCookie('apbct_check_comments_offset')) + 100;\n\t\t\t\t\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + offset + \"; path=/\";\n\t\t\t\t\t\n\t\t\t\t\tct_send_comments();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_send_comments(), 3000); \n },\n timeout: 25000\n\t});\n}\nfunction ct_show_info(){\n\t\n\tif(ct_working){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif(!ct_comments_total){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_comments',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif(ct_date_from && ct_date_till){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_comments_total = msg.total;\n\t\t\t\t\tct_comments_spam = msg.spam;\n\t\t\t\t\tct_comments_checked = msg.checked;\n\t\t\t\t\tct_comments_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\t\t\tsetTimeout(ct_show_info(), 3000); \n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\nfunction ct_trash_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_trash_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_trash_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_trash_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\nfunction ct_spam_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_spam_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_spam_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_spam_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\njQuery(document).ready(function(){\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\tfunction ct_start_check(continue_check){\n\n continue_check = continue_check || null;\n\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\t\t\t\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\t\t\t\t\t\t\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\n\t\t\t\talert('Please, specify a date range.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\t\tct_accurate_check = true;\n\t\t}\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_working_message').show();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_pause').show();\n\n\t\tct_working=true;\n\t\t\n\t\tif(continue_check){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}else\n\t\t\tct_clear_comments();\n\t\t\n\t}\n\t\n\t// Check comments\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_spam_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\n\n\tif(ctCommentsCheck.start === '1'){\n\t\tdocument.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/; samesite=lax';\n\t\tjQuery('#ct_check_spam_button').click();\t\n\t}\n\n\t// Delete all spam comments\n\tjQuery(\".ct_trash_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_trash_all))\n\t\t\treturn false;\n\n\t\tct_trash_all( e );\n\n\t});\n\n\t// Mark as spam all spam comments\n\tjQuery(\".ct_spam_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_spam_all))\n\t\t\treturn false;\n\n\t\tct_spam_all( e );\n\n\t});\n\n});\n\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n\tvar matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}"],"names":["ct_working","String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctCommentsCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_comments_total","ct_comments_checked","ct_comments_spam","ct_comments_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_comments","from","till","ctSecure","is","val","location","protocol","document","cookie","ajax","type","url","ajaxurl","data","action","security","success","msg","ct_show_info","ct_send_comments","ct_cooling_down_toggle","setTimeout","new_check","unchecked","offset","Number","ctGetCookie","status_string","parseJSON","parseInt","error","confirm","error_message","new_href","href","end","hide","checked","spam","bad","total","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_trash_all","e","target","addClass","css","removeClass","ct_spam_all","name","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","alert","click","ct_check","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_trash_all","ct_confirm_spam_all"],"mappings":"AAYA,IAAIA,WAAa,EAXjBC,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,CAAC,CAA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hB,CAAC,CAEF,CAAC"}
|
1 |
+
{"version":3,"file":"cleantalk-comments-checkspam.min.js","sources":["cleantalk-comments-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctCommentsCheck.ct_prev_accurate,\n\tct_prev_from = ctCommentsCheck.ct_prev_from,\t\n\tct_prev_till = ctCommentsCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,\n\tct_comments_total = 0,\n\tct_comments_checked = 0,\n\tct_comments_spam = 0,\n\tct_comments_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to==0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_comments(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\t\n\tvar data = {\n\t\t'action' : 'ajax_clear_comments',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}\n\t});\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_comments();\n\tct_show_info();\n}\n\nfunction ct_send_comments(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\t\n\tvar data = {\n\t\t'action': 'ajax_check_comments',\n\t\t'security': ct_ajax_nonce,\n\t\t'new_check': ct_new_check,\n\t\t'unchecked': ct_unchecked,\n\t\t'offset' : Number(ctGetCookie('apbct_check_comments_offset'))\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_comments();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause === true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_comments_checked += msg.checked;\n\t\t\t\t\tct_comments_spam += msg.spam;\n\t\t\t\t\tct_comments_bad = msg.bad;\n\t\t\t\t\tct_comments_total += msg.total;\n\t\t\t\t\tct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;\n\t\t\t\t\tvar status_string = String(ctCommentsCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_comments_checked, ct_comments_spam, ct_comments_bad);\n\t\t\t\t\tif(parseInt(ct_comments_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctCommentsCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\t// If DB woks not properly\n\t\t\t\t\tif(+ct_comments_total < ct_comments_checked + ct_comments_bad){\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_start_check=1; path=/; samesite=lax';\n\t\t\t\t\t\tlocation.href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\t}\n\n\t\t\t\t\tvar offset = Number(ctGetCookie('apbct_check_comments_offset')) + 100;\n\t\t\t\t\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + offset + \"; path=/; samesite=lax\" + ctSecure;\n\t\t\t\t\t\n\t\t\t\t\tct_send_comments();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_send_comments(), 3000); \n },\n timeout: 25000\n\t});\n}\nfunction ct_show_info(){\n\t\n\tif(ct_working){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif(!ct_comments_total){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_comments',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif(ct_date_from && ct_date_till){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_comments_total = msg.total;\n\t\t\t\t\tct_comments_spam = msg.spam;\n\t\t\t\t\tct_comments_checked = msg.checked;\n\t\t\t\t\tct_comments_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\t\t\tsetTimeout(ct_show_info(), 3000); \n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\nfunction ct_trash_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_trash_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_trash_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_trash_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\nfunction ct_spam_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_spam_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_spam_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_spam_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\njQuery(document).ready(function(){\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\tfunction ct_start_check(continue_check){\n\n continue_check = continue_check || null;\n\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\t\t\t\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\t\t\t\t\t\t\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\n\t\t\t\talert('Please, specify a date range.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\t\tct_accurate_check = true;\n\t\t}\n\n\t\tif (\n\t\t\tjQuery('#ct_accurate_check').is(':checked') &&\n\t\t\t! jQuery('#ct_allow_date_range').is(':checked')\n\t\t) {\n\t\t\talert('Please, select a date range.');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_working_message').show();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_pause').show();\n\n\t\tct_working=true;\n\t\t\n\t\tif(continue_check){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}else\n\t\t\tct_clear_comments();\n\t\t\n\t}\n\t\n\t// Check comments\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_spam_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\n\n\tif(ctCommentsCheck.start === '1'){\n\t\tdocument.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/; samesite=lax';\n\t\tjQuery('#ct_check_spam_button').click();\t\n\t}\n\n\t// Delete all spam comments\n\tjQuery(\".ct_trash_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_trash_all))\n\t\t\treturn false;\n\n\t\tct_trash_all( e );\n\n\t});\n\n\t// Mark as spam all spam comments\n\tjQuery(\".ct_spam_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_spam_all))\n\t\t\treturn false;\n\n\t\tct_spam_all( e );\n\n\t});\n\n\t/**\n\t * Checked ct_accurate_check\n\t */\n\tjQuery('#ct_accurate_check').change(function () {\n\t\tif(this.checked) {\n\t\t\tjQuery('#ct_allow_date_range').prop('checked', true);\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t}\n\t});\n});\n\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n\tvar matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}"],"names":["ct_working","String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctCommentsCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_comments_total","ct_comments_checked","ct_comments_spam","ct_comments_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_comments","from","till","ctSecure","is","val","location","protocol","document","cookie","ajax","type","url","ajaxurl","data","action","security","success","msg","ct_show_info","ct_send_comments","ct_cooling_down_toggle","setTimeout","new_check","unchecked","offset","Number","ctGetCookie","status_string","parseJSON","parseInt","error","confirm","error_message","new_href","href","end","hide","checked","spam","bad","total","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_trash_all","e","target","addClass","css","removeClass","ct_spam_all","name","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","alert","click","ct_check","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_trash_all","ct_confirm_spam_all","change"],"mappings":"AAYA,IAAIA,WAAa,EAXjBC,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ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cC,CAAE,CAEjB,CAAC,EAGD5D,OAAO,cAAc,EAAEiG,MAAM,SAAUrC,GAEtC,GAAI,CAAC1B,QAAQnD,gBAAgB2H,mBAAmB,EAC/C,MAAO,CAAA,EAERzC,YAAaL,CAAE,CAEhB,CAAC,EAKD5D,OAAO,oBAAoB,EAAE2G,OAAO,WAChCzI,KAAKsE,UACPxC,OAAO,sBAAsB,EAAEyD,KAAK,UAAW,CAAA,CAAI,EACnDzD,OAAO,UAAU,EAAEyD,KAAK,UAAW,CAAA,CAAI,EAAEkB,KAAK,WAAW,CAAA,CAAK,EAEhE,CAAC,CACF,CAAC"}
|
lib/Cleantalk/Antispam/Cleantalk.php
CHANGED
@@ -4,6 +4,7 @@ namespace Cleantalk\Antispam;
|
|
4 |
|
5 |
use Cleantalk\ApbctWP\Helper;
|
6 |
use Cleantalk\ApbctWP\HTTP\Request;
|
|
|
7 |
|
8 |
/**
|
9 |
* Cleantalk base class
|
@@ -398,13 +399,27 @@ class Cleantalk
|
|
398 |
}
|
399 |
|
400 |
$starttime = microtime(true);
|
401 |
-
|
402 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
|
404 |
-
if (
|
405 |
$status = $this->max_server_timeout / 1000; // Site is down
|
406 |
} else {
|
407 |
-
|
|
|
|
|
408 |
$status = ($stoptime - $starttime);
|
409 |
$status = round($status, 4);
|
410 |
}
|
4 |
|
5 |
use Cleantalk\ApbctWP\Helper;
|
6 |
use Cleantalk\ApbctWP\HTTP\Request;
|
7 |
+
use Cleantalk\Common\DNS;
|
8 |
|
9 |
/**
|
10 |
* Cleantalk base class
|
399 |
}
|
400 |
|
401 |
$starttime = microtime(true);
|
402 |
+
if ( function_exists('fsockopen') ) {
|
403 |
+
$file = @fsockopen($host, 443, $errno, $errstr, $this->max_server_timeout / 1000);
|
404 |
+
} else {
|
405 |
+
$http = new Request();
|
406 |
+
$host = 'https://' . gethostbyaddr($host);
|
407 |
+
$file = $http->setUrl($host)
|
408 |
+
->setOptions(['timeout' => $this->max_server_timeout / 1000])
|
409 |
+
->setPresets('get_code get')
|
410 |
+
->request();
|
411 |
+
if ( !empty($file['error']) || $file !== '200' ) {
|
412 |
+
$file = false;
|
413 |
+
}
|
414 |
+
}
|
415 |
+
$stoptime = microtime(true);
|
416 |
|
417 |
+
if ( !$file ) {
|
418 |
$status = $this->max_server_timeout / 1000; // Site is down
|
419 |
} else {
|
420 |
+
if ( function_exists('fsockopen') ) {
|
421 |
+
fclose($file);
|
422 |
+
}
|
423 |
$status = ($stoptime - $starttime);
|
424 |
$status = round($status, 4);
|
425 |
}
|
lib/Cleantalk/Antispam/Integrations.php
CHANGED
@@ -33,7 +33,9 @@ class Integrations
|
|
33 |
add_action('wp_ajax_' . $integration_info['hook'], array($this, 'checkSpam'), 1);
|
34 |
add_action('wp_ajax_nopriv_' . $integration_info['hook'], array($this, 'checkSpam'), 1);
|
35 |
}
|
36 |
-
}
|
|
|
|
|
37 |
if ( is_array($integration_info['hook']) ) {
|
38 |
foreach ( $integration_info['hook'] as $hook ) {
|
39 |
add_action($hook, array($this, 'checkSpam'));
|
33 |
add_action('wp_ajax_' . $integration_info['hook'], array($this, 'checkSpam'), 1);
|
34 |
add_action('wp_ajax_nopriv_' . $integration_info['hook'], array($this, 'checkSpam'), 1);
|
35 |
}
|
36 |
+
}
|
37 |
+
|
38 |
+
if ( !$integration_info['ajax'] || !empty($integration_info['ajax_and_post']) ) {
|
39 |
if ( is_array($integration_info['hook']) ) {
|
40 |
foreach ( $integration_info['hook'] as $hook ) {
|
41 |
add_action($hook, array($this, 'checkSpam'));
|
lib/Cleantalk/Antispam/Integrations/GiveWP.php
CHANGED
@@ -8,7 +8,7 @@ class GiveWP extends IntegrationBase
|
|
8 |
{
|
9 |
public function getDataForChecking($argument)
|
10 |
{
|
11 |
-
if ( Post::get('action') === 'give_process_donation' ) {
|
12 |
/**
|
13 |
* Filter for POST
|
14 |
*/
|
8 |
{
|
9 |
public function getDataForChecking($argument)
|
10 |
{
|
11 |
+
if ( Post::get('action') === 'give_process_donation' || in_array(Post::get('give_action'), ['donation', 'purchase']) ) {
|
12 |
/**
|
13 |
* Filter for POST
|
14 |
*/
|
lib/Cleantalk/Antispam/Integrations/StrongTestimonials.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Cleantalk\Antispam\Integrations;
|
4 |
+
|
5 |
+
use Cleantalk\ApbctWP\Variables\Post;
|
6 |
+
|
7 |
+
class StrongTestimonials extends IntegrationBase
|
8 |
+
{
|
9 |
+
public function getDataForChecking($argument)
|
10 |
+
{
|
11 |
+
if ( Post::get('action') === 'wpmtst_form' || Post::get('action') === 'wpmtst_form2' ) {
|
12 |
+
/**
|
13 |
+
* Filter for POST
|
14 |
+
*/
|
15 |
+
$input_array = apply_filters('apbct__filter_post', $_POST);
|
16 |
+
|
17 |
+
$nickname = Post::get('client_name');
|
18 |
+
|
19 |
+
return ct_get_fields_any($input_array, null, $nickname);
|
20 |
+
}
|
21 |
+
|
22 |
+
return null;
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @param $message
|
27 |
+
*
|
28 |
+
* @return void
|
29 |
+
*/
|
30 |
+
public function doBlock($message)
|
31 |
+
{
|
32 |
+
if ( apbct_is_ajax() ) {
|
33 |
+
$return = array(
|
34 |
+
'success' => false,
|
35 |
+
'errors' => array(
|
36 |
+
'email' => $message)
|
37 |
+
);
|
38 |
+
echo json_encode($return);
|
39 |
+
wp_die();
|
40 |
+
} else {
|
41 |
+
wp_die($message);
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
lib/Cleantalk/ApbctWP/Escape.php
CHANGED
@@ -104,7 +104,7 @@ class Escape extends \Cleantalk\Common\Escape
|
|
104 |
)
|
105 |
)
|
106 |
) {
|
107 |
-
$result = str_replace(array('>', '<'), array('>', '<'), $result);
|
108 |
}
|
109 |
return $result;
|
110 |
}
|
104 |
)
|
105 |
)
|
106 |
) {
|
107 |
+
$result = str_replace(array('>', '<', '&&'), array('>', '<', '&&'), $result);
|
108 |
}
|
109 |
return $result;
|
110 |
}
|
lib/Cleantalk/ApbctWP/FindSpam/CommentsChecker.php
CHANGED
@@ -60,6 +60,99 @@ class CommentsChecker extends Checker
|
|
60 |
));
|
61 |
}
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
public function getCurrentScanPage()
|
64 |
{
|
65 |
$this->list_table = new \Cleantalk\ApbctWP\FindSpam\ListTable\CommentsScan();
|
@@ -129,156 +222,16 @@ class CommentsChecker extends Checker
|
|
129 |
{
|
130 |
check_ajax_referer('ct_secret_nonce', 'security');
|
131 |
|
132 |
-
|
133 |
-
|
134 |
-
$sql_where = "WHERE NOT comment_approved = 'spam'";
|
135 |
-
$sql_where .= " AND comment_type = 'comment'";
|
136 |
-
if ( Post::get('from') && Post::get('till') ) {
|
137 |
-
$from_date = date('Y-m-d', intval(strtotime(Post::get('from'))));
|
138 |
-
$till_date = date('Y-m-d', intval(strtotime(Post::get('till'))));
|
139 |
-
|
140 |
-
$sql_where .= " AND comment_date_gmt > '$from_date 00:00:00' AND comment_date_gmt < '$till_date 23:59:59'";
|
141 |
-
}
|
142 |
-
|
143 |
-
$offset = Cookie::get('apbct_check_comments_offset') ? (int) Cookie::get('apbct_check_comments_offset') : 0;
|
144 |
-
|
145 |
-
$query = "SELECT comment_ID, comment_date_gmt, comment_author_IP, comment_author_email
|
146 |
-
FROM $wpdb->comments
|
147 |
-
$sql_where
|
148 |
-
ORDER BY comment_ID
|
149 |
-
LIMIT 100 OFFSET " . $offset;
|
150 |
-
|
151 |
-
$c = $wpdb->get_results($query);
|
152 |
-
|
153 |
-
$check_result = array(
|
154 |
-
'end' => 0,
|
155 |
-
'checked' => 0,
|
156 |
-
'spam' => 0,
|
157 |
-
'bad' => 0,
|
158 |
-
'error' => 0,
|
159 |
-
'total' => wp_count_comments()->total_comments,
|
160 |
-
);
|
161 |
-
|
162 |
-
if ( count($c) > 0 ) {
|
163 |
-
// Converting $c to objects
|
164 |
-
if ( is_array($c[0]) ) {
|
165 |
-
foreach ( $c as $key => $value ) {
|
166 |
-
$c[$key] = (object)$value;
|
167 |
-
}
|
168 |
-
}
|
169 |
-
|
170 |
-
if ( ! empty(Post::get('accurate_check')) ) {
|
171 |
-
// Leaving comments only with first comment's date. Unsetting others.
|
172 |
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
if ( substr($comment->comment_date_gmt, 0, 10) != $curr_date ) {
|
179 |
-
unset($c[$comment_index]);
|
180 |
-
}
|
181 |
-
}
|
182 |
-
}
|
183 |
-
|
184 |
-
// Checking comments IP/Email. Gathering $data for check.
|
185 |
-
$data = array();
|
186 |
-
foreach ( $c as $i => $iValue ) {
|
187 |
-
$curr_ip = $iValue->comment_author_IP;
|
188 |
-
$curr_email = $iValue->comment_author_email;
|
189 |
-
|
190 |
-
// Check for identity
|
191 |
-
$curr_ip = preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $curr_ip) === 1 ? $curr_ip : null;
|
192 |
-
$curr_email = preg_match('/^\S+@\S+\.\S+$/', $curr_email) === 1 ? $curr_email : null;
|
193 |
-
|
194 |
-
if ( empty($curr_ip) && empty($curr_email) ) {
|
195 |
-
$check_result['bad']++;
|
196 |
-
unset($c[$i]);
|
197 |
-
} else {
|
198 |
-
if ( ! empty($curr_ip) ) {
|
199 |
-
$data[] = $curr_ip;
|
200 |
-
}
|
201 |
-
if ( ! empty($curr_email) ) {
|
202 |
-
$data[] = $curr_email;
|
203 |
-
}
|
204 |
-
// Patch for empty IP/Email
|
205 |
-
$iValue->comment_author_IP = empty($curr_ip) ? 'none' : $curr_ip;
|
206 |
-
$iValue->comment_author_email = empty($curr_email) ? 'none' : $curr_email;
|
207 |
-
}
|
208 |
-
}
|
209 |
-
|
210 |
-
// save count bad comments to State:data
|
211 |
-
$apbct->data['count_bad_comments'] += $check_result['bad'];
|
212 |
-
$apbct->saveData();
|
213 |
-
|
214 |
-
// Recombining after checking and unsetting
|
215 |
-
$c = array_values($c);
|
216 |
-
|
217 |
-
// Drop if data empty and there's no comments to check
|
218 |
-
if ( count($data) === 0 ) {
|
219 |
-
if ( (int) Post::get('unchecked') === 0 ) {
|
220 |
-
$check_result['end'] = 1;
|
221 |
-
}
|
222 |
-
print json_encode($check_result);
|
223 |
-
die();
|
224 |
-
}
|
225 |
-
|
226 |
-
$result = API::methodSpamCheckCms(
|
227 |
-
$apbct->api_key,
|
228 |
-
$data,
|
229 |
-
! empty(Post::get('accurate_check')) ? $curr_date : null
|
230 |
-
);
|
231 |
-
|
232 |
-
if ( empty($result['error']) ) {
|
233 |
-
foreach ( $c as $iValue ) {
|
234 |
-
$mark_spam_ip = false;
|
235 |
-
$mark_spam_email = false;
|
236 |
-
|
237 |
-
$check_result['checked']++;
|
238 |
-
|
239 |
-
$uip = $iValue->comment_author_IP;
|
240 |
-
$uim = $iValue->comment_author_email;
|
241 |
-
|
242 |
-
if ( isset($result[$uip]) && isset($result[$uim]['appears']) && $result[$uip]['appears'] == 1 ) {
|
243 |
-
$mark_spam_ip = true;
|
244 |
-
}
|
245 |
-
|
246 |
-
if ( isset($result[$uim]) && isset($result[$uim]['appears']) && $result[$uim]['appears'] == 1 ) {
|
247 |
-
$mark_spam_email = true;
|
248 |
-
}
|
249 |
-
|
250 |
-
if ( $mark_spam_ip || $mark_spam_email ) {
|
251 |
-
$check_result['spam']++;
|
252 |
-
update_comment_meta($iValue->comment_ID, 'ct_marked_as_spam', '1');
|
253 |
-
}
|
254 |
-
}
|
255 |
-
|
256 |
-
// save count checked comments to State:data
|
257 |
-
$apbct->data['count_checked_comments'] += $check_result['checked'];
|
258 |
-
$apbct->saveData();
|
259 |
-
|
260 |
-
print json_encode($check_result);
|
261 |
-
} else {
|
262 |
-
$check_result['error'] = 1;
|
263 |
-
$check_result['error_message'] = $result['error'];
|
264 |
-
echo json_encode($check_result);
|
265 |
-
}
|
266 |
} else {
|
267 |
-
$
|
268 |
-
|
269 |
-
$log_data = static::getLogData();
|
270 |
-
static::writeSpamLog(
|
271 |
-
'comments',
|
272 |
-
date("Y-m-d H:i:s"),
|
273 |
-
$log_data['checked'],
|
274 |
-
$log_data['spam'],
|
275 |
-
$log_data['bad']
|
276 |
-
);
|
277 |
-
|
278 |
-
print json_encode($check_result);
|
279 |
}
|
280 |
-
|
281 |
-
die;
|
282 |
}
|
283 |
|
284 |
public static function ctAjaxInfo($direct_call = false)
|
@@ -306,7 +259,7 @@ class CommentsChecker extends Checker
|
|
306 |
$cnt_spam = get_comments($params_spam);
|
307 |
|
308 |
// Bad comments (without IP and Email)
|
309 |
-
$cnt_bad
|
310 |
|
311 |
/**
|
312 |
* Total comments
|
@@ -381,11 +334,10 @@ class CommentsChecker extends Checker
|
|
381 |
check_ajax_referer('ct_secret_nonce', 'security');
|
382 |
|
383 |
$apbct->data['count_checked_comments'] = 0;
|
384 |
-
$apbct->data['count_bad_comments'] = 0;
|
385 |
$apbct->saveData();
|
386 |
|
387 |
$wpdb->query("DELETE FROM {$wpdb->commentmeta} WHERE meta_key IN ('ct_marked_as_spam')");
|
388 |
-
die;
|
389 |
}
|
390 |
|
391 |
private static function getLogData()
|
@@ -408,7 +360,7 @@ class CommentsChecker extends Checker
|
|
408 |
);
|
409 |
$cnt_spam = get_comments($params_spam);
|
410 |
|
411 |
-
$cnt_bad =
|
412 |
|
413 |
return array(
|
414 |
'spam' => $cnt_spam,
|
@@ -490,4 +442,220 @@ class CommentsChecker extends Checker
|
|
490 |
print $cnt_all;
|
491 |
die();
|
492 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
493 |
}
|
60 |
));
|
61 |
}
|
62 |
|
63 |
+
/**
|
64 |
+
* Get all comments from DB
|
65 |
+
*
|
66 |
+
* @return array|false
|
67 |
+
*/
|
68 |
+
private static function getAllComments(CommentsScanParameters $commentsScanParameters)
|
69 |
+
{
|
70 |
+
global $wpdb;
|
71 |
+
|
72 |
+
$amount = $commentsScanParameters->getAmount();
|
73 |
+
$skip_roles = $commentsScanParameters->getSkipRoles();
|
74 |
+
$offset = $commentsScanParameters->getOffset();
|
75 |
+
$between_dates_sql = '';
|
76 |
+
$date_from = $commentsScanParameters->getFrom();
|
77 |
+
$date_till = $commentsScanParameters->getTill();
|
78 |
+
if ($date_from && $date_till) {
|
79 |
+
$date_from = date('Y-m-d', (int) strtotime($date_from)) . ' 00:00:00';
|
80 |
+
$date_till = date('Y-m-d', (int) strtotime($date_till)) . ' 23:59:59';
|
81 |
+
|
82 |
+
$between_dates_sql = "WHERE $wpdb->comments.comment_date_gmt >= '$date_from' AND $wpdb->comments.comment_date_gmt <= '$date_till'";
|
83 |
+
}
|
84 |
+
|
85 |
+
$comments = $wpdb->get_results(
|
86 |
+
"
|
87 |
+
SELECT {$wpdb->comments}.comment_ID, {$wpdb->comments}.comment_date_gmt, {$wpdb->comments}.comment_author_IP, {$wpdb->comments}.comment_author_email, {$wpdb->comments}.user_id
|
88 |
+
FROM {$wpdb->comments}
|
89 |
+
{$between_dates_sql}
|
90 |
+
ORDER BY {$wpdb->comments}.comment_ID ASC
|
91 |
+
LIMIT $amount OFFSET $offset;"
|
92 |
+
);
|
93 |
+
|
94 |
+
if (!$comments) {
|
95 |
+
$comments = array();
|
96 |
+
}
|
97 |
+
|
98 |
+
// removed skip_roles and return $comments
|
99 |
+
$comments = self::removeSkipRoles($comments, $skip_roles);
|
100 |
+
|
101 |
+
// removed comments without comment_author_IP and comment_author_email
|
102 |
+
$comments = self::removeCommentsWithoutIPEmail($comments);
|
103 |
+
|
104 |
+
return $comments;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* @param array $comments
|
109 |
+
* @param array $skip_roles
|
110 |
+
*
|
111 |
+
* @return array|false
|
112 |
+
*/
|
113 |
+
private static function removeSkipRoles(array $comments, array $skip_roles)
|
114 |
+
{
|
115 |
+
foreach ($comments as $index => $comment) {
|
116 |
+
if (!$comment->user_id) {
|
117 |
+
continue;
|
118 |
+
}
|
119 |
+
$user_meta = get_userdata($comment->user_id);
|
120 |
+
$user_roles = $user_meta->roles;
|
121 |
+
foreach ($user_roles as $user_role) {
|
122 |
+
if (in_array($user_role, $skip_roles, true)) {
|
123 |
+
unset($comments[$index]);
|
124 |
+
break;
|
125 |
+
}
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
return $comments;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* @param array $comments
|
134 |
+
*
|
135 |
+
* @return array|false
|
136 |
+
*/
|
137 |
+
private static function removeCommentsWithoutIPEmail(array $comments)
|
138 |
+
{
|
139 |
+
foreach ($comments as $index => $comment) {
|
140 |
+
$comment_ip = ! empty($comment->comment_author_IP) ? trim($comment->comment_author_IP) : false;
|
141 |
+
$comment_email = ! empty($comment->comment_author_email) ? trim($comment->comment_author_email) : false;
|
142 |
+
|
143 |
+
// Validate IP and Email
|
144 |
+
$comment_ip = filter_var($comment_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
|
145 |
+
$comment_email = filter_var($comment_email, FILTER_VALIDATE_EMAIL);
|
146 |
+
|
147 |
+
if (!$comment_ip && !$comment_email) {
|
148 |
+
update_comment_meta($comment->comment_ID, 'ct_bad', '1', true);
|
149 |
+
unset($comments[$index]);
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
return $comments;
|
154 |
+
}
|
155 |
+
|
156 |
public function getCurrentScanPage()
|
157 |
{
|
158 |
$this->list_table = new \Cleantalk\ApbctWP\FindSpam\ListTable\CommentsScan();
|
222 |
{
|
223 |
check_ajax_referer('ct_secret_nonce', 'security');
|
224 |
|
225 |
+
$commentScanParameters = new CommentsScanParameters($_POST);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
|
227 |
+
// Set type checking
|
228 |
+
if ($commentScanParameters->getAccurateCheck() && ($commentScanParameters->getFrom() && $commentScanParameters->getTill())) {
|
229 |
+
self::startAccurateChecking($commentScanParameters);
|
230 |
+
} elseif (!$commentScanParameters->getAccurateCheck() && ($commentScanParameters->getFrom() && $commentScanParameters->getTill())) {
|
231 |
+
self::startCommonChecking($commentScanParameters);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
} else {
|
233 |
+
self::startCommonChecking($commentScanParameters);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
}
|
|
|
|
|
235 |
}
|
236 |
|
237 |
public static function ctAjaxInfo($direct_call = false)
|
259 |
$cnt_spam = get_comments($params_spam);
|
260 |
|
261 |
// Bad comments (without IP and Email)
|
262 |
+
$cnt_bad = self::getCountBadComments();
|
263 |
|
264 |
/**
|
265 |
* Total comments
|
334 |
check_ajax_referer('ct_secret_nonce', 'security');
|
335 |
|
336 |
$apbct->data['count_checked_comments'] = 0;
|
|
|
337 |
$apbct->saveData();
|
338 |
|
339 |
$wpdb->query("DELETE FROM {$wpdb->commentmeta} WHERE meta_key IN ('ct_marked_as_spam')");
|
340 |
+
die('OK');
|
341 |
}
|
342 |
|
343 |
private static function getLogData()
|
360 |
);
|
361 |
$cnt_spam = get_comments($params_spam);
|
362 |
|
363 |
+
$cnt_bad = self::getCountBadComments();
|
364 |
|
365 |
return array(
|
366 |
'spam' => $cnt_spam,
|
442 |
print $cnt_all;
|
443 |
die();
|
444 |
}
|
445 |
+
|
446 |
+
/**
|
447 |
+
* Getting count bas comments without IP and Email
|
448 |
+
*
|
449 |
+
* @return int
|
450 |
+
*/
|
451 |
+
public static function getCountBadComments()
|
452 |
+
{
|
453 |
+
global $wpdb;
|
454 |
+
|
455 |
+
$sql = "SELECT
|
456 |
+
COUNT(`comment_id`)
|
457 |
+
FROM $wpdb->commentmeta
|
458 |
+
where `meta_key`='ct_bad'";
|
459 |
+
|
460 |
+
$count_bad = $wpdb->get_var($sql);
|
461 |
+
|
462 |
+
if (is_null($count_bad)) {
|
463 |
+
return 0;
|
464 |
+
}
|
465 |
+
|
466 |
+
return (int) $count_bad;
|
467 |
+
}
|
468 |
+
|
469 |
+
/**
|
470 |
+
* All comments checking
|
471 |
+
*
|
472 |
+
* @param CommentsScanParameters $commentScanParameters
|
473 |
+
*
|
474 |
+
* @return void
|
475 |
+
*/
|
476 |
+
public static function startCommonChecking(CommentsScanParameters $commentScanParameters)
|
477 |
+
{
|
478 |
+
global $apbct;
|
479 |
+
$comments = self::getAllComments($commentScanParameters);
|
480 |
+
|
481 |
+
if (!$comments) {
|
482 |
+
CommentsScanResponse::getInstance()->setEnd(1);
|
483 |
+
|
484 |
+
$log_data = static::getLogData();
|
485 |
+
static::writeSpamLog(
|
486 |
+
'comments',
|
487 |
+
date("Y-m-d H:i:s"),
|
488 |
+
$log_data['checked'],
|
489 |
+
$log_data['spam'],
|
490 |
+
$log_data['bad']
|
491 |
+
);
|
492 |
+
|
493 |
+
echo CommentsScanResponse::getInstance()->toJson();
|
494 |
+
die;
|
495 |
+
}
|
496 |
+
|
497 |
+
$ips_emails_data = self::getIPEmailsData($comments);
|
498 |
+
|
499 |
+
$result = \Cleantalk\ApbctWP\API::methodSpamCheckCms(
|
500 |
+
$apbct->api_key,
|
501 |
+
$ips_emails_data,
|
502 |
+
null
|
503 |
+
);
|
504 |
+
|
505 |
+
if (!empty($result['error'])) {
|
506 |
+
CommentsScanResponse::getInstance()->setError(1);
|
507 |
+
CommentsScanResponse::getInstance()->setErrorMessage($result['error']);
|
508 |
+
} else {
|
509 |
+
$onlySpammers = self::getSpammersFromResultAPI($result);
|
510 |
+
$marked_comment_ids = [];
|
511 |
+
|
512 |
+
foreach ($comments as $comment) {
|
513 |
+
if (
|
514 |
+
! in_array($comment->comment_ID, $marked_comment_ids, true) &&
|
515 |
+
(in_array($comment->comment_author_IP, $onlySpammers, true) ||
|
516 |
+
in_array($comment->comment_author_email, $onlySpammers, true))
|
517 |
+
) {
|
518 |
+
$marked_comment_ids[] = $comment->comment_ID;
|
519 |
+
update_comment_meta($comment->comment_ID, 'ct_marked_as_spam', '1', true);
|
520 |
+
}
|
521 |
+
}
|
522 |
+
|
523 |
+
// Count spam
|
524 |
+
CommentsScanResponse::getInstance()->setSpam(count($marked_comment_ids));
|
525 |
+
}
|
526 |
+
|
527 |
+
// Count bad comments
|
528 |
+
CommentsScanResponse::getInstance()->setBad((int)self::getCountBadComments());
|
529 |
+
// Count checked comments
|
530 |
+
CommentsScanResponse::getInstance()->setChecked(count($comments));
|
531 |
+
// save count checked comments to State:data
|
532 |
+
$apbct->data['count_checked_comments'] += count($comments);
|
533 |
+
$apbct->saveData();
|
534 |
+
|
535 |
+
echo CommentsScanResponse::getInstance()->toJson();
|
536 |
+
die;
|
537 |
+
}
|
538 |
+
|
539 |
+
/**
|
540 |
+
* Accurate comment checking
|
541 |
+
*
|
542 |
+
* @param CommentsScanParameters $commentScanParameters
|
543 |
+
*
|
544 |
+
* @return void
|
545 |
+
*/
|
546 |
+
private static function startAccurateChecking(CommentsScanParameters $commentScanParameters)
|
547 |
+
{
|
548 |
+
global $apbct;
|
549 |
+
$comments = self::getAllComments($commentScanParameters);
|
550 |
+
|
551 |
+
if (!$comments) {
|
552 |
+
CommentsScanResponse::getInstance()->setEnd(1);
|
553 |
+
|
554 |
+
$log_data = static::getLogData();
|
555 |
+
static::writeSpamLog(
|
556 |
+
'comments',
|
557 |
+
date("Y-m-d H:i:s"),
|
558 |
+
$log_data['checked'],
|
559 |
+
$log_data['spam'],
|
560 |
+
$log_data['bad']
|
561 |
+
);
|
562 |
+
|
563 |
+
echo CommentsScanResponse::getInstance()->toJson();
|
564 |
+
die;
|
565 |
+
}
|
566 |
+
|
567 |
+
$comments_grouped_by_date = array();
|
568 |
+
|
569 |
+
foreach ($comments as $index => $comment) {
|
570 |
+
if (!empty($comment->comment_date_gmt)) {
|
571 |
+
$comment_date = date('Y-m-d', strtotime($comment->comment_date_gmt));
|
572 |
+
$comments_grouped_by_date[$comment_date][] = $comment;
|
573 |
+
} else {
|
574 |
+
unset($comments[$index]);
|
575 |
+
}
|
576 |
+
}
|
577 |
+
|
578 |
+
foreach ($comments_grouped_by_date as $date => $comments) {
|
579 |
+
$ips_emails_data = self::getIPEmailsData($comments);
|
580 |
+
|
581 |
+
$result = \Cleantalk\ApbctWP\API::methodSpamCheckCms(
|
582 |
+
$apbct->api_key,
|
583 |
+
$ips_emails_data,
|
584 |
+
$date
|
585 |
+
);
|
586 |
+
|
587 |
+
if (!empty($result['error'])) {
|
588 |
+
CommentsScanResponse::getInstance()->setError(1);
|
589 |
+
CommentsScanResponse::getInstance()->setErrorMessage($result['error']);
|
590 |
+
} else {
|
591 |
+
$onlySpammers = self::getSpammersFromResultAPI($result);
|
592 |
+
$marked_comment_ids = [];
|
593 |
+
|
594 |
+
foreach ($comments as $comment) {
|
595 |
+
if (
|
596 |
+
! in_array($comment->comment_ID, $marked_comment_ids, true) &&
|
597 |
+
(in_array($comment->comment_author_IP, $onlySpammers, true) ||
|
598 |
+
in_array($comment->comment_author_email, $onlySpammers, true))
|
599 |
+
) {
|
600 |
+
$marked_comment_ids[] = $comment->comment_ID;
|
601 |
+
update_comment_meta($comment->comment_ID, 'ct_marked_as_spam', '1', true);
|
602 |
+
}
|
603 |
+
}
|
604 |
+
|
605 |
+
// Count spam
|
606 |
+
CommentsScanResponse::getInstance()->updateSpam(count($marked_comment_ids));
|
607 |
+
}
|
608 |
+
|
609 |
+
// Count checked comments
|
610 |
+
CommentsScanResponse::getInstance()->updateChecked(count($comments));
|
611 |
+
// save count checked comments to State:data
|
612 |
+
$apbct->data['count_checked_comments'] += count($comments);
|
613 |
+
$apbct->saveData();
|
614 |
+
}
|
615 |
+
|
616 |
+
// Count bad comments
|
617 |
+
CommentsScanResponse::getInstance()->setBad((int)self::getCountBadComments());
|
618 |
+
|
619 |
+
echo CommentsScanResponse::getInstance()->toJson();
|
620 |
+
die;
|
621 |
+
}
|
622 |
+
|
623 |
+
/**
|
624 |
+
* @param array $comments
|
625 |
+
*
|
626 |
+
* @return array
|
627 |
+
*/
|
628 |
+
private static function getIPEmailsData(array $comments)
|
629 |
+
{
|
630 |
+
$data = array();
|
631 |
+
|
632 |
+
foreach ($comments as $comment) {
|
633 |
+
if ($comment->comment_author_IP) {
|
634 |
+
$data[] = $comment->comment_author_IP;
|
635 |
+
}
|
636 |
+
if ($comment->comment_author_email) {
|
637 |
+
$data[] = $comment->comment_author_email;
|
638 |
+
}
|
639 |
+
}
|
640 |
+
|
641 |
+
return $data;
|
642 |
+
}
|
643 |
+
|
644 |
+
/**
|
645 |
+
* @param array $result
|
646 |
+
*
|
647 |
+
* @return array
|
648 |
+
*/
|
649 |
+
private static function getSpammersFromResultAPI(array $result)
|
650 |
+
{
|
651 |
+
$spammers = array();
|
652 |
+
|
653 |
+
foreach ($result as $param => $status) {
|
654 |
+
if ((int) $status['appears'] === 1) {
|
655 |
+
$spammers[] = $param;
|
656 |
+
}
|
657 |
+
}
|
658 |
+
|
659 |
+
return $spammers;
|
660 |
+
}
|
661 |
}
|
lib/Cleantalk/ApbctWP/FindSpam/CommentsScanParameters.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Cleantalk\ApbctWP\FindSpam;
|
4 |
+
|
5 |
+
class CommentsScanParameters
|
6 |
+
{
|
7 |
+
private $new_check;
|
8 |
+
private $unchecked;
|
9 |
+
private $amount;
|
10 |
+
private $offset;
|
11 |
+
private $accurate_check;
|
12 |
+
private $from;
|
13 |
+
private $till;
|
14 |
+
private $skip_roles;
|
15 |
+
|
16 |
+
public function __construct($post)
|
17 |
+
{
|
18 |
+
$this->new_check = isset($post['new_check']) ? $post['new_check'] : true;
|
19 |
+
$this->unchecked = isset($post['unchecked']) ? $post['unchecked'] : 'unset';
|
20 |
+
$this->amount = isset($post['amount']) ? $post['amount'] : 100;
|
21 |
+
$this->offset = isset($_COOKIE['apbct_check_comments_offset']) ? (int)$_COOKIE['apbct_check_comments_offset'] : 0;
|
22 |
+
$this->accurate_check = isset($post['accurate_check']) ? $post['accurate_check'] : false;
|
23 |
+
$this->from = isset($post['from']) ? $post['from'] : false;
|
24 |
+
$this->till = isset($post['till']) ? $post['till'] : false;
|
25 |
+
$this->skip_roles = array('administrator');
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @return array
|
30 |
+
* @psalm-suppress PossiblyUnusedMethod
|
31 |
+
*/
|
32 |
+
public function getSkipRoles()
|
33 |
+
{
|
34 |
+
return $this->skip_roles;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @return bool|mixed
|
39 |
+
* @psalm-suppress PossiblyUnusedMethod
|
40 |
+
*/
|
41 |
+
public function getNewCheck()
|
42 |
+
{
|
43 |
+
return $this->new_check;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @return mixed|string
|
48 |
+
* @psalm-suppress PossiblyUnusedMethod
|
49 |
+
*/
|
50 |
+
public function getUnchecked()
|
51 |
+
{
|
52 |
+
return $this->unchecked;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @return int|mixed
|
57 |
+
* @psalm-suppress PossiblyUnusedMethod
|
58 |
+
*/
|
59 |
+
public function getAmount()
|
60 |
+
{
|
61 |
+
return $this->amount;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* @return int|mixed
|
66 |
+
* @psalm-suppress PossiblyUnusedMethod
|
67 |
+
*/
|
68 |
+
public function getOffset()
|
69 |
+
{
|
70 |
+
return $this->offset;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* @return false|mixed
|
75 |
+
* @psalm-suppress PossiblyUnusedMethod
|
76 |
+
*/
|
77 |
+
public function getAccurateCheck()
|
78 |
+
{
|
79 |
+
return $this->accurate_check;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* @return false|mixed
|
84 |
+
* @psalm-suppress PossiblyUnusedMethod
|
85 |
+
*/
|
86 |
+
public function getFrom()
|
87 |
+
{
|
88 |
+
return $this->from;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* @return false|mixed
|
93 |
+
* @psalm-suppress PossiblyUnusedMethod
|
94 |
+
*/
|
95 |
+
public function getTill()
|
96 |
+
{
|
97 |
+
return $this->till;
|
98 |
+
}
|
99 |
+
}
|
lib/Cleantalk/ApbctWP/FindSpam/CommentsScanResponse.php
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Singleton
|
4 |
+
namespace Cleantalk\ApbctWP\FindSpam;
|
5 |
+
|
6 |
+
use Cleantalk\Templates\Singleton;
|
7 |
+
|
8 |
+
class CommentsScanResponse
|
9 |
+
{
|
10 |
+
use Singleton;
|
11 |
+
|
12 |
+
private $end;
|
13 |
+
private $checked;
|
14 |
+
private $spam;
|
15 |
+
private $bad;
|
16 |
+
private $error;
|
17 |
+
private $error_message;
|
18 |
+
|
19 |
+
private function init()
|
20 |
+
{
|
21 |
+
$this->end = 0;
|
22 |
+
$this->checked = 0;
|
23 |
+
$this->spam = 0;
|
24 |
+
$this->bad = 0;
|
25 |
+
$this->error = 0;
|
26 |
+
$this->error_message = '';
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @return array
|
31 |
+
* @psalm-suppress PossiblyUnusedMethod
|
32 |
+
*/
|
33 |
+
public function toArray()
|
34 |
+
{
|
35 |
+
return array(
|
36 |
+
'end' => $this->end,
|
37 |
+
'checked' => $this->checked,
|
38 |
+
'spam' => $this->spam,
|
39 |
+
'bad' => $this->bad,
|
40 |
+
'error' => $this->error,
|
41 |
+
'error_message' => $this->error_message,
|
42 |
+
);
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* @return false|string
|
47 |
+
* @psalm-suppress PossiblyUnusedMethod
|
48 |
+
*/
|
49 |
+
public function toJson()
|
50 |
+
{
|
51 |
+
return json_encode($this->toArray());
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @return string
|
56 |
+
* @psalm-suppress PossiblyUnusedMethod
|
57 |
+
*/
|
58 |
+
public function getErrorMessage()
|
59 |
+
{
|
60 |
+
return $this->error_message;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* @param string $error_message
|
65 |
+
* @psalm-suppress PossiblyUnusedMethod
|
66 |
+
*/
|
67 |
+
public function setErrorMessage($error_message)
|
68 |
+
{
|
69 |
+
$this->error_message = $error_message;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* @return string
|
74 |
+
* @psalm-suppress PossiblyUnusedMethod
|
75 |
+
*/
|
76 |
+
public function getEnd()
|
77 |
+
{
|
78 |
+
return $this->end;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* @param int 1|0 $end
|
83 |
+
* @psalm-suppress PossiblyUnusedMethod
|
84 |
+
*/
|
85 |
+
public function setEnd($end)
|
86 |
+
{
|
87 |
+
$this->end = $end;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* @return integer
|
92 |
+
* @psalm-suppress PossiblyUnusedMethod
|
93 |
+
*/
|
94 |
+
public function getChecked()
|
95 |
+
{
|
96 |
+
return $this->checked;
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* @param integer $checked
|
101 |
+
* @psalm-suppress PossiblyUnusedMethod
|
102 |
+
*/
|
103 |
+
public function setChecked($checked)
|
104 |
+
{
|
105 |
+
$this->checked = $checked;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* @param integer $checked
|
110 |
+
* @psalm-suppress PossiblyUnusedMethod
|
111 |
+
*/
|
112 |
+
public function updateChecked($checked)
|
113 |
+
{
|
114 |
+
$this->checked += $checked;
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* @return string|integer
|
119 |
+
* @psalm-suppress PossiblyUnusedMethod
|
120 |
+
*/
|
121 |
+
public function getSpam()
|
122 |
+
{
|
123 |
+
return $this->spam;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* @param integer $spam
|
128 |
+
* @psalm-suppress PossiblyUnusedMethod
|
129 |
+
*/
|
130 |
+
public function setSpam($spam)
|
131 |
+
{
|
132 |
+
$this->spam = $spam;
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* @param integer $spam
|
137 |
+
* @psalm-suppress PossiblyUnusedMethod
|
138 |
+
*/
|
139 |
+
public function updateSpam($spam)
|
140 |
+
{
|
141 |
+
$this->spam += $spam;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* @return integer
|
146 |
+
* @psalm-suppress PossiblyUnusedMethod
|
147 |
+
*/
|
148 |
+
public function getBad()
|
149 |
+
{
|
150 |
+
return $this->bad;
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* @param integer $bad
|
155 |
+
* @psalm-suppress PossiblyUnusedMethod
|
156 |
+
*/
|
157 |
+
public function setBad($bad)
|
158 |
+
{
|
159 |
+
$this->bad = $bad;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* @return string
|
164 |
+
* @psalm-suppress PossiblyUnusedMethod
|
165 |
+
*/
|
166 |
+
public function getError()
|
167 |
+
{
|
168 |
+
return $this->error;
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* @param int 1|0 $error
|
173 |
+
* @psalm-suppress PossiblyUnusedMethod
|
174 |
+
*/
|
175 |
+
public function setError($error)
|
176 |
+
{
|
177 |
+
$this->error = $error;
|
178 |
+
}
|
179 |
+
}
|
lib/Cleantalk/ApbctWP/FindSpam/ListTable/BadUsers.php
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
|
3 |
namespace Cleantalk\ApbctWP\FindSpam\ListTable;
|
4 |
|
|
|
|
|
5 |
class BadUsers extends Users
|
6 |
{
|
7 |
public function prepare_items() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
@@ -91,7 +93,16 @@ class BadUsers extends Users
|
|
91 |
$column_content .= esc_html__('No IP address', 'cleantalk-spam-protect');
|
92 |
}
|
93 |
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
|
97 |
public function getBadUsers()
|
2 |
|
3 |
namespace Cleantalk\ApbctWP\FindSpam\ListTable;
|
4 |
|
5 |
+
use Cleantalk\ApbctWP\Variables\Get;
|
6 |
+
|
7 |
class BadUsers extends Users
|
8 |
{
|
9 |
public function prepare_items() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
93 |
$column_content .= esc_html__('No IP address', 'cleantalk-spam-protect');
|
94 |
}
|
95 |
|
96 |
+
$actions = array(
|
97 |
+
'unapprove' => sprintf(
|
98 |
+
'<a href="?page=%s&action=%s&spam=%s">Unapprove</a>',
|
99 |
+
htmlspecialchars(addslashes(Get::get('page'))),
|
100 |
+
'unapprove',
|
101 |
+
$user_obj->ID
|
102 |
+
)
|
103 |
+
);
|
104 |
+
|
105 |
+
return sprintf('%1$s %2$s', $column_content, $this->row_actions($actions));
|
106 |
}
|
107 |
|
108 |
public function getBadUsers()
|
lib/Cleantalk/ApbctWP/FindSpam/ListTable/Users.php
CHANGED
@@ -114,6 +114,12 @@ class Users extends \Cleantalk\ApbctWP\CleantalkListTable
|
|
114 |
}
|
115 |
|
116 |
$actions = array(
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
'delete' => sprintf(
|
118 |
'<a href="?page=%s&action=%s&spam=%s">Delete</a>',
|
119 |
htmlspecialchars(addslashes(Get::get('page'))),
|
@@ -156,6 +162,7 @@ class Users extends \Cleantalk\ApbctWP\CleantalkListTable
|
|
156 |
public function get_bulk_actions() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
157 |
{
|
158 |
return array(
|
|
|
159 |
'delete' => 'Delete'
|
160 |
);
|
161 |
}
|
@@ -174,7 +181,13 @@ class Users extends \Cleantalk\ApbctWP\CleantalkListTable
|
|
174 |
wp_die('nonce error');
|
175 |
}
|
176 |
|
177 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
}
|
179 |
|
180 |
public function row_actions_handler() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
@@ -183,6 +196,16 @@ class Users extends \Cleantalk\ApbctWP\CleantalkListTable
|
|
183 |
return;
|
184 |
}
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
if ( Get::get('action') === 'delete' ) {
|
187 |
$id = filter_input(INPUT_GET, 'spam', FILTER_SANITIZE_NUMBER_INT);
|
188 |
$this->removeSpam(array($id));
|
@@ -198,6 +221,28 @@ class Users extends \Cleantalk\ApbctWP\CleantalkListTable
|
|
198 |
// LOGIC //
|
199 |
//********************************************//
|
200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
public function removeSpam($ids)
|
202 |
{
|
203 |
foreach ( $ids as $id ) {
|
114 |
}
|
115 |
|
116 |
$actions = array(
|
117 |
+
'approve' => sprintf(
|
118 |
+
'<a href="?page=%s&action=%s&spam=%s">Approve</a>',
|
119 |
+
htmlspecialchars(addslashes(Get::get('page'))),
|
120 |
+
'approve',
|
121 |
+
$user_obj->ID
|
122 |
+
),
|
123 |
'delete' => sprintf(
|
124 |
'<a href="?page=%s&action=%s&spam=%s">Delete</a>',
|
125 |
htmlspecialchars(addslashes(Get::get('page'))),
|
162 |
public function get_bulk_actions() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
163 |
{
|
164 |
return array(
|
165 |
+
'approve' => 'Approve',
|
166 |
'delete' => 'Delete'
|
167 |
);
|
168 |
}
|
181 |
wp_die('nonce error');
|
182 |
}
|
183 |
|
184 |
+
if ( $this->current_action() === 'approve' ) {
|
185 |
+
$this->approveSpam(Post::get('spamids'));
|
186 |
+
}
|
187 |
+
|
188 |
+
if ( $this->current_action() === 'delete' ) {
|
189 |
+
$this->removeSpam(Post::get('spamids'));
|
190 |
+
}
|
191 |
}
|
192 |
|
193 |
public function row_actions_handler() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
196 |
return;
|
197 |
}
|
198 |
|
199 |
+
if ( Get::get('action') === 'approve' ) {
|
200 |
+
$id = filter_input(INPUT_GET, 'spam', FILTER_SANITIZE_NUMBER_INT);
|
201 |
+
$this->approveSpam(array($id));
|
202 |
+
}
|
203 |
+
|
204 |
+
if ( Get::get('action') === 'unapprove' ) {
|
205 |
+
$id = filter_input(INPUT_GET, 'spam', FILTER_SANITIZE_NUMBER_INT);
|
206 |
+
$this->unapproveSpam(array($id));
|
207 |
+
}
|
208 |
+
|
209 |
if ( Get::get('action') === 'delete' ) {
|
210 |
$id = filter_input(INPUT_GET, 'spam', FILTER_SANITIZE_NUMBER_INT);
|
211 |
$this->removeSpam(array($id));
|
221 |
// LOGIC //
|
222 |
//********************************************//
|
223 |
|
224 |
+
public function approveSpam($ids)
|
225 |
+
{
|
226 |
+
foreach ( $ids as $id ) {
|
227 |
+
$user_id = (int)sanitize_key($id);
|
228 |
+
$user_meta = delete_user_meta((int)$id, 'ct_marked_as_spam');
|
229 |
+
|
230 |
+
if ( $user_meta ) {
|
231 |
+
update_user_meta($user_id, 'ct_bad', true);
|
232 |
+
}
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
public function unapproveSpam($ids)
|
237 |
+
{
|
238 |
+
foreach ($ids as $id) {
|
239 |
+
$user_id = (int)sanitize_key($id);
|
240 |
+
|
241 |
+
update_user_meta($user_id, 'ct_marked_as_spam', true);
|
242 |
+
delete_user_meta($user_id, 'ct_bad');
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
public function removeSpam($ids)
|
247 |
{
|
248 |
foreach ( $ids as $id ) {
|
lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersLogs.php
CHANGED
@@ -39,6 +39,7 @@ class UsersLogs extends Users
|
|
39 |
public function get_bulk_actions() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
40 |
{
|
41 |
return array(
|
|
|
42 |
'delete' => 'Delete'
|
43 |
);
|
44 |
}
|
39 |
public function get_bulk_actions() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
40 |
{
|
41 |
return array(
|
42 |
+
'approve' => 'Approve',
|
43 |
'delete' => 'Delete'
|
44 |
);
|
45 |
}
|
lib/Cleantalk/ApbctWP/FindSpam/UsersChecker.php
CHANGED
@@ -171,6 +171,12 @@ class UsersChecker extends Checker
|
|
171 |
private static function removeUsersWithoutIPEmail(array $users)
|
172 |
{
|
173 |
foreach ($users as $index => $user) {
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
$user_meta = self::getUserMeta($user->ID);
|
175 |
|
176 |
$user_ip = ! empty($user_meta[0]['ip']) ? trim($user_meta[0]['ip']) : false;
|
171 |
private static function removeUsersWithoutIPEmail(array $users)
|
172 |
{
|
173 |
foreach ($users as $index => $user) {
|
174 |
+
if ( (bool)get_user_meta($user->ID, 'ct_bad') === true ) {
|
175 |
+
delete_user_meta($user->ID, 'ct_marked_as_spam');
|
176 |
+
unset($users[$index]);
|
177 |
+
continue;
|
178 |
+
}
|
179 |
+
|
180 |
$user_meta = self::getUserMeta($user->ID);
|
181 |
|
182 |
$user_ip = ! empty($user_meta[0]['ip']) ? trim($user_meta[0]['ip']) : false;
|
lib/Cleantalk/ApbctWP/Firewall/die_page_anticrawler.html
CHANGED
@@ -77,7 +77,7 @@
|
|
77 |
background: #fff;
|
78 |
border: 1px solid #ccd0d4;
|
79 |
color: #444;
|
80 |
-
font-family:
|
81 |
margin: 2em auto;
|
82 |
padding: 1em 2em;
|
83 |
max-width: 700px;
|
@@ -239,7 +239,7 @@
|
|
239 |
setTimeout( function(){
|
240 |
set_spamFireWallCookie('wordpress_apbct_antibot', '{COOKIE_ANTICRAWLER}');
|
241 |
set_spamFireWallCookie('apbct_anticrawler_passed','{COOKIE_ANTICRAWLER_PASSED}');
|
242 |
-
},
|
243 |
|
244 |
if(location.search.search('debug=1') === -1) {
|
245 |
var apbctSfwRandomGet = '';
|
77 |
background: #fff;
|
78 |
border: 1px solid #ccd0d4;
|
79 |
color: #444;
|
80 |
+
font-family: Arial, "Times New Roman", Georgia, sans-serif;
|
81 |
margin: 2em auto;
|
82 |
padding: 1em 2em;
|
83 |
max-width: 700px;
|
239 |
setTimeout( function(){
|
240 |
set_spamFireWallCookie('wordpress_apbct_antibot', '{COOKIE_ANTICRAWLER}');
|
241 |
set_spamFireWallCookie('apbct_anticrawler_passed','{COOKIE_ANTICRAWLER_PASSED}');
|
242 |
+
}, 1000 );
|
243 |
|
244 |
if(location.search.search('debug=1') === -1) {
|
245 |
var apbctSfwRandomGet = '';
|
lib/Cleantalk/ApbctWP/Firewall/die_page_antiflood.html
CHANGED
@@ -77,7 +77,7 @@
|
|
77 |
background: #fff;
|
78 |
border: 1px solid #ccd0d4;
|
79 |
color: #444;
|
80 |
-
font-family:
|
81 |
margin: 2em auto;
|
82 |
padding: 1em 2em;
|
83 |
max-width: 700px;
|
77 |
background: #fff;
|
78 |
border: 1px solid #ccd0d4;
|
79 |
color: #444;
|
80 |
+
font-family: Arial, "Times New Roman", Georgia, sans-serif;
|
81 |
margin: 2em auto;
|
82 |
padding: 1em 2em;
|
83 |
max-width: 700px;
|
lib/Cleantalk/ApbctWP/Firewall/die_page_sfw.html
CHANGED
@@ -77,7 +77,7 @@
|
|
77 |
background: #fff;
|
78 |
border: 1px solid #ccd0d4;
|
79 |
color: #444;
|
80 |
-
font-family:
|
81 |
margin: 2em auto;
|
82 |
padding: 1em 2em;
|
83 |
max-width: 700px;
|
77 |
background: #fff;
|
78 |
border: 1px solid #ccd0d4;
|
79 |
color: #444;
|
80 |
+
font-family: Arial, "Times New Roman", Georgia, sans-serif;
|
81 |
margin: 2em auto;
|
82 |
padding: 1em 2em;
|
83 |
max-width: 700px;
|
lib/Cleantalk/ApbctWP/Variables/AltSessions.php
CHANGED
@@ -21,8 +21,12 @@ class AltSessions
|
|
21 |
{
|
22 |
self::cleanFromOld();
|
23 |
|
|
|
|
|
|
|
|
|
24 |
// Bad incoming data
|
25 |
-
if ( ! $name || (empty($value) && $value !== false) ) {
|
26 |
return;
|
27 |
}
|
28 |
|
21 |
{
|
22 |
self::cleanFromOld();
|
23 |
|
24 |
+
if ( is_int($value) ) {
|
25 |
+
$value = (string)$value;
|
26 |
+
}
|
27 |
+
|
28 |
// Bad incoming data
|
29 |
+
if ( ! $name || (empty($value) && $value !== false && $value !== "0") ) {
|
30 |
return;
|
31 |
}
|
32 |
|
lib/Cleantalk/ApbctWP/Variables/Cookie.php
CHANGED
@@ -6,6 +6,14 @@ class Cookie extends \Cleantalk\Variables\Cookie
|
|
6 |
{
|
7 |
protected static $instance;
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
/**
|
10 |
* @inheritDoc
|
11 |
*/
|
@@ -29,7 +37,14 @@ class Cookie extends \Cleantalk\Variables\Cookie
|
|
29 |
$value = $this->getAndSanitize(urldecode($_COOKIE[$name]));
|
30 |
//NoCookies
|
31 |
} else if ( $apbct->data['cookies_type'] === 'none' ) {
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
} else {
|
34 |
$value = '';
|
35 |
}
|
@@ -72,14 +87,22 @@ class Cookie extends \Cleantalk\Variables\Cookie
|
|
72 |
$no_cookie_to_db = false
|
73 |
) {
|
74 |
global $apbct;
|
75 |
-
|
76 |
-
if ( $apbct->data['
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
|
|
83 |
return true;
|
84 |
}
|
85 |
|
6 |
{
|
7 |
protected static $instance;
|
8 |
|
9 |
+
public static $firewall_force_alternative_cookies = array(
|
10 |
+
'ct_sfw_pass_key',
|
11 |
+
'ct_sfw_passed',
|
12 |
+
'wordpress_apbct_antibot',
|
13 |
+
'apbct_anticrawler_passed',
|
14 |
+
'apbct_antiflood_passed'
|
15 |
+
);
|
16 |
+
|
17 |
/**
|
18 |
* @inheritDoc
|
19 |
*/
|
37 |
$value = $this->getAndSanitize(urldecode($_COOKIE[$name]));
|
38 |
//NoCookies
|
39 |
} else if ( $apbct->data['cookies_type'] === 'none' ) {
|
40 |
+
if ( in_array($name, static::$firewall_force_alternative_cookies, true) ) {
|
41 |
+
$value = AltSessions::get($name);
|
42 |
+
if ( empty($value) && isset($_COOKIE[$name]) ) {
|
43 |
+
$value = $this->getAndSanitize(urldecode($_COOKIE[$name]));
|
44 |
+
}
|
45 |
+
} else {
|
46 |
+
$value = NoCookie::get($name);
|
47 |
+
}
|
48 |
} else {
|
49 |
$value = '';
|
50 |
}
|
87 |
$no_cookie_to_db = false
|
88 |
) {
|
89 |
global $apbct;
|
90 |
+
|
91 |
+
if ( $apbct->data['key_is_ok'] ) {
|
92 |
+
//select handling way to set cookie data in dependence of cookie type in the settings
|
93 |
+
if ( $apbct->data['cookies_type'] === 'none' ) {
|
94 |
+
if ( in_array($name, static::$firewall_force_alternative_cookies, true) ) {
|
95 |
+
AltSessions::set($name, $value);
|
96 |
+
} else {
|
97 |
+
return NoCookie::set($name, $value, $no_cookie_to_db);
|
98 |
+
}
|
99 |
+
} elseif ($apbct->data['cookies_type'] === 'alternative') {
|
100 |
+
AltSessions::set($name, $value);
|
101 |
+
} else {
|
102 |
+
self::setNativeCookie(apbct__get_cookie_prefix() . $name, $value, $expires, $path, $domain, $secure, $httponly, $samesite);
|
103 |
+
}
|
104 |
}
|
105 |
+
|
106 |
return true;
|
107 |
}
|
108 |
|
lib/Cleantalk/Common/DNS.php
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
|
3 |
namespace Cleantalk\Common;
|
4 |
|
|
|
|
|
5 |
class DNS
|
6 |
{
|
7 |
private static $min_server_timeout = 500;
|
@@ -108,13 +110,27 @@ class DNS
|
|
108 |
}
|
109 |
|
110 |
$starttime = microtime(true);
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
-
if (
|
115 |
$status = static::$max_server_timeout / 1000; // Site is down
|
116 |
} else {
|
117 |
-
|
|
|
|
|
118 |
$status = ($stoptime - $starttime);
|
119 |
$status = round($status, 4);
|
120 |
}
|
2 |
|
3 |
namespace Cleantalk\Common;
|
4 |
|
5 |
+
use Cleantalk\ApbctWP\HTTP\Request;
|
6 |
+
|
7 |
class DNS
|
8 |
{
|
9 |
private static $min_server_timeout = 500;
|
110 |
}
|
111 |
|
112 |
$starttime = microtime(true);
|
113 |
+
if ( function_exists('fsockopen') ) {
|
114 |
+
$file = @fsockopen($host, 443, $errno, $errstr, static::$max_server_timeout / 1000);
|
115 |
+
} else {
|
116 |
+
$http = new Request();
|
117 |
+
$host = 'https://' . gethostbyaddr($host);
|
118 |
+
$file = $http->setUrl($host)
|
119 |
+
->setOptions(['timeout' => static::$max_server_timeout / 1000])
|
120 |
+
->setPresets('get_code get')
|
121 |
+
->request();
|
122 |
+
if ( !empty($file['error']) || $file !== '200' ) {
|
123 |
+
$file = false;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
$stoptime = microtime(true);
|
127 |
|
128 |
+
if ( !$file ) {
|
129 |
$status = static::$max_server_timeout / 1000; // Site is down
|
130 |
} else {
|
131 |
+
if ( function_exists('fsockopen') ) {
|
132 |
+
fclose($file);
|
133 |
+
}
|
134 |
$status = ($stoptime - $starttime);
|
135 |
$status = round($status, 4);
|
136 |
}
|
lib/Cleantalk/Variables/Request.php
CHANGED
@@ -37,14 +37,11 @@ abstract class Request extends ServerVariables
|
|
37 |
|
38 |
$post_class = $namespace . '\\Post';
|
39 |
$get_class = $namespace . '\\Get';
|
40 |
-
$cookie_class = $namespace . '\\Cookie';
|
41 |
|
42 |
if ( $post_class::get($name) ) {
|
43 |
$value = $post_class::get($name);
|
44 |
} elseif ( $get_class::get($name) ) {
|
45 |
$value = $get_class::get($name);
|
46 |
-
} elseif ( $cookie_class::get($name) ) {
|
47 |
-
$value = $cookie_class::get($name);
|
48 |
}
|
49 |
|
50 |
// Remember for further calls
|
37 |
|
38 |
$post_class = $namespace . '\\Post';
|
39 |
$get_class = $namespace . '\\Get';
|
|
|
40 |
|
41 |
if ( $post_class::get($name) ) {
|
42 |
$value = $post_class::get($name);
|
43 |
} elseif ( $get_class::get($name) ) {
|
44 |
$value = $get_class::get($name);
|
|
|
|
|
45 |
}
|
46 |
|
47 |
// Remember for further calls
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
|
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 6.1
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 5.
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
@@ -451,6 +451,27 @@ Yes, it is. Please read this article,
|
|
451 |
|
452 |
== Changelog ==
|
453 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
454 |
= 5.188 Nov 2 2022 =
|
455 |
#### Lot of improvements of the EmailEncoder 🔥, wpForo topics and posts protection 💣, a honeypot for Gravity forms, parameters without cookies improved 🎈 and some minor issues fixed 💪🏼
|
456 |
* New. wpForo - add topic and post under protection
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 6.1
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 5.189
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
451 |
|
452 |
== Changelog ==
|
453 |
|
454 |
+
= 5.189 Nov 17 2022 =
|
455 |
+
#### Cookies enhancements 🔥, StrongTestimonials plugin integration 💣, let Woocommerce orders interface to report spam, checking existing users and comments improvements🎈 and some minor issues fixed 💪🏼
|
456 |
+
* New. Cookies. Do not run cookies setting process if no access key provided.
|
457 |
+
* New. Cookies. NoCookie mode now support SFW, Anti-Crawler and AntiFlood modes.
|
458 |
+
* New. Integrations. StrongTestimonials for POST and AJAX requests.
|
459 |
+
* New. Woocommerce. Orders interface now can manage spam.
|
460 |
+
* New. UserChecker. User can be approved and unapproved from spam list
|
461 |
+
* Mod. Checking comments. Lot of improvements.
|
462 |
+
* Mod. Synchronization process frontend improvements.
|
463 |
+
* Mod. httpPing. Ping now uses curl if fsockopen is disabled.
|
464 |
+
* Mod. Removed Google Fonts from die pages
|
465 |
+
* Mod. Public JS. Iframes check refactoring.
|
466 |
+
* Fix. Common. Rotating m-servers fixed.
|
467 |
+
* Fix. AltCookies enhancements. Now can place zero values correct.
|
468 |
+
* Fix. Registration check. Fix request type and submittime graylisting on Avada Fusion register forms.
|
469 |
+
* Fix. Public JS. Skip GiveWP iframe generated forms because of direct integration.
|
470 |
+
* Fix. Integration. GiveWP protection improved.
|
471 |
+
* Fix. Skip ninja form PRO service requests with nonce.
|
472 |
+
* Fix. Integration. Abandoned Cart Recovery for WooCommerce requests excluded.
|
473 |
+
* Fix. Code style enhancements.
|
474 |
+
|
475 |
= 5.188 Nov 2 2022 =
|
476 |
#### Lot of improvements of the EmailEncoder 🔥, wpForo topics and posts protection 💣, a honeypot for Gravity forms, parameters without cookies improved 🎈 and some minor issues fixed 💪🏼
|
477 |
* New. wpForo - add topic and post under protection
|