diff --git a/cleantalk.php b/cleantalk.php index 5f0a72014..dfb5d336d 100644 --- a/cleantalk.php +++ b/cleantalk.php @@ -4,7 +4,7 @@ Plugin Name: Anti-Spam by CleanTalk Plugin URI: https://cleantalk.org 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. - Version: 6.74.99-dev + Version: 6.76.99-dev Author: CleanTalk - Anti-Spam Protection Author URI: https://cleantalk.org Text Domain: cleantalk-spam-protect diff --git a/inc/cleantalk-common.php b/inc/cleantalk-common.php index cccae3ce0..5bdd13118 100644 --- a/inc/cleantalk-common.php +++ b/inc/cleantalk-common.php @@ -1857,7 +1857,6 @@ function apbct__bot_detector_get_fired_exclusions() */ function apbct__bot_detector_get_fd_log() { - global $apbct; $result = array( 'plugin_status' => 'OK', 'error_msg' => '', @@ -1872,7 +1871,7 @@ function apbct__bot_detector_get_fd_log() } try { - if ( TT::toString($apbct->settings['data__bot_detector_enabled']) === '0') { + if ( ! apbct__is_bot_detector_enabled() ) { throw new \Exception('bot detector library usage is disabled'); } // Retrieve bot detector frontend data log from Alt Sessions @@ -1929,3 +1928,24 @@ function apbct__bot_detector_get_custom_exclusion_from_settings() } return $exclusions; } + +/** + * Check if Bot-Detector is enabled/disabled + * + * @return bool + */ +function apbct__is_bot_detector_enabled() +{ + global $apbct; + + // Constant is preferred + if ( isset($apbct->service_constants->bot_detector_enabled) && $apbct->service_constants->bot_detector_enabled->isDefined() ) { + return (bool) $apbct->service_constants->bot_detector_enabled->getValue(); + } + // Check by $apbct->data + if ( isset($apbct->data['bot_detector_enabled']) ) { + return (bool) $apbct->data['bot_detector_enabled']; + } + // By default - enabled + return true; +} diff --git a/inc/cleantalk-public.php b/inc/cleantalk-public.php index b007516aa..1099aab62 100644 --- a/inc/cleantalk-public.php +++ b/inc/cleantalk-public.php @@ -32,7 +32,7 @@ function apbct_init() $apbct->settings['data__pixel'] && empty($apbct->pixel_url) && !( - $apbct->settings['data__bot_detector_enabled'] === '1' && + apbct__is_bot_detector_enabled() && $apbct->settings['data__pixel'] === '3' ) ) { @@ -540,7 +540,7 @@ function apbct_hook__wp_footer() ( $apbct->settings['data__pixel'] === '3' && ! apbct_is_cache_plugins_exists() && - $apbct->settings['data__bot_detector_enabled'] !== '1' + ! apbct__is_bot_detector_enabled() ) ) { echo ''; @@ -1245,7 +1245,7 @@ function apbct_enqueue_and_localize_public_scripts() ApbctEnqueue::getInstance()->js($bundle_name, array(), $in_footer); // Bot detector - if ( $apbct->settings['data__bot_detector_enabled'] && ! apbct_bot_detector_scripts_exclusion()) { + if ( apbct__is_bot_detector_enabled() && ! apbct_bot_detector_scripts_exclusion()) { // Attention! Skip old enqueue way for external script. wp_enqueue_script( 'ct_bot_detector', diff --git a/inc/cleantalk-settings.php b/inc/cleantalk-settings.php index f3fee95bd..4aa9c68b8 100644 --- a/inc/cleantalk-settings.php +++ b/inc/cleantalk-settings.php @@ -568,14 +568,17 @@ function apbct_settings__set_fields() 'callback' => 'apbct_settings__check_alt_cookies_types' ), //bot detector - 'data__bot_detector_enabled' => array( - 'title' => __('Use ', 'cleantalk-spam-protect') - . $apbct->data['wl_brandname'] - . __(' JavaScript library', 'cleantalk-spam-protect'), - 'description' => __('This option includes external ', 'cleantalk-spam-protect') - . $apbct->data['wl_brandname'] - . __(' JavaScript library to getting visitors info data', 'cleantalk-spam-protect'), - 'childrens' => array('exclusions__bot_detector') + 'bot_detector_state' => array( + 'callback' => function () { + printf( + esc_html__('JavaScript library (Bot Detector) is %s', 'cleantalk-spam-protect'), + apbct__is_bot_detector_enabled() + ? esc_html__('enabled', 'cleantalk-spam-protect') + : esc_html__('disabled', 'cleantalk-spam-protect') + ); + }, + 'long_description' => true, + 'display' => apbct__is_bot_detector_enabled(), ), 'exclusions__bot_detector' => array( 'title' => __('JavaScript Library Exclusions', 'cleantalk-spam-protect'), @@ -588,7 +591,7 @@ function apbct_settings__set_fields() 'Regular expression. Use to skip a HTML form from special service field attach.', 'cleantalk-spam-protect' ), - 'parent' => 'data__bot_detector_enabled', + 'display' => apbct__is_bot_detector_enabled(), ), 'exclusions__bot_detector__form_attributes' => array( 'type' => 'text', @@ -596,6 +599,7 @@ function apbct_settings__set_fields() 'parent' => 'exclusions__bot_detector', 'class' => 'apbct_settings-field_wrapper--sub', 'long_description' => true, + 'display' => apbct__is_bot_detector_enabled(), ), 'exclusions__bot_detector__form_children_attributes' => array( 'type' => 'text', @@ -603,6 +607,7 @@ function apbct_settings__set_fields() 'parent' => 'exclusions__bot_detector', 'class' => 'apbct_settings-field_wrapper--sub', 'long_description' => true, + 'display' => apbct__is_bot_detector_enabled(), ), 'exclusions__bot_detector__form_parent_attributes' => array( 'type' => 'text', @@ -610,6 +615,7 @@ function apbct_settings__set_fields() 'parent' => 'exclusions__bot_detector', 'class' => 'apbct_settings-field_wrapper--sub', 'long_description' => true, + 'display' => apbct__is_bot_detector_enabled(), ), 'wp__use_builtin_http_api' => array( 'title' => __("Use WordPress HTTP API", 'cleantalk-spam-protect'), @@ -3155,6 +3161,12 @@ function apbct_settings__get__long_description() 'title' => __('Contact data encoding', 'cleantalk-spam-protect'), 'desc' => ContactsEncoder::getEmailEncoderCommonLongDescription(), ), + 'bot_detector_state' => array( + 'title' => esc_html__('JavaScript library (Bot Detector)', 'cleantalk-spam-protect'), + 'desc' => esc_html__('The state of this option is now controlled by a constant', 'cleantalk-spam-protect') + . ' ' + . '`APBCT_SERVICE__BOT_DETECTOR_ENABLED`' + ), ); if (!empty($setting_id) && isset($descriptions[$setting_id])) { diff --git a/inc/cleantalk-updater.php b/inc/cleantalk-updater.php index f8304326a..d4c865378 100644 --- a/inc/cleantalk-updater.php +++ b/inc/cleantalk-updater.php @@ -1377,3 +1377,14 @@ function apbct_update_to_6_60_0() } } } + +function apbct_update_to_6_76_0() +{ + global $apbct; + + if ( isset($apbct->settings['data__bot_detector_enabled']) ) { + $bot_detector_state = $apbct->settings['data__bot_detector_enabled']; + $apbct->data['bot_detector_enabled'] = $bot_detector_state; + $apbct->saveData(); + } +} diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index f8d339f83..22f19344e 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(f=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,_.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(f=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,_.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection.min.js b/js/apbct-public-bundle_ext-protection.min.js index 25dd9c053..a4d57f491 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(m=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,f.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(d.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(m=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,f.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(d.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_ext-protection_gathering.min.js b/js/apbct-public-bundle_ext-protection_gathering.min.js index 0ef2fd12c..86eb9b484 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(f=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,_.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(f=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,_.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection.min.js b/js/apbct-public-bundle_full-protection.min.js index 705b9b7a7..f24452c71 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(m=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,f.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(d.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(m=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,f.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};+ctPublic.bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}function ctCheckInternal(t){var e,n={},o=t.elements;for(e in o)"submit"!==o[e].type&&void 0!==o[e].value&&""!==o[e].value&&(n[o[e].name]=t.elements[e].value);n.action="ct_check_internal",apbct_public_sendAJAX(n,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.origSubmit()}})}function ctProtectInternalForms(){for(var e,t="",n="",o=0;o .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(d.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index 7253a3b86..ff8fc8035 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var o=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(o,n.decoded_email),c[t].href=e+n.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),n.append(c),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(f=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,_.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),n=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var c=o.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};1==ctPublic.settings__data__bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var n;this.wrappers.forEach(function(e){n=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;n&&"string"==typeof n&&(t=decodeURIComponent(n),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var n,o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var n=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){n.data.push(Object.assign({},n.fieldData))})}},{key:"setListeners",value:function(){var o=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){o.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){o.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,n){e.addEventListener("input",function(){o.data[n].countOfKey++;var e,t=+new Date;1===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].firstKeyTimestamp=t):(e=t-o.data[n].lastKeyTimestamp,2===o.data[n].countOfKey?(o.data[n].lastKeyTimestamp=t,o.data[n].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!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,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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(n,[{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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof o[0]?o[0]:(null==(a=o[0])?void 0:a.url)||""))return e.a(2,b.apply(this,o));e.n=2;break;case 2:if(f=!1,o&&o[0]&&o[1]&&o[1].body){e.n=3;break}return e.a(2,b.apply(this,o));case 3:return e.n=4,_.processFetch(o);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{o[1].body=p(o[1].body,d(+ctPublic.bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={post_url:document.location.href,referrer:document.referrer};+ctPublic.bot_detector_enabled?e.event_token=apbctLocalStorage.get("bot_detector_event_token"):e.event_javascript_data=getJavascriptClientData(),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?(this.decodeForms(),document.dispatchEvent(new Event("apbctForceProtectionAllowed"))):this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var o;this.wrappers.forEach(function(e){o=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{var t;o&&"string"==typeof o&&(t=decodeURIComponent(o),e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))();function apbctForceProtect(){+ctPublic.settings__forms__force_protection&&void 0!==ApbctForceProtection&&new ApbctForceProtection}ctPublic.data__key_is_ok&&("loading"!==document.readyState?apbctForceProtect():apbct_attach_event_handler(document,"DOMContentLoaded",apbctForceProtect));var ctMouseReadInterval,ctMouseWriteDataInterval,ApbctGatheringData=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index a0a9b7d12..3e75f5f33 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!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,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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(n,[{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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof o[0]?o[0]:(null==(a=o[0])?void 0:a.url)||""))return e.a(2,b.apply(this,o));e.n=2;break;case 2:if(f=!1,o&&o[0]&&o[1]&&o[1].body){e.n=3;break}return e.a(2,b.apply(this,o));case 3:return e.n=4,_.processFetch(o);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{o[1].body=p(o[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!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,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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(n,[{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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof o[0]?o[0]:(null==(a=o[0])?void 0:a.url)||""))return e.a(2,b.apply(this,o));e.n=2;break;case 2:if(f=!1,o&&o[0]&&o[1]&&o[1].body){e.n=3;break}return e.a(2,b.apply(this,o));case 3:return e.n=4,_.processFetch(o);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{o[1].body=p(o[1].body,d(+ctPublic.bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection.min.js b/js/apbct-public-bundle_int-protection.min.js index 3bd273d5b..f1524c88b 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1 +1 @@ -function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(i.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(f=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,_.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),i=null,c=(null!==r&&null!==r.value&&(i=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==i&&(o.apbct_search_form__honeypot_value=i),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,i=this.findParentContainer(r);if(i){var c=this.getIdFromHTML(i);if(c===n){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,i,c,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(c),i.append(" "),i.append(d.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),c.append(l)),r.append(i,c),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;et||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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n{var n,e;if(c.data.forEach(function(e){e.encoded_email===r[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===r[t].href||0!==r[t].href.indexOf("mailto:")&&0!==r[t].href.indexOf("tel:"))r[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r[t])},2e3);else{if(0===r[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==r[t].href.indexOf("tel:"))return 0;e="tel:"}var o=r[t].href.replace(e,""),a=r[t].innerHTML;r[t].innerHTML=a.replace(o,n.decoded_email),r[t].href=e+n.decoded_email,r[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}r[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];r.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,r)},2e3),r.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(r.innerHTML="Loading...",t&&this.load(t)),r.setAttribute("id","cleantalk-modal-content"),n.append(r),this.opened=!0},confirm:function(e){var t,n=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var n in e)if(Object.hasOwn(e,n))for(var o=n.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?n||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?n||Boolean(e[t]):n||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):n}},{key:"isWithoutSelector",value:function(e,t){var n,o=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(n=a.n()).done;)o=o||e===n.value}catch(e){a.e(e)}finally{a.f()}return o}},{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,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.after(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"append",value:function(e){var t,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)t.value.append(e)}catch(e){n.e(e)}finally{n.f()}}},{key:"fadeIn",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-n)/o,n=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,n=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(o){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-n)/o,n=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,n=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,n="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(n=e.headers["X-WP-Nonce"]),""!==(n=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:n)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:n,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),n=0;n{function o(){for(var e=arguments.length,t=new Array(e),n=0;n{function a(){for(var e=arguments.length,t=new Array(e),n=0;n{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,n=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(o){o.addEventListener("click",function(e){var t=o.getAttribute("href"),n=apbctLocalStorage.get("bot_detector_event_token");n&&(-1===t.indexOf("?")?t+="?":t+="&",o.setAttribute("href",t+="ct_bot_detector_event_token="+n))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var n=document.createElement("input"),t=(n.setAttribute("type","hidden"),n.setAttribute("id","apbct_visible_fields_"+t),n.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),n.value=btoa(JSON.stringify(t)),e.append(n)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),n=getCleanTalkStorageDataArray(),n=JSON.stringify(n);return n="_ct_no_cookie_data_"+btoa(n),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",n),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,n;+ctPublic.bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(n="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,n+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var n="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var o in n){if(10{function c(){_classCallCheck(this,c)}return _createClass(c,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof n[0]?n[0]:(null==(a=n[0])?void 0:a.url)||""))return e.a(2,b.apply(this,n));e.n=2;break;case 2:if(f=!1,n&&n[0]&&n[1]&&n[1].body){e.n=3;break}return e.a(2,b.apply(this,n));case 3:return e.n=4,_.processFetch(n);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{n[1].body=p(n[1].body,d(+ctPublic.bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return n.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var n,o,a,r=t.querySelector('[name*="apbct_email_id__"]'),c=null,i=(null!==r&&null!==r.value&&(c=r.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&null===r&&null===l||(e.preventDefault(),n=function(){null!==r&&r.parentNode.removeChild(r),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=i,null!==c&&(o.apbct_search_form__honeypot_value=c),o.ct_bot_detector_event_token=l,"string"==typeof o.apbct_pixel_url&&-1!==o.apbct_pixel_url.indexOf("%3A")&&(o.apbct_pixel_url=decodeURIComponent(o.apbct_pixel_url)),void 0!==(a=JSON.stringify(o))&&0!==a.length?ctSetAlternativeCookie(a,{callback:n,onErrorCallback:n,forceAltCookies:!0}):n())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var o=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,n){o(t)}):jQuery(document).ajaxComplete(function(e,t,n){o(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&o(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),n=this.getIdFromAjax(e);if(n){var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value,c=this.findParentContainer(r);if(c){var i=this.getIdFromHTML(c);if(i===n){var l=c.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,n=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var n,o,a,r,c,i,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((n=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(o=document.createElement("img")).setAttribute("src",d.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(d.phrases.trpHeading),(r=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),r.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(i),c.append(" "),c.append(d.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),i.append(l)),r.append(c,i),a.append(r),n.append(o),e.append(n),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),o.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),o.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),o.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;a=setTimeout(function(){var e=n.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/apbct-public-bundle_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index 8b0128ef8..cc8e8f36d 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!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,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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(n,[{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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.settings__data__bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof o[0]?o[0]:(null==(a=o[0])?void 0:a.url)||""))return e.a(2,b.apply(this,o));e.n=2;break;case 2:if(f=!1,o&&o[0]&&o[1]&&o[1].body){e.n=3;break}return e.a(2,b.apply(this,o));case 3:return e.n=4,_.processFetch(o);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{o[1].body=p(o[1].body,d(+ctPublic.settings__data__bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;et||c=e.length?{done:!0}:{done:!1,value:e[c++]}},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={}.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=Array(t);o{var o,e;if(i.data.forEach(function(e){e.encoded_email===c[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===c[t].href||0!==c[t].href.indexOf("mailto:")&&0!==c[t].href.indexOf("tel:"))c[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c[t])},2e3);else{if(0===c[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[t].href.indexOf("tel:"))return 0;e="tel:"}var n=c[t].href.replace(e,""),a=c[t].innerHTML;c[t].innerHTML=a.replace(n,o.decoded_email),c[t].href=e+o.decoded_email,c[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";i.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})}c[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];c.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=e),e.length)for(var t=0;t$1'):(c.innerHTML="Loading...",t&&this.load(t)),c.setAttribute("id","cleantalk-modal-content"),o.append(c),this.opened=!0},confirm:function(e){var t,o=1_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(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=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!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,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.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 a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{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"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))());function selectActualNonce(){var e="";return ctPublicFunctions.hasOwnProperty("_fresh_nonce")&&"string"==typeof ctPublicFunctions._fresh_nonce&&0{function n(e){for(var t in _classCallCheck(this,n),_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",""),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.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):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(n,[{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:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctFetchProxyConfig},[{key:"findMatchingConfig",value:function(e){for(var t=0,o=Object.entries(this.config);tMath.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_createClass(function e(){_classCallCheck(this,e)},[{key:"attachEventTokenToMultipageGravityForms",value:function(){document.addEventListener("gform_page_loaded",function(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||"function"!=typeof setEventTokenField||"function"!=typeof botDetectorLocalStorage||setEventTokenField(botDetectorLocalStorage.get("bot_detector_event_token"))})}},{key:"attachEventTokenToWoocommerceGetRequestAddToCart",value:function(){ctPublic.wc_ajax_add_to_cart||document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}},{key:"restartBotDetectorEventTokenAttach",value:function(){var e,t=0_createClass(function e(){_classCallCheck(this,e)},[{key:"attachHiddenFieldsToForms",value:function(e){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.bot_detector_enabled&&!e||(ctNoCookieAttachHiddenFieldsToForms(),document.addEventListener("gform_page_loaded",ctNoCookieAttachHiddenFieldsToForms))}},{key:"attachVisibleFieldsToForm",value:function(e,t){var o=document.createElement("input"),t=(o.setAttribute("type","hidden"),o.setAttribute("id","apbct_visible_fields_"+t),o.setAttribute("name","apbct_visible_fields"),{});t[0]=this.collectVisibleFields(e),o.value=btoa(JSON.stringify(t)),e.append(o)}},{key:"attachVisibleFieldsDuringSubmit",value:function(e,t){"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&this.setVisibleFieldsCookie(this.collectVisibleFields(t),e.target.ctFormIndex)}},{key:"constructNoCookieHiddenField",value:function(e){var t="hidden",e=("submit"===e&&(t="submit"),""),o=getCleanTalkStorageDataArray(),o=JSON.stringify(o);return o="_ct_no_cookie_data_"+btoa(o),(e=document.createElement("input")).setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",o),e.setAttribute("type",t),e.classList.add("apbct_special_field"),e.classList.add("ct_no_cookie_hidden_field"),e}},{key:"attachNoCookieDuringSubmit",value:function(e){"none"===ctPublic.data__cookies_type&&e.target&&e.target.action&&-1!==e.target.action.toString().indexOf("mailpoet_subscription_form")&&(window.XMLHttpRequest.prototype.send=function(e){var t,o;+ctPublic.bot_detector_enabled?(t=(new ApbctHandler).toolGetEventToken())&&(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+("data%5Bct_bot_detector_event_token%5D="+t+"&")+e)):(o="data%5Bct_no_cookie_hidden_field%5D="+getNoCookieData()+"&",defaultSend.call(this,o+e)),setTimeout(function(){window.XMLHttpRequest.prototype.send=defaultSend},0)})}},{key:"setVisibleFieldsCookie",value:function(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{function i(){_classCallCheck(this,i)}return _createClass(i,[{key:"excludeForm",value:function(e){return!!this.checkHiddenFieldsExclusions(e,"visible_fields")||!!(e.querySelector('input[name="wspsc_add_cart_submit"]')||e.querySelector('input[name="option"][value="com_vikrentcar"]')||e.querySelector('input[name="option"][value="com_vikbooking"]'))||void 0!==e.elements.apbct_visible_fields&&0!(!t||"string"!=typeof t)&&["google.com/recaptcha","gstatic.com/recaptcha","recaptcha.google.com","recaptcha.net","www.google.com/recaptcha","apis.google.com","paypal.com","api.paypal.com","www.paypal.com","js.stripe.com","api.stripe.com","checkout.stripe.com","api.doboard.com"].some(function(e){return t.includes(e)}))("string"==typeof o[0]?o[0]:(null==(a=o[0])?void 0:a.url)||""))return e.a(2,b.apply(this,o));e.n=2;break;case 2:if(f=!1,o&&o[0]&&o[1]&&o[1].body){e.n=3;break}return e.a(2,b.apply(this,o));case 3:return e.n=4,_.processFetch(o);case 4:if(!0===e.v)return e.a(2,new Promise(function(){}));e.n=5;break;case 5:if(0{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})()))try{o[1].body=p(o[1].body,d(+ctPublic.bot_detector_enabled))}catch(e){}if(0{var t=e.value;"undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&null!==t.getAttribute("apbct-form-sign")&&"native_search"===t.getAttribute("apbct-form-sign")&&(t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return o.searchFormHandler(e,t)})})()}catch(e){t.e(e)}finally{t.f()}}},{key:"searchFormHandler",value:function(e,t){try{var o,n,a,c=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==c&&null!==c.value&&(i=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===c&&null===l||(e.preventDefault(),o=function(){null!==c&&c.parentNode.removeChild(c),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},n=r,null!==i&&(n.apbct_search_form__honeypot_value=i),n.ct_bot_detector_event_token=l,"string"==typeof n.apbct_pixel_url&&-1!==n.apbct_pixel_url.indexOf("%3A")&&(n.apbct_pixel_url=decodeURIComponent(n.apbct_pixel_url)),void 0!==(a=JSON.stringify(n))&&0!==a.length?ctSetAlternativeCookie(a,{callback:o,onErrorCallback:o,forceAltCookies:!0}):o())}catch(e){console.warn("APBCT search form onsubmit handler error. "+e)}}},{key:"toolForAntiCrawlerCheckDuringBotDetector",value:function(){var e=setInterval(function(){localStorage.bot_detector_event_token&&(ctSetCookie("apbct_bot_detector_exist","1","3600"),clearInterval(e))},500)}},{key:"toolGetEventToken",value:function(){var t=localStorage.getItem("bot_detector_event_token");try{t=JSON.parse(t)}catch(e){t=!1}return!(null===t||!1===t||!t.hasOwnProperty("value")||""===t.value)&&t.value}}])})(),ApbctShowForbidden=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"prepareBlockForAjaxForms",value:function(){var n=function(e){if(e.responseText&&-1!==e.responseText.indexOf('"apbct')&&-1===e.responseText.indexOf("DOCTYPE"))try{this.parseBlockMessage(JSON.parse(e.responseText))}catch(e){console.log(e.toString())}}.bind(this);"undefined"!=typeof jQuery?"function"!=typeof jQuery(document).ajaxComplete()?jQuery(document).on("ajaxComplete",function(e,t,o){n(t)}):jQuery(document).ajaxComplete(function(e,t,o){n(t)}):"undefined"!=typeof XMLHttpRequest&&document.addEventListener("readystatechange",function(e){4===e.target.readyState&&n(e.target)})}},{key:"parseBlockMessage",value:function(e){var t="";void 0!==e.apbct&&(e=e.apbct).blocked&&(t=e.comment),(t=void 0!==e.data&&void 0!==(e=e.data).message?e.message:t)&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t}})),cleantalkModal.loaded=t,cleantalkModal.open(),1==+e.stop_script)&&(window.stop(),e.integration)&&"NEXForms"===e.integration&&((t=document.querySelector("form.submit-nex-form button.nex-submit"))&&(t.disabled=!0,t.style.opacity="0.5",t.style.cursor="not-allowed",t.style.pointerEvents="none",t.style.backgroundColor="#ccc",t.style.color="#fff"),e=document.querySelector("div.nex_success_message"))&&(e.style.display="none")}}]))(),ApbctVisibleFieldsExtractor=(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"extract",value:function(e){if(e&&"string"==typeof e){try{e=decodeURIComponent(e)}catch(e){return!1}var t=document.querySelectorAll("form"),o=this.getIdFromAjax(e);if(o){var n,a=_createForOfIteratorHelper(t);try{for(a.s();!(n=a.n()).done;){var c=n.value,i=this.findParentContainer(c);if(i){var r=this.getIdFromHTML(i);if(r===o){var l=i.querySelector("input[id^=apbct_visible_fields_]");if(null!=l&&l.value)return l.value}}}}catch(e){a.e(e)}finally{a.f()}}}return!1}},{key:"getIdFromAjax",value:function(e){return console.warn("getIdFromAjax must be implemented by child class"),null}},{key:"findParentContainer",value:function(e){return console.warn("findParentContainer must be implemented by child class"),null}},{key:"getIdFromHTML",value:function(e){return console.warn("getIdFromHTML must be implemented by child class"),null}}],[{key:"createExtractor",value:function(e){switch(e){case"action=nf_ajax_submit":return new ApbctNinjaFormsVisibleFields;case"action=mailpoet":return new ApbctMailpoetVisibleFields;default:return null}}}]))(),ApbctNinjaFormsVisibleFields=(()=>{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/"id"\s*:\s*"?(\d+)"/,/form_id\s*[:\s]*"?(\d+)"/,/nf-form-(\d+)/,/"id":(\d+)/];t{function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,ApbctVisibleFieldsExtractor),_createClass(e,[{key:"getIdFromAjax",value:function(e){for(var t=0,o=[/form_id\s*[:\s]*"?(\d+)"/,/data\[form_id\]=(\d+)/,/form_id=(\d+)/];t_createClass(function e(){_classCallCheck(this,e)},[{key:"setSessionId",value:function(){var e;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(e=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",e,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}},{key:"writeReferrersToSessionStorage",value:function(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}},{key:"setCookiesType",value:function(){var e=apbctLocalStorage.get("ct_cookies_type");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"))}},{key:"startFieldsListening",value:function(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elementBody",document.querySelector("body")),_defineProperty(this,"collectionForms",document.forms),this.setListeners()},[{key:"setListeners",value:function(){var t=this;this.elementBody.addEventListener("click",function(e){t.checkElementInForms(e,"addClicks")}),this.elementBody.addEventListener("mouseup",function(e){"Range"==document.getSelection().type.toString()&&t.addSelected()}),this.elementBody.addEventListener("mousemove",function(e){t.checkElementInForms(e,"trackMouseMovement")})}},{key:"checkElementInForms",value:function(e,t){for(var o,n=0;n_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2 .comment-body *[class*="comment-author"]',document.querySelector(".apbct-trp .comment-author .comment-author-link")&&(e='.apbct-trp *[class*="comment-author-link"]'),0!==(e=document.querySelectorAll(e+',.apbct-trp > .wp-block-group *[class*="comment-author"],.apbct-trp *[class*="review__author"],.apbct-trp td[class*="column-author"] > strong')).length)&&(e.forEach(function(e,t){var o,n,a,c,i,r,l,s,u;e.className.indexOf("review")<0&&"undefined"==typeof pagenow&&e.parentElement.className.indexOf("group")<0&&"DIV"!=e.tagName||e.querySelector(".comment-metadata")||((o=document.createElement("div")).setAttribute("class","apbct-real-user-badge"),(n=document.createElement("img")).setAttribute("src",d.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(d.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(d.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",d.trpContentLink),s.setAttribute("target","_blank"),(u=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),u.setAttribute("alt","New window"),u.setAttribute("style","padding-top:3px"),s.append(u),l.append(s),r.append(l)),c.append(i,r),a.append(c),o.append(n),e.append(o),e.append(a))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(t.body.addEventListener("click",function(e){-1==e.target.className.indexOf("apbct-real-user")&&-1==e.target.parentElement.className.indexOf("apbct-real-user")&&closeAllPopupTRP()}),n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){closeAllPopupTRP();var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/cleantalk-admin.min.js b/js/cleantalk-admin.min.js index 66b31d4f1..e914aef60 100644 --- a/js/cleantalk-admin.min.js +++ b/js/cleantalk-admin.min.js @@ -1,2 +1,2 @@ -function apbct_admin_sendAJAX(t,n,c){let o=n.callback||null,i=n.callback_context||null,a=n.callback_params||null;var e=n.async||!0;let d=n.notJson||null;var l=n.timeout||15e3,c=c||null;let r=n.button||null,s=n.spinner||null,u=n.progressbar||null;"string"==typeof t?t=t+"&_ajax_nonce="+ctAdminCommon._ajax_nonce+"&no_cache="+Math.random():(t._ajax_nonce=ctAdminCommon._ajax_nonce,t.no_cache=Math.random()),r&&(r.setAttribute("disabled","disabled"),r.style.cursor="not-allowed"),s&&jQuery(s).css("display","inline"),jQuery.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:t,async:e,success:function(e){r&&(r.removeAttribute("disabled"),r.style.cursor="pointer"),s&&jQuery(s).css("display","none"),(e=d?e:JSON.parse(e)).error?(setTimeout(function(){u&&u.fadeOut("slow")},1e3),"undefined"!=typeof cleantalkModal?(cleantalkModal.loaded="Error:
"+e.error.toString(),cleantalkModal.open()):alert("Error happens: "+(e.error||"Unkown"))):o&&(a?o.apply(i,a.concat(e,t,n,c)):o(e,t,n,c))},error:function(e,t,n){r&&(r.removeAttribute("disabled"),r.style.cursor="pointer"),s&&jQuery(s).css("display","none"),console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(t),console.log(n)},timeout:l})}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],n=document.createElement("div");n.classList="apbct-ee-animation-wrapper";for(let e=0;e{e.encoded_email===a.dataset.originalString&&(t=e)}),e=t.decoded_email.split(/[&?]/)[0]}else e=o.data[0].decoded_email;var n=t.querySelector("#apbct_email_ecoder__popup_text_node_first"),c=document.createElement("b"),c=(c.setAttribute("class","apbct-email-encoder-select-whole-email"),c.innerText=e,"undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_click_to_select?c.title=ctPublicFunctions.text__ee_click_to_select:c.title=ctAdminCommon.text__ee_click_to_select,n&&("undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_original_email?n.innerHTML=ctPublicFunctions.text__ee_original_email+" "+c.outerHTML:n.innerHTML=ctAdminCommon.text__ee_original_email+" "+c.outerHTML,n.setAttribute("style","flex-direction: row;")),t.querySelector(".apbct-ee-animation-wrapper")),n=(c&&c.remove(),t.querySelector("#apbct_email_ecoder__popup_text_node_second")),c=(n&&n.remove(),document.createElement("span"));c.classList="apbct-email-encoder-elements_center top-margin-long",document.querySelector(".apbct-email-encoder-got-it-button")||(n=document.createElement("button"),"undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_got_it?n.innerText=ctPublicFunctions.text__ee_got_it:n.innerText=ctAdminCommon.text__ee_got_it,n.classList="apbct-email-encoder-got-it-button",n.addEventListener("click",function(){document.body.classList.remove("apbct-popup-fade"),t.setAttribute("style","display:none"),fillDecodedNodes(i,o),"undefined"!=typeof ctPublic&&ctPublic.encodedEmailNodesIsMixed&&a&&a.click()}),c.append(n),t.append(c))}},3e3);else if(a){let e="unknown_error";o.hasOwnProperty("data")&&0{e.encoded_email===c[n].dataset.originalString&&(t=e)}),!1===t.is_allowed)return;if(void 0===c[n].href||0!==c[n].href.indexOf("mailto:")&&0!==c[n].href.indexOf("tel:"))c[n].classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(t,c[n])},2e3);else{let e;if(0===c[n].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[n].href.indexOf("tel:"))continue;e="tel:"}var i=c[n].href.replace(e,""),a=c[n].innerHTML;c[n].innerHTML=a.replace(i,t.decoded_email),c[n].href=e+t.decoded_email,c[n].querySelectorAll("span.apbct-email-encoder").forEach(t=>{let n="";o.data.forEach(e=>{e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[n].removeEventListener("click",ctFillDecodedEmailHandler)}else{let e=o.data[0];c.classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(e,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}jQuery(document).ready(function(t){jQuery(".apbct_update_notice").on("click","button",function(){var e=new Date((new Date).getTime()+2592e6),t="https:"===location.protocol?"; secure":"";document.cookie="apbct_update_banner_closed=1; path=/; expires="+e.toUTCString()+"; samesite=lax"+t}),jQuery('li a[href="options-general.php?page=cleantalk"]').css("white-space","nowrap").css("display","inline-block"),jQuery("body").on("click",".apbct-notice .notice-dismiss-link",function(e){jQuery(e.target).parent().parent(".notice").after('

'+ctAdminCommon.apbctNoticeDismissSuccess+"

"),setTimeout(function(){jQuery("#apbct-notice-dismiss-success").fadeOut()},2e3),jQuery(e.target).parent().siblings(".apbct-notice .notice-dismiss").click()}),jQuery("body").on("click",".apbct-notice .notice-dismiss",function(e){e=jQuery(e.target).parent().attr("id");e&&apbct_admin_sendAJAX({action:"cleantalk_dismiss_notice",notice_id:e},{callback:null,notJson:!0})}),jQuery(".ct_username .row-actions .delete a").on("click",function(e){e.preventDefault(),confirm(ctAdminCommon.notice_when_deleting_user_text)&&(window.location=this.href)});let n=document.querySelector("#apbct_setting_forms__force_protection__On");var e;n&&n.addEventListener("click",function(e){n.checked&&!confirm(ctAdminCommon.apbctNoticeForceProtectionOn)&&e.preventDefault()}),t(".apbct-restore-spam-order-button").click(function(){var e=t(this).data("spam-order-id"),e={action:"apbct_restore_spam_order",_ajax_nonce:ctAdminCommon._ajax_nonce,order_id:e};t.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:e,success:function(e){e.success?window.location.reload():alert(e.data.message)}})}),window.location.href.includes("options-general.php?page=cleantalk")&&(e=document.querySelector("[data-original-string]"))&&((ctAdminCommon.encodedEmailNode=e).style.cursor="pointer",e.addEventListener("click",ctFillDecodedEmailHandler))}),document.addEventListener("DOMContentLoaded",function(){var t=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=t),t.length)for(let e=0;e{e.encoded_email===a.dataset.originalString&&(t=e)}),e=t.decoded_email.split(/[&?]/)[0]}else e=o.data[0].decoded_email;var n=t.querySelector("#apbct_email_ecoder__popup_text_node_first"),c=document.createElement("b"),c=(c.setAttribute("class","apbct-email-encoder-select-whole-email"),c.innerText=e,"undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_click_to_select?c.title=ctPublicFunctions.text__ee_click_to_select:c.title=ctAdminCommon.text__ee_click_to_select,n&&("undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_original_email?n.innerHTML=ctPublicFunctions.text__ee_original_email+" "+c.outerHTML:n.innerHTML=ctAdminCommon.text__ee_original_email+" "+c.outerHTML,n.setAttribute("style","flex-direction: row;")),t.querySelector(".apbct-ee-animation-wrapper")),n=(c&&c.remove(),t.querySelector("#apbct_email_ecoder__popup_text_node_second")),c=(n&&n.remove(),document.createElement("span"));c.classList="apbct-email-encoder-elements_center top-margin-long",document.querySelector(".apbct-email-encoder-got-it-button")||(n=document.createElement("button"),"undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_got_it?n.innerText=ctPublicFunctions.text__ee_got_it:n.innerText=ctAdminCommon.text__ee_got_it,n.classList="apbct-email-encoder-got-it-button",n.addEventListener("click",function(){document.body.classList.remove("apbct-popup-fade"),t.setAttribute("style","display:none"),fillDecodedNodes(i,o),"undefined"!=typeof ctPublic&&ctPublic.encodedEmailNodesIsMixed&&a&&a.click()}),c.append(n),t.append(c))}},3e3);else if(a){let e="unknown_error";o.hasOwnProperty("data")&&0{e.encoded_email===c[n].dataset.originalString&&(t=e)}),!1===t.is_allowed)return;if(void 0===c[n].href||0!==c[n].href.indexOf("mailto:")&&0!==c[n].href.indexOf("tel:"))c[n].classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(t,c[n])},2e3);else{let e;if(0===c[n].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[n].href.indexOf("tel:"))continue;e="tel:"}var i=c[n].href.replace(e,""),a=c[n].innerHTML;c[n].innerHTML=a.replace(i,t.decoded_email),c[n].href=e+t.decoded_email,c[n].querySelectorAll("span.apbct-email-encoder").forEach(t=>{let n="";o.data.forEach(e=>{e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[n].removeEventListener("click",ctFillDecodedEmailHandler)}else{let e=o.data[0];c.classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(e,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(
)/,t+"$1")}jQuery(document).ready(function(t){jQuery(".apbct_update_notice").on("click","button",function(){var e=new Date((new Date).getTime()+2592e6),t="https:"===location.protocol?"; secure":"";document.cookie="apbct_update_banner_closed=1; path=/; expires="+e.toUTCString()+"; samesite=lax"+t}),jQuery('li a[href="options-general.php?page=cleantalk"]').css("white-space","nowrap").css("display","inline-block"),jQuery("body").on("click",".apbct-notice .notice-dismiss-link",function(e){jQuery(e.target).parent().parent(".notice").after('

'+ctAdminCommon.apbctNoticeDismissSuccess+"

"),setTimeout(function(){jQuery("#apbct-notice-dismiss-success").fadeOut()},2e3),jQuery(e.target).parent().siblings(".apbct-notice .notice-dismiss").click()}),jQuery("body").on("click",".apbct-notice .notice-dismiss",function(e){e=jQuery(e.target).parent().attr("id");e&&apbct_admin_sendAJAX({action:"cleantalk_dismiss_notice",notice_id:e},{callback:null,notJson:!0})}),jQuery(".ct_username .row-actions .delete a").on("click",function(e){e.preventDefault(),confirm(ctAdminCommon.notice_when_deleting_user_text)&&(window.location=this.href)});let n=document.querySelector("#apbct_setting_forms__force_protection__On");var e;n&&n.addEventListener("click",function(e){n.checked&&!confirm(ctAdminCommon.apbctNoticeForceProtectionOn)&&e.preventDefault()}),t(".apbct-restore-spam-order-button").click(function(){var e=t(this).data("spam-order-id"),e={action:"apbct_restore_spam_order",_ajax_nonce:ctAdminCommon._ajax_nonce,order_id:e};t.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:e,success:function(e){e.success?window.location.reload():alert(e.data.message)}})}),window.location.href.includes("options-general.php?page=cleantalk")&&(e=document.querySelector("[data-original-string]"))&&((ctAdminCommon.encodedEmailNode=e).style.cursor="pointer",e.addEventListener("click",ctFillDecodedEmailHandler))}),document.addEventListener("DOMContentLoaded",function(){var t=document.querySelectorAll("[data-original-string]");if("undefined"!=typeof ctPublic&&(ctPublic.encodedEmailNodes=t),t.length)for(let e=0;e

' +\n ctAdminCommon.apbctNoticeDismissSuccess +\n '

');\n setTimeout(function() {\n jQuery('#apbct-notice-dismiss-success').fadeOut();\n }, 2000);\n jQuery(e.target).parent().siblings('.apbct-notice .notice-dismiss').click();\n });\n jQuery('body').on('click', '.apbct-notice .notice-dismiss', function(e) {\n let apbctNoticeName = jQuery(e.target).parent().attr('id');\n if ( apbctNoticeName ) {\n apbct_admin_sendAJAX(\n {\n 'action': 'cleantalk_dismiss_notice',\n 'notice_id': apbctNoticeName,\n },\n {\n 'callback': null,\n 'notJson': true,\n },\n );\n }\n });\n\n // Notice when deleting user\n jQuery('.ct_username .row-actions .delete a').on('click', function(e) {\n e.preventDefault();\n\n let result = confirm(ctAdminCommon.notice_when_deleting_user_text);\n\n if (result) {\n window.location = this.href;\n }\n });\n\n let btnForceProtectionOn = document.querySelector('#apbct_setting_forms__force_protection__On');\n if (btnForceProtectionOn) {\n btnForceProtectionOn.addEventListener('click', function(e) {\n if (btnForceProtectionOn.checked) {\n let result = confirm(ctAdminCommon.apbctNoticeForceProtectionOn);\n\n if (!result) {\n e.preventDefault();\n }\n }\n });\n }\n // Restore spam order\n $('.apbct-restore-spam-order-button').click(function() {\n const spmOrderId = $(this).data('spam-order-id');\n let data = {\n action: 'apbct_restore_spam_order',\n _ajax_nonce: ctAdminCommon._ajax_nonce,\n order_id: spmOrderId,\n };\n $.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n success: function(result) {\n if (result.success) {\n window.location.reload();\n } else {\n alert(result.data.message);\n }\n },\n });\n });\n\n // Email decoder example\n if (window.location.href.includes('options-general.php?page=cleantalk')) {\n let encodedEmailNode = document.querySelector('[data-original-string]');\n if (encodedEmailNode) {\n ctAdminCommon.encodedEmailNode = encodedEmailNode;\n encodedEmailNode.style.cursor = 'pointer';\n encodedEmailNode.addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n});\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_admin_sendAJAX(data, params, obj) {\n // Default params\n let callback = params.callback || null;\n let callbackContext = params.callback_context || null;\n let callbackParams = params.callback_params || null;\n let async = params.async || true;\n let notJson = params.notJson || null;\n let timeout = params.timeout || 15000;\n var obj = obj || null; // eslint-disable-line no-var\n let button = params.button || null;\n let spinner = params.spinner || null;\n let progressbar = params.progressbar || null;\n\n if (typeof (data) === 'string') {\n data = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();\n } else {\n data._ajax_nonce = ctAdminCommon._ajax_nonce;\n data.no_cache = Math.random();\n }\n // Button and spinner\n if (button) {\n button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed';\n }\n if (spinner) jQuery(spinner).css('display', 'inline');\n\n jQuery.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n async: async,\n success: function(result) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n if (!notJson) result = JSON.parse(result);\n if (result.error) {\n setTimeout(function() {\n if (progressbar) progressbar.fadeOut('slow');\n }, 1000);\n if ( typeof cleantalkModal !== 'undefined' ) {\n // Show the result by modal\n cleantalkModal.loaded = 'Error:
' + result.error.toString();\n cleantalkModal.open();\n } else {\n alert('Error happens: ' + (result.error || 'Unkown'));\n }\n } else {\n if (callback) {\n if (callbackParams) {\n callback.apply( callbackContext, callbackParams.concat( result, data, params, obj ) );\n } else {\n callback(result, data, params, obj);\n }\n }\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n console.log('APBCT_AJAX_ERROR');\n console.log(jqXHR);\n console.log(textStatus);\n console.log(errorThrown);\n },\n timeout: timeout,\n });\n}\n","/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler(event = false) {\n let clickSource = false;\n let ctWlBrandname = '';\n let encodedEmail = '';\n if (typeof ctPublic !== 'undefined') {\n this.removeEventListener('click', ctFillDecodedEmailHandler);\n // remember clickSource\n clickSource = this;\n // globally remember if emails is mixed with mailto\n ctPublic.encodedEmailNodesIsMixed = false;\n ctWlBrandname = ctPublic.wl_brandname;\n encodedEmail = ctPublic.encodedEmailNodes;\n } else if (typeof ctAdminCommon !== 'undefined') {\n ctWlBrandname = ctAdminCommon.plugin_name;\n encodedEmail = ctAdminCommon.encodedEmailNode;\n }\n\n // get fade\n document.body.classList.add('apbct-popup-fade');\n // popup show\n let encoderPopup = document.getElementById('apbct_popup');\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctWlBrandname;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_wait_for_decoding) {\n popupTextWaiting.innerText = ctPublicFunctions.text__ee_wait_for_decoding;\n } else {\n popupTextWaiting.innerText = ctAdminCommon.text__ee_wait_for_decoding;\n }\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_decoding_process) {\n popupTextDecoding.innerText = ctPublicFunctions.text__ee_decoding_process;\n } else {\n popupTextDecoding.innerText = ctAdminCommon.text__ee_decoding_process;\n }\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_wait_for_decoding) {\n document.getElementById('apbct_popup_text').innerHTML = ctPublicFunctions.text__ee_wait_for_decoding;\n } else {\n document.getElementById('apbct_popup_text').innerHTML = ctAdminCommon.text__ee_wait_for_decoding;\n }\n }\n\n apbctAjaxEmailDecodeBulk(event, encodedEmail, clickSource);\n}\n\n/**\n * @param {mixed} event\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {\n if (event && clickSource) {\n // collect data\n let data = {\n post_url: document.location.href,\n referrer: document.referrer,\n encodedEmails: '',\n };\n if (ctPublic.settings__data__bot_detector_enabled == 1) {\n data.event_token = apbctLocalStorage.get('bot_detector_event_token');\n } else {\n data.event_javascript_data = getJavascriptClientData();\n }\n\n let encodedEmailsCollection = {};\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // disable click for mailto\n if (\n typeof encodedEmailNodes[i].href !== 'undefined' &&\n encodedEmailNodes[i].href.indexOf('mailto:') === 0\n ) {\n event.preventDefault();\n ctPublic.encodedEmailNodesIsMixed = true;\n }\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n apbct(encodedEmailNodes[i]).append(apbctTooltip);\n\n // collect encoded email strings\n encodedEmailsCollection[i] = encodedEmailNodes[i].dataset.originalString;\n }\n\n // JSONify encoded email strings\n data.encodedEmails = JSON.stringify(encodedEmailsCollection);\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_decode_email',\n {\n data: data,\n method: 'POST',\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey, '');\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n\n // Using AJAX request and handler\n } else {\n data.action = 'apbct_decode_email';\n apbct_public_sendAJAX(\n data,\n {\n notJson: false,\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey, '');\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n }\n } else {\n const encodedEmail = encodedEmailNodes.dataset.originalString;\n let data = {\n encodedEmails: JSON.stringify({0: encodedEmail}),\n };\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n encodedEmailNodes.appendChild(apbctTooltip);\n\n apbct_admin_sendAJAX(\n {\n 'action': 'apbct_decode_email',\n 'encodedEmails': data.encodedEmails,\n },\n {\n 'callback': function(result) {\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, false);\n },\n 'notJson': true,\n },\n );\n }\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource = false) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n // popup remove\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n let email = '';\n if (clickSource) {\n let currentResultData;\n result.data.forEach((row) => {\n if (row.encoded_email === clickSource.dataset.originalString) {\n currentResultData = row;\n }\n });\n\n email = currentResultData.decoded_email.split(/[&?]/)[0];\n } else {\n email = result.data[0].decoded_email;\n }\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_click_to_select) {\n selectableEmail.title = ctPublicFunctions.text__ee_click_to_select;\n } else {\n selectableEmail.title = ctAdminCommon.text__ee_click_to_select;\n }\n // add email to the first node\n if (firstNode) {\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_original_email) {\n firstNode.innerHTML = ctPublicFunctions.text__ee_original_email +\n ' ' + selectableEmail.outerHTML;\n } else {\n firstNode.innerHTML = ctAdminCommon.text__ee_original_email +\n ' ' + selectableEmail.outerHTML;\n }\n\n firstNode.setAttribute('style', 'flex-direction: row;');\n }\n // remove animation\n let wrapper = popup.querySelector('.apbct-ee-animation-wrapper');\n if (wrapper) {\n wrapper.remove();\n }\n // remove second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n if (secondNode) {\n secondNode.remove();\n }\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n if (!document.querySelector('.apbct-email-encoder-got-it-button')) {\n let button = document.createElement('button');\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_got_it) {\n button.innerText = ctPublicFunctions.text__ee_got_it;\n } else {\n button.innerText = ctAdminCommon.text__ee_got_it;\n }\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedNodes(encodedEmailNodes, result);\n // click on mailto if so\n if (typeof ctPublic !== 'undefined' && ctPublic.encodedEmailNodesIsMixed && clickSource) {\n clickSource.click();\n }\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }\n }, 3000);\n } else {\n if (clickSource) {\n let comment = 'unknown_error';\n if (\n result.hasOwnProperty('data') &&\n result.data.length > 0 &&\n typeof result.data[0] === 'object' &&\n typeof result.data[0].comment === 'string'\n ) {\n comment = result.data[0].comment;\n }\n if (result.success) {\n resetEncodedNodes();\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_blocked) {\n ctShowDecodeComment(ctPublicFunctions.text__ee_blocked + ': ' + comment);\n } else {\n ctShowDecodeComment(ctAdminCommon.text__ee_blocked + ': ' + comment);\n }\n } else {\n resetEncodedNodes();\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_cannot_connect) {\n ctShowDecodeComment(ctPublicFunctions.text__ee_cannot_connect + ': ' + comment);\n } else {\n ctShowDecodeComment(ctAdminCommon.text__ee_cannot_connect + ': ' + comment);\n }\n }\n } else {\n console.log('result', result);\n }\n }\n}\n\n/**\n * Reset click event for encoded email\n */\nfunction resetEncodedNodes() {\n if (typeof ctPublic.encodedEmailNodes !== 'undefined') {\n ctPublic.encodedEmailNodes.forEach(function(element) {\n element.addEventListener('click', ctFillDecodedEmailHandler);\n });\n }\n}\n\n/**\n * Show Decode Comment\n * @param {string} comment\n */\nfunction ctShowDecodeComment(comment) {\n if ( ! comment ) {\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_cannot_decode) {\n comment = ctPublicFunctions.text__ee_cannot_decode;\n } else {\n comment = ctAdminCommon.text__ee_cannot_decode;\n }\n }\n\n let popup = document.getElementById('apbct_popup');\n let popupText = document.getElementById('apbct_popup_text');\n if (popup !== null) {\n document.body.classList.remove('apbct-popup-fade');\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_email_decoder) {\n popupText.innerText = ctPublicFunctions.text__ee_email_decoder + ': ' + comment;\n } else {\n popupText.innerText = ctAdminCommon.text__ee_email_decoder + ': ' + comment;\n }\n setTimeout(function() {\n popup.setAttribute('style', 'display:none');\n }, 3000);\n }\n}\n\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedNodes\n * @param {mixed} decodingResult\n */\nfunction fillDecodedNodes(encodedNodes, decodingResult) {\n if (encodedNodes.length > 0) {\n for (let i = 0; i < encodedNodes.length; i++) {\n // chek what is what\n let currentResultData;\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === encodedNodes[i].dataset.originalString) {\n currentResultData = row;\n }\n });\n // quit case on cloud block\n if (currentResultData.is_allowed === false) {\n return;\n }\n // handler for mailto\n if (\n typeof encodedNodes[i].href !== 'undefined' &&\n (\n encodedNodes[i].href.indexOf('mailto:') === 0 ||\n encodedNodes[i].href.indexOf('tel:') === 0\n )\n ) {\n let linkTypePrefix;\n if (encodedNodes[i].href.indexOf('mailto:') === 0) {\n linkTypePrefix = 'mailto:';\n } else if (encodedNodes[i].href.indexOf('tel:') === 0) {\n linkTypePrefix = 'tel:';\n } else {\n continue;\n }\n let encodedEmail = encodedNodes[i].href.replace(linkTypePrefix, '');\n let baseElementContent = encodedNodes[i].innerHTML;\n encodedNodes[i].innerHTML = baseElementContent.replace(\n encodedEmail,\n currentResultData.decoded_email,\n );\n encodedNodes[i].href = linkTypePrefix + currentResultData.decoded_email;\n\n encodedNodes[i].querySelectorAll('span.apbct-email-encoder').forEach((el) => {\n let encodedEmailTextInsideMailto = '';\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === el.dataset.originalString) {\n encodedEmailTextInsideMailto = row.decoded_email;\n }\n });\n el.innerHTML = encodedEmailTextInsideMailto;\n });\n } else {\n encodedNodes[i].classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedNodes[i]);\n }, 2000);\n }\n // remove listeners\n encodedNodes[i].removeEventListener('click', ctFillDecodedEmailHandler);\n }\n } else {\n let currentResultData = decodingResult.data[0];\n encodedNodes.classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedNodes);\n }, 2000);\n encodedNodes.removeEventListener('click', ctFillDecodedEmailHandler);\n }\n}\n\n/**\n * @param {mixed} response\n * @param {mixed} targetElement\n */\nfunction ctProcessDecodedDataResult(response, targetElement) {\n targetElement.setAttribute('title', '');\n targetElement.removeAttribute('style');\n ctFillDecodedEmail(targetElement, response.decoded_email);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n target.innerHTML = target.innerHTML.replace(/.+?(
)/, email + '$1');\n}\n\n// Listen clicks on encoded emails\ndocument.addEventListener('DOMContentLoaded', function() {\n let encodedEmailNodes = document.querySelectorAll('[data-original-string]');\n if (typeof ctPublic !== 'undefined') {\n ctPublic.encodedEmailNodes = encodedEmailNodes;\n }\n if (encodedEmailNodes.length) {\n for (let i = 0; i < encodedEmailNodes.length; ++i) {\n const node = encodedEmailNodes[i];\n if (\n node.parentNode &&\n node.parentNode.tagName === 'A' &&\n node.parentNode.getAttribute('href')?.includes('mailto:') &&\n node.parentNode.hasAttribute('data-original-string')\n ) {\n // This node was skipped from listeners\n continue;\n }\n node.addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n});\n"]} \ No newline at end of file +{"version":3,"sources":["cleantalk-admin.js","common-decoder.js"],"names":["apbct_admin_sendAJAX","data","params","obj","let","callback","callbackContext","callback_context","callbackParams","callback_params","async","notJson","timeout","button","spinner","progressbar","ctAdminCommon","_ajax_nonce","Math","random","no_cache","setAttribute","style","cursor","jQuery","css","ajax","type","url","_ajax_url","success","result","removeAttribute","JSON","parse","error","setTimeout","fadeOut","cleantalkModal","loaded","toString","open","alert","apply","concat","jqXHR","textStatus","errorThrown","console","log","apbctSetEmailDecoderPopupAnimation","animationElements","animationWrapper","document","createElement","classList","i","length","apbctEEAnimationDogOne","innerText","append","ctFillDecodedEmailHandler","event","clickSource","ctWlBrandname","encodedEmail","ctPublic","this","removeEventListener","encodedEmailNodesIsMixed","wl_brandname","encodedEmailNodes","plugin_name","encodedEmailNode","body","add","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","getElementById","ctPublicFunctions","text__ee_wait_for_decoding","innerHTML","waitingPopup","popupHeader","color","id","text__ee_decoding_process","apbctAjaxEmailDecodeBulk","post_url","location","href","referrer","encodedEmails","encodedEmailsCollection","bot_detector_enabled","event_token","apbctLocalStorage","get","event_javascript_data","getJavascriptClientData","indexOf","preventDefault","apbctTooltip","apbct","dataset","originalString","stringify","data__ajax_type","apbct_public_sendREST","method","ctSetCookie","emailEncoderPassKey","apbctEmailEncoderCallbackBulk","onErrorCallback","res","resetEncodedNodes","ctShowDecodeComment","action","apbct_public_sendAJAX","0","appendChild","is_allowed","popup","email","currentResultData","forEach","row","encoded_email","decoded_email","split","firstNode","querySelector","selectableEmail","wrapper","text__ee_click_to_select","title","text__ee_original_email","outerHTML","secondNode","remove","buttonWrapper","text__ee_got_it","addEventListener","fillDecodedNodes","click","comment","hasOwnProperty","text__ee_blocked","text__ee_cannot_connect","element","text__ee_cannot_decode","popupText","text__ee_email_decoder","encodedNodes","decodingResult","ctProcessDecodedDataResult","linkTypePrefix","replace","baseElementContent","querySelectorAll","encodedEmailTextInsideMailto","el","response","targetElement","ctFillDecodedEmail","target","ready","$","on","ctDate","Date","getTime","ctSecure","protocol","cookie","toUTCString","e","parent","after","apbctNoticeDismissSuccess","siblings","apbctNoticeName","attr","notice_id","confirm","notice_when_deleting_user_text","window","btnForceProtectionOn","checked","apbctNoticeForceProtectionOn","spmOrderId","order_id","reload","message","includes","node","parentNode","tagName","getAttribute","hasAttribute"],"mappings":"AA+FA,SAAAA,qBAAAC,EAAAC,EAAAC,GAEAC,IAAAC,EAAAH,EAAAG,UAAA,KACAC,EAAAJ,EAAAK,kBAAA,KACAC,EAAAN,EAAAO,iBAAA,KACAL,IAAAM,EAAAR,EAAAQ,OAAA,CAAA,EACAN,IAAAO,EAAAT,EAAAS,SAAA,KACAP,IAAAQ,EAAAV,EAAAU,SAAA,KACAT,EAAAA,GAAA,KACAC,IAAAS,EAAAX,EAAAW,QAAA,KACAC,EAAAZ,EAAAY,SAAA,KACAC,EAAAb,EAAAa,aAAA,KAEA,UAAA,OAAA,EACAd,EAAAA,EAAA,gBAAAe,cAAAC,YAAA,aAAAC,KAAAC,OAAA,GAEAlB,EAAAgB,YAAAD,cAAAC,YACAhB,EAAAmB,SAAAF,KAAAC,OAAA,GAGAN,IACAA,EAAAQ,aAAA,WAAA,UAAA,EAAAR,EAAAS,MAAAC,OAAA,eAEAT,GAAAU,OAAAV,CAAA,EAAAW,IAAA,UAAA,QAAA,EAEAD,OAAAE,KAAA,CACAC,KAAA,OACAC,IAAAZ,cAAAa,UACA5B,KAAAA,EACAS,MAAAA,EACAoB,QAAA,SAAAC,GACAlB,IACAA,EAAAmB,gBAAA,UAAA,EAAAnB,EAAAS,MAAAC,OAAA,WAEAT,GAAAU,OAAAV,CAAA,EAAAW,IAAA,UAAA,MAAA,GACAM,EAAApB,EACAoB,EADAE,KAAAC,MAAAH,CAAA,GACAI,OACAC,WAAA,WACArB,GAAAA,EAAAsB,QAAA,MAAA,CACA,EAAA,GAAA,EACA,aAAA,OAAAC,gBAEAA,eAAAC,OAAA,aAAAR,EAAAI,MAAAK,SAAA,EACAF,eAAAG,KAAA,GAEAC,MAAA,mBAAAX,EAAAI,OAAA,SAAA,GAGA9B,IACAG,EACAH,EAAAsC,MAAArC,EAAAE,EAAAoC,OAAAb,EAAA9B,EAAAC,EAAAC,CAAA,CAAA,EAEAE,EAAA0B,EAAA9B,EAAAC,EAAAC,CAAA,EAIA,EACAgC,MAAA,SAAAU,EAAAC,EAAAC,GACAlC,IACAA,EAAAmB,gBAAA,UAAA,EAAAnB,EAAAS,MAAAC,OAAA,WAEAT,GAAAU,OAAAV,CAAA,EAAAW,IAAA,UAAA,MAAA,EACAuB,QAAAC,IAAA,kBAAA,EACAD,QAAAC,IAAAJ,CAAA,EACAG,QAAAC,IAAAH,CAAA,EACAE,QAAAC,IAAAF,CAAA,CACA,EACAnC,QAAAA,CACA,CAAA,CACA,CCjKA,SAAAsC,qCACA,IAAAC,EAAA,CAAA,gBAAA,gBAAA,mBACAC,EAAAC,SAAAC,cAAA,KAAA,EACAF,EAAAG,UAAA,6BACA,IAAAnD,IAAAoD,EAAA,EAAAA,EAAAL,EAAAM,OAAAD,CAAA,GAAA,CACA,IAAAE,EAAAL,SAAAC,cAAA,MAAA,EACAI,EAAAH,UAAA,aAAAJ,EAAAK,GACAE,EAAAC,UAAA,IACAP,EAAAQ,OAAAF,CAAA,CACA,CACA,OAAAN,CACA,CAKA,SAAAS,0BAAAC,EAAA,CAAA,GACA1D,IAAA2D,EAAA,CAAA,EACAC,EAAA,GACAC,EAAA,GACA,aAAA,OAAAC,UACAC,KAAAC,oBAAA,QAAAP,yBAAA,EAEAE,EAAAI,KAEAD,SAAAG,yBAAA,CAAA,EACAL,EAAAE,SAAAI,aACAL,EAAAC,SAAAK,mBACA,aAAA,OAAAvD,gBACAgD,EAAAhD,cAAAwD,YACAP,EAAAjD,cAAAyD,kBAIApB,SAAAqB,KAAAnB,UAAAoB,IAAA,kBAAA,EAEAvE,IAQAwE,EAQAC,EAOAC,EAWAC,EAlCAC,EAAA3B,SAAA4B,eAAA,aAAA,EACAD,GAiDAA,EAAA3D,aAAA,QAAA,kBAAA,EACA,aAAA,OAAA6D,mBAAAA,kBAAAC,2BACA9B,SAAA4B,eAAA,kBAAA,EAAAG,UAAAF,kBAAAC,2BAEA9B,SAAA4B,eAAA,kBAAA,EAAAG,UAAApE,cAAAmE,8BAnDAE,EAAAhC,SAAAC,cAAA,KAAA,GACAjC,aAAA,QAAA,uCAAA,EACAgE,EAAAhE,aAAA,KAAA,aAAA,GAGAuD,EAAAvB,SAAAC,cAAA,MAAA,GACAC,UAAA,uCACA+B,EAAAjC,SAAAC,cAAA,GAAA,GACAK,UAAAK,EACAsB,EAAAjE,aAAA,QAAA,mCAAA,EACAuD,EAAAhB,OAAA0B,CAAA,GAGAT,EAAAxB,SAAAC,cAAA,KAAA,GACAjC,aAAA,KAAA,kBAAA,EACAwD,EAAAxD,aAAA,QAAA,qCAAA,EACAwD,EAAAvD,MAAAiE,MAAA,SAIAT,EAAAzB,SAAAC,cAAA,GAAA,GACAkC,GAAA,4CACA,aAAA,OAAAN,mBAAAA,kBAAAC,2BACAL,EAAAnB,UAAAuB,kBAAAC,2BAEAL,EAAAnB,UAAA3C,cAAAmE,2BAEAL,EAAAzD,aAAA,QAAA,qCAAA,GAIA0D,EAAA1B,SAAAC,cAAA,GAAA,GACAkC,GAAA,6CACA,aAAA,OAAAN,mBAAAA,kBAAAO,0BACAV,EAAApB,UAAAuB,kBAAAO,0BAEAV,EAAApB,UAAA3C,cAAAyE,0BAIAZ,EAAAjB,OAAAkB,CAAA,EACAD,EAAAjB,OAAAmB,CAAA,EACAM,EAAAzB,OAAAgB,CAAA,EACAS,EAAAzB,OAAAiB,CAAA,EACAQ,EAAAzB,OAAAV,mCAAA,CAAA,EACAG,SAAAqB,KAAAd,OAAAyB,CAAA,GAUAK,yBAAA5B,EAAAG,EAAAF,CAAA,CACA,CAOA,SAAA2B,yBAAA5B,EAAAS,EAAAR,GACA,GAAAD,GAAAC,EAAA,CAEA3D,IAAAH,EAAA,CACA0F,SAAAtC,SAAAuC,SAAAC,KACAC,SAAAzC,SAAAyC,SACAC,cAAA,EACA,EAOAC,GANA,CAAA9B,SAAA+B,qBACAhG,EAAAiG,YAAAC,kBAAAC,IAAA,0BAAA,EAEAnG,EAAAoG,sBAAAC,wBAAA,EAGA,IACA,IAAAlG,IAAAoD,EAAA,EAAAA,EAAAe,EAAAd,OAAAD,CAAA,GAAA,CAGA,KAAA,IAAAe,EAAAf,GAAAqC,MACA,IAAAtB,EAAAf,GAAAqC,KAAAU,QAAA,SAAA,IAEAzC,EAAA0C,eAAA,EACAtC,SAAAG,yBAAA,CAAA,GAIAjE,IAAAqG,EAAApD,SAAAC,cAAA,KAAA,EACAmD,EAAApF,aAAA,QAAA,eAAA,EACAqF,MAAAnC,EAAAf,EAAA,EAAAI,OAAA6C,CAAA,EAGAT,EAAAxC,GAAAe,EAAAf,GAAAmD,QAAAC,cACA,CAGA3G,EAAA8F,cAAA9D,KAAA4E,UAAAb,CAAA,EAGA,SAAAd,kBAAA4B,gBACAC,sBACA,qBACA,CACA9G,KAAAA,EACA+G,OAAA,OACA3G,SAAA,SAAA0B,GAEAkF,YAAA,6BAAA/C,SAAAgD,oBAAA,EAAA,EACAC,8BAAApF,EAAAwC,EAAAR,CAAA,CACA,EACAqD,gBAAA,SAAAC,GACAC,kBAAA,EACAC,oBAAAF,CAAA,CACA,CACA,CACA,GAIApH,EAAAuH,OAAA,qBACAC,sBACAxH,EACA,CACAU,QAAA,CAAA,EACAN,SAAA,SAAA0B,GAEAkF,YAAA,6BAAA/C,SAAAgD,oBAAA,EAAA,EACAC,8BAAApF,EAAAwC,EAAAR,CAAA,CACA,EACAqD,gBAAA,SAAAC,GACAC,kBAAA,EACAC,oBAAAF,CAAA,CACA,CACA,CACA,EAEA,KAAA,CACA,IAAApD,EAAAM,EAAAoC,QAAAC,eACA3G,EAAA,CACA8F,cAAA9D,KAAA4E,UAAA,CAAAa,EAAAzD,CAAA,CAAA,CACA,EAGAwC,EAAApD,SAAAC,cAAA,KAAA,EACAmD,EAAApF,aAAA,QAAA,eAAA,EACAkD,EAAAoD,YAAAlB,CAAA,EAEAzG,qBACA,CACAwH,OAAA,qBACAzB,cAAA9F,EAAA8F,aACA,EACA,CACA1F,SAAA,SAAA0B,GACAoF,8BAAApF,EAAAwC,EAAA,CAAA,CAAA,CACA,EACA5D,QAAA,CAAA,CACA,CACA,CACA,CACA,CAOA,SAAAwG,8BAAApF,EAAAwC,EAAAR,EAAA,CAAA,GACA,GAAAhC,EAAAD,SAAA,CAAA,IAAAC,EAAA9B,KAAA,GAAA2H,WAEAxF,WAAA,WAEAhC,IAAAyH,EAAAxE,SAAA4B,eAAA,aAAA,EACA,GAAA,OAAA4C,EAAA,CACAzH,IAAA0H,EAAA,GACA,GAAA/D,EAAA,CACA3D,IAAA2H,EACAhG,EAAA9B,KAAA+H,QAAA,IACAC,EAAAC,gBAAAnE,EAAA4C,QAAAC,iBACAmB,EAAAE,EAEA,CAAA,EAEAH,EAAAC,EAAAI,cAAAC,MAAA,MAAA,EAAA,EACA,MACAN,EAAA/F,EAAA9B,KAAA,GAAAkI,cAGA/H,IAAAiI,EAAAR,EAAAS,cAAA,4CAAA,EAEAC,EAAAlF,SAAAC,cAAA,GAAA,EAqBAkF,GApBAD,EAAAlH,aAAA,QAAA,wCAAA,EACAkH,EAAA5E,UAAAmE,EACA,aAAA,OAAA5C,mBAAAA,kBAAAuD,yBACAF,EAAAG,MAAAxD,kBAAAuD,yBAEAF,EAAAG,MAAA1H,cAAAyH,yBAGAJ,IACA,aAAA,OAAAnD,mBAAAA,kBAAAyD,wBACAN,EAAAjD,UAAAF,kBAAAyD,wBACA,SAAAJ,EAAAK,UAEAP,EAAAjD,UAAApE,cAAA2H,wBACA,SAAAJ,EAAAK,UAGAP,EAAAhH,aAAA,QAAA,sBAAA,GAGAwG,EAAAS,cAAA,6BAAA,GAKAO,GAJAL,GACAA,EAAAM,OAAA,EAGAjB,EAAAS,cAAA,6CAAA,GAKAS,GAJAF,GACAA,EAAAC,OAAA,EAGAzF,SAAAC,cAAA,MAAA,GACAyF,EAAAxF,UAAA,sDACAF,SAAAiF,cAAA,oCAAA,IACAzH,EAAAwC,SAAAC,cAAA,QAAA,EACA,aAAA,OAAA4B,mBAAAA,kBAAA8D,gBACAnI,EAAA8C,UAAAuB,kBAAA8D,gBAEAnI,EAAA8C,UAAA3C,cAAAgI,gBAEAnI,EAAA0C,UAAA,oCACA1C,EAAAoI,iBAAA,QAAA,WACA5F,SAAAqB,KAAAnB,UAAAuF,OAAA,kBAAA,EACAjB,EAAAxG,aAAA,QAAA,cAAA,EACA6H,iBAAA3E,EAAAxC,CAAA,EAEA,aAAA,OAAAmC,UAAAA,SAAAG,0BAAAN,GACAA,EAAAoF,MAAA,CAEA,CAAA,EACAJ,EAAAnF,OAAA/C,CAAA,EACAgH,EAAAjE,OAAAmF,CAAA,EAEA,CACA,EAAA,GAAA,OAEA,GAAAhF,EAAA,CACA3D,IAAAgJ,EAAA,gBAEArH,EAAAsH,eAAA,MAAA,GACA,EAAAtH,EAAA9B,KAAAwD,QACA,UAAA,OAAA1B,EAAA9B,KAAA,IACA,UAAA,OAAA8B,EAAA9B,KAAA,GAAAmJ,UAEAA,EAAArH,EAAA9B,KAAA,GAAAmJ,SAEArH,EAAAD,SACAwF,kBAAA,EACA,aAAA,OAAApC,mBAAAA,kBAAAoE,iBACA/B,oBAAArC,kBAAAoE,iBAAA,KAAAF,CAAA,EAEA7B,oBAAAvG,cAAAsI,iBAAA,KAAAF,CAAA,IAGA9B,kBAAA,EACA,aAAA,OAAApC,mBAAAA,kBAAAqE,wBACAhC,oBAAArC,kBAAAqE,wBAAA,KAAAH,CAAA,EAEA7B,oBAAAvG,cAAAuI,wBAAA,KAAAH,CAAA,EAGA,MACApG,QAAAC,IAAA,SAAAlB,CAAA,CAGA,CAKA,SAAAuF,oBACA,KAAA,IAAApD,SAAAK,mBACAL,SAAAK,kBAAAyD,QAAA,SAAAwB,GACAA,EAAAP,iBAAA,QAAApF,yBAAA,CACA,CAAA,CAEA,CAMA,SAAA0D,oBAAA6B,GACAA,EAAAA,IACA,aAAA,OAAAlE,mBAAAA,kBAAAuE,uBACAvE,kBAEAlE,eAFAyI,uBAMArJ,IAAAyH,EAAAxE,SAAA4B,eAAA,aAAA,EACA7E,IAAAsJ,EAAArG,SAAA4B,eAAA,kBAAA,EACA,OAAA4C,IACAxE,SAAAqB,KAAAnB,UAAAuF,OAAA,kBAAA,EACA,aAAA,OAAA5D,mBAAAA,kBAAAyE,uBACAD,EAAA/F,UAAAuB,kBAAAyE,uBAAA,KAAAP,EAEAM,EAAA/F,UAAA3C,cAAA2I,uBAAA,KAAAP,EAEAhH,WAAA,WACAyF,EAAAxG,aAAA,QAAA,cAAA,CACA,EAAA,GAAA,EAEA,CAOA,SAAA6H,iBAAAU,EAAAC,GACA,GAAA,EAAAD,EAAAnG,OACA,IAAArD,IAAAoD,EAAA,EAAAA,EAAAoG,EAAAnG,OAAAD,CAAA,GAAA,CAEApD,IAAA2H,EAOA,GANA8B,EAAA5J,KAAA+H,QAAA,IACAC,EAAAC,gBAAA0B,EAAApG,GAAAmD,QAAAC,iBACAmB,EAAAE,EAEA,CAAA,EAEA,CAAA,IAAAF,EAAAH,WACA,OAGA,GACA,KAAA,IAAAgC,EAAApG,GAAAqC,MAEA,IAAA+D,EAAApG,GAAAqC,KAAAU,QAAA,SAAA,GACA,IAAAqD,EAAApG,GAAAqC,KAAAU,QAAA,MAAA,EA6BAqD,EAAApG,GAAAD,UAAAoB,IAAA,SAAA,EAEAvC,WAAA,KACA0H,2BAAA/B,EAAA6B,EAAApG,EAAA,CACA,EAAA,GAAA,MA/BA,CACApD,IAAA2J,EACA,GAAA,IAAAH,EAAApG,GAAAqC,KAAAU,QAAA,SAAA,EACAwD,EAAA,cACA,CAAA,GAAA,IAAAH,EAAApG,GAAAqC,KAAAU,QAAA,MAAA,EAGA,SAFAwD,EAAA,MAGA,CACA3J,IAAA6D,EAAA2F,EAAApG,GAAAqC,KAAAmE,QAAAD,EAAA,EAAA,EACAE,EAAAL,EAAApG,GAAA4B,UACAwE,EAAApG,GAAA4B,UAAA6E,EAAAD,QACA/F,EACA8D,EAAAI,aACA,EACAyB,EAAApG,GAAAqC,KAAAkE,EAAAhC,EAAAI,cAEAyB,EAAApG,GAAA0G,iBAAA,0BAAA,EAAAlC,QAAA,IACA5H,IAAA+J,EAAA,GACAN,EAAA5J,KAAA+H,QAAA,IACAC,EAAAC,gBAAAkC,EAAAzD,QAAAC,iBACAuD,EAAAlC,EAAAE,cAEA,CAAA,EACAiC,EAAAhF,UAAA+E,CACA,CAAA,CACA,CAQAP,EAAApG,GAAAY,oBAAA,QAAAP,yBAAA,CACA,KACA,CACAzD,IAAA2H,EAAA8B,EAAA5J,KAAA,GACA2J,EAAArG,UAAAoB,IAAA,SAAA,EAEAvC,WAAA,KACA0H,2BAAA/B,EAAA6B,CAAA,CACA,EAAA,GAAA,EACAA,EAAAxF,oBAAA,QAAAP,yBAAA,CACA,CACA,CAMA,SAAAiG,2BAAAO,EAAAC,GACAA,EAAAjJ,aAAA,QAAA,EAAA,EACAiJ,EAAAtI,gBAAA,OAAA,EACAuI,mBAAAD,EAAAD,EAAAlC,aAAA,CACA,CAMA,SAAAoC,mBAAAC,EAAA1C,GACA0C,EAAApF,UAAAoF,EAAApF,UAAA4E,QAAA,kDAAAlC,EAAA,IAAA,CACA,CDjcAtG,OAAA6B,QAAA,EAAAoH,MAAA,SAAAC,GAEAlJ,OAAA,sBAAA,EAAAmJ,GAAA,QAAA,SAAA,WACAvK,IAAAwK,EAAA,IAAAC,MAAA,IAAAA,MAAAC,QAAA,EAAA,MAAA,EACAC,EAAA,WAAAnF,SAAAoF,SAAA,WAAA,GACA3H,SAAA4H,OAAA,iDACAL,EAAAM,YAAA,EAAA,iBAAAH,CACA,CAAA,EAEAvJ,OAAA,iDAAA,EAAAC,IAAA,cAAA,QAAA,EACAA,IAAA,UAAA,cAAA,EAEAD,OAAA,MAAA,EAAAmJ,GAAA,QAAA,qCAAA,SAAAQ,GACA3J,OAAA2J,EAAAX,MAAA,EAAAY,OAAA,EACAA,OAAA,SAAA,EACAC,MAAA,0FACArK,cAAAsK,0BACA,YAAA,EACAlJ,WAAA,WACAZ,OAAA,+BAAA,EAAAa,QAAA,CACA,EAAA,GAAA,EACAb,OAAA2J,EAAAX,MAAA,EAAAY,OAAA,EAAAG,SAAA,+BAAA,EAAApC,MAAA,CACA,CAAA,EACA3H,OAAA,MAAA,EAAAmJ,GAAA,QAAA,gCAAA,SAAAQ,GACAK,EAAAhK,OAAA2J,EAAAX,MAAA,EAAAY,OAAA,EAAAK,KAAA,IAAA,EACAD,GACAxL,qBACA,CACAwH,OAAA,2BACAkE,UAAAF,CACA,EACA,CACAnL,SAAA,KACAM,QAAA,CAAA,CACA,CACA,CAEA,CAAA,EAGAa,OAAA,qCAAA,EAAAmJ,GAAA,QAAA,SAAAQ,GACAA,EAAA3E,eAAA,EAEAmF,QAAA3K,cAAA4K,8BAAA,IAGAC,OAAAjG,SAAAzB,KAAA0B,KAEA,CAAA,EAEAzF,IAAA0L,EAAAzI,SAAAiF,cAAA,4CAAA,EAmCA,IACA7D,EAnCAqH,GACAA,EAAA7C,iBAAA,QAAA,SAAAkC,GACAW,EAAAC,SACAJ,CAAAA,QAAA3K,cAAAgL,4BAAA,GAGAb,EAAA3E,eAAA,CAGA,CAAA,EAGAkE,EAAA,kCAAA,EAAAvB,MAAA,WACA,IAAA8C,EAAAvB,EAAAvG,IAAA,EAAAlE,KAAA,eAAA,EACAA,EAAA,CACAuH,OAAA,2BACAvG,YAAAD,cAAAC,YACAiL,SAAAD,CACA,EACAvB,EAAAhJ,KAAA,CACAC,KAAA,OACAC,IAAAZ,cAAAa,UACA5B,KAAAA,EACA6B,QAAA,SAAAC,GACAA,EAAAD,QACA+J,OAAAjG,SAAAuG,OAAA,EAEAzJ,MAAAX,EAAA9B,KAAAmM,OAAA,CAEA,CACA,CAAA,CACA,CAAA,EAGAP,OAAAjG,SAAAC,KAAAwG,SAAA,oCAAA,IACA5H,EAAApB,SAAAiF,cAAA,wBAAA,MAEAtH,cAAAyD,iBAAAA,GACAnD,MAAAC,OAAA,UACAkD,EAAAwE,iBAAA,QAAApF,yBAAA,EAGA,CAAA,ECuWAR,SAAA4F,iBAAA,mBAAA,WACA7I,IAAAmE,EAAAlB,SAAA6G,iBAAA,wBAAA,EAIA,GAHA,aAAA,OAAAhG,WACAA,SAAAK,kBAAAA,GAEAA,EAAAd,OACA,IAAArD,IAAAoD,EAAA,EAAAA,EAAAe,EAAAd,OAAA,EAAAD,EAAA,CACA,IAAA8I,EAAA/H,EAAAf,GAEA8I,EAAAC,YACA,MAAAD,EAAAC,WAAAC,SACAF,EAAAC,WAAAE,aAAA,MAAA,GAAAJ,SAAA,SAAA,GACAC,EAAAC,WAAAG,aAAA,sBAAA,GAKAJ,EAAArD,iBAAA,QAAApF,yBAAA,CACA,CAEA,CAAA","file":"cleantalk-admin.min.js","sourcesContent":["jQuery(document).ready(function($) {\n // Auto update banner close handler\n jQuery('.apbct_update_notice').on('click', 'button', function() {\n let ctDate = new Date(new Date().getTime() + 1000 * 86400 * 30 );\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = 'apbct_update_banner_closed=1; path=/; expires=' +\n ctDate.toUTCString() + '; samesite=lax' + ctSecure;\n });\n\n jQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space', 'nowrap')\n .css('display', 'inline-block');\n\n jQuery('body').on('click', '.apbct-notice .notice-dismiss-link', function(e) {\n jQuery(e.target).parent()\n .parent('.notice')\n .after('

' +\n ctAdminCommon.apbctNoticeDismissSuccess +\n '

');\n setTimeout(function() {\n jQuery('#apbct-notice-dismiss-success').fadeOut();\n }, 2000);\n jQuery(e.target).parent().siblings('.apbct-notice .notice-dismiss').click();\n });\n jQuery('body').on('click', '.apbct-notice .notice-dismiss', function(e) {\n let apbctNoticeName = jQuery(e.target).parent().attr('id');\n if ( apbctNoticeName ) {\n apbct_admin_sendAJAX(\n {\n 'action': 'cleantalk_dismiss_notice',\n 'notice_id': apbctNoticeName,\n },\n {\n 'callback': null,\n 'notJson': true,\n },\n );\n }\n });\n\n // Notice when deleting user\n jQuery('.ct_username .row-actions .delete a').on('click', function(e) {\n e.preventDefault();\n\n let result = confirm(ctAdminCommon.notice_when_deleting_user_text);\n\n if (result) {\n window.location = this.href;\n }\n });\n\n let btnForceProtectionOn = document.querySelector('#apbct_setting_forms__force_protection__On');\n if (btnForceProtectionOn) {\n btnForceProtectionOn.addEventListener('click', function(e) {\n if (btnForceProtectionOn.checked) {\n let result = confirm(ctAdminCommon.apbctNoticeForceProtectionOn);\n\n if (!result) {\n e.preventDefault();\n }\n }\n });\n }\n // Restore spam order\n $('.apbct-restore-spam-order-button').click(function() {\n const spmOrderId = $(this).data('spam-order-id');\n let data = {\n action: 'apbct_restore_spam_order',\n _ajax_nonce: ctAdminCommon._ajax_nonce,\n order_id: spmOrderId,\n };\n $.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n success: function(result) {\n if (result.success) {\n window.location.reload();\n } else {\n alert(result.data.message);\n }\n },\n });\n });\n\n // Email decoder example\n if (window.location.href.includes('options-general.php?page=cleantalk')) {\n let encodedEmailNode = document.querySelector('[data-original-string]');\n if (encodedEmailNode) {\n ctAdminCommon.encodedEmailNode = encodedEmailNode;\n encodedEmailNode.style.cursor = 'pointer';\n encodedEmailNode.addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n});\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_admin_sendAJAX(data, params, obj) {\n // Default params\n let callback = params.callback || null;\n let callbackContext = params.callback_context || null;\n let callbackParams = params.callback_params || null;\n let async = params.async || true;\n let notJson = params.notJson || null;\n let timeout = params.timeout || 15000;\n var obj = obj || null; // eslint-disable-line no-var\n let button = params.button || null;\n let spinner = params.spinner || null;\n let progressbar = params.progressbar || null;\n\n if (typeof (data) === 'string') {\n data = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();\n } else {\n data._ajax_nonce = ctAdminCommon._ajax_nonce;\n data.no_cache = Math.random();\n }\n // Button and spinner\n if (button) {\n button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed';\n }\n if (spinner) jQuery(spinner).css('display', 'inline');\n\n jQuery.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n async: async,\n success: function(result) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n if (!notJson) result = JSON.parse(result);\n if (result.error) {\n setTimeout(function() {\n if (progressbar) progressbar.fadeOut('slow');\n }, 1000);\n if ( typeof cleantalkModal !== 'undefined' ) {\n // Show the result by modal\n cleantalkModal.loaded = 'Error:
' + result.error.toString();\n cleantalkModal.open();\n } else {\n alert('Error happens: ' + (result.error || 'Unkown'));\n }\n } else {\n if (callback) {\n if (callbackParams) {\n callback.apply( callbackContext, callbackParams.concat( result, data, params, obj ) );\n } else {\n callback(result, data, params, obj);\n }\n }\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n console.log('APBCT_AJAX_ERROR');\n console.log(jqXHR);\n console.log(textStatus);\n console.log(errorThrown);\n },\n timeout: timeout,\n });\n}\n","/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler(event = false) {\n let clickSource = false;\n let ctWlBrandname = '';\n let encodedEmail = '';\n if (typeof ctPublic !== 'undefined') {\n this.removeEventListener('click', ctFillDecodedEmailHandler);\n // remember clickSource\n clickSource = this;\n // globally remember if emails is mixed with mailto\n ctPublic.encodedEmailNodesIsMixed = false;\n ctWlBrandname = ctPublic.wl_brandname;\n encodedEmail = ctPublic.encodedEmailNodes;\n } else if (typeof ctAdminCommon !== 'undefined') {\n ctWlBrandname = ctAdminCommon.plugin_name;\n encodedEmail = ctAdminCommon.encodedEmailNode;\n }\n\n // get fade\n document.body.classList.add('apbct-popup-fade');\n // popup show\n let encoderPopup = document.getElementById('apbct_popup');\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctWlBrandname;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_wait_for_decoding) {\n popupTextWaiting.innerText = ctPublicFunctions.text__ee_wait_for_decoding;\n } else {\n popupTextWaiting.innerText = ctAdminCommon.text__ee_wait_for_decoding;\n }\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_decoding_process) {\n popupTextDecoding.innerText = ctPublicFunctions.text__ee_decoding_process;\n } else {\n popupTextDecoding.innerText = ctAdminCommon.text__ee_decoding_process;\n }\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_wait_for_decoding) {\n document.getElementById('apbct_popup_text').innerHTML = ctPublicFunctions.text__ee_wait_for_decoding;\n } else {\n document.getElementById('apbct_popup_text').innerHTML = ctAdminCommon.text__ee_wait_for_decoding;\n }\n }\n\n apbctAjaxEmailDecodeBulk(event, encodedEmail, clickSource);\n}\n\n/**\n * @param {mixed} event\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {\n if (event && clickSource) {\n // collect data\n let data = {\n post_url: document.location.href,\n referrer: document.referrer,\n encodedEmails: '',\n };\n if (+ctPublic.bot_detector_enabled) {\n data.event_token = apbctLocalStorage.get('bot_detector_event_token');\n } else {\n data.event_javascript_data = getJavascriptClientData();\n }\n\n let encodedEmailsCollection = {};\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // disable click for mailto\n if (\n typeof encodedEmailNodes[i].href !== 'undefined' &&\n encodedEmailNodes[i].href.indexOf('mailto:') === 0\n ) {\n event.preventDefault();\n ctPublic.encodedEmailNodesIsMixed = true;\n }\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n apbct(encodedEmailNodes[i]).append(apbctTooltip);\n\n // collect encoded email strings\n encodedEmailsCollection[i] = encodedEmailNodes[i].dataset.originalString;\n }\n\n // JSONify encoded email strings\n data.encodedEmails = JSON.stringify(encodedEmailsCollection);\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_decode_email',\n {\n data: data,\n method: 'POST',\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey, '');\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n\n // Using AJAX request and handler\n } else {\n data.action = 'apbct_decode_email';\n apbct_public_sendAJAX(\n data,\n {\n notJson: false,\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey, '');\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n }\n } else {\n const encodedEmail = encodedEmailNodes.dataset.originalString;\n let data = {\n encodedEmails: JSON.stringify({0: encodedEmail}),\n };\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n encodedEmailNodes.appendChild(apbctTooltip);\n\n apbct_admin_sendAJAX(\n {\n 'action': 'apbct_decode_email',\n 'encodedEmails': data.encodedEmails,\n },\n {\n 'callback': function(result) {\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, false);\n },\n 'notJson': true,\n },\n );\n }\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource = false) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n // popup remove\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n let email = '';\n if (clickSource) {\n let currentResultData;\n result.data.forEach((row) => {\n if (row.encoded_email === clickSource.dataset.originalString) {\n currentResultData = row;\n }\n });\n\n email = currentResultData.decoded_email.split(/[&?]/)[0];\n } else {\n email = result.data[0].decoded_email;\n }\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_click_to_select) {\n selectableEmail.title = ctPublicFunctions.text__ee_click_to_select;\n } else {\n selectableEmail.title = ctAdminCommon.text__ee_click_to_select;\n }\n // add email to the first node\n if (firstNode) {\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_original_email) {\n firstNode.innerHTML = ctPublicFunctions.text__ee_original_email +\n ' ' + selectableEmail.outerHTML;\n } else {\n firstNode.innerHTML = ctAdminCommon.text__ee_original_email +\n ' ' + selectableEmail.outerHTML;\n }\n\n firstNode.setAttribute('style', 'flex-direction: row;');\n }\n // remove animation\n let wrapper = popup.querySelector('.apbct-ee-animation-wrapper');\n if (wrapper) {\n wrapper.remove();\n }\n // remove second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n if (secondNode) {\n secondNode.remove();\n }\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n if (!document.querySelector('.apbct-email-encoder-got-it-button')) {\n let button = document.createElement('button');\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_got_it) {\n button.innerText = ctPublicFunctions.text__ee_got_it;\n } else {\n button.innerText = ctAdminCommon.text__ee_got_it;\n }\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedNodes(encodedEmailNodes, result);\n // click on mailto if so\n if (typeof ctPublic !== 'undefined' && ctPublic.encodedEmailNodesIsMixed && clickSource) {\n clickSource.click();\n }\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }\n }, 3000);\n } else {\n if (clickSource) {\n let comment = 'unknown_error';\n if (\n result.hasOwnProperty('data') &&\n result.data.length > 0 &&\n typeof result.data[0] === 'object' &&\n typeof result.data[0].comment === 'string'\n ) {\n comment = result.data[0].comment;\n }\n if (result.success) {\n resetEncodedNodes();\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_blocked) {\n ctShowDecodeComment(ctPublicFunctions.text__ee_blocked + ': ' + comment);\n } else {\n ctShowDecodeComment(ctAdminCommon.text__ee_blocked + ': ' + comment);\n }\n } else {\n resetEncodedNodes();\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_cannot_connect) {\n ctShowDecodeComment(ctPublicFunctions.text__ee_cannot_connect + ': ' + comment);\n } else {\n ctShowDecodeComment(ctAdminCommon.text__ee_cannot_connect + ': ' + comment);\n }\n }\n } else {\n console.log('result', result);\n }\n }\n}\n\n/**\n * Reset click event for encoded email\n */\nfunction resetEncodedNodes() {\n if (typeof ctPublic.encodedEmailNodes !== 'undefined') {\n ctPublic.encodedEmailNodes.forEach(function(element) {\n element.addEventListener('click', ctFillDecodedEmailHandler);\n });\n }\n}\n\n/**\n * Show Decode Comment\n * @param {string} comment\n */\nfunction ctShowDecodeComment(comment) {\n if ( ! comment ) {\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_cannot_decode) {\n comment = ctPublicFunctions.text__ee_cannot_decode;\n } else {\n comment = ctAdminCommon.text__ee_cannot_decode;\n }\n }\n\n let popup = document.getElementById('apbct_popup');\n let popupText = document.getElementById('apbct_popup_text');\n if (popup !== null) {\n document.body.classList.remove('apbct-popup-fade');\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_email_decoder) {\n popupText.innerText = ctPublicFunctions.text__ee_email_decoder + ': ' + comment;\n } else {\n popupText.innerText = ctAdminCommon.text__ee_email_decoder + ': ' + comment;\n }\n setTimeout(function() {\n popup.setAttribute('style', 'display:none');\n }, 3000);\n }\n}\n\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedNodes\n * @param {mixed} decodingResult\n */\nfunction fillDecodedNodes(encodedNodes, decodingResult) {\n if (encodedNodes.length > 0) {\n for (let i = 0; i < encodedNodes.length; i++) {\n // chek what is what\n let currentResultData;\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === encodedNodes[i].dataset.originalString) {\n currentResultData = row;\n }\n });\n // quit case on cloud block\n if (currentResultData.is_allowed === false) {\n return;\n }\n // handler for mailto\n if (\n typeof encodedNodes[i].href !== 'undefined' &&\n (\n encodedNodes[i].href.indexOf('mailto:') === 0 ||\n encodedNodes[i].href.indexOf('tel:') === 0\n )\n ) {\n let linkTypePrefix;\n if (encodedNodes[i].href.indexOf('mailto:') === 0) {\n linkTypePrefix = 'mailto:';\n } else if (encodedNodes[i].href.indexOf('tel:') === 0) {\n linkTypePrefix = 'tel:';\n } else {\n continue;\n }\n let encodedEmail = encodedNodes[i].href.replace(linkTypePrefix, '');\n let baseElementContent = encodedNodes[i].innerHTML;\n encodedNodes[i].innerHTML = baseElementContent.replace(\n encodedEmail,\n currentResultData.decoded_email,\n );\n encodedNodes[i].href = linkTypePrefix + currentResultData.decoded_email;\n\n encodedNodes[i].querySelectorAll('span.apbct-email-encoder').forEach((el) => {\n let encodedEmailTextInsideMailto = '';\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === el.dataset.originalString) {\n encodedEmailTextInsideMailto = row.decoded_email;\n }\n });\n el.innerHTML = encodedEmailTextInsideMailto;\n });\n } else {\n encodedNodes[i].classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedNodes[i]);\n }, 2000);\n }\n // remove listeners\n encodedNodes[i].removeEventListener('click', ctFillDecodedEmailHandler);\n }\n } else {\n let currentResultData = decodingResult.data[0];\n encodedNodes.classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedNodes);\n }, 2000);\n encodedNodes.removeEventListener('click', ctFillDecodedEmailHandler);\n }\n}\n\n/**\n * @param {mixed} response\n * @param {mixed} targetElement\n */\nfunction ctProcessDecodedDataResult(response, targetElement) {\n targetElement.setAttribute('title', '');\n targetElement.removeAttribute('style');\n ctFillDecodedEmail(targetElement, response.decoded_email);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n target.innerHTML = target.innerHTML.replace(/.+?(
)/, email + '$1');\n}\n\n// Listen clicks on encoded emails\ndocument.addEventListener('DOMContentLoaded', function() {\n let encodedEmailNodes = document.querySelectorAll('[data-original-string]');\n if (typeof ctPublic !== 'undefined') {\n ctPublic.encodedEmailNodes = encodedEmailNodes;\n }\n if (encodedEmailNodes.length) {\n for (let i = 0; i < encodedEmailNodes.length; ++i) {\n const node = encodedEmailNodes[i];\n if (\n node.parentNode &&\n node.parentNode.tagName === 'A' &&\n node.parentNode.getAttribute('href')?.includes('mailto:') &&\n node.parentNode.hasAttribute('data-original-string')\n ) {\n // This node was skipped from listeners\n continue;\n }\n node.addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n});\n"]} \ No newline at end of file diff --git a/js/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 8a8be6ac3..6e0e40ee7 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) { referrer: document.referrer, encodedEmails: '', }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); @@ -1906,7 +1906,7 @@ class ApbctFetchProxyProtection { data.raw_body = bodyText; } - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventToken = new ApbctHandler().toolGetEventToken(); if (eventToken) { data.ct_bot_detector_event_token = eventToken; @@ -1992,6 +1992,7 @@ class ApbctFetchProxyProtection { return await this.checkRequest(match.formKey, match.config, bodyText); } } + /** * Set init params */ @@ -2129,7 +2130,7 @@ function ctSetCookie( cookies, value, expires ) { // do it just once ctSetAlternativeCookie(cookies, {forceAltCookies: true}); } else { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { ctNoCookieAttachHiddenFieldsToForms(); } } @@ -2167,7 +2168,7 @@ function ctSetAlternativeCookie(cookies, params) { if (Array.isArray(cookies)) { cookies = getJavascriptClientData(cookies); } - } else if (!+ctPublic.settings__data__bot_detector_enabled) { + } else if (!+ctPublic.bot_detector_enabled) { console.log('APBCT ERROR: getJavascriptClientData() is not loaded'); } @@ -2624,7 +2625,7 @@ class ApbctAttachData { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -2694,7 +2695,7 @@ class ApbctAttachData { event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1 ) { window.XMLHttpRequest.prototype.send = function(data) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&'; defaultSend.call(this, noCookieData + data); } else { @@ -3009,7 +3010,7 @@ class ApbctHandler { cronFormsHandler(cronStartTimeout = 2000) { setTimeout(function() { setInterval(function() { - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().restartFieldsListening(); } new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach(); @@ -3082,7 +3083,7 @@ class ApbctHandler { let addidionalCleantalkData = ''; if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3099,7 +3100,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckFormData) { if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3157,7 +3158,7 @@ class ApbctHandler { args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { args[1].body.append( @@ -3317,7 +3318,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3333,7 +3334,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3354,7 +3355,7 @@ class ApbctHandler { if (+ctPublic.settings__forms__wc_add_to_cart) { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } } catch (e) { @@ -3583,7 +3584,7 @@ class ApbctHandler { let noCookieData = ''; let visibleFieldsString = ''; if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { const token = new ApbctHandler().toolGetEventToken(); @@ -3649,7 +3650,7 @@ class ApbctHandler { options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { let token = localStorage.getItem('bot_detector_event_token'); @@ -3664,7 +3665,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); @@ -4186,7 +4187,7 @@ async function apbct_ready() { if ( apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit - +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active + +ctPublic.bot_detector_enabled && // If Bot-Detector is active !apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet ) { @@ -4205,7 +4206,7 @@ async function apbct_ready() { // Gathering data when bot detector is disabled if ( - ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) && typeof ApbctGatheringData !== 'undefined' ) { const gatheringData = new ApbctGatheringData(); @@ -4227,7 +4228,7 @@ async function apbct_ready() { setTimeout(function() { // Attach data when bot detector is enabled - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventTokenTransport = new ApbctEventTokenTransport(); eventTokenTransport.attachEventTokenToMultipageGravityForms(); eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart(); @@ -4236,7 +4237,7 @@ async function apbct_ready() { const attachData = new ApbctAttachData(); // Attach data when bot detector is disabled or blocked - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { attachData.attachHiddenFieldsToForms(gatheringLoaded); } @@ -4263,7 +4264,7 @@ async function apbct_ready() { handler.catchJqueryAjax(); handler.catchWCRestRequestAsMiddleware(); - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; @@ -4283,7 +4284,7 @@ async function apbct_ready() { }); } - if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { + if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } @@ -4316,8 +4317,8 @@ let botDetectorLogEventTypesCollected = []; // bot_detector frontend_data log alt session saving cron if ( - ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') && - ctPublicFunctions.data__bot_detector_enabled == 1 && + ctPublicFunctions.hasOwnProperty('bot_detector_enabled') && + +ctPublicFunctions.bot_detector_enabled && ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') && ctPublicFunctions.data__frontend_data_log_enabled == 1 ) { diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index 4b776f3ef..bc00afaa3 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) { referrer: document.referrer, encodedEmails: '', }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); @@ -1906,7 +1906,7 @@ class ApbctFetchProxyProtection { data.raw_body = bodyText; } - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventToken = new ApbctHandler().toolGetEventToken(); if (eventToken) { data.ct_bot_detector_event_token = eventToken; @@ -1992,6 +1992,7 @@ class ApbctFetchProxyProtection { return await this.checkRequest(match.formKey, match.config, bodyText); } } + /** * Set init params */ @@ -2129,7 +2130,7 @@ function ctSetCookie( cookies, value, expires ) { // do it just once ctSetAlternativeCookie(cookies, {forceAltCookies: true}); } else { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { ctNoCookieAttachHiddenFieldsToForms(); } } @@ -2167,7 +2168,7 @@ function ctSetAlternativeCookie(cookies, params) { if (Array.isArray(cookies)) { cookies = getJavascriptClientData(cookies); } - } else if (!+ctPublic.settings__data__bot_detector_enabled) { + } else if (!+ctPublic.bot_detector_enabled) { console.log('APBCT ERROR: getJavascriptClientData() is not loaded'); } @@ -2624,7 +2625,7 @@ class ApbctAttachData { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -2694,7 +2695,7 @@ class ApbctAttachData { event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1 ) { window.XMLHttpRequest.prototype.send = function(data) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&'; defaultSend.call(this, noCookieData + data); } else { @@ -3009,7 +3010,7 @@ class ApbctHandler { cronFormsHandler(cronStartTimeout = 2000) { setTimeout(function() { setInterval(function() { - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().restartFieldsListening(); } new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach(); @@ -3082,7 +3083,7 @@ class ApbctHandler { let addidionalCleantalkData = ''; if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3099,7 +3100,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckFormData) { if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3157,7 +3158,7 @@ class ApbctHandler { args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { args[1].body.append( @@ -3317,7 +3318,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3333,7 +3334,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3354,7 +3355,7 @@ class ApbctHandler { if (+ctPublic.settings__forms__wc_add_to_cart) { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } } catch (e) { @@ -3583,7 +3584,7 @@ class ApbctHandler { let noCookieData = ''; let visibleFieldsString = ''; if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { const token = new ApbctHandler().toolGetEventToken(); @@ -3649,7 +3650,7 @@ class ApbctHandler { options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { let token = localStorage.getItem('bot_detector_event_token'); @@ -3664,7 +3665,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); @@ -4186,7 +4187,7 @@ async function apbct_ready() { if ( apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit - +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active + +ctPublic.bot_detector_enabled && // If Bot-Detector is active !apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet ) { @@ -4205,7 +4206,7 @@ async function apbct_ready() { // Gathering data when bot detector is disabled if ( - ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) && typeof ApbctGatheringData !== 'undefined' ) { const gatheringData = new ApbctGatheringData(); @@ -4227,7 +4228,7 @@ async function apbct_ready() { setTimeout(function() { // Attach data when bot detector is enabled - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventTokenTransport = new ApbctEventTokenTransport(); eventTokenTransport.attachEventTokenToMultipageGravityForms(); eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart(); @@ -4236,7 +4237,7 @@ async function apbct_ready() { const attachData = new ApbctAttachData(); // Attach data when bot detector is disabled or blocked - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { attachData.attachHiddenFieldsToForms(gatheringLoaded); } @@ -4263,7 +4264,7 @@ async function apbct_ready() { handler.catchJqueryAjax(); handler.catchWCRestRequestAsMiddleware(); - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; @@ -4283,7 +4284,7 @@ async function apbct_ready() { }); } - if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { + if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } @@ -4379,7 +4380,7 @@ function ctProtectExternal() { // Trying to process external form into an iframe apbctProcessIframes(); // if form is still not processed by fields listening, do it here - if (ctPublic.settings__data__bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') { + if (ctPublic.bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().startFieldsListening(); } } @@ -5656,8 +5657,8 @@ let botDetectorLogEventTypesCollected = []; // bot_detector frontend_data log alt session saving cron if ( - ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') && - ctPublicFunctions.data__bot_detector_enabled == 1 && + ctPublicFunctions.hasOwnProperty('bot_detector_enabled') && + +ctPublicFunctions.bot_detector_enabled && ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') && ctPublicFunctions.data__frontend_data_log_enabled == 1 ) { diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index 7dbd4d80d..73666356d 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) { referrer: document.referrer, encodedEmails: '', }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); @@ -1906,7 +1906,7 @@ class ApbctFetchProxyProtection { data.raw_body = bodyText; } - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventToken = new ApbctHandler().toolGetEventToken(); if (eventToken) { data.ct_bot_detector_event_token = eventToken; @@ -1992,6 +1992,7 @@ class ApbctFetchProxyProtection { return await this.checkRequest(match.formKey, match.config, bodyText); } } + /** * Set init params */ @@ -2129,7 +2130,7 @@ function ctSetCookie( cookies, value, expires ) { // do it just once ctSetAlternativeCookie(cookies, {forceAltCookies: true}); } else { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { ctNoCookieAttachHiddenFieldsToForms(); } } @@ -2167,7 +2168,7 @@ function ctSetAlternativeCookie(cookies, params) { if (Array.isArray(cookies)) { cookies = getJavascriptClientData(cookies); } - } else if (!+ctPublic.settings__data__bot_detector_enabled) { + } else if (!+ctPublic.bot_detector_enabled) { console.log('APBCT ERROR: getJavascriptClientData() is not loaded'); } @@ -2624,7 +2625,7 @@ class ApbctAttachData { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -2694,7 +2695,7 @@ class ApbctAttachData { event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1 ) { window.XMLHttpRequest.prototype.send = function(data) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&'; defaultSend.call(this, noCookieData + data); } else { @@ -3009,7 +3010,7 @@ class ApbctHandler { cronFormsHandler(cronStartTimeout = 2000) { setTimeout(function() { setInterval(function() { - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().restartFieldsListening(); } new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach(); @@ -3082,7 +3083,7 @@ class ApbctHandler { let addidionalCleantalkData = ''; if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3099,7 +3100,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckFormData) { if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3157,7 +3158,7 @@ class ApbctHandler { args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { args[1].body.append( @@ -3317,7 +3318,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3333,7 +3334,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3354,7 +3355,7 @@ class ApbctHandler { if (+ctPublic.settings__forms__wc_add_to_cart) { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } } catch (e) { @@ -3583,7 +3584,7 @@ class ApbctHandler { let noCookieData = ''; let visibleFieldsString = ''; if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { const token = new ApbctHandler().toolGetEventToken(); @@ -3649,7 +3650,7 @@ class ApbctHandler { options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { let token = localStorage.getItem('bot_detector_event_token'); @@ -3664,7 +3665,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); @@ -4186,7 +4187,7 @@ async function apbct_ready() { if ( apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit - +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active + +ctPublic.bot_detector_enabled && // If Bot-Detector is active !apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet ) { @@ -4205,7 +4206,7 @@ async function apbct_ready() { // Gathering data when bot detector is disabled if ( - ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) && typeof ApbctGatheringData !== 'undefined' ) { const gatheringData = new ApbctGatheringData(); @@ -4227,7 +4228,7 @@ async function apbct_ready() { setTimeout(function() { // Attach data when bot detector is enabled - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventTokenTransport = new ApbctEventTokenTransport(); eventTokenTransport.attachEventTokenToMultipageGravityForms(); eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart(); @@ -4236,7 +4237,7 @@ async function apbct_ready() { const attachData = new ApbctAttachData(); // Attach data when bot detector is disabled or blocked - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { attachData.attachHiddenFieldsToForms(gatheringLoaded); } @@ -4263,7 +4264,7 @@ async function apbct_ready() { handler.catchJqueryAjax(); handler.catchWCRestRequestAsMiddleware(); - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; @@ -4283,7 +4284,7 @@ async function apbct_ready() { }); } - if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { + if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } @@ -4379,7 +4380,7 @@ function ctProtectExternal() { // Trying to process external form into an iframe apbctProcessIframes(); // if form is still not processed by fields listening, do it here - if (ctPublic.settings__data__bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') { + if (ctPublic.bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().startFieldsListening(); } } @@ -6296,7 +6297,7 @@ function getJavascriptClientData(commonCookies = []) { // eslint-disable-line no * @return {bool} */ function ctIsDrawPixel() { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } @@ -6310,7 +6311,7 @@ function ctIsDrawPixel() { * @return {bool} */ function ctSetPixelImg(pixelUrl) { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } ctSetCookie('apbct_pixel_url', pixelUrl); @@ -6332,7 +6333,7 @@ function ctSetPixelImg(pixelUrl) { * @return {bool} */ function ctSetPixelImgFromLocalstorage(pixelUrl) { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } if ( ctIsDrawPixel() ) { @@ -6354,7 +6355,7 @@ function ctSetPixelImgFromLocalstorage(pixelUrl) { */ // eslint-disable-next-line no-unused-vars, require-jsdoc function ctGetPixelUrl() { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } @@ -6531,8 +6532,8 @@ let botDetectorLogEventTypesCollected = []; // bot_detector frontend_data log alt session saving cron if ( - ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') && - ctPublicFunctions.data__bot_detector_enabled == 1 && + ctPublicFunctions.hasOwnProperty('bot_detector_enabled') && + +ctPublicFunctions.bot_detector_enabled && ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') && ctPublicFunctions.data__frontend_data_log_enabled == 1 ) { diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 7c25b0a83..d29d1ecda 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) { referrer: document.referrer, encodedEmails: '', }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); @@ -1906,7 +1906,7 @@ class ApbctFetchProxyProtection { data.raw_body = bodyText; } - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventToken = new ApbctHandler().toolGetEventToken(); if (eventToken) { data.ct_bot_detector_event_token = eventToken; @@ -1992,6 +1992,7 @@ class ApbctFetchProxyProtection { return await this.checkRequest(match.formKey, match.config, bodyText); } } + /** * Set init params */ @@ -2129,7 +2130,7 @@ function ctSetCookie( cookies, value, expires ) { // do it just once ctSetAlternativeCookie(cookies, {forceAltCookies: true}); } else { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { ctNoCookieAttachHiddenFieldsToForms(); } } @@ -2167,7 +2168,7 @@ function ctSetAlternativeCookie(cookies, params) { if (Array.isArray(cookies)) { cookies = getJavascriptClientData(cookies); } - } else if (!+ctPublic.settings__data__bot_detector_enabled) { + } else if (!+ctPublic.bot_detector_enabled) { console.log('APBCT ERROR: getJavascriptClientData() is not loaded'); } @@ -2624,7 +2625,7 @@ class ApbctAttachData { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -2694,7 +2695,7 @@ class ApbctAttachData { event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1 ) { window.XMLHttpRequest.prototype.send = function(data) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&'; defaultSend.call(this, noCookieData + data); } else { @@ -3009,7 +3010,7 @@ class ApbctHandler { cronFormsHandler(cronStartTimeout = 2000) { setTimeout(function() { setInterval(function() { - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().restartFieldsListening(); } new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach(); @@ -3082,7 +3083,7 @@ class ApbctHandler { let addidionalCleantalkData = ''; if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3099,7 +3100,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckFormData) { if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3157,7 +3158,7 @@ class ApbctHandler { args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { args[1].body.append( @@ -3317,7 +3318,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3333,7 +3334,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3354,7 +3355,7 @@ class ApbctHandler { if (+ctPublic.settings__forms__wc_add_to_cart) { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } } catch (e) { @@ -3583,7 +3584,7 @@ class ApbctHandler { let noCookieData = ''; let visibleFieldsString = ''; if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { const token = new ApbctHandler().toolGetEventToken(); @@ -3649,7 +3650,7 @@ class ApbctHandler { options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { let token = localStorage.getItem('bot_detector_event_token'); @@ -3664,7 +3665,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); @@ -4186,7 +4187,7 @@ async function apbct_ready() { if ( apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit - +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active + +ctPublic.bot_detector_enabled && // If Bot-Detector is active !apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet ) { @@ -4205,7 +4206,7 @@ async function apbct_ready() { // Gathering data when bot detector is disabled if ( - ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) && typeof ApbctGatheringData !== 'undefined' ) { const gatheringData = new ApbctGatheringData(); @@ -4227,7 +4228,7 @@ async function apbct_ready() { setTimeout(function() { // Attach data when bot detector is enabled - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventTokenTransport = new ApbctEventTokenTransport(); eventTokenTransport.attachEventTokenToMultipageGravityForms(); eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart(); @@ -4236,7 +4237,7 @@ async function apbct_ready() { const attachData = new ApbctAttachData(); // Attach data when bot detector is disabled or blocked - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { attachData.attachHiddenFieldsToForms(gatheringLoaded); } @@ -4263,7 +4264,7 @@ async function apbct_ready() { handler.catchJqueryAjax(); handler.catchWCRestRequestAsMiddleware(); - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; @@ -4283,7 +4284,7 @@ async function apbct_ready() { }); } - if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { + if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } @@ -4379,7 +4380,7 @@ function ctProtectExternal() { // Trying to process external form into an iframe apbctProcessIframes(); // if form is still not processed by fields listening, do it here - if (ctPublic.settings__data__bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') { + if (ctPublic.bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().startFieldsListening(); } } @@ -5687,7 +5688,7 @@ class ApbctForceProtection { post_url: document.location.href, referrer: document.referrer, }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); @@ -5900,8 +5901,8 @@ let botDetectorLogEventTypesCollected = []; // bot_detector frontend_data log alt session saving cron if ( - ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') && - ctPublicFunctions.data__bot_detector_enabled == 1 && + ctPublicFunctions.hasOwnProperty('bot_detector_enabled') && + +ctPublicFunctions.bot_detector_enabled && ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') && ctPublicFunctions.data__frontend_data_log_enabled == 1 ) { diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 103bd96e2..756d69fb7 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) { referrer: document.referrer, encodedEmails: '', }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); @@ -1906,7 +1906,7 @@ class ApbctFetchProxyProtection { data.raw_body = bodyText; } - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventToken = new ApbctHandler().toolGetEventToken(); if (eventToken) { data.ct_bot_detector_event_token = eventToken; @@ -1992,6 +1992,7 @@ class ApbctFetchProxyProtection { return await this.checkRequest(match.formKey, match.config, bodyText); } } + /** * Set init params */ @@ -2129,7 +2130,7 @@ function ctSetCookie( cookies, value, expires ) { // do it just once ctSetAlternativeCookie(cookies, {forceAltCookies: true}); } else { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { ctNoCookieAttachHiddenFieldsToForms(); } } @@ -2167,7 +2168,7 @@ function ctSetAlternativeCookie(cookies, params) { if (Array.isArray(cookies)) { cookies = getJavascriptClientData(cookies); } - } else if (!+ctPublic.settings__data__bot_detector_enabled) { + } else if (!+ctPublic.bot_detector_enabled) { console.log('APBCT ERROR: getJavascriptClientData() is not loaded'); } @@ -2624,7 +2625,7 @@ class ApbctAttachData { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -2694,7 +2695,7 @@ class ApbctAttachData { event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1 ) { window.XMLHttpRequest.prototype.send = function(data) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&'; defaultSend.call(this, noCookieData + data); } else { @@ -3009,7 +3010,7 @@ class ApbctHandler { cronFormsHandler(cronStartTimeout = 2000) { setTimeout(function() { setInterval(function() { - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().restartFieldsListening(); } new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach(); @@ -3082,7 +3083,7 @@ class ApbctHandler { let addidionalCleantalkData = ''; if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3099,7 +3100,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckFormData) { if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3157,7 +3158,7 @@ class ApbctHandler { args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { args[1].body.append( @@ -3317,7 +3318,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3333,7 +3334,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3354,7 +3355,7 @@ class ApbctHandler { if (+ctPublic.settings__forms__wc_add_to_cart) { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } } catch (e) { @@ -3583,7 +3584,7 @@ class ApbctHandler { let noCookieData = ''; let visibleFieldsString = ''; if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { const token = new ApbctHandler().toolGetEventToken(); @@ -3649,7 +3650,7 @@ class ApbctHandler { options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { let token = localStorage.getItem('bot_detector_event_token'); @@ -3664,7 +3665,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); @@ -4186,7 +4187,7 @@ async function apbct_ready() { if ( apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit - +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active + +ctPublic.bot_detector_enabled && // If Bot-Detector is active !apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet ) { @@ -4205,7 +4206,7 @@ async function apbct_ready() { // Gathering data when bot detector is disabled if ( - ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) && typeof ApbctGatheringData !== 'undefined' ) { const gatheringData = new ApbctGatheringData(); @@ -4227,7 +4228,7 @@ async function apbct_ready() { setTimeout(function() { // Attach data when bot detector is enabled - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventTokenTransport = new ApbctEventTokenTransport(); eventTokenTransport.attachEventTokenToMultipageGravityForms(); eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart(); @@ -4236,7 +4237,7 @@ async function apbct_ready() { const attachData = new ApbctAttachData(); // Attach data when bot detector is disabled or blocked - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { attachData.attachHiddenFieldsToForms(gatheringLoaded); } @@ -4263,7 +4264,7 @@ async function apbct_ready() { handler.catchJqueryAjax(); handler.catchWCRestRequestAsMiddleware(); - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; @@ -4283,7 +4284,7 @@ async function apbct_ready() { }); } - if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { + if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } @@ -4379,7 +4380,7 @@ function ctProtectExternal() { // Trying to process external form into an iframe apbctProcessIframes(); // if form is still not processed by fields listening, do it here - if (ctPublic.settings__data__bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') { + if (ctPublic.bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().startFieldsListening(); } } @@ -5687,7 +5688,7 @@ class ApbctForceProtection { post_url: document.location.href, referrer: document.referrer, }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); @@ -6436,7 +6437,7 @@ function getJavascriptClientData(commonCookies = []) { // eslint-disable-line no * @return {bool} */ function ctIsDrawPixel() { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } @@ -6450,7 +6451,7 @@ function ctIsDrawPixel() { * @return {bool} */ function ctSetPixelImg(pixelUrl) { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } ctSetCookie('apbct_pixel_url', pixelUrl); @@ -6472,7 +6473,7 @@ function ctSetPixelImg(pixelUrl) { * @return {bool} */ function ctSetPixelImgFromLocalstorage(pixelUrl) { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } if ( ctIsDrawPixel() ) { @@ -6494,7 +6495,7 @@ function ctSetPixelImgFromLocalstorage(pixelUrl) { */ // eslint-disable-next-line no-unused-vars, require-jsdoc function ctGetPixelUrl() { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } @@ -6775,8 +6776,8 @@ let botDetectorLogEventTypesCollected = []; // bot_detector frontend_data log alt session saving cron if ( - ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') && - ctPublicFunctions.data__bot_detector_enabled == 1 && + ctPublicFunctions.hasOwnProperty('bot_detector_enabled') && + +ctPublicFunctions.bot_detector_enabled && ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') && ctPublicFunctions.data__frontend_data_log_enabled == 1 ) { diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index b09097c45..1f53d01c5 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) { referrer: document.referrer, encodedEmails: '', }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); @@ -1906,7 +1906,7 @@ class ApbctFetchProxyProtection { data.raw_body = bodyText; } - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventToken = new ApbctHandler().toolGetEventToken(); if (eventToken) { data.ct_bot_detector_event_token = eventToken; @@ -1992,6 +1992,7 @@ class ApbctFetchProxyProtection { return await this.checkRequest(match.formKey, match.config, bodyText); } } + /** * Set init params */ @@ -2129,7 +2130,7 @@ function ctSetCookie( cookies, value, expires ) { // do it just once ctSetAlternativeCookie(cookies, {forceAltCookies: true}); } else { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { ctNoCookieAttachHiddenFieldsToForms(); } } @@ -2167,7 +2168,7 @@ function ctSetAlternativeCookie(cookies, params) { if (Array.isArray(cookies)) { cookies = getJavascriptClientData(cookies); } - } else if (!+ctPublic.settings__data__bot_detector_enabled) { + } else if (!+ctPublic.bot_detector_enabled) { console.log('APBCT ERROR: getJavascriptClientData() is not loaded'); } @@ -2624,7 +2625,7 @@ class ApbctAttachData { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -2694,7 +2695,7 @@ class ApbctAttachData { event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1 ) { window.XMLHttpRequest.prototype.send = function(data) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&'; defaultSend.call(this, noCookieData + data); } else { @@ -3009,7 +3010,7 @@ class ApbctHandler { cronFormsHandler(cronStartTimeout = 2000) { setTimeout(function() { setInterval(function() { - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().restartFieldsListening(); } new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach(); @@ -3082,7 +3083,7 @@ class ApbctHandler { let addidionalCleantalkData = ''; if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3099,7 +3100,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckFormData) { if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3157,7 +3158,7 @@ class ApbctHandler { args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { args[1].body.append( @@ -3317,7 +3318,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3333,7 +3334,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3354,7 +3355,7 @@ class ApbctHandler { if (+ctPublic.settings__forms__wc_add_to_cart) { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } } catch (e) { @@ -3583,7 +3584,7 @@ class ApbctHandler { let noCookieData = ''; let visibleFieldsString = ''; if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { const token = new ApbctHandler().toolGetEventToken(); @@ -3649,7 +3650,7 @@ class ApbctHandler { options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { let token = localStorage.getItem('bot_detector_event_token'); @@ -3664,7 +3665,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); @@ -4186,7 +4187,7 @@ async function apbct_ready() { if ( apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit - +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active + +ctPublic.bot_detector_enabled && // If Bot-Detector is active !apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet ) { @@ -4205,7 +4206,7 @@ async function apbct_ready() { // Gathering data when bot detector is disabled if ( - ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) && typeof ApbctGatheringData !== 'undefined' ) { const gatheringData = new ApbctGatheringData(); @@ -4227,7 +4228,7 @@ async function apbct_ready() { setTimeout(function() { // Attach data when bot detector is enabled - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventTokenTransport = new ApbctEventTokenTransport(); eventTokenTransport.attachEventTokenToMultipageGravityForms(); eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart(); @@ -4236,7 +4237,7 @@ async function apbct_ready() { const attachData = new ApbctAttachData(); // Attach data when bot detector is disabled or blocked - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { attachData.attachHiddenFieldsToForms(gatheringLoaded); } @@ -4263,7 +4264,7 @@ async function apbct_ready() { handler.catchJqueryAjax(); handler.catchWCRestRequestAsMiddleware(); - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; @@ -4283,7 +4284,7 @@ async function apbct_ready() { }); } - if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { + if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } @@ -4956,7 +4957,7 @@ function getJavascriptClientData(commonCookies = []) { // eslint-disable-line no * @return {bool} */ function ctIsDrawPixel() { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } @@ -4970,7 +4971,7 @@ function ctIsDrawPixel() { * @return {bool} */ function ctSetPixelImg(pixelUrl) { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } ctSetCookie('apbct_pixel_url', pixelUrl); @@ -4992,7 +4993,7 @@ function ctSetPixelImg(pixelUrl) { * @return {bool} */ function ctSetPixelImgFromLocalstorage(pixelUrl) { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } if ( ctIsDrawPixel() ) { @@ -5014,7 +5015,7 @@ function ctSetPixelImgFromLocalstorage(pixelUrl) { */ // eslint-disable-next-line no-unused-vars, require-jsdoc function ctGetPixelUrl() { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } @@ -5191,8 +5192,8 @@ let botDetectorLogEventTypesCollected = []; // bot_detector frontend_data log alt session saving cron if ( - ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') && - ctPublicFunctions.data__bot_detector_enabled == 1 && + ctPublicFunctions.hasOwnProperty('bot_detector_enabled') && + +ctPublicFunctions.bot_detector_enabled && ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') && ctPublicFunctions.data__frontend_data_log_enabled == 1 ) { diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index 52d8fb89d..c37376e1a 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) { referrer: document.referrer, encodedEmails: '', }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); @@ -1906,7 +1906,7 @@ class ApbctFetchProxyProtection { data.raw_body = bodyText; } - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventToken = new ApbctHandler().toolGetEventToken(); if (eventToken) { data.ct_bot_detector_event_token = eventToken; @@ -1992,6 +1992,7 @@ class ApbctFetchProxyProtection { return await this.checkRequest(match.formKey, match.config, bodyText); } } + /** * Set init params */ @@ -2129,7 +2130,7 @@ function ctSetCookie( cookies, value, expires ) { // do it just once ctSetAlternativeCookie(cookies, {forceAltCookies: true}); } else { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { ctNoCookieAttachHiddenFieldsToForms(); } } @@ -2167,7 +2168,7 @@ function ctSetAlternativeCookie(cookies, params) { if (Array.isArray(cookies)) { cookies = getJavascriptClientData(cookies); } - } else if (!+ctPublic.settings__data__bot_detector_enabled) { + } else if (!+ctPublic.bot_detector_enabled) { console.log('APBCT ERROR: getJavascriptClientData() is not loaded'); } @@ -2624,7 +2625,7 @@ class ApbctAttachData { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -2694,7 +2695,7 @@ class ApbctAttachData { event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1 ) { window.XMLHttpRequest.prototype.send = function(data) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&'; defaultSend.call(this, noCookieData + data); } else { @@ -3009,7 +3010,7 @@ class ApbctHandler { cronFormsHandler(cronStartTimeout = 2000) { setTimeout(function() { setInterval(function() { - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().restartFieldsListening(); } new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach(); @@ -3082,7 +3083,7 @@ class ApbctHandler { let addidionalCleantalkData = ''; if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3099,7 +3100,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckFormData) { if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3157,7 +3158,7 @@ class ApbctHandler { args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { args[1].body.append( @@ -3317,7 +3318,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3333,7 +3334,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3354,7 +3355,7 @@ class ApbctHandler { if (+ctPublic.settings__forms__wc_add_to_cart) { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } } catch (e) { @@ -3583,7 +3584,7 @@ class ApbctHandler { let noCookieData = ''; let visibleFieldsString = ''; if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { const token = new ApbctHandler().toolGetEventToken(); @@ -3649,7 +3650,7 @@ class ApbctHandler { options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { let token = localStorage.getItem('bot_detector_event_token'); @@ -3664,7 +3665,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); @@ -4186,7 +4187,7 @@ async function apbct_ready() { if ( apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit - +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active + +ctPublic.bot_detector_enabled && // If Bot-Detector is active !apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet ) { @@ -4205,7 +4206,7 @@ async function apbct_ready() { // Gathering data when bot detector is disabled if ( - ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) && typeof ApbctGatheringData !== 'undefined' ) { const gatheringData = new ApbctGatheringData(); @@ -4227,7 +4228,7 @@ async function apbct_ready() { setTimeout(function() { // Attach data when bot detector is enabled - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventTokenTransport = new ApbctEventTokenTransport(); eventTokenTransport.attachEventTokenToMultipageGravityForms(); eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart(); @@ -4236,7 +4237,7 @@ async function apbct_ready() { const attachData = new ApbctAttachData(); // Attach data when bot detector is disabled or blocked - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { attachData.attachHiddenFieldsToForms(gatheringLoaded); } @@ -4263,7 +4264,7 @@ async function apbct_ready() { handler.catchJqueryAjax(); handler.catchWCRestRequestAsMiddleware(); - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; @@ -4283,7 +4284,7 @@ async function apbct_ready() { }); } - if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { + if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } @@ -4420,8 +4421,8 @@ let botDetectorLogEventTypesCollected = []; // bot_detector frontend_data log alt session saving cron if ( - ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') && - ctPublicFunctions.data__bot_detector_enabled == 1 && + ctPublicFunctions.hasOwnProperty('bot_detector_enabled') && + +ctPublicFunctions.bot_detector_enabled && ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') && ctPublicFunctions.data__frontend_data_log_enabled == 1 ) { diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 94819a466..b9fae9b17 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) { referrer: document.referrer, encodedEmails: '', }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); @@ -1906,7 +1906,7 @@ class ApbctFetchProxyProtection { data.raw_body = bodyText; } - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventToken = new ApbctHandler().toolGetEventToken(); if (eventToken) { data.ct_bot_detector_event_token = eventToken; @@ -1992,6 +1992,7 @@ class ApbctFetchProxyProtection { return await this.checkRequest(match.formKey, match.config, bodyText); } } + /** * Set init params */ @@ -2129,7 +2130,7 @@ function ctSetCookie( cookies, value, expires ) { // do it just once ctSetAlternativeCookie(cookies, {forceAltCookies: true}); } else { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { ctNoCookieAttachHiddenFieldsToForms(); } } @@ -2167,7 +2168,7 @@ function ctSetAlternativeCookie(cookies, params) { if (Array.isArray(cookies)) { cookies = getJavascriptClientData(cookies); } - } else if (!+ctPublic.settings__data__bot_detector_enabled) { + } else if (!+ctPublic.bot_detector_enabled) { console.log('APBCT ERROR: getJavascriptClientData() is not loaded'); } @@ -2624,7 +2625,7 @@ class ApbctAttachData { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -2694,7 +2695,7 @@ class ApbctAttachData { event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1 ) { window.XMLHttpRequest.prototype.send = function(data) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&'; defaultSend.call(this, noCookieData + data); } else { @@ -3009,7 +3010,7 @@ class ApbctHandler { cronFormsHandler(cronStartTimeout = 2000) { setTimeout(function() { setInterval(function() { - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().restartFieldsListening(); } new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach(); @@ -3082,7 +3083,7 @@ class ApbctHandler { let addidionalCleantalkData = ''; if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3099,7 +3100,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckFormData) { if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -3157,7 +3158,7 @@ class ApbctHandler { args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { args[1].body.append( @@ -3317,7 +3318,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3333,7 +3334,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -3354,7 +3355,7 @@ class ApbctHandler { if (+ctPublic.settings__forms__wc_add_to_cart) { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } } catch (e) { @@ -3583,7 +3584,7 @@ class ApbctHandler { let noCookieData = ''; let visibleFieldsString = ''; if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { const token = new ApbctHandler().toolGetEventToken(); @@ -3649,7 +3650,7 @@ class ApbctHandler { options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { let token = localStorage.getItem('bot_detector_event_token'); @@ -3664,7 +3665,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); @@ -4186,7 +4187,7 @@ async function apbct_ready() { if ( apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit - +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active + +ctPublic.bot_detector_enabled && // If Bot-Detector is active !apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet ) { @@ -4205,7 +4206,7 @@ async function apbct_ready() { // Gathering data when bot detector is disabled if ( - ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) && typeof ApbctGatheringData !== 'undefined' ) { const gatheringData = new ApbctGatheringData(); @@ -4227,7 +4228,7 @@ async function apbct_ready() { setTimeout(function() { // Attach data when bot detector is enabled - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventTokenTransport = new ApbctEventTokenTransport(); eventTokenTransport.attachEventTokenToMultipageGravityForms(); eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart(); @@ -4236,7 +4237,7 @@ async function apbct_ready() { const attachData = new ApbctAttachData(); // Attach data when bot detector is disabled or blocked - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { attachData.attachHiddenFieldsToForms(gatheringLoaded); } @@ -4263,7 +4264,7 @@ async function apbct_ready() { handler.catchJqueryAjax(); handler.catchWCRestRequestAsMiddleware(); - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; @@ -4283,7 +4284,7 @@ async function apbct_ready() { }); } - if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { + if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } @@ -5060,7 +5061,7 @@ function getJavascriptClientData(commonCookies = []) { // eslint-disable-line no * @return {bool} */ function ctIsDrawPixel() { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } @@ -5074,7 +5075,7 @@ function ctIsDrawPixel() { * @return {bool} */ function ctSetPixelImg(pixelUrl) { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } ctSetCookie('apbct_pixel_url', pixelUrl); @@ -5096,7 +5097,7 @@ function ctSetPixelImg(pixelUrl) { * @return {bool} */ function ctSetPixelImgFromLocalstorage(pixelUrl) { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } if ( ctIsDrawPixel() ) { @@ -5118,7 +5119,7 @@ function ctSetPixelImgFromLocalstorage(pixelUrl) { */ // eslint-disable-next-line no-unused-vars, require-jsdoc function ctGetPixelUrl() { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } @@ -5295,8 +5296,8 @@ let botDetectorLogEventTypesCollected = []; // bot_detector frontend_data log alt session saving cron if ( - ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') && - ctPublicFunctions.data__bot_detector_enabled == 1 && + ctPublicFunctions.hasOwnProperty('bot_detector_enabled') && + +ctPublicFunctions.bot_detector_enabled && ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') && ctPublicFunctions.data__frontend_data_log_enabled == 1 ) { diff --git a/js/public-2-gathering-data.min.js b/js/public-2-gathering-data.min.js index 6807272b9..4a31f85c1 100644 --- a/js/public-2-gathering-data.min.js +++ b/js/public-2-gathering-data.min.js @@ -1,2 +1,2 @@ -class ApbctGatheringData{setSessionId(){var t;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(t=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",t,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}writeReferrersToSessionStorage(){var t=apbctSessionStorage.get("apbct_session_current_page");!1!==t&&document.location.href!==t&&apbctSessionStorage.set("apbct_prev_referer",t,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}setCookiesType(){var t=apbctLocalStorage.get("ct_cookies_type");t&&t===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled"))}startFieldsListening(){"alternative"!==ctPublic.data__cookies_type&&(this.startFieldsListening(),setTimeout(this.startFieldsListening,1e3))}listenAutocomplete(){window.addEventListener("animationstart",this.apbctOnAnimationStart,!0),window.addEventListener("input",this.apbctOnInput,!0)}gatheringTypoData(){document.ctTypoData=new CTTypoData,document.ctTypoData.gatheringFields(),document.ctTypoData.setListeners()}gatheringMouseData(){new ApbctCollectingUserMouseActivity}getScreenInfo(){var t=document.documentElement,e=document.body,e={scrollWidth:t.scrollWidth,bodyScrollHeight:e.scrollHeight,docScrollHeight:t.scrollHeight,bodyOffsetHeight:e.offsetHeight,docOffsetHeight:t.offsetHeight,bodyClientHeight:e.clientHeight,docClientHeight:t.clientHeight,docClientWidth:t.clientWidth};return JSON.stringify({fullWidth:e.scrollWidth,fullHeight:Math.max(e.bodyScrollHeight,e.docScrollHeight,e.bodyOffsetHeight,e.docOffsetHeight,e.bodyClientHeight,e.docClientHeight),visibleWidth:e.docClientWidth,visibleHeight:e.docClientHeight})}restartFieldsListening(){apbctLocalStorage.isSet("ct_has_input_focused")||apbctLocalStorage.isSet("ct_has_key_up")||this.startFieldsListening()}startFieldsListening(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0{this.checkElementInForms(t,"addClicks")}),this.elementBody.addEventListener("mouseup",t=>{"Range"==document.getSelection().type.toString()&&this.addSelected()}),this.elementBody.addEventListener("mousemove",t=>{this.checkElementInForms(t,"trackMouseMovement")})}checkElementInForms(e,t){let c;for(let t=0;t{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((t,e)=>{t.addEventListener("paste",()=>{this.data[e].isUseBuffer=!0})}),this.fields.forEach((t,e)=>{t.addEventListener("onautocomplete",()=>{this.data[e].isAutoFill=!0})}),this.fields.forEach((t,c)=>{t.addEventListener("input",()=>{this.data[c].countOfKey++;var t,e=+new Date;1===this.data[c].countOfKey?(this.data[c].lastKeyTimestamp=e,this.data[c].firstKeyTimestamp=e):(t=e-this.data[c].lastKeyTimestamp,2===this.data[c].countOfKey?(this.data[c].lastKeyTimestamp=e,this.data[c].lastDelta=t):2{this.checkElementInForms(t,"addClicks")}),this.elementBody.addEventListener("mouseup",t=>{"Range"==document.getSelection().type.toString()&&this.addSelected()}),this.elementBody.addEventListener("mousemove",t=>{this.checkElementInForms(t,"trackMouseMovement")})}checkElementInForms(e,t){let c;for(let t=0;t{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((t,e)=>{t.addEventListener("paste",()=>{this.data[e].isUseBuffer=!0})}),this.fields.forEach((t,e)=>{t.addEventListener("onautocomplete",()=>{this.data[e].isAutoFill=!0})}),this.fields.forEach((t,c)=>{t.addEventListener("input",()=>{this.data[c].countOfKey++;var t,e=+new Date;1===this.data[c].countOfKey?(this.data[c].lastKeyTimestamp=e,this.data[c].firstKeyTimestamp=e):(t=e-this.data[c].lastKeyTimestamp,2===this.data[c].countOfKey?(this.data[c].lastKeyTimestamp=e,this.data[c].lastDelta=t):2 0) {\n for (let i = 0; i < forms.length; i++) {\n // handle only inputs and textareas\n const handledFormFields = forms[i].querySelectorAll('input,textarea');\n for (let i = 0; i < handledFormFields.length; i++) {\n if (handledFormFields[i].type !== 'hidden') {\n // collect handled fields to remove handler in the future\n ctPublic.handled_fields.push(handledFormFields[i]);\n // do attach handlers\n apbct_attach_event_handler(handledFormFields[i], 'focus', ctFunctionHasInputFocused);\n apbct_attach_event_handler(handledFormFields[i], 'keyup', ctFunctionHasKeyUp);\n }\n }\n }\n }\n }\n}\n\n/**\n * Class collecting user mouse activity data\n *\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nclass ApbctCollectingUserMouseActivity {\n elementBody = document.querySelector('body');\n collectionForms = document.forms;\n /**\n * Constructor\n */\n constructor() {\n this.setListeners();\n }\n\n /**\n * Set listeners\n */\n setListeners() {\n this.elementBody.addEventListener('click', (event) => {\n this.checkElementInForms(event, 'addClicks');\n });\n\n this.elementBody.addEventListener('mouseup', (event) => {\n const selectedType = document.getSelection().type.toString();\n if (selectedType == 'Range') {\n this.addSelected();\n }\n });\n\n this.elementBody.addEventListener('mousemove', (event) => {\n this.checkElementInForms(event, 'trackMouseMovement');\n });\n }\n\n /**\n * Checking if there is an element in the form\n * @param {object} event\n * @param {string} addTarget\n */\n checkElementInForms(event, addTarget) {\n let resultCheck;\n for (let i = 0; i < this.collectionForms.length; i++) {\n if (\n event.target.outerHTML.length > 0 &&\n this.collectionForms[i].innerHTML.length > 0\n ) {\n resultCheck = this.collectionForms[i].innerHTML.indexOf(event.target.outerHTML);\n } else {\n resultCheck = -1;\n }\n }\n\n switch (addTarget) {\n case 'addClicks':\n if (resultCheck < 0) {\n this.addClicks();\n }\n break;\n case 'trackMouseMovement':\n if (resultCheck > -1) {\n this.trackMouseMovement();\n }\n break;\n default:\n break;\n }\n }\n\n /**\n * Add clicks\n */\n addClicks() {\n if (document.ctCollectingUserActivityData) {\n if (document.ctCollectingUserActivityData.clicks) {\n document.ctCollectingUserActivityData.clicks++;\n } else {\n document.ctCollectingUserActivityData.clicks = 1;\n }\n return;\n }\n\n document.ctCollectingUserActivityData = {clicks: 1};\n }\n\n /**\n * Add selected\n */\n addSelected() {\n if (document.ctCollectingUserActivityData) {\n if (document.ctCollectingUserActivityData.selected) {\n document.ctCollectingUserActivityData.selected++;\n } else {\n document.ctCollectingUserActivityData.selected = 1;\n }\n return;\n }\n\n document.ctCollectingUserActivityData = {selected: 1};\n }\n\n /**\n * Track mouse movement\n */\n trackMouseMovement() {\n if (!document.ctCollectingUserActivityData) {\n document.ctCollectingUserActivityData = {};\n }\n if (!document.ctCollectingUserActivityData.mouseMovementsInsideForm) {\n document.ctCollectingUserActivityData.mouseMovementsInsideForm = false;\n }\n\n document.ctCollectingUserActivityData.mouseMovementsInsideForm = true;\n }\n}\n\n/**\n * Class for gathering data about user typing.\n *\n * ==============================\n * isAutoFill - only person can use auto fill\n * isUseBuffer - use buffer for fill current field\n * ==============================\n * lastKeyTimestamp - timestamp of last key press in current field\n * speedDelta - change for each key press in current field,\n * as difference between current and previous key press timestamps,\n * robots in general have constant speed of typing.\n * If speedDelta is constant for each key press in current field,\n * so, speedDelta will be roughly to 0, then it is robot.\n * ==============================\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nclass CTTypoData {\n fieldData = {\n isAutoFill: false,\n isUseBuffer: false,\n speedDelta: 0,\n firstKeyTimestamp: 0,\n lastKeyTimestamp: 0,\n lastDelta: 0,\n countOfKey: 0,\n };\n\n fields = document.querySelectorAll('textarea[name=comment]');\n\n data = [];\n\n /**\n * Gather fields.\n */\n gatheringFields() {\n let fieldSet = Array.prototype.slice.call(this.fields);\n fieldSet.forEach((field, i) => {\n this.data.push(Object.assign({}, this.fieldData));\n });\n }\n\n /**\n * Set listeners.\n */\n setListeners() {\n this.fields.forEach((field, i) => {\n field.addEventListener('paste', () => {\n this.data[i].isUseBuffer = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('onautocomplete', () => {\n this.data[i].isAutoFill = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('input', () => {\n this.data[i].countOfKey++;\n let time = + new Date();\n let currentDelta = 0;\n\n if (this.data[i].countOfKey === 1) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].firstKeyTimestamp = time;\n return;\n }\n\n currentDelta = time - this.data[i].lastKeyTimestamp;\n if (this.data[i].countOfKey === 2) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n return;\n }\n\n if (this.data[i].countOfKey > 2) {\n this.data[i].speedDelta += Math.abs(this.data[i].lastDelta - currentDelta);\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n }\n });\n });\n }\n}\n\n// eslint-disable-next-line camelcase\nconst ctTimeMs = new Date().getTime();\nlet ctMouseEventTimerFlag = true; // Reading interval flag\nlet ctMouseData = [];\nlet ctMouseDataCounter = 0;\nlet ctMouseReadInterval;\nlet ctMouseWriteDataInterval;\n\n\n// Writing first key press timestamp\nconst ctFunctionFirstKey = function output(event) {\n let KeyTimestamp = Math.floor(new Date().getTime() / 1000);\n ctSetCookie('ct_fkp_timestamp', KeyTimestamp);\n ctKeyStopStopListening();\n};\n\n/**\n * Stop mouse observing function\n */\nfunction ctMouseStopData() {\n apbct_remove_event_handler(document, 'mousemove', ctFunctionMouseMove);\n clearInterval(ctMouseReadInterval);\n clearInterval(ctMouseWriteDataInterval);\n}\n\n\n// mouse read\nif (ctPublic.data__key_is_ok) {\n // Reading interval\n ctMouseReadInterval = setInterval(function() {\n ctMouseEventTimerFlag = true;\n }, 150);\n\n // Writting interval\n ctMouseWriteDataInterval = setInterval(function() {\n ctSetCookie('ct_pointer_data', JSON.stringify(ctMouseData));\n }, 1200);\n}\n\n// Logging mouse position each 150 ms\nconst ctFunctionMouseMove = function output(event) {\n ctSetMouseMoved();\n if (ctMouseEventTimerFlag === true) {\n ctMouseData.push([\n Math.round(event.clientY),\n Math.round(event.clientX),\n Math.round(new Date().getTime() - ctTimeMs),\n ]);\n\n ctMouseDataCounter++;\n ctMouseEventTimerFlag = false;\n if (ctMouseDataCounter >= 50) {\n ctMouseStopData();\n }\n }\n};\n\n/**\n * Stop key listening function\n */\nfunction ctKeyStopStopListening() {\n apbct_remove_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_remove_event_handler(document, 'keydown', ctFunctionFirstKey);\n}\n\n/**\n * ctSetHasScrolled\n */\nfunction ctSetHasScrolled() {\n if ( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n ctSetCookie('ct_has_scrolled', 'true');\n apbctLocalStorage.set('ct_has_scrolled', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_scrolled') === undefined\n ) {\n ctSetCookie('ct_has_scrolled', 'true');\n }\n}\n\n/**\n * ctSetMouseMoved\n */\nfunction ctSetMouseMoved() {\n if ( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n ctSetCookie('ct_mouse_moved', 'true');\n apbctLocalStorage.set('ct_mouse_moved', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_mouse_moved') === undefined\n ) {\n ctSetCookie('ct_mouse_moved', 'true');\n }\n}\n\n/**\n * stop listening keyup and focus\n * @param {string} eventName\n * @param {string} functionName\n */\nfunction ctStopFieldsListening(eventName, functionName) {\n if (typeof ctPublic.handled_fields !== 'undefined' && ctPublic.handled_fields.length > 0) {\n for (let i = 0; i < ctPublic.handled_fields.length; i++) {\n apbct_remove_event_handler(ctPublic.handled_fields[i], eventName, functionName);\n }\n }\n}\n\nlet ctFunctionHasInputFocused = function output(event) {\n ctSetHasInputFocused();\n ctStopFieldsListening('focus', ctFunctionHasInputFocused);\n};\n\nlet ctFunctionHasKeyUp = function output(event) {\n ctSetHasKeyUp();\n ctStopFieldsListening('keyup', ctFunctionHasKeyUp);\n};\n\n/**\n * set ct_has_input_focused ct_has_key_up cookies on session period\n */\nfunction ctSetHasInputFocused() {\n if ( ! apbctLocalStorage.isSet('ct_has_input_focused') || ! apbctLocalStorage.get('ct_has_input_focused') ) {\n apbctLocalStorage.set('ct_has_input_focused', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_input_focused', 'true');\n }\n}\n\n/**\n * ctSetHasKeyUp\n */\nfunction ctSetHasKeyUp() {\n if ( ! apbctLocalStorage.isSet('ct_has_key_up') || ! apbctLocalStorage.get('ct_has_key_up') ) {\n apbctLocalStorage.set('ct_has_key_up', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_key_up') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_key_up', 'true');\n }\n}\n\nif (ctPublic.data__key_is_ok) {\n apbct_attach_event_handler(document, 'mousemove', ctFunctionMouseMove);\n apbct_attach_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'keydown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'scroll', ctSetHasScrolled);\n}\n\n/**\n * @param {mixed} commonCookies\n * @return {string}\n */\nfunction getJavascriptClientData(commonCookies = []) { // eslint-disable-line no-unused-vars\n let resultDataJson = {};\n\n resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n resultDataJson.ct_checked_emails_exist = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails_exist');\n resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n // collecting data from localstorage\n const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const apbctPageHits = apbctLocalStorage.get('apbct_page_hits');\n const apbctPrevReferer = apbctSessionStorage.get('apbct_prev_referer');\n const apbctSiteReferer = apbctSessionStorage.get('apbct_site_referer');\n const ctJsErrorsLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_js_errors');\n const ctPixelUrl = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadless = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n const ctBotDetectorFrontendDataLog = apbctLocalStorage.get(\n ctPublicFunctions.cookiePrefix + 'ct_bot_detector_frontend_data_log',\n );\n\n // collecting data from cookies\n const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const ctCookiesPixelUrl = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadlessNative = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\n\n resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ?\n ctMouseMovedLocalStorage : ctMouseMovedCookie;\n resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ?\n ctHasScrolledLocalStorage : ctHasScrolledCookie;\n resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ?\n ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n resultDataJson.apbct_pixel_url = ctPixelUrl !== undefined ?\n ctPixelUrl : ctCookiesPixelUrl;\n resultDataJson.apbct_headless = apbctHeadless !== undefined ?\n apbctHeadless : apbctHeadlessNative;\n resultDataJson.ct_bot_detector_frontend_data_log = ctBotDetectorFrontendDataLog !== undefined ?\n ctBotDetectorFrontendDataLog : '';\n if (resultDataJson.apbct_pixel_url && typeof(resultDataJson.apbct_pixel_url) == 'string') {\n if (resultDataJson.apbct_pixel_url.indexOf('%3A%2F')) {\n resultDataJson.apbct_pixel_url = decodeURIComponent(resultDataJson.apbct_pixel_url);\n }\n }\n\n resultDataJson.apbct_page_hits = apbctPageHits;\n resultDataJson.apbct_prev_referer = apbctPrevReferer;\n resultDataJson.apbct_site_referer = apbctSiteReferer;\n resultDataJson.apbct_ct_js_errors = ctJsErrorsLocalStorage;\n\n if (!resultDataJson.apbct_pixel_url) {\n resultDataJson.apbct_pixel_url = ctPublic.pixel__url;\n }\n\n if (typeof (commonCookies) === 'object') {\n for (let i = 0; i < commonCookies.length; ++i) {\n if ( typeof (commonCookies[i][1]) === 'object' ) {\n // this is for handle SFW cookies\n resultDataJson[commonCookies[i][1][0]] = commonCookies[i][1][1];\n } else {\n resultDataJson[commonCookies[i][0]] = commonCookies[i][1];\n }\n }\n } else {\n console.log('APBCT JS ERROR: Collecting data type mismatch');\n }\n\n // Parse JSON properties to prevent double JSON encoding\n resultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\n return JSON.stringify(resultDataJson);\n}\n\n/**\n * @return {bool}\n */\nfunction ctIsDrawPixel() {\n if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {\n return false;\n }\n\n return +ctPublic.pixel__enabled ||\n (ctPublic.data__cookies_type === 'none' && document.querySelectorAll('img#apbct_pixel').length === 0) ||\n (ctPublic.data__cookies_type === 'alternative' && document.querySelectorAll('img#apbct_pixel').length === 0);\n}\n\n/**\n * @param {string} pixelUrl\n * @return {bool}\n */\nfunction ctSetPixelImg(pixelUrl) {\n if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {\n return false;\n }\n ctSetCookie('apbct_pixel_url', pixelUrl);\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', pixelUrl);\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n * @return {bool}\n */\nfunction ctSetPixelImgFromLocalstorage(pixelUrl) {\n if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {\n return false;\n }\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', decodeURIComponent(pixelUrl));\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * ctGetPixelUrl\n * @return {bool}\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nfunction ctGetPixelUrl() {\n if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {\n return false;\n }\n\n // Check if pixel is already in localstorage and is not outdated\n let localStoragePixelUrl = apbctLocalStorage.get('apbct_pixel_url');\n if ( localStoragePixelUrl !== false ) {\n if ( ! apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n apbctLocalStorage.delete('apbct_pixel_url');\n } else {\n // if so - load pixel from localstorage and draw it skipping AJAX\n ctSetPixelImgFromLocalstorage(localStoragePixelUrl);\n return;\n }\n }\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_get_pixel_url',\n {\n method: 'POST',\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n // Using AJAX request and handler\n } else {\n apbct_public_sendAJAX(\n {\n action: 'apbct_get_pixel_url',\n },\n {\n notJson: true,\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetPixelUrlLocalstorage(ajaxPixelUrl) {\n // set pixel to the storage\n ctSetCookie('apbct_pixel_url', ajaxPixelUrl);\n}\n\n/**\n * Handler for -webkit based browser that listen for a custom\n * animation create using the :pseudo-selector in the stylesheet.\n * Works with Chrome, Safari\n *\n * @param {AnimationEvent} event\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctOnAnimationStart(event) {\n ('onautofillstart' === event.animationName) ?\n apbctAutocomplete(event.target) : apbctCancelAutocomplete(event.target);\n}\n\n/**\n * Handler for non-webkit based browser that listen for input\n * event to trigger the autocomplete-cancel process.\n * Works with Firefox, Edge, IE11\n *\n * @param {InputEvent} event\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctOnInput(event) {\n ('insertReplacementText' === event.inputType || !('data' in event)) ?\n apbctAutocomplete(event.target) : apbctCancelAutocomplete(event.target);\n}\n\n/**\n * Manage an input element when its value is autocompleted\n * by the browser in the following steps:\n * - add [autocompleted] attribute from event.target\n * - create 'onautocomplete' cancelable CustomEvent\n * - dispatch the Event\n *\n * @param {HtmlInputElement} element\n */\nfunction apbctAutocomplete(element) {\n if (element.hasAttribute('autocompleted')) return;\n element.setAttribute('autocompleted', '');\n\n let event = new window.CustomEvent('onautocomplete', {\n bubbles: true, cancelable: true, detail: null,\n });\n\n // no autofill if preventDefault is called\n if (!element.dispatchEvent(event)) {\n element.value = '';\n }\n}\n\n/**\n * Manage an input element when its autocompleted value is\n * removed by the browser in the following steps:\n * - remove [autocompleted] attribute from event.target\n * - create 'onautocomplete' non-cancelable CustomEvent\n * - dispatch the Event\n *\n * @param {HtmlInputElement} element\n */\nfunction apbctCancelAutocomplete(element) {\n if (!element.hasAttribute('autocompleted')) return;\n element.removeAttribute('autocompleted');\n\n // dispatch event\n element.dispatchEvent(new window.CustomEvent('onautocomplete', {\n bubbles: true, cancelable: false, detail: null,\n }));\n}\n\n/**\n * ctNoCookieAttachHiddenFieldsToForms\n */\nfunction ctNoCookieAttachHiddenFieldsToForms() {\n if (ctPublic.data__cookies_type !== 'none') {\n return;\n }\n\n let forms = ctGetPageForms();\n\n if (forms) {\n for ( let i = 0; i < forms.length; i++ ) {\n if ( new ApbctHandler().checkHiddenFieldsExclusions(document.forms[i], 'no_cookie') ) {\n continue;\n }\n\n // ignore forms with get method @todo We need to think about this\n if (document.forms[i].getAttribute('method') === null ||\n document.forms[i].getAttribute('method').toLowerCase() === 'post') {\n // remove old sets\n let fields = forms[i].querySelectorAll('.ct_no_cookie_hidden_field');\n for ( let j = 0; j < fields.length; j++ ) {\n fields[j].outerHTML = '';\n }\n // add new set\n document.forms[i].append(new ApbctAttachData().constructNoCookieHiddenField());\n }\n }\n }\n}\n"],"names":["ApbctGatheringData","setSessionId","sessionID","apbctSessionStorage","isSet","apbctLocalStorage","set","Number","get","Math","random","toString","replace","substr","document","referrer","URL","host","location","writeReferrersToSessionStorage","sessionCurrentPage","href","setCookiesType","cookiesType","ctPublic","data__cookies_type","delete","startFieldsListening","this","setTimeout","listenAutocomplete","window","addEventListener","apbctOnAnimationStart","apbctOnInput","gatheringTypoData","ctTypoData","CTTypoData","gatheringFields","setListeners","gatheringMouseData","ApbctCollectingUserMouseActivity","getScreenInfo","docEl","documentElement","body","layoutData","scrollWidth","bodyScrollHeight","scrollHeight","docScrollHeight","bodyOffsetHeight","offsetHeight","docOffsetHeight","bodyClientHeight","clientHeight","docClientHeight","docClientWidth","clientWidth","JSON","stringify","fullWidth","fullHeight","max","visibleWidth","visibleHeight","restartFieldsListening","undefined","ctGetCookie","let","forms","ctGetPageForms","handled_fields","length","i","handledFormFields","querySelectorAll","type","push","apbct_attach_event_handler","ctFunctionHasInputFocused","ctFunctionHasKeyUp","elementBody","querySelector","collectionForms","constructor","checkElementInForms","event","getSelection","addSelected","addTarget","resultCheck","target","outerHTML","innerHTML","indexOf","addClicks","trackMouseMovement","ctCollectingUserActivityData","clicks","selected","mouseMovementsInsideForm","fieldData","isAutoFill","isUseBuffer","speedDelta","firstKeyTimestamp","lastKeyTimestamp","lastDelta","countOfKey","fields","data","Array","prototype","slice","call","forEach","field","Object","assign","currentDelta","time","Date","abs","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctMouseReadInterval","ctMouseWriteDataInterval","ctFunctionFirstKey","KeyTimestamp","floor","ctSetCookie","ctKeyStopStopListening","ctMouseStopData","apbct_remove_event_handler","ctFunctionMouseMove","clearInterval","data__key_is_ok","setInterval","ctSetMouseMoved","round","clientY","clientX","ctSetHasScrolled","ctStopFieldsListening","eventName","functionName","ctSetHasInputFocused","ctSetHasKeyUp","force_alt_cookies","getJavascriptClientData","commonCookies","resultDataJson","ct_checked_emails","ctPublicFunctions","cookiePrefix","ct_checked_emails_exist","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","apbctPageHits","apbctPrevReferer","apbctSiteReferer","ctJsErrorsLocalStorage","ctPixelUrl","apbctHeadless","ctBotDetectorFrontendDataLog","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ctCookiesPixelUrl","apbctHeadlessNative","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","apbct_pixel_url","apbct_headless","ct_bot_detector_frontend_data_log","decodeURIComponent","apbct_page_hits","apbct_prev_referer","apbct_site_referer","apbct_ct_js_errors","pixel__url","console","log","removeDoubleJsonEncoding","ctIsDrawPixel","pixel__setting","settings__data__bot_detector_enabled","pixel__enabled","ctSetPixelImg","pixelUrl","insertedImg","getElementById","createElement","setAttribute","apbct","append","ctSetPixelImgFromLocalstorage","ctGetPixelUrl","localStoragePixelUrl","isAlive","data__ajax_type","apbct_public_sendREST","method","callback","result","String","ctNoCookieAttachHiddenFieldsToForms","apbct_public_sendAJAX","action","notJson","beforeSend","xhr","setRequestHeader","ctSetPixelUrlLocalstorage","ajaxPixelUrl","animationName","apbctAutocomplete","apbctCancelAutocomplete","inputType","element","hasAttribute","CustomEvent","bubbles","cancelable","detail","dispatchEvent","value","removeAttribute","ApbctHandler","checkHiddenFieldsExclusions","getAttribute","toLowerCase","j","ApbctAttachData","constructNoCookieHiddenField"],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"public-2-gathering-data.min.js","sources":["public-2-gathering-data.js"],"sourcesContent":["/**\n * Class for gathering data\n */\nclass ApbctGatheringData { // eslint-disable-line no-unused-vars\n /**\n * Set session ID\n * @return {void}\n */\n setSessionId() {\n if (!apbctSessionStorage.isSet('apbct_session_id')) {\n const sessionID = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);\n apbctSessionStorage.set('apbct_session_id', sessionID, false);\n apbctLocalStorage.set('apbct_page_hits', 1);\n if (document.referrer) {\n let urlReferer = new URL(document.referrer);\n if (urlReferer.host !== location.host) {\n apbctSessionStorage.set('apbct_site_referer', document.referrer, false);\n }\n }\n } else {\n apbctLocalStorage.set('apbct_page_hits', Number(apbctLocalStorage.get('apbct_page_hits')) + 1);\n }\n }\n\n /**\n * Set three statements to the sessions storage: apbct_session_current_page, apbct_prev_referer.\n * @return {void}\n */\n writeReferrersToSessionStorage() {\n const sessionCurrentPage = apbctSessionStorage.get('apbct_session_current_page');\n // set session apbct_referer\n if (sessionCurrentPage!== false && document.location.href !== sessionCurrentPage) {\n apbctSessionStorage.set('apbct_prev_referer', sessionCurrentPage, false);\n }\n // set session current page to know referrer\n apbctSessionStorage.set('apbct_session_current_page', document.location.href, false);\n }\n\n /**\n * Set cookies type.\n * If it's not set or not equal to ctPublic.data__cookies_type, clear ct_mouse_moved and ct_has_scrolled values.\n * @return {void}\n */\n setCookiesType() {\n const cookiesType = apbctLocalStorage.get('ct_cookies_type');\n if ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n apbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n apbctLocalStorage.delete('ct_mouse_moved');\n apbctLocalStorage.delete('ct_has_scrolled');\n }\n }\n\n /**\n * Start fields listening\n * @return {void}\n */\n startFieldsListening() {\n if (ctPublic.data__cookies_type !== 'alternative') {\n this.startFieldsListening();\n // 2nd try to add listeners for delayed appears forms\n setTimeout(this.startFieldsListening, 1000);\n }\n }\n\n /**\n * Listen autocomplete\n * @return {void}\n */\n listenAutocomplete() {\n window.addEventListener('animationstart', this.apbctOnAnimationStart, true);\n window.addEventListener('input', this.apbctOnInput, true);\n }\n\n /**\n * Gathering typo data\n * @return {void}\n */\n gatheringTypoData() {\n document.ctTypoData = new CTTypoData();\n document.ctTypoData.gatheringFields();\n document.ctTypoData.setListeners();\n }\n\n /**\n * Gathering mouse data\n * @return {void}\n */\n gatheringMouseData() {\n new ApbctCollectingUserMouseActivity();\n }\n\n /**\n * Get screen info\n * @return {string}\n */\n getScreenInfo() {\n // Batch all layout-triggering property reads to avoid forced synchronous layouts\n const docEl = document.documentElement;\n const body = document.body;\n\n // Read all layout properties in one batch\n const layoutData = {\n scrollWidth: docEl.scrollWidth,\n bodyScrollHeight: body.scrollHeight,\n docScrollHeight: docEl.scrollHeight,\n bodyOffsetHeight: body.offsetHeight,\n docOffsetHeight: docEl.offsetHeight,\n bodyClientHeight: body.clientHeight,\n docClientHeight: docEl.clientHeight,\n docClientWidth: docEl.clientWidth,\n };\n\n return JSON.stringify({\n fullWidth: layoutData.scrollWidth,\n fullHeight: Math.max(\n layoutData.bodyScrollHeight, layoutData.docScrollHeight,\n layoutData.bodyOffsetHeight, layoutData.docOffsetHeight,\n layoutData.bodyClientHeight, layoutData.docClientHeight,\n ),\n visibleWidth: layoutData.docClientWidth,\n visibleHeight: layoutData.docClientHeight,\n });\n }\n\n /**\n * Restart listen fields to set ct_has_input_focused or ct_has_key_up\n * @return {void}\n */\n restartFieldsListening() {\n if (!apbctLocalStorage.isSet('ct_has_input_focused') && !apbctLocalStorage.isSet('ct_has_key_up')) {\n this.startFieldsListening();\n }\n }\n\n /**\n * Init listeners for keyup and focus events\n * @return {void}\n */\n startFieldsListening() {\n if (\n (apbctLocalStorage.isSet('ct_has_key_up') || apbctLocalStorage.get('ct_has_key_up')) &&\n (apbctLocalStorage.isSet('ct_has_input_focused') || apbctLocalStorage.get('ct_has_input_focused')) &&\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') !== undefined &&\n ctGetCookie('ct_has_key_up') !== undefined\n )\n ) {\n // already set\n return;\n }\n\n let forms = ctGetPageForms();\n ctPublic.handled_fields = [];\n\n if (forms.length > 0) {\n for (let i = 0; i < forms.length; i++) {\n // handle only inputs and textareas\n const handledFormFields = forms[i].querySelectorAll('input,textarea');\n for (let i = 0; i < handledFormFields.length; i++) {\n if (handledFormFields[i].type !== 'hidden') {\n // collect handled fields to remove handler in the future\n ctPublic.handled_fields.push(handledFormFields[i]);\n // do attach handlers\n apbct_attach_event_handler(handledFormFields[i], 'focus', ctFunctionHasInputFocused);\n apbct_attach_event_handler(handledFormFields[i], 'keyup', ctFunctionHasKeyUp);\n }\n }\n }\n }\n }\n}\n\n/**\n * Class collecting user mouse activity data\n *\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nclass ApbctCollectingUserMouseActivity {\n elementBody = document.querySelector('body');\n collectionForms = document.forms;\n /**\n * Constructor\n */\n constructor() {\n this.setListeners();\n }\n\n /**\n * Set listeners\n */\n setListeners() {\n this.elementBody.addEventListener('click', (event) => {\n this.checkElementInForms(event, 'addClicks');\n });\n\n this.elementBody.addEventListener('mouseup', (event) => {\n const selectedType = document.getSelection().type.toString();\n if (selectedType == 'Range') {\n this.addSelected();\n }\n });\n\n this.elementBody.addEventListener('mousemove', (event) => {\n this.checkElementInForms(event, 'trackMouseMovement');\n });\n }\n\n /**\n * Checking if there is an element in the form\n * @param {object} event\n * @param {string} addTarget\n */\n checkElementInForms(event, addTarget) {\n let resultCheck;\n for (let i = 0; i < this.collectionForms.length; i++) {\n if (\n event.target.outerHTML.length > 0 &&\n this.collectionForms[i].innerHTML.length > 0\n ) {\n resultCheck = this.collectionForms[i].innerHTML.indexOf(event.target.outerHTML);\n } else {\n resultCheck = -1;\n }\n }\n\n switch (addTarget) {\n case 'addClicks':\n if (resultCheck < 0) {\n this.addClicks();\n }\n break;\n case 'trackMouseMovement':\n if (resultCheck > -1) {\n this.trackMouseMovement();\n }\n break;\n default:\n break;\n }\n }\n\n /**\n * Add clicks\n */\n addClicks() {\n if (document.ctCollectingUserActivityData) {\n if (document.ctCollectingUserActivityData.clicks) {\n document.ctCollectingUserActivityData.clicks++;\n } else {\n document.ctCollectingUserActivityData.clicks = 1;\n }\n return;\n }\n\n document.ctCollectingUserActivityData = {clicks: 1};\n }\n\n /**\n * Add selected\n */\n addSelected() {\n if (document.ctCollectingUserActivityData) {\n if (document.ctCollectingUserActivityData.selected) {\n document.ctCollectingUserActivityData.selected++;\n } else {\n document.ctCollectingUserActivityData.selected = 1;\n }\n return;\n }\n\n document.ctCollectingUserActivityData = {selected: 1};\n }\n\n /**\n * Track mouse movement\n */\n trackMouseMovement() {\n if (!document.ctCollectingUserActivityData) {\n document.ctCollectingUserActivityData = {};\n }\n if (!document.ctCollectingUserActivityData.mouseMovementsInsideForm) {\n document.ctCollectingUserActivityData.mouseMovementsInsideForm = false;\n }\n\n document.ctCollectingUserActivityData.mouseMovementsInsideForm = true;\n }\n}\n\n/**\n * Class for gathering data about user typing.\n *\n * ==============================\n * isAutoFill - only person can use auto fill\n * isUseBuffer - use buffer for fill current field\n * ==============================\n * lastKeyTimestamp - timestamp of last key press in current field\n * speedDelta - change for each key press in current field,\n * as difference between current and previous key press timestamps,\n * robots in general have constant speed of typing.\n * If speedDelta is constant for each key press in current field,\n * so, speedDelta will be roughly to 0, then it is robot.\n * ==============================\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nclass CTTypoData {\n fieldData = {\n isAutoFill: false,\n isUseBuffer: false,\n speedDelta: 0,\n firstKeyTimestamp: 0,\n lastKeyTimestamp: 0,\n lastDelta: 0,\n countOfKey: 0,\n };\n\n fields = document.querySelectorAll('textarea[name=comment]');\n\n data = [];\n\n /**\n * Gather fields.\n */\n gatheringFields() {\n let fieldSet = Array.prototype.slice.call(this.fields);\n fieldSet.forEach((field, i) => {\n this.data.push(Object.assign({}, this.fieldData));\n });\n }\n\n /**\n * Set listeners.\n */\n setListeners() {\n this.fields.forEach((field, i) => {\n field.addEventListener('paste', () => {\n this.data[i].isUseBuffer = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('onautocomplete', () => {\n this.data[i].isAutoFill = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('input', () => {\n this.data[i].countOfKey++;\n let time = + new Date();\n let currentDelta = 0;\n\n if (this.data[i].countOfKey === 1) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].firstKeyTimestamp = time;\n return;\n }\n\n currentDelta = time - this.data[i].lastKeyTimestamp;\n if (this.data[i].countOfKey === 2) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n return;\n }\n\n if (this.data[i].countOfKey > 2) {\n this.data[i].speedDelta += Math.abs(this.data[i].lastDelta - currentDelta);\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n }\n });\n });\n }\n}\n\n// eslint-disable-next-line camelcase\nconst ctTimeMs = new Date().getTime();\nlet ctMouseEventTimerFlag = true; // Reading interval flag\nlet ctMouseData = [];\nlet ctMouseDataCounter = 0;\nlet ctMouseReadInterval;\nlet ctMouseWriteDataInterval;\n\n\n// Writing first key press timestamp\nconst ctFunctionFirstKey = function output(event) {\n let KeyTimestamp = Math.floor(new Date().getTime() / 1000);\n ctSetCookie('ct_fkp_timestamp', KeyTimestamp);\n ctKeyStopStopListening();\n};\n\n/**\n * Stop mouse observing function\n */\nfunction ctMouseStopData() {\n apbct_remove_event_handler(document, 'mousemove', ctFunctionMouseMove);\n clearInterval(ctMouseReadInterval);\n clearInterval(ctMouseWriteDataInterval);\n}\n\n\n// mouse read\nif (ctPublic.data__key_is_ok) {\n // Reading interval\n ctMouseReadInterval = setInterval(function() {\n ctMouseEventTimerFlag = true;\n }, 150);\n\n // Writting interval\n ctMouseWriteDataInterval = setInterval(function() {\n ctSetCookie('ct_pointer_data', JSON.stringify(ctMouseData));\n }, 1200);\n}\n\n// Logging mouse position each 150 ms\nconst ctFunctionMouseMove = function output(event) {\n ctSetMouseMoved();\n if (ctMouseEventTimerFlag === true) {\n ctMouseData.push([\n Math.round(event.clientY),\n Math.round(event.clientX),\n Math.round(new Date().getTime() - ctTimeMs),\n ]);\n\n ctMouseDataCounter++;\n ctMouseEventTimerFlag = false;\n if (ctMouseDataCounter >= 50) {\n ctMouseStopData();\n }\n }\n};\n\n/**\n * Stop key listening function\n */\nfunction ctKeyStopStopListening() {\n apbct_remove_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_remove_event_handler(document, 'keydown', ctFunctionFirstKey);\n}\n\n/**\n * ctSetHasScrolled\n */\nfunction ctSetHasScrolled() {\n if ( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n ctSetCookie('ct_has_scrolled', 'true');\n apbctLocalStorage.set('ct_has_scrolled', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_scrolled') === undefined\n ) {\n ctSetCookie('ct_has_scrolled', 'true');\n }\n}\n\n/**\n * ctSetMouseMoved\n */\nfunction ctSetMouseMoved() {\n if ( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n ctSetCookie('ct_mouse_moved', 'true');\n apbctLocalStorage.set('ct_mouse_moved', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_mouse_moved') === undefined\n ) {\n ctSetCookie('ct_mouse_moved', 'true');\n }\n}\n\n/**\n * stop listening keyup and focus\n * @param {string} eventName\n * @param {string} functionName\n */\nfunction ctStopFieldsListening(eventName, functionName) {\n if (typeof ctPublic.handled_fields !== 'undefined' && ctPublic.handled_fields.length > 0) {\n for (let i = 0; i < ctPublic.handled_fields.length; i++) {\n apbct_remove_event_handler(ctPublic.handled_fields[i], eventName, functionName);\n }\n }\n}\n\nlet ctFunctionHasInputFocused = function output(event) {\n ctSetHasInputFocused();\n ctStopFieldsListening('focus', ctFunctionHasInputFocused);\n};\n\nlet ctFunctionHasKeyUp = function output(event) {\n ctSetHasKeyUp();\n ctStopFieldsListening('keyup', ctFunctionHasKeyUp);\n};\n\n/**\n * set ct_has_input_focused ct_has_key_up cookies on session period\n */\nfunction ctSetHasInputFocused() {\n if ( ! apbctLocalStorage.isSet('ct_has_input_focused') || ! apbctLocalStorage.get('ct_has_input_focused') ) {\n apbctLocalStorage.set('ct_has_input_focused', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_input_focused', 'true');\n }\n}\n\n/**\n * ctSetHasKeyUp\n */\nfunction ctSetHasKeyUp() {\n if ( ! apbctLocalStorage.isSet('ct_has_key_up') || ! apbctLocalStorage.get('ct_has_key_up') ) {\n apbctLocalStorage.set('ct_has_key_up', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_key_up') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_key_up', 'true');\n }\n}\n\nif (ctPublic.data__key_is_ok) {\n apbct_attach_event_handler(document, 'mousemove', ctFunctionMouseMove);\n apbct_attach_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'keydown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'scroll', ctSetHasScrolled);\n}\n\n/**\n * @param {mixed} commonCookies\n * @return {string}\n */\nfunction getJavascriptClientData(commonCookies = []) { // eslint-disable-line no-unused-vars\n let resultDataJson = {};\n\n resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n resultDataJson.ct_checked_emails_exist = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails_exist');\n resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n // collecting data from localstorage\n const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const apbctPageHits = apbctLocalStorage.get('apbct_page_hits');\n const apbctPrevReferer = apbctSessionStorage.get('apbct_prev_referer');\n const apbctSiteReferer = apbctSessionStorage.get('apbct_site_referer');\n const ctJsErrorsLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_js_errors');\n const ctPixelUrl = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadless = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n const ctBotDetectorFrontendDataLog = apbctLocalStorage.get(\n ctPublicFunctions.cookiePrefix + 'ct_bot_detector_frontend_data_log',\n );\n\n // collecting data from cookies\n const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const ctCookiesPixelUrl = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadlessNative = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\n\n resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ?\n ctMouseMovedLocalStorage : ctMouseMovedCookie;\n resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ?\n ctHasScrolledLocalStorage : ctHasScrolledCookie;\n resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ?\n ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n resultDataJson.apbct_pixel_url = ctPixelUrl !== undefined ?\n ctPixelUrl : ctCookiesPixelUrl;\n resultDataJson.apbct_headless = apbctHeadless !== undefined ?\n apbctHeadless : apbctHeadlessNative;\n resultDataJson.ct_bot_detector_frontend_data_log = ctBotDetectorFrontendDataLog !== undefined ?\n ctBotDetectorFrontendDataLog : '';\n if (resultDataJson.apbct_pixel_url && typeof(resultDataJson.apbct_pixel_url) == 'string') {\n if (resultDataJson.apbct_pixel_url.indexOf('%3A%2F')) {\n resultDataJson.apbct_pixel_url = decodeURIComponent(resultDataJson.apbct_pixel_url);\n }\n }\n\n resultDataJson.apbct_page_hits = apbctPageHits;\n resultDataJson.apbct_prev_referer = apbctPrevReferer;\n resultDataJson.apbct_site_referer = apbctSiteReferer;\n resultDataJson.apbct_ct_js_errors = ctJsErrorsLocalStorage;\n\n if (!resultDataJson.apbct_pixel_url) {\n resultDataJson.apbct_pixel_url = ctPublic.pixel__url;\n }\n\n if (typeof (commonCookies) === 'object') {\n for (let i = 0; i < commonCookies.length; ++i) {\n if ( typeof (commonCookies[i][1]) === 'object' ) {\n // this is for handle SFW cookies\n resultDataJson[commonCookies[i][1][0]] = commonCookies[i][1][1];\n } else {\n resultDataJson[commonCookies[i][0]] = commonCookies[i][1];\n }\n }\n } else {\n console.log('APBCT JS ERROR: Collecting data type mismatch');\n }\n\n // Parse JSON properties to prevent double JSON encoding\n resultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\n return JSON.stringify(resultDataJson);\n}\n\n/**\n * @return {bool}\n */\nfunction ctIsDrawPixel() {\n if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {\n return false;\n }\n\n return +ctPublic.pixel__enabled ||\n (ctPublic.data__cookies_type === 'none' && document.querySelectorAll('img#apbct_pixel').length === 0) ||\n (ctPublic.data__cookies_type === 'alternative' && document.querySelectorAll('img#apbct_pixel').length === 0);\n}\n\n/**\n * @param {string} pixelUrl\n * @return {bool}\n */\nfunction ctSetPixelImg(pixelUrl) {\n if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {\n return false;\n }\n ctSetCookie('apbct_pixel_url', pixelUrl);\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', pixelUrl);\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n * @return {bool}\n */\nfunction ctSetPixelImgFromLocalstorage(pixelUrl) {\n if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {\n return false;\n }\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', decodeURIComponent(pixelUrl));\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * ctGetPixelUrl\n * @return {bool}\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nfunction ctGetPixelUrl() {\n if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {\n return false;\n }\n\n // Check if pixel is already in localstorage and is not outdated\n let localStoragePixelUrl = apbctLocalStorage.get('apbct_pixel_url');\n if ( localStoragePixelUrl !== false ) {\n if ( ! apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n apbctLocalStorage.delete('apbct_pixel_url');\n } else {\n // if so - load pixel from localstorage and draw it skipping AJAX\n ctSetPixelImgFromLocalstorage(localStoragePixelUrl);\n return;\n }\n }\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_get_pixel_url',\n {\n method: 'POST',\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n // Using AJAX request and handler\n } else {\n apbct_public_sendAJAX(\n {\n action: 'apbct_get_pixel_url',\n },\n {\n notJson: true,\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetPixelUrlLocalstorage(ajaxPixelUrl) {\n // set pixel to the storage\n ctSetCookie('apbct_pixel_url', ajaxPixelUrl);\n}\n\n/**\n * Handler for -webkit based browser that listen for a custom\n * animation create using the :pseudo-selector in the stylesheet.\n * Works with Chrome, Safari\n *\n * @param {AnimationEvent} event\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctOnAnimationStart(event) {\n ('onautofillstart' === event.animationName) ?\n apbctAutocomplete(event.target) : apbctCancelAutocomplete(event.target);\n}\n\n/**\n * Handler for non-webkit based browser that listen for input\n * event to trigger the autocomplete-cancel process.\n * Works with Firefox, Edge, IE11\n *\n * @param {InputEvent} event\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctOnInput(event) {\n ('insertReplacementText' === event.inputType || !('data' in event)) ?\n apbctAutocomplete(event.target) : apbctCancelAutocomplete(event.target);\n}\n\n/**\n * Manage an input element when its value is autocompleted\n * by the browser in the following steps:\n * - add [autocompleted] attribute from event.target\n * - create 'onautocomplete' cancelable CustomEvent\n * - dispatch the Event\n *\n * @param {HtmlInputElement} element\n */\nfunction apbctAutocomplete(element) {\n if (element.hasAttribute('autocompleted')) return;\n element.setAttribute('autocompleted', '');\n\n let event = new window.CustomEvent('onautocomplete', {\n bubbles: true, cancelable: true, detail: null,\n });\n\n // no autofill if preventDefault is called\n if (!element.dispatchEvent(event)) {\n element.value = '';\n }\n}\n\n/**\n * Manage an input element when its autocompleted value is\n * removed by the browser in the following steps:\n * - remove [autocompleted] attribute from event.target\n * - create 'onautocomplete' non-cancelable CustomEvent\n * - dispatch the Event\n *\n * @param {HtmlInputElement} element\n */\nfunction apbctCancelAutocomplete(element) {\n if (!element.hasAttribute('autocompleted')) return;\n element.removeAttribute('autocompleted');\n\n // dispatch event\n element.dispatchEvent(new window.CustomEvent('onautocomplete', {\n bubbles: true, cancelable: false, detail: null,\n }));\n}\n\n/**\n * ctNoCookieAttachHiddenFieldsToForms\n */\nfunction ctNoCookieAttachHiddenFieldsToForms() {\n if (ctPublic.data__cookies_type !== 'none') {\n return;\n }\n\n let forms = ctGetPageForms();\n\n if (forms) {\n for ( let i = 0; i < forms.length; i++ ) {\n if ( new ApbctHandler().checkHiddenFieldsExclusions(document.forms[i], 'no_cookie') ) {\n continue;\n }\n\n // ignore forms with get method @todo We need to think about this\n if (document.forms[i].getAttribute('method') === null ||\n document.forms[i].getAttribute('method').toLowerCase() === 'post') {\n // remove old sets\n let fields = forms[i].querySelectorAll('.ct_no_cookie_hidden_field');\n for ( let j = 0; j < fields.length; j++ ) {\n fields[j].outerHTML = '';\n }\n // add new set\n document.forms[i].append(new ApbctAttachData().constructNoCookieHiddenField());\n }\n }\n }\n}\n"],"names":["ApbctGatheringData","setSessionId","sessionID","apbctSessionStorage","isSet","apbctLocalStorage","set","Number","get","Math","random","toString","replace","substr","document","referrer","URL","host","location","writeReferrersToSessionStorage","sessionCurrentPage","href","setCookiesType","cookiesType","ctPublic","data__cookies_type","delete","startFieldsListening","this","setTimeout","listenAutocomplete","window","addEventListener","apbctOnAnimationStart","apbctOnInput","gatheringTypoData","ctTypoData","CTTypoData","gatheringFields","setListeners","gatheringMouseData","ApbctCollectingUserMouseActivity","getScreenInfo","docEl","documentElement","body","layoutData","scrollWidth","bodyScrollHeight","scrollHeight","docScrollHeight","bodyOffsetHeight","offsetHeight","docOffsetHeight","bodyClientHeight","clientHeight","docClientHeight","docClientWidth","clientWidth","JSON","stringify","fullWidth","fullHeight","max","visibleWidth","visibleHeight","restartFieldsListening","undefined","ctGetCookie","let","forms","ctGetPageForms","handled_fields","length","i","handledFormFields","querySelectorAll","type","push","apbct_attach_event_handler","ctFunctionHasInputFocused","ctFunctionHasKeyUp","elementBody","querySelector","collectionForms","constructor","checkElementInForms","event","getSelection","addSelected","addTarget","resultCheck","target","outerHTML","innerHTML","indexOf","addClicks","trackMouseMovement","ctCollectingUserActivityData","clicks","selected","mouseMovementsInsideForm","fieldData","isAutoFill","isUseBuffer","speedDelta","firstKeyTimestamp","lastKeyTimestamp","lastDelta","countOfKey","fields","data","Array","prototype","slice","call","forEach","field","Object","assign","currentDelta","time","Date","abs","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctMouseReadInterval","ctMouseWriteDataInterval","ctFunctionFirstKey","KeyTimestamp","floor","ctSetCookie","ctKeyStopStopListening","ctMouseStopData","apbct_remove_event_handler","ctFunctionMouseMove","clearInterval","data__key_is_ok","setInterval","ctSetMouseMoved","round","clientY","clientX","ctSetHasScrolled","ctStopFieldsListening","eventName","functionName","ctSetHasInputFocused","ctSetHasKeyUp","force_alt_cookies","getJavascriptClientData","commonCookies","resultDataJson","ct_checked_emails","ctPublicFunctions","cookiePrefix","ct_checked_emails_exist","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","apbctPageHits","apbctPrevReferer","apbctSiteReferer","ctJsErrorsLocalStorage","ctPixelUrl","apbctHeadless","ctBotDetectorFrontendDataLog","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ctCookiesPixelUrl","apbctHeadlessNative","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","apbct_pixel_url","apbct_headless","ct_bot_detector_frontend_data_log","decodeURIComponent","apbct_page_hits","apbct_prev_referer","apbct_site_referer","apbct_ct_js_errors","pixel__url","console","log","removeDoubleJsonEncoding","ctIsDrawPixel","pixel__setting","bot_detector_enabled","pixel__enabled","ctSetPixelImg","pixelUrl","insertedImg","getElementById","createElement","setAttribute","apbct","append","ctSetPixelImgFromLocalstorage","ctGetPixelUrl","localStoragePixelUrl","isAlive","data__ajax_type","apbct_public_sendREST","method","callback","result","String","ctNoCookieAttachHiddenFieldsToForms","apbct_public_sendAJAX","action","notJson","beforeSend","xhr","setRequestHeader","ctSetPixelUrlLocalstorage","ajaxPixelUrl","animationName","apbctAutocomplete","apbctCancelAutocomplete","inputType","element","hasAttribute","CustomEvent","bubbles","cancelable","detail","dispatchEvent","value","removeAttribute","ApbctHandler","checkHiddenFieldsExclusions","getAttribute","toLowerCase","j","ApbctAttachData","constructNoCookieHiddenField"],"mappings":"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"} \ No newline at end of file diff --git a/js/src/FetchProxyProtection/ApbctFetchProxyProtection.js b/js/src/FetchProxyProtection/ApbctFetchProxyProtection.js index 7d143fb05..a05926168 100644 --- a/js/src/FetchProxyProtection/ApbctFetchProxyProtection.js +++ b/js/src/FetchProxyProtection/ApbctFetchProxyProtection.js @@ -48,7 +48,7 @@ class ApbctFetchProxyProtection { data.raw_body = bodyText; } - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventToken = new ApbctHandler().toolGetEventToken(); if (eventToken) { data.ct_bot_detector_event_token = eventToken; @@ -133,4 +133,4 @@ class ApbctFetchProxyProtection { const bodyText = this.extractBodyText(args); return await this.checkRequest(match.formKey, match.config, bodyText); } -} \ No newline at end of file +} diff --git a/js/src/common-decoder.js b/js/src/common-decoder.js index 39d1c9f85..ee26f902d 100644 --- a/js/src/common-decoder.js +++ b/js/src/common-decoder.js @@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) { referrer: document.referrer, encodedEmails: '', }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); diff --git a/js/src/public-1-functions.js b/js/src/public-1-functions.js index 5e27ff3f7..793f270b4 100644 --- a/js/src/public-1-functions.js +++ b/js/src/public-1-functions.js @@ -135,7 +135,7 @@ function ctSetCookie( cookies, value, expires ) { // do it just once ctSetAlternativeCookie(cookies, {forceAltCookies: true}); } else { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { ctNoCookieAttachHiddenFieldsToForms(); } } @@ -173,7 +173,7 @@ function ctSetAlternativeCookie(cookies, params) { if (Array.isArray(cookies)) { cookies = getJavascriptClientData(cookies); } - } else if (!+ctPublic.settings__data__bot_detector_enabled) { + } else if (!+ctPublic.bot_detector_enabled) { console.log('APBCT ERROR: getJavascriptClientData() is not loaded'); } diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index 89ef4b69c..6f59f5082 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -92,7 +92,7 @@ class ApbctAttachData { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -162,7 +162,7 @@ class ApbctAttachData { event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1 ) { window.XMLHttpRequest.prototype.send = function(data) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.bot_detector_enabled) { const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&'; defaultSend.call(this, noCookieData + data); } else { @@ -477,7 +477,7 @@ class ApbctHandler { cronFormsHandler(cronStartTimeout = 2000) { setTimeout(function() { setInterval(function() { - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().restartFieldsListening(); } new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach(); @@ -550,7 +550,7 @@ class ApbctHandler { let addidionalCleantalkData = ''; if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -567,7 +567,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckFormData) { if (!( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') )) { let noCookieData = getNoCookieData(); @@ -625,7 +625,7 @@ class ApbctHandler { args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { args[1].body.append( @@ -785,7 +785,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -801,7 +801,7 @@ class ApbctHandler { try { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } catch (e) { // Continue even if error @@ -822,7 +822,7 @@ class ApbctHandler { if (+ctPublic.settings__forms__wc_add_to_cart) { args[1].body = attachFieldsToBody( args[1].body, - selectFieldsData(+ctPublic.settings__data__bot_detector_enabled), + selectFieldsData(+ctPublic.bot_detector_enabled), ); } } catch (e) { @@ -1051,7 +1051,7 @@ class ApbctHandler { let noCookieData = ''; let visibleFieldsString = ''; if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { const token = new ApbctHandler().toolGetEventToken(); @@ -1117,7 +1117,7 @@ class ApbctHandler { options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { let token = localStorage.getItem('bot_detector_event_token'); @@ -1132,7 +1132,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { if ( - +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token') ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); @@ -1654,7 +1654,7 @@ async function apbct_ready() { if ( apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit - +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active + +ctPublic.bot_detector_enabled && // If Bot-Detector is active !apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet ) { @@ -1673,7 +1673,7 @@ async function apbct_ready() { // Gathering data when bot detector is disabled if ( - ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) && typeof ApbctGatheringData !== 'undefined' ) { const gatheringData = new ApbctGatheringData(); @@ -1695,7 +1695,7 @@ async function apbct_ready() { setTimeout(function() { // Attach data when bot detector is enabled - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { const eventTokenTransport = new ApbctEventTokenTransport(); eventTokenTransport.attachEventTokenToMultipageGravityForms(); eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart(); @@ -1704,7 +1704,7 @@ async function apbct_ready() { const attachData = new ApbctAttachData(); // Attach data when bot detector is disabled or blocked - if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + if (!+ctPublic.bot_detector_enabled || gatheringLoaded) { attachData.attachHiddenFieldsToForms(gatheringLoaded); } @@ -1731,7 +1731,7 @@ async function apbct_ready() { handler.catchJqueryAjax(); handler.catchWCRestRequestAsMiddleware(); - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.bot_detector_enabled) { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; @@ -1751,7 +1751,7 @@ async function apbct_ready() { }); } - if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { + if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } diff --git a/js/src/public-2-external-forms.js b/js/src/public-2-external-forms.js index 804ce37c8..080c216a1 100644 --- a/js/src/public-2-external-forms.js +++ b/js/src/public-2-external-forms.js @@ -66,7 +66,7 @@ function ctProtectExternal() { // Trying to process external form into an iframe apbctProcessIframes(); // if form is still not processed by fields listening, do it here - if (ctPublic.settings__data__bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') { + if (ctPublic.bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') { new ApbctGatheringData().startFieldsListening(); } } diff --git a/js/src/public-2-force-protection.js b/js/src/public-2-force-protection.js index d1383be43..5ca2982ab 100644 --- a/js/src/public-2-force-protection.js +++ b/js/src/public-2-force-protection.js @@ -34,7 +34,7 @@ class ApbctForceProtection { post_url: document.location.href, referrer: document.referrer, }; - if (ctPublic.settings__data__bot_detector_enabled == 1) { + if (+ctPublic.bot_detector_enabled) { data.event_token = apbctLocalStorage.get('bot_detector_event_token'); } else { data.event_javascript_data = getJavascriptClientData(); diff --git a/js/src/public-2-gathering-data.js b/js/src/public-2-gathering-data.js index d36444c5d..de8463ed1 100644 --- a/js/src/public-2-gathering-data.js +++ b/js/src/public-2-gathering-data.js @@ -643,7 +643,7 @@ function getJavascriptClientData(commonCookies = []) { // eslint-disable-line no * @return {bool} */ function ctIsDrawPixel() { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } @@ -657,7 +657,7 @@ function ctIsDrawPixel() { * @return {bool} */ function ctSetPixelImg(pixelUrl) { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } ctSetCookie('apbct_pixel_url', pixelUrl); @@ -679,7 +679,7 @@ function ctSetPixelImg(pixelUrl) { * @return {bool} */ function ctSetPixelImgFromLocalstorage(pixelUrl) { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } if ( ctIsDrawPixel() ) { @@ -701,7 +701,7 @@ function ctSetPixelImgFromLocalstorage(pixelUrl) { */ // eslint-disable-next-line no-unused-vars, require-jsdoc function ctGetPixelUrl() { - if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') { + if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) { return false; } diff --git a/js/src/public-3-bot-detector-log.js b/js/src/public-3-bot-detector-log.js index 051619e14..6630a29e6 100644 --- a/js/src/public-3-bot-detector-log.js +++ b/js/src/public-3-bot-detector-log.js @@ -3,8 +3,8 @@ let botDetectorLogEventTypesCollected = []; // bot_detector frontend_data log alt session saving cron if ( - ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') && - ctPublicFunctions.data__bot_detector_enabled == 1 && + ctPublicFunctions.hasOwnProperty('bot_detector_enabled') && + +ctPublicFunctions.bot_detector_enabled && ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') && ctPublicFunctions.data__frontend_data_log_enabled == 1 ) { diff --git a/lib/Cleantalk/ApbctWP/ApbctJsBundleResolver.php b/lib/Cleantalk/ApbctWP/ApbctJsBundleResolver.php index dd88c3c68..ad0721c35 100644 --- a/lib/Cleantalk/ApbctWP/ApbctJsBundleResolver.php +++ b/lib/Cleantalk/ApbctWP/ApbctJsBundleResolver.php @@ -29,7 +29,7 @@ public static function getBundleName($settings) $script = 'apbct-public-bundle.min.js'; } - if (isset($settings['data__bot_detector_enabled']) && $settings['data__bot_detector_enabled'] != '1') { + if ( ! apbct__is_bot_detector_enabled() ) { $script = str_replace('.min.js', '_gathering.min.js', $script); } diff --git a/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php b/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php index bece59f24..ef5d569af 100644 --- a/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php +++ b/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php @@ -219,7 +219,7 @@ protected function checkRequest() $event_javascript_data = ''; $event_token = ''; - if ($apbct->settings['data__bot_detector_enabled'] == 1) { + if ( apbct__is_bot_detector_enabled() ) { $event_token = Post::getString('event_token'); } else { $post_event_javascript_data = TT::toString(Post::get('event_javascript_data')); diff --git a/lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php b/lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php index b7cd38022..a6dbfd0e7 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php +++ b/lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php @@ -510,7 +510,7 @@ public function printDiePage() 'data__email_check_before_post' => $apbct->settings['data__email_check_before_post'], 'data__cookies_type' => $apbct->data['cookies_type'], 'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1, - 'settings__data__bot_detector_enabled' => $apbct->settings['data__bot_detector_enabled'], + 'bot_detector_enabled' => apbct__is_bot_detector_enabled(), ); $replaces = array( diff --git a/lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php b/lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php index 28ba56678..58f1fad5f 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php +++ b/lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php @@ -302,7 +302,7 @@ public function printDiePage() 'data__email_check_before_post' => $apbct->settings['data__email_check_before_post'], 'data__cookies_type' => $apbct->data['cookies_type'], 'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1, - 'settings__data__bot_detector_enabled' => $apbct->settings['data__bot_detector_enabled'], + 'bot_detector_enabled' => apbct__is_bot_detector_enabled(), ); $replaces = array( diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFW.php b/lib/Cleantalk/ApbctWP/Firewall/SFW.php index 36c8c3774..da6f04e93 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/SFW.php +++ b/lib/Cleantalk/ApbctWP/Firewall/SFW.php @@ -542,7 +542,7 @@ public function printDiePage() 'data__email_check_before_post' => $apbct->settings['data__email_check_before_post'], 'data__cookies_type' => $apbct->data['cookies_type'], 'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1, - 'settings__data__bot_detector_enabled' => $apbct->settings['data__bot_detector_enabled'], + 'bot_detector_enabled' => apbct__is_bot_detector_enabled(), ); $replaces = array( diff --git a/lib/Cleantalk/ApbctWP/Localize/CtPublicFunctionsLocalize.php b/lib/Cleantalk/ApbctWP/Localize/CtPublicFunctionsLocalize.php index 0f075d1a6..c1bbcdcaf 100644 --- a/lib/Cleantalk/ApbctWP/Localize/CtPublicFunctionsLocalize.php +++ b/lib/Cleantalk/ApbctWP/Localize/CtPublicFunctionsLocalize.php @@ -22,7 +22,7 @@ public static function getData() '_rest_url' => Escape::escUrl(apbct_get_rest_url()), 'data__cookies_type' => $apbct->data['cookies_type'], 'data__ajax_type' => $apbct->data['ajax_type'], - 'data__bot_detector_enabled' => $apbct->settings['data__bot_detector_enabled'], + 'bot_detector_enabled' => apbct__is_bot_detector_enabled(), 'data__frontend_data_log_enabled' => defined('APBCT_DO_NOT_COLLECT_FRONTEND_DATA_LOGS') ? 0 : 1, 'cookiePrefix' => apbct__get_cookie_prefix(), 'wprocket_detected' => apbct_is_plugin_active('wp-rocket/wp-rocket.php'), diff --git a/lib/Cleantalk/ApbctWP/Localize/CtPublicLocalize.php b/lib/Cleantalk/ApbctWP/Localize/CtPublicLocalize.php index 331ccc71f..361e4fcda 100644 --- a/lib/Cleantalk/ApbctWP/Localize/CtPublicLocalize.php +++ b/lib/Cleantalk/ApbctWP/Localize/CtPublicLocalize.php @@ -20,7 +20,7 @@ public static function getData() 'settings__forms__force_protection' => $apbct->settings['forms__force_protection'], 'settings__forms__search_test' => $apbct->settings['forms__search_test'], 'settings__forms__wc_add_to_cart' => $apbct->settings['forms__wc_add_to_cart'], - 'settings__data__bot_detector_enabled' => $apbct->settings['data__bot_detector_enabled'], + 'bot_detector_enabled' => apbct__is_bot_detector_enabled(), 'settings__sfw__anti_crawler' => $apbct->settings['sfw__anti_crawler'], 'blog_home' => get_home_url() . '/', 'pixel__setting' => $apbct->settings['data__pixel'], diff --git a/lib/Cleantalk/ApbctWP/PluginSettingsPage/SummaryAndSupportRenderer.php b/lib/Cleantalk/ApbctWP/PluginSettingsPage/SummaryAndSupportRenderer.php index eb849ce6f..711429a03 100644 --- a/lib/Cleantalk/ApbctWP/PluginSettingsPage/SummaryAndSupportRenderer.php +++ b/lib/Cleantalk/ApbctWP/PluginSettingsPage/SummaryAndSupportRenderer.php @@ -96,6 +96,7 @@ private function renderStatistics() %s %s %s + %s
'; @@ -106,6 +107,7 @@ private function renderStatistics() $this->renderLastSfwBlock(), $this->renderSfwUpdate(), $this->renderSfwLogs(), + $this->renderBotDetectorState(), $this->renderPluginVersion() ); @@ -287,6 +289,18 @@ private function renderSfwLogs() return $this->wrapListItem($html); } + public function renderBotDetectorState() + { + return $this->wrapListItem( + sprintf( + esc_html__('JavaScript library (Bot Detector) is %s', 'cleantalk-spam-protect'), + apbct__is_bot_detector_enabled() + ? esc_html__('enabled', 'cleantalk-spam-protect') + : esc_html__('disabled', 'cleantalk-spam-protect') + ) + . '' + ); + } /** * Renders the current plugin version. diff --git a/lib/Cleantalk/ApbctWP/RemoteCalls.php b/lib/Cleantalk/ApbctWP/RemoteCalls.php index f347559ba..60b3f4cac 100644 --- a/lib/Cleantalk/ApbctWP/RemoteCalls.php +++ b/lib/Cleantalk/ApbctWP/RemoteCalls.php @@ -531,7 +531,6 @@ private static function getSettings($settings) 'data__use_static_js_key' => 'Use static keys for JavaScript check', 'data__general_postdata_test' => 'Check all post data', 'data__set_cookies' => 'Set cookies', - 'data__bot_detector_enabled' => 'Use JavaScript library', 'exclusions__bot_detector' => 'JavaScript Library Exclusions', 'exclusions__bot_detector__form_attributes' => 'Exclude any forms that has attribute matches', 'exclusions__bot_detector__form_children_attributes' => 'Exclude any forms that includes a child element with attribute matches', diff --git a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php index 67122704d..5e04d6f3c 100644 --- a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php +++ b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php @@ -70,10 +70,8 @@ final public static function setToRequest($current_timestamp, &$cookie_test_valu */ final public static function isCalculationDisabled() { - global $apbct; - // Return the value of the bot detector setting - return $apbct->settings['data__bot_detector_enabled'] + return apbct__is_bot_detector_enabled() ? !RequestParameters::get('ct_gathering_loaded') : false; } diff --git a/lib/Cleantalk/ApbctWP/ServiceConstants.php b/lib/Cleantalk/ApbctWP/ServiceConstants.php index 7c8c05288..84b4b4b77 100644 --- a/lib/Cleantalk/ApbctWP/ServiceConstants.php +++ b/lib/Cleantalk/ApbctWP/ServiceConstants.php @@ -20,6 +20,13 @@ class ServiceConstants */ public $set_ajax_route_type; + /** + * Is BotDetector enabled/disabled + * @var ApbctConstant + * @psalm-suppress PossiblyUnusedProperty + */ + public $bot_detector_enabled; + public function __construct() { $this->disable_empty_email_exception = new ApbctConstant( @@ -42,6 +49,10 @@ public function __construct() ), 'Provides AJAX route type' ); + $this->bot_detector_enabled = new ApbctConstant( + array('APBCT_SERVICE__BOT_DETECTOR_ENABLED'), + 'Allows to set Bot-Detector enabled/disabled' + ); // $accepted_constants = array( // // needs to be refactored // 'APBCT_SERVICE__SELF_OWNED_ACCESS_KEY' => array( diff --git a/lib/Cleantalk/ApbctWP/State.php b/lib/Cleantalk/ApbctWP/State.php index 0ae2963cb..ce471d1d1 100644 --- a/lib/Cleantalk/ApbctWP/State.php +++ b/lib/Cleantalk/ApbctWP/State.php @@ -84,7 +84,6 @@ class State extends \Cleantalk\Common\State 'data__use_static_js_key' => -1, 'data__general_postdata_test' => 0, //CAPD 'data__set_cookies' => 3, // Cookies type: 0 - Off / 1 - Native cookies / 2 - Alt cookies / 3 - Auto - 'data__bot_detector_enabled' => 1, 'data__pixel' => '3', 'data__email_check_before_post' => 1, 'data__email_check_exist_post' => 1, diff --git a/tests/ApbctWP/TestSubmitTimeHandler.php b/tests/ApbctWP/TestSubmitTimeHandler.php index 4d86edb9e..52c53ba7c 100644 --- a/tests/ApbctWP/TestSubmitTimeHandler.php +++ b/tests/ApbctWP/TestSubmitTimeHandler.php @@ -9,8 +9,10 @@ public function testGetFromRequestReturnsNullWhenCalculationDisabled() { global $apbct; $apbct = (object) [ - 'settings' => ['data__bot_detector_enabled' => true], - 'data' => ['cookies_type' => 'alternative'] + 'data' => [ + 'cookies_type' => 'alternative', + 'bot_detector_enabled' => true + ] ]; $result = SubmitTimeHandler::getFromRequest(); @@ -23,8 +25,10 @@ public function testSetToRequestModifiesArrayRegardlessOfCalculationDisabled() { global $apbct; $apbct = (object) [ - 'settings' => ['data__bot_detector_enabled' => true], - 'data' => ['cookies_type' => 'alternative'] + 'data' => [ + 'cookies_type' => 'alternative', + 'bot_detector_enabled' => true + ] ]; $cookie_test_value = []; @@ -40,8 +44,10 @@ public function testIsCalculationDisabledReturnsTrueWhenBotDetectorEnabled() { global $apbct; $apbct = (object) [ - 'settings' => ['data__bot_detector_enabled' => true], - 'data' => ['cookies_type' => 'alternative'] + 'data' => [ + 'cookies_type' => 'alternative', + 'bot_detector_enabled' => true + ] ]; $result = SubmitTimeHandler::isCalculationDisabled(); @@ -52,7 +58,7 @@ public function testIsCalculationDisabledReturnsTrueWhenBotDetectorEnabled() public function testIsCalculationDisabledReturnsFalseWhenBotDetectorDisabled() { global $apbct; - $apbct = (object) ['settings' => ['data__bot_detector_enabled' => false]]; + $apbct = (object) ['data' => ['bot_detector_enabled' => false]]; $result = SubmitTimeHandler::isCalculationDisabled(); diff --git a/tests/StandaloneFunctions/TestBotDetectorLogGathering.php b/tests/StandaloneFunctions/TestBotDetectorLogGathering.php index e67f8094f..133e0a9a3 100644 --- a/tests/StandaloneFunctions/TestBotDetectorLogGathering.php +++ b/tests/StandaloneFunctions/TestBotDetectorLogGathering.php @@ -11,7 +11,7 @@ class TestBotDetectorLogGathering extends TestCase public function test_returnsFrontendDataLog() { global $apbct; - $apbct->settings['data__bot_detector_enabled'] = '1'; + $apbct->data['bot_detector_enabled'] = '1'; AltSessions::set('ct_bot_detector_frontend_data_log', json_encode(['log' => 'data'])); $result = apbct__bot_detector_get_fd_log(); @@ -27,7 +27,7 @@ public function test_returnsFrontendDataLog() public function test_returnsErrorWhenDisabled() { global $apbct; - $apbct->settings['data__bot_detector_enabled'] = '0'; + $apbct->data['bot_detector_enabled'] = '0'; $result = apbct__bot_detector_get_fd_log(); $expected = json_encode([ @@ -42,7 +42,7 @@ public function test_returnsErrorWhenDisabled() public function test_returnsErrorWhenNoLogFound() { global $apbct; - $apbct->settings['data__bot_detector_enabled'] = '1'; + $apbct->data['bot_detector_enabled'] = '1'; AltSessions::wipe(); $result = apbct__bot_detector_get_fd_log(); @@ -58,7 +58,7 @@ public function test_returnsErrorWhenNoLogFound() public function test_returnsErrorWhenLogNotString() { global $apbct; - $apbct->settings['data__bot_detector_enabled'] = '1'; + $apbct->data['bot_detector_enabled'] = '1'; AltSessions::set('ct_bot_detector_frontend_data_log', false); $result = apbct__bot_detector_get_fd_log(); @@ -74,7 +74,7 @@ public function test_returnsErrorWhenLogNotString() public function test_returnsErrorWhenLogNotJson() { global $apbct; - $apbct->settings['data__bot_detector_enabled'] = '1'; + $apbct->data['bot_detector_enabled'] = '1'; AltSessions::set('ct_bot_detector_frontend_data_log', 'invalid json'); $result = apbct__bot_detector_get_fd_log();