From 069aec32e55bfe75b6d0dbba76691c5a41e84432 Mon Sep 17 00:00:00 2001 From: svfcode Date: Sat, 27 Dec 2025 15:58:19 +0300 Subject: [PATCH 01/60] Upd. Code. SFW Update. HTTP multi request refactored. --- cleantalk.php | 89 +-- .../ApbctWP/Firewall/SFWFilesDownloader.php | 205 +++++++ .../ApbctWP/Firewall/SFWUpdateHelper.php | 25 + .../ApbctWP/HTTP/HTTPMultiRequestFactory.php | 349 ++++++++++++ .../ApbctWP/HTTP/HTTPRequestContract.php | 28 + lib/Cleantalk/ApbctWP/State.php | 1 + lib/Cleantalk/Common/Helper.php | 1 + tests/.phpcs.xml | 2 +- .../ApbctWP/Firewall/SFWUpdateHelperTest.php | 86 +++ .../HTTP/TestHTTPMultiRequestFactory.php | 536 ++++++++++++++++++ .../ApbctWP/HTTP/TestHTTPRequestContract.php | 70 +++ tests/ApbctWP/HTTP/TestSFWFilesDownloader.php | 440 ++++++++++++++ 12 files changed, 1747 insertions(+), 85 deletions(-) create mode 100644 lib/Cleantalk/ApbctWP/Firewall/SFWFilesDownloader.php create mode 100644 lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestFactory.php create mode 100644 lib/Cleantalk/ApbctWP/HTTP/HTTPRequestContract.php create mode 100644 tests/ApbctWP/Firewall/SFWUpdateHelperTest.php create mode 100644 tests/ApbctWP/HTTP/TestHTTPMultiRequestFactory.php create mode 100644 tests/ApbctWP/HTTP/TestHTTPRequestContract.php create mode 100644 tests/ApbctWP/HTTP/TestSFWFilesDownloader.php diff --git a/cleantalk.php b/cleantalk.php index 75ddbaeff..1d77c92a9 100644 --- a/cleantalk.php +++ b/cleantalk.php @@ -1497,92 +1497,13 @@ function apbct_sfw_update__get_multifiles_of_type(array $params) /** * Queue stage. Do load multifiles with networks on their urls. - * @param $urls - * @return array|array[]|bool|string|string[] + * @param $all_urls + * @return array|true */ -function apbct_sfw_update__download_files($urls, $direct_update = false) +function apbct_sfw_update__download_files($all_urls, $direct_update = false) { - global $apbct; - - sleep(3); - - if ( ! is_writable($apbct->fw_stats['updating_folder']) ) { - return array('error' => 'SFW update folder is not writable.'); - } - - //Reset keys - $urls = array_values(array_unique($urls)); - - $results = array(); - $batch_size = 10; - - /** - * Reduce batch size of curl multi instanced - */ - if (defined('APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE')) { - if ( - is_int(APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE) && - APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE > 0 && - APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE < 10 - ) { - $batch_size = APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE; - }; - } - - $total_urls = count($urls); - $batches = ceil($total_urls / $batch_size); - - for ($i = 0; $i < $batches; $i++) { - $batch_urls = array_slice($urls, $i * $batch_size, $batch_size); - if (!empty($batch_urls)) { - $http_results = Helper::httpMultiRequest($batch_urls, $apbct->fw_stats['updating_folder']); - if (is_array($http_results)) { - $results = array_merge($results, $http_results); - } - // to handle case if we request only one url, then Helper::httpMultiRequest returns string 'success' instead of array - if (count($batch_urls) === 1 && $http_results === 'success') { - $results = array_merge($results, $batch_urls); - } - } - } - - $results = TT::toArray($results); - $count_urls = count($urls); - $count_results = count($results); - - if ( empty($results['error']) && ($count_urls === $count_results) ) { - if ( $direct_update ) { - return true; - } - $download_again = array(); - $results = array_values($results); - for ( $i = 0; $i < $count_results; $i++ ) { - if ( $results[$i] === 'error' ) { - $download_again[] = $urls[$i]; - } - } - - if ( count($download_again) !== 0 ) { - return array( - 'error' => 'Files download not completed.', - 'update_args' => array( - 'args' => $download_again - ) - ); - } - - return array( - 'next_stage' => array( - 'name' => 'apbct_sfw_update__create_tables' - ) - ); - } - - if ( ! empty($results['error']) ) { - return $results; - } - - return array('error' => 'Files download not completed.'); + $downloader = new \Cleantalk\ApbctWP\Firewall\SFWFilesDownloader(); + return $downloader->downloadFiles($all_urls, $direct_update); } /** diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFWFilesDownloader.php b/lib/Cleantalk/ApbctWP/Firewall/SFWFilesDownloader.php new file mode 100644 index 000000000..40f6f7d82 --- /dev/null +++ b/lib/Cleantalk/ApbctWP/Firewall/SFWFilesDownloader.php @@ -0,0 +1,205 @@ +deafult_error_prefix = basename(__CLASS__) . ': '; + $this->http_multi_request_factory = $factory ?: new HTTPMultiRequestFactory(); + } + + /** + * Downloads SFW data files from provided URLs with batch processing and retry logic + * + * Downloads files in batches to avoid server overload. Automatically retries failed downloads + * with reduced batch size if necessary. Validates write permissions and URL format before processing. + * + * @param array|mixed $all_urls List of URLs to download files from + * @param bool $direct_update Optional. If true, returns boolean result. If false, returns stage info array. + * @param int sleep Pause in seconds before multi contracts run, default is 3 + * + * @return true|array True on success (direct update mode), or array with 'next_stage' key, + * or array with 'error' key on failure, or array with 'update_args' for retry. + */ + public function downloadFiles($all_urls, $direct_update = false, $sleep = 3) + { + global $apbct; + + // Delay to prevent server overload + sleep($sleep); + + // Validate write permissions for update folder + if ( ! is_writable($apbct->fw_stats['updating_folder']) ) { + return $this->responseStopUpdate('SFW UPDATE FOLDER IS NOT WRITABLE.'); + } + + // Validate URLs parameter type + if ( ! is_array($all_urls) ) { + return $this->responseStopUpdate('URLS LIST SHOULD BE AN ARRAY'); + } + + // Remove duplicates and reset array keys to sequential integers + $all_urls = array_values(array_unique($all_urls)); + + // Get current batch size from settings or default + $work_batch_size = SFWUpdateHelper::getSFWFilesBatchSize(); + + // Initialize batch processing variables + $total_urls = count($all_urls); + $batches = ceil($total_urls / $work_batch_size); + $download_again = []; + $written_urls = []; + + // Get or set default batch size for retry attempts + $on_repeat_batch_size = !empty($apbct->data['sfw_update__batch_size']) + ? TT::toInt($apbct->data['sfw_update__batch_size']) + : 10; + + // Process URLs in batches + for ($i = 0; $i < $batches; $i++) { + // Extract current batch of URLs + $current_batch_urls = array_slice($all_urls, $i * $work_batch_size, $work_batch_size); + + if (!empty($current_batch_urls)) { + // Execute multi-request for current batch + $multi_request_contract = $this->http_multi_request_factory->setMultiContract($current_batch_urls); + + // Critical error: contract processing failed, stop update immediately + if (!$multi_request_contract->process_done) { + $error = !empty($multi_request_contract->error_msg) ? $multi_request_contract->error_msg : 'UNKNOWN ERROR'; + return $this->responseStopUpdate($error); + } + + // Handle failed downloads in this batch + if (!empty($multi_request_contract->getFailedURLs())) { + // Reduce batch size for retry if fabric suggests it + if ($multi_request_contract->suggest_batch_reduce_to) { + $on_repeat_batch_size = min($on_repeat_batch_size, $multi_request_contract->suggest_batch_reduce_to); + } + // Collect failed URLs for retry + $download_again = array_merge($download_again, $multi_request_contract->getFailedURLs()); + } + + // Write successfully downloaded content to files + $write_result = $multi_request_contract->writeSuccessURLsContent($apbct->fw_stats['updating_folder']); + + // File write error occurred, stop update + if (is_string($write_result)) { + return $this->responseStopUpdate($write_result); + } + + // Track successfully written URLs + $written_urls = array_merge($written_urls, $write_result); + } + } + + // Some downloads failed, schedule retry with adjusted batch size + if (!empty($download_again)) { + $apbct->fw_stats['multi_request_batch_size'] = $on_repeat_batch_size; + $apbct->save('data'); + return $this->responseRepeatStage('FILES DOWNLOAD NOT COMPLETED, TRYING AGAIN', $download_again); + } + + // Verify all URLs were successfully downloaded and written + if (empty(array_diff($all_urls, $written_urls))) { + return $this->responseSuccess($direct_update); + } + + // Download incomplete with no retry - collect error information + $last_contract_errors = isset($multi_request_contract) && $multi_request_contract->getContractsErrors() + ? $multi_request_contract->getContractsErrors() + : 'no known contract errors'; + + $error = 'FILES DOWNLOAD NOT COMPLETED - STOP UPDATE, ERRORS: ' . $last_contract_errors; + return $this->responseStopUpdate($error); + } + + /** + * Creates error response to stop the update process + * + * @param string $message Error message describing why update was stopped + * + * @return array Error response array with 'error' key + */ + private function responseStopUpdate($message): array + { + $message = is_string($message) ? $message : $this->deafult_error_content; + $message = $this->deafult_error_prefix . $message; + return [ + 'error' => $message + ]; + } + + /** + * Creates response to repeat current stage with modified arguments + * + * Used when downloads partially failed and should be retried with + * potentially reduced batch size or different parameters. + * + * @param string $message Descriptive message about why stage needs repeating + * @param array $args Arguments for retry attempt (typically failed URLs) + * + * @return array Response array with 'error' message and 'update_args' for retry + */ + private function responseRepeatStage($message, $args): array + { + $args = is_array($args) ? $args : []; + $message = is_string($message) ? $message : $this->deafult_error_content; + $message = $this->deafult_error_prefix . $message; + return [ + 'error' => $message, + 'update_args' => [ + 'args' => $args + ], + ]; + } + + /** + * Creates success response to proceed to next stage or complete update + * + * @param bool $direct_update If true, returns simple boolean. If false, returns stage transition array. + * + * @return true|array True for direct update mode, or array with 'next_stage' key for staged updates + */ + private function responseSuccess($direct_update) + { + return $direct_update ? true : [ + 'next_stage' => array( + 'name' => 'apbct_sfw_update__create_tables' + ) + ]; + } +} diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateHelper.php b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateHelper.php index 70039a8f3..4dd7697fd 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateHelper.php +++ b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateHelper.php @@ -578,4 +578,29 @@ public static function fallback() */ apbct_sfw_update__create_tables(); } + + public static function getSFWFilesBatchSize() + { + global $apbct; + $work_batch_size = 10; + + /** + * Reduce batch size of curl multi instanced + */ + if (defined('APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE')) { + if ( + is_int(APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE) && + APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE > 1 && + APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE < 10 + ) { + $work_batch_size = APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE; + }; + } + + $work_batch_size = !empty($apbct->fw_stats['multi_request_batch_size']) + ? TT::toInt($apbct->fw_stats['multi_request_batch_size'], $work_batch_size) + : $work_batch_size; + + return $work_batch_size; + } } diff --git a/lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestFactory.php b/lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestFactory.php new file mode 100644 index 000000000..bcc66f4eb --- /dev/null +++ b/lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestFactory.php @@ -0,0 +1,349 @@ +process_done = false; + $this->suggest_batch_reduce_to = false; + $this->contracts = []; + $this->error_msg = null; + + // Prepare individual contracts for each URL + $this->prepareContracts($urls); + + // Execute all HTTP requests if contracts are valid + $this->executeMultiContract(); + + return $this; + } + + /** + * Prepares HTTP request contracts from URLs array + * + * Validates URLs and creates HTTPRequestContract instance for each valid URL. + * Sets error message and stops processing if validation fails. + * + * @param array $urls Array of URLs to prepare contracts for + * + * @return void + */ + public function prepareContracts(array $urls) + { + // Validate URLs array is not empty + if (empty($urls)) { + $this->error_msg = __CLASS__ . ': URLS SHOULD BE NOT EMPTY'; + return; + } + + // Create contract for each URL with validation + foreach ($urls as $url) { + // Ensure each URL is a string + if (!is_string($url)) { + $this->error_msg = __CLASS__ . ': SINGLE URL SHOULD BE A STRING'; + $this->contracts = []; + return; + } + $this->contracts[] = new HTTPRequestContract($url); + } + } + + /** + * Executes multi-request and fills contracts with response data + * + * Sends HTTP requests for all prepared contracts and processes the results. + * Only executes if there are valid URLs to process. + * + * @return void + */ + public function executeMultiContract() + { + // Execute requests only if contracts contain URLs + if (!empty($this->getAllURLs())) { + $http_multi_result = $this->sendRequests($this->getAllURLs()); + $this->fillMultiContract($http_multi_result); + } + } + + /** + * Fills contracts with HTTP response data and validates results + * + * Processes multi-request results, validates response content, updates contract states, + * and suggests batch size reduction if some requests failed. + * + * @param array|bool $http_multi_result Response data from multi-request or false on failure + * + * @return $this Returns self for method chaining + */ + public function fillMultiContract($http_multi_result) + { + // Handle HTTP request error + if (!empty($http_multi_result['error'])) { + $this->error_msg = __CLASS__ . ': HTTP_MULTI_RESULT ERROR' . $http_multi_result['error']; + return $this; + } + + // Validate result is an array + if (!is_array($http_multi_result)) { + $this->error_msg = __CLASS__ . ': HTTP_MULTI_RESULT INVALID'; + return $this; + } + + // Fill each contract with corresponding response data + foreach ($this->contracts as $contract) { + if (isset($http_multi_result[$contract->url])) { + $contract_content = $http_multi_result[$contract->url]; + + // Validate response content is string + if (!is_string($contract_content)) { + $contract->error_msg = __CLASS__ . ': SINGLE CONTRACT_CONTENT SHOULD BE A STRING'; + continue; + } + + // Validate response content is not empty + if (empty($contract_content)) { + $contract->error_msg = __CLASS__ . ': SINGLE CONTRACT_CONTENT SHOULD BE NOT EMPTY'; + continue; + } + + // Mark contract as successful with content + $contract->content = $contract_content; + $contract->success = true; + } + } + + // Suggest batch size reduction if some contracts failed + if (!$this->allContractsCompleted()) { + // Reduce to number of successful requests, minimum 2 + $this->suggest_batch_reduce_to = !empty($this->getSuccessURLs()) + ? count($this->getSuccessURLs()) + : 2; + } + + // Mark processing as completed + $this->process_done = true; + return $this; + } + + /** + * Checks if all contracts completed successfully + * + * @return bool True if all contracts succeeded, false if any failed + */ + private function allContractsCompleted() + { + // Extract success flags from all contracts + $flags = array_map(function ($contract) { + return $contract->success; + }, $this->contracts); + + // Return true only if no false flags exist + return !in_array(false, $flags, true); + } + + /** + * Sends HTTP requests to multiple URLs using CommonRequest + * + * @param array $urls Array of URLs to request + * + * @return array|bool Response data array or false on failure + */ + public function sendRequests($urls) + { + $http = new CommonRequest(); + + // Configure and execute multi-request + $http->setUrl($urls) + ->setPresets('get'); + return $http->request(); + } + + /** + * Collects and formats error messages from failed contracts + * + * Returns formatted string with URL and error message pairs for all failed contracts. + * Used for debugging and error reporting. + * + * @return false|string False if no errors, comma-separated error string otherwise + * @psalm-suppress PossiblyUnusedMethod + */ + public function getContractsErrors() + { + $result = []; + + // Collect errors from failed contracts + foreach ($this->contracts as $contract) { + if (!$contract->success && !empty($contract->error_msg)) { + // Format: [url]:[error_message] + $result[] = '[' . esc_url($contract->url) . ']:[' . esc_html($contract->error_msg) . ']'; + } + } + + return empty($result) ? false : implode(',', $result); + } + + /** + * Extracts URLs from all contracts + * + * @return array Array of URLs from all contracts + */ + public function getAllURLs() + { + return array_map(function ($contract) { + return $contract->url; + }, $this->contracts); + } + + /** + * Returns URLs of failed contracts + * + * Contract is considered failed if success flag is false or content is empty. + * + * @return array Array of URLs that failed to download or have empty content + */ + public function getFailedURLs() + { + $result = []; + foreach ($this->contracts as $contract) { + // Failed if not successful or content is empty + if (!$contract->success || empty($contract->content)) { + $result[] = $contract->url; + } + } + return $result; + } + + /** + * Returns URLs of successful contracts + * + * Contract is considered successful if success flag is true and content is not empty. + * + * @return array Array of URLs that successfully downloaded with non-empty content + */ + public function getSuccessURLs() + { + $result = []; + foreach ($this->contracts as $contract) { + // Successful only if both success flag and content exist + if ($contract->success && !empty($contract->content)) { + $result[] = $contract->url; + } + } + return $result; + } + + /** + * Writes content from successful contracts to files + * + * Extracts filename from URL and writes contract content to specified directory. + * Only processes contracts that completed successfully. Validates directory permissions + * before writing and handles write errors gracefully. + * + * @param string $write_to_dir Target directory path (must exist and be writable) + * + * @return array|string Array of successfully written URLs on success, error message string on failure + */ + public function writeSuccessURLsContent($write_to_dir) + { + $written_urls = []; + try { + // Validate target directory exists and is writable + if (!is_dir($write_to_dir) || !is_writable($write_to_dir)) { + throw new \Exception('CAN NOT WRITE TO DIRECTORY: ' . $write_to_dir); + } + + // Write content from each successful contract + foreach ($this->contracts as $single_contract) { + if ($single_contract->success) { + // Extract filename from URL and build full path + $file_name = $write_to_dir . self::getFilenameFromUrl($single_contract->url); + + // Write content to file + $write_result = file_put_contents($file_name, $single_contract->content); + + // Check for write failure + if (false === $write_result) { + throw new \Exception('CAN NOT WRITE TO FILE: ' . $file_name); + } + + // Track successfully written URL + $written_urls[] = $single_contract->url; + } + } + } catch (\Exception $e) { + // Return error message on any exception + return $e->getMessage(); + } + + return $written_urls; + } + + /** + * Extracts filename with extension from URL + * + * Parses URL to extract filename and extension components. + * Example: "https://example.com/path/file.gz" -> "file.gz" + * + * @param string $url Full URL to extract filename from + * + * @return string Filename with extension + */ + private static function getFilenameFromUrl($url) + { + return pathinfo($url, PATHINFO_FILENAME) . '.' . pathinfo($url, PATHINFO_EXTENSION); + } +} diff --git a/lib/Cleantalk/ApbctWP/HTTP/HTTPRequestContract.php b/lib/Cleantalk/ApbctWP/HTTP/HTTPRequestContract.php new file mode 100644 index 000000000..f7a8da99b --- /dev/null +++ b/lib/Cleantalk/ApbctWP/HTTP/HTTPRequestContract.php @@ -0,0 +1,28 @@ +url = $url; + } +} diff --git a/lib/Cleantalk/ApbctWP/State.php b/lib/Cleantalk/ApbctWP/State.php index 7a4b63db7..a67543b43 100644 --- a/lib/Cleantalk/ApbctWP/State.php +++ b/lib/Cleantalk/ApbctWP/State.php @@ -369,6 +369,7 @@ class State extends \Cleantalk\Common\State 'expected_ua_count_personal' => 0, 'update_mode' => 0, 'reason_direct_update_log' => null, + 'multi_request_batch_size' => 10, 'personal_lists_url_id' => '', 'common_lists_url_id' => '', 'calls' => 0, diff --git a/lib/Cleantalk/Common/Helper.php b/lib/Cleantalk/Common/Helper.php index 66010cc3d..78beb40e1 100644 --- a/lib/Cleantalk/Common/Helper.php +++ b/lib/Cleantalk/Common/Helper.php @@ -614,6 +614,7 @@ public static function httpRequest($url, $data = array(), $presets = array(), $o * @param array $urls Array of URLs to requests * * @return array|bool + * @psalm-suppress PossiblyUnusedMethod */ public static function httpMultiRequest($urls, $write_to = '') { diff --git a/tests/.phpcs.xml b/tests/.phpcs.xml index 0977dd533..50e82a392 100644 --- a/tests/.phpcs.xml +++ b/tests/.phpcs.xml @@ -24,7 +24,7 @@ - + diff --git a/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php b/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php new file mode 100644 index 000000000..ff8454759 --- /dev/null +++ b/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php @@ -0,0 +1,86 @@ +apbctBackup = $apbct; + + // Setup mock $apbct global + $apbct = new \stdClass(); + $apbct->fw_stats['multi_request_batch_size'] = 10; + } + + protected function tearDown() + { + parent::tearDown(); + global $apbct; + $apbct = $this->apbctBackup; + } + + /** + * @test + */ + public function testGetSFWFilesBatchSizeReturnsDefaultValue() + { + global $apbct; + unset($apbct->fw_stats['multi_request_batch_size']); + + $batchSize = SFWUpdateHelper::getSFWFilesBatchSize(); + + $this->assertEquals(10, $batchSize); + } + + /** + * @test + */ + public function testGetSFWFilesBatchSizeReturnsCustomValue() + { + global $apbct; + $apbct->fw_stats['multi_request_batch_size'] = 5; + + $batchSize = SFWUpdateHelper::getSFWFilesBatchSize(); + + $this->assertEquals(5, $batchSize); + } + + /** + * @test + */ + public function testGetSFWFilesBatchSizeReturnsCustomValueAsString() + { + global $apbct; + $apbct->fw_stats['multi_request_batch_size'] = 7; + + $batchSize = SFWUpdateHelper::getSFWFilesBatchSize(); + + $this->assertEquals(7, $batchSize); + } + + /** + * @test + */ + public function testGetSFWFilesBatchSizeRespectsConstantWithValidValue() + { + if (!defined('APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE')) { + define('APBCT_SERVICE__SFW_UPDATE_CURL_MULTI_BATCH_SIZE', 3); + } + + global $apbct; + unset($apbct->fw_stats['multi_request_batch_size']); + + $batchSize = SFWUpdateHelper::getSFWFilesBatchSize(); + + $this->assertEquals(3, $batchSize); + } +} + diff --git a/tests/ApbctWP/HTTP/TestHTTPMultiRequestFactory.php b/tests/ApbctWP/HTTP/TestHTTPMultiRequestFactory.php new file mode 100644 index 000000000..7b9ea3004 --- /dev/null +++ b/tests/ApbctWP/HTTP/TestHTTPMultiRequestFactory.php @@ -0,0 +1,536 @@ +testFolder = sys_get_temp_dir() . '/test_fabric_' . time() . '/'; + if (!is_dir($this->testFolder)) { + mkdir($this->testFolder, 0777, true); + } + } + + protected function tearDown() + { + parent::tearDown(); + + if (is_dir($this->testFolder)) { + $files = glob($this->testFolder . '/*'); + if ($files) { + foreach ($files as $file) { + if (is_file($file)) { + unlink($file); + } + } + } + rmdir($this->testFolder); + } + } + + /** + * @test + */ + public function testPrepareContractsWithEmptyUrlsSetsError() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->setMethods(['executeMultiContract', 'sendMultiRequest']) + ->getMock(); + + $fabric->expects($this->never()) + ->method('sendMultiRequest'); + + $fabric->setMultiContract([]); + + $this->assertNotNull($fabric->error_msg); + $this->assertStringContainsString('URLS SHOULD BE NOT EMPTY', $fabric->error_msg); + $this->assertEmpty($fabric->contracts); + } + + /** + * @test + */ + public function testPrepareContractsWithNonStringUrlSetsError() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->setMethods(['executeMultiContract']) + ->getMock(); + + $urls = [ + 'https://example.com/file1.gz', + 123, // Invalid + 'https://example.com/file3.gz' + ]; + + $fabric->setMultiContract($urls); + + $this->assertNotNull($fabric->error_msg); + $this->assertStringContainsString('SINGLE URL SHOULD BE A STRING', $fabric->error_msg); + $this->assertEmpty($fabric->contracts); + } + + /** + * @test + */ + public function testPrepareContractsCreatesHTTPRequestContracts() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->setMethods(['executeMultiContract']) + ->getMock(); + + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz' + ]; + + $fabric->setMultiContract($urls); + + $this->assertCount(2, $fabric->contracts); + $this->assertContainsOnlyInstancesOf(HTTPRequestContract::class, $fabric->contracts); + $this->assertEquals($urls[0], $fabric->contracts[0]->url); + $this->assertEquals($urls[1], $fabric->contracts[1]->url); + } + + /** + * @test + */ + public function testGetAllURLsReturnsAllContractUrls() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->setMethods(['executeMultiContract']) + ->getMock(); + + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz' + ]; + + $fabric->setMultiContract($urls); + + $this->assertEquals($urls, $fabric->getAllURLs()); + } + + /** + * @test + */ + public function testGetFailedURLsReturnsUrlsWithNoSuccess() + { + $fabric = new HTTPMultiRequestFactory(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = false; + + $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); + $contract3->success = true; + $contract3->content = ''; + + $fabric->contracts = [$contract1, $contract2, $contract3]; + + $failed = $fabric->getFailedURLs(); + + $this->assertCount(2, $failed); + $this->assertContains('https://example.com/file2.gz', $failed); + $this->assertContains('https://example.com/file3.gz', $failed); + } + + /** + * @test + */ + public function testGetSuccessURLsReturnsOnlySuccessfulUrls() + { + $fabric = new HTTPMultiRequestFactory(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = false; + + $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); + $contract3->success = true; + $contract3->content = 'content3'; + + $fabric->contracts = [$contract1, $contract2, $contract3]; + + $success = $fabric->getSuccessURLs(); + + $this->assertCount(2, $success); + $this->assertEquals(['https://example.com/file1.gz', 'https://example.com/file3.gz'], $success); + } + + /** + * @test + */ + public function testFillMultiContractWithErrorArraySetsError() + { + $fabric = new HTTPMultiRequestFactory(); + + $fabric->fillMultiContract(['error' => 'CURL_ERROR']); + + $this->assertNotNull($fabric->error_msg); + $this->assertStringContainsString('HTTP_MULTI_RESULT ERROR', $fabric->error_msg); + } + + /** + * @test + */ + public function testFillMultiContractWithNonArraySetsError() + { + $fabric = new HTTPMultiRequestFactory(); + + $fabric->fillMultiContract('not an array'); + + $this->assertNotNull($fabric->error_msg); + $this->assertStringContainsString('HTTP_MULTI_RESULT INVALID', $fabric->error_msg); + } + + /** + * @test + */ + public function testFillMultiContractWithValidResultsFillsContracts() + { + $fabric = new HTTPMultiRequestFactory(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz'), + new HTTPRequestContract('https://example.com/file2.gz') + ]; + + $results = [ + 'https://example.com/file1.gz' => 'content for file1', + 'https://example.com/file2.gz' => 'content for file2' + ]; + + $fabric->fillMultiContract($results); + + $this->assertTrue($fabric->contracts[0]->success); + $this->assertEquals('content for file1', $fabric->contracts[0]->content); + $this->assertTrue($fabric->contracts[1]->success); + $this->assertEquals('content for file2', $fabric->contracts[1]->content); + $this->assertTrue($fabric->process_done); + } + + /** + * @test + */ + public function testFillMultiContractWithNonStringContentSetsContractError() + { + $fabric = new HTTPMultiRequestFactory(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz') + ]; + + $results = [ + 'https://example.com/file1.gz' => 123 + ]; + + $fabric->fillMultiContract($results); + + $this->assertFalse($fabric->contracts[0]->success); + $this->assertNotNull($fabric->contracts[0]->error_msg); + $this->assertStringContainsString('SHOULD BE A STRING', $fabric->contracts[0]->error_msg); + } + + /** + * @test + */ + public function testFillMultiContractWithEmptyContentSetsContractError() + { + $fabric = new HTTPMultiRequestFactory(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz') + ]; + + $results = [ + 'https://example.com/file1.gz' => '' + ]; + + $fabric->fillMultiContract($results); + + $this->assertFalse($fabric->contracts[0]->success); + $this->assertNotNull($fabric->contracts[0]->error_msg); + $this->assertStringContainsString('SHOULD BE NOT EMPTY', $fabric->contracts[0]->error_msg); + } + + /** + * @test + */ + public function testFillMultiContractWithPartialSuccessSuggestsBatchReduce() + { + $fabric = new HTTPMultiRequestFactory(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz'), + new HTTPRequestContract('https://example.com/file2.gz'), + new HTTPRequestContract('https://example.com/file3.gz') + ]; + + $results = [ + 'https://example.com/file1.gz' => 'content1', + 'https://example.com/file3.gz' => 'content3' + ]; + + $fabric->fillMultiContract($results); + + $this->assertEquals(2, $fabric->suggest_batch_reduce_to); + $this->assertTrue($fabric->process_done); + } + + /** + * @test + */ + public function testFillMultiContractWithAllFailedSuggestsMinimumBatchSize() + { + $fabric = new HTTPMultiRequestFactory(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz'), + new HTTPRequestContract('https://example.com/file2.gz') + ]; + + $results = []; + + $fabric->fillMultiContract($results); + + $this->assertEquals(2, $fabric->suggest_batch_reduce_to); + $this->assertTrue($fabric->process_done); + } + + /** + * @test + */ + public function testFillMultiContractWithAllSuccessDoesNotSuggestBatchReduce() + { + $fabric = new HTTPMultiRequestFactory(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz'), + new HTTPRequestContract('https://example.com/file2.gz') + ]; + + $results = [ + 'https://example.com/file1.gz' => 'content1', + 'https://example.com/file2.gz' => 'content2' + ]; + + $fabric->fillMultiContract($results); + + $this->assertFalse($fabric->suggest_batch_reduce_to); + $this->assertTrue($fabric->process_done); + } + + /** + * @test + */ + public function testGetContractsErrorsReturnsFormattedErrors() + { + $fabric = new HTTPMultiRequestFactory(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->error_msg = 'Connection timeout'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = true; + $contract2->content = 'content'; + + $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); + $contract3->error_msg = '404 Not Found'; + + $fabric->contracts = [$contract1, $contract2, $contract3]; + + $errors = $fabric->getContractsErrors(); + + $this->assertIsString($errors); + $this->assertStringContainsString('file1.gz', $errors); + $this->assertStringContainsString('Connection timeout', $errors); + $this->assertStringContainsString('file3.gz', $errors); + $this->assertStringContainsString('404 Not Found', $errors); + $this->assertStringNotContainsString('file2', $errors); + } + + /** + * @test + */ + public function testGetContractsErrorsReturnsFalseWhenNoErrors() + { + $fabric = new HTTPMultiRequestFactory(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = true; + $contract2->content = 'content2'; + + $fabric->contracts = [$contract1, $contract2]; + + $errors = $fabric->getContractsErrors(); + + $this->assertFalse($errors); + } + + /** + * @test + */ + public function testWriteSuccessURLsContentWritesFiles() + { + $fabric = new HTTPMultiRequestFactory(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = true; + $contract2->content = 'content2'; + + $fabric->contracts = [$contract1, $contract2]; + + $result = $fabric->writeSuccessURLsContent($this->testFolder); + + $this->assertIsArray($result); + $this->assertCount(2, $result); + $this->assertFileExists($this->testFolder . 'file1.gz'); + $this->assertFileExists($this->testFolder . 'file2.gz'); + $this->assertEquals('content1', file_get_contents($this->testFolder . 'file1.gz')); + $this->assertEquals('content2', file_get_contents($this->testFolder . 'file2.gz')); + } + + /** + * @test + */ + public function testWriteSuccessURLsContentSkipsFailedContracts() + { + $fabric = new HTTPMultiRequestFactory(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = false; + + $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); + $contract3->success = true; + $contract3->content = 'content3'; + + $fabric->contracts = [$contract1, $contract2, $contract3]; + + $result = $fabric->writeSuccessURLsContent($this->testFolder); + + $this->assertIsArray($result); + $this->assertCount(2, $result); + $this->assertFileExists($this->testFolder . 'file1.gz'); + $this->assertFileNotExists($this->testFolder . 'file2.gz'); + $this->assertFileExists($this->testFolder . 'file3.gz'); + } + + /** + * @test + */ + public function testWriteSuccessURLsContentReturnsErrorWhenDirectoryNotExists() + { + $fabric = new HTTPMultiRequestFactory(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $fabric->contracts = [$contract1]; + + $result = $fabric->writeSuccessURLsContent('/nonexistent/path/'); + + $this->assertIsString($result); + $this->assertStringContainsString('CAN NOT WRITE TO DIRECTORY', $result); + } + + /** + * @test + */ + public function testWriteSuccessURLsContentReturnsErrorWhenDirectoryNotWritable() + { + $fabric = new HTTPMultiRequestFactory(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $fabric->contracts = [$contract1]; + + // Use root directory which is typically not writable + $result = $fabric->writeSuccessURLsContent('/nonexist'); + + $this->assertIsString($result); + $this->assertStringContainsString('CAN NOT WRITE', $result); + } + + /** + * @test + */ + public function testSetMultiContractResetsStateOnEachCall() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->setMethods(['executeMultiContract']) + ->getMock(); + + // First call + $fabric->setMultiContract(['https://example.com/file1.gz']); + $this->assertCount(1, $fabric->contracts); + $fabric->process_done = true; + $fabric->suggest_batch_reduce_to = 5; + $fabric->error_msg = 'some error'; + + // Second call should reset everything + $fabric->setMultiContract(['https://example.com/file2.gz', 'https://example.com/file3.gz']); + + $this->assertCount(2, $fabric->contracts); + $this->assertFalse($fabric->suggest_batch_reduce_to); + $this->assertNull($fabric->error_msg); + $this->assertFalse($fabric->process_done); + } + + /** + * @test + */ + public function testSetMultiContractReturnsItself() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->setMethods(['executeMultiContract']) + ->getMock(); + + $result = $fabric->setMultiContract(['https://example.com/file1.gz']); + + $this->assertInstanceOf(HTTPMultiRequestFactory::class, $result); + $this->assertSame($fabric, $result); + } + + /** + * @test + */ + public function testFillMultiContractReturnsItself() + { + $fabric = new HTTPMultiRequestFactory(); + + $result = $fabric->fillMultiContract([]); + + $this->assertInstanceOf(HTTPMultiRequestFactory::class, $result); + $this->assertSame($fabric, $result); + } +} diff --git a/tests/ApbctWP/HTTP/TestHTTPRequestContract.php b/tests/ApbctWP/HTTP/TestHTTPRequestContract.php new file mode 100644 index 000000000..47a1a4dd2 --- /dev/null +++ b/tests/ApbctWP/HTTP/TestHTTPRequestContract.php @@ -0,0 +1,70 @@ +assertEquals($url, $contract->url); + $this->assertEquals('', $contract->content); + $this->assertFalse($contract->success); + $this->assertNull($contract->error_msg); + } + + /** + * @test + */ + public function testPropertiesCanBeModified() + { + $contract = new HTTPRequestContract('https://example.com/file1.gz'); + + $contract->content = 'test content'; + $contract->success = true; + $contract->error_msg = 'test error'; + + $this->assertEquals('test content', $contract->content); + $this->assertTrue($contract->success); + $this->assertEquals('test error', $contract->error_msg); + } + + /** + * @test + */ + public function testSuccessStateWithContent() + { + $contract = new HTTPRequestContract('https://example.com/file1.gz'); + + $contract->success = true; + $contract->content = 'downloaded content'; + + $this->assertTrue($contract->success); + $this->assertNotEmpty($contract->content); + $this->assertNull($contract->error_msg); + } + + /** + * @test + */ + public function testFailureStateWithError() + { + $contract = new HTTPRequestContract('https://example.com/file1.gz'); + + $contract->success = false; + $contract->error_msg = 'Connection timeout'; + + $this->assertFalse($contract->success); + $this->assertEquals('Connection timeout', $contract->error_msg); + $this->assertEmpty($contract->content); + } +} diff --git a/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php b/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php new file mode 100644 index 000000000..b8e54e4f6 --- /dev/null +++ b/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php @@ -0,0 +1,440 @@ +apbctBackup = $apbct; + + $this->testFolder = sys_get_temp_dir() . '/test_sfw_' . time() . '/'; + if (!is_dir($this->testFolder)) { + mkdir($this->testFolder, 0777, true); + } + + $apbct = new State('cleantalk', array('settings', 'data', 'errors', 'remote_calls', 'stats', 'fw_stats')); + $apbct->data = ['sfw_update__batch_size' => 10]; + $apbct->fw_stats = ['updating_folder' => $this->testFolder]; + $apbct->save = function($key) {}; + } + + protected function tearDown() + { + parent::tearDown(); + global $apbct; + + if (is_dir($this->testFolder)) { + $files = glob($this->testFolder . '/*'); + if ($files) { + foreach ($files as $file) { + if (is_file($file)) { + unlink($file); + } + } + } + rmdir($this->testFolder); + } + + $apbct = $this->apbctBackup; + } + + /** + * @test + */ + public function testReturnsErrorWhenFolderNotWritable() + { + global $apbct; + $apbct->fw_stats['updating_folder'] = '/nonexistent/path/'; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->getMock(); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles(['https://example.com/file1.gz'], false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('NOT WRITABLE', $result['error']); + $this->assertArrayNotHasKey('update_args', $result); + } + + /** + * @test + */ + public function testReturnsErrorWhenUrlsNotArray() + { + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->getMock(); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles('NOT AN ARRAY', false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('SHOULD BE AN ARRAY', $result['error']); + } + + /** + * @test + */ + public function testReturnsSuccessStageWhenEmptyUrlsArray() + { + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->getMock(); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles([], false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('next_stage', $result); + $this->assertEquals('apbct_sfw_update__create_tables', $result['next_stage']['name']); + } + + /** + * @test + */ + public function testReturnsTrueWhenEmptyUrlsAndDirectUpdateTrue() + { + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->getMock(); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles([], true, 0); + + $this->assertTrue((bool)$result); + } + + /** + * @test + */ + public function testReturnsErrorWhenContractProcessNotDone() + { + $urls = ['https://example.com/file1.gz']; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract']) + ->getMock(); + + $mockFabric->expects($this->once()) + ->method('setMultiContract') + ->with($urls) + ->willReturnCallback(function() use ($mockFabric) { + $mockFabric->process_done = false; + $mockFabric->error_msg = 'CONTRACT PROCESSING FAILED'; + return $mockFabric; + }); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles($urls, false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('CONTRACT PROCESSING FAILED', $result['error']); + } + + /** + * @test + */ + public function testReturnsRepeatStageWhenSomeFilesFailedToDownload() + { + global $apbct; + $apbct->fw_stats['multi_request_batch_size'] = 10; + + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz', + 'https://example.com/file3.gz' + ]; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function() use ($mockFabric) { + $mockFabric->process_done = true; + $mockFabric->suggest_batch_reduce_to = 2; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn(['https://example.com/file2.gz']); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturn(['https://example.com/file1.gz', 'https://example.com/file3.gz']); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles($urls, false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('NOT COMPLETED, TRYING AGAIN', $result['error']); + $this->assertArrayHasKey('update_args', $result); + $this->assertEquals(['https://example.com/file2.gz'], $result['update_args']['args']); + $this->assertEquals(2, $apbct->fw_stats['multi_request_batch_size']); + } + + /** + * @test + */ + public function testReturnsErrorWhenWriteToFileSystemFails() + { + $urls = ['https://example.com/file1.gz']; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function() use ($mockFabric) { + $mockFabric->process_done = true; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn([]); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturn('CAN NOT WRITE TO FILE: /test/file1.gz'); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles($urls, false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('CAN NOT WRITE TO FILE', $result['error']); + $this->assertStringContainsString('/test/file1.gz', $result['error']); + } + + /** + * @test + */ + public function testReturnsNextStageWhenAllFilesDownloadedSuccessfully() + { + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz' + ]; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function() use ($mockFabric) { + $mockFabric->process_done = true; + $mockFabric->suggest_batch_reduce_to = false; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn([]); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturn($urls); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles($urls, false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('next_stage', $result); + $this->assertEquals('apbct_sfw_update__create_tables', $result['next_stage']['name']); + } + + /** + * @test + */ + public function testProcessesUrlsInBatchesAccordingToBatchSize() + { + global $apbct; + $apbct->fw_stats['multi_request_batch_size'] = 3; + + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz', + 'https://example.com/file3.gz', + 'https://example.com/file4.gz', + 'https://example.com/file5.gz' + ]; + + $callCount = 0; + $receivedBatches = []; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function($batchUrls) use ($mockFabric, &$callCount, &$receivedBatches) { + $callCount++; + $receivedBatches[] = $batchUrls; + $mockFabric->process_done = true; + $mockFabric->suggest_batch_reduce_to = false; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn([]); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturnCallback(function() use (&$receivedBatches, &$callCount) { + return $receivedBatches[$callCount - 1]; + }); + + $downloader = new SFWFilesDownloader($mockFabric); + $downloader->downloadFiles($urls, false, 0); + + $this->assertEquals(2, $callCount); + $this->assertCount(3, $receivedBatches[0]); + $this->assertCount(2, $receivedBatches[1]); + } + + /** + * @test + */ + public function testReducesBatchSizeToMinimumWhenMultipleSuggestions() + { + global $apbct; + $apbct->fw_stats['multi_request_batch_size'] = 10; + + $urls = []; + for ($i = 0; $i < 20; $i++) { + $urls[] = 'https://example.com/file' . $i . '.gz'; + } + + $callCount = 0; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function($batchUrls) use ($mockFabric, &$callCount) { + $callCount++; + $mockFabric->process_done = true; + $mockFabric->suggest_batch_reduce_to = $callCount === 1 ? 7 : 5; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturnCallback(function() use (&$callCount, $urls) { + $batchStart = ($callCount - 1) * 10; + return [$urls[$batchStart]]; + }); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturnCallback(function() use (&$callCount, $urls) { + $batchStart = ($callCount - 1) * 10; + $batchSize = min(10, count($urls) - $batchStart); + $result = []; + for ($i = 1; $i < $batchSize; $i++) { + $result[] = $urls[$batchStart + $i]; + } + return $result; + }); + + $downloader = new SFWFilesDownloader($mockFabric); + $downloader->downloadFiles($urls, false, 0); + + $this->assertEquals(5, $apbct->fw_stats['multi_request_batch_size']); + } + + /** + * @test + */ + public function testReturnsErrorWhenNotAllFilesDownloadedAfterBatches() + { + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz' + ]; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent', 'getContractsErrors']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function() use ($mockFabric) { + $mockFabric->process_done = true; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn([]); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturn(['https://example.com/file1.gz']); + + $mockFabric->method('getContractsErrors') + ->willReturn('[url1]:[error1],[url2]:[error2]'); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles($urls, false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('NOT COMPLETED - STOP UPDATE', $result['error']); + $this->assertStringContainsString('[url1]:[error1],[url2]:[error2]', $result['error']); + } + + /** + * @test + */ + public function testRemovesDuplicateUrlsAndResetsKeys() + { + $urls = [ + 5 => 'https://example.com/file1.gz', + 7 => 'https://example.com/file1.gz', + 9 => 'https://example.com/file2.gz' + ]; + + $receivedUrls = null; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function($batchUrls) use ($mockFabric, &$receivedUrls) { + $receivedUrls = $batchUrls; + $mockFabric->process_done = true; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn([]); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturn(['https://example.com/file1.gz', 'https://example.com/file2.gz']); + + $downloader = new SFWFilesDownloader($mockFabric); + $downloader->downloadFiles($urls, false, 0); + + $this->assertCount(2, $receivedUrls); + $this->assertEquals(['https://example.com/file1.gz', 'https://example.com/file2.gz'], $receivedUrls); + } +} From 2b3416e28fce9195aef2f095ed3afcd4a1a394f5 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Mon, 19 Jan 2026 17:24:52 +0500 Subject: [PATCH 02/60] Test codecov. #1 --- tests/ApbctWP/Firewall/SFWUpdateHelperTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php b/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php index ff8454759..9f7871a16 100644 --- a/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php +++ b/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php @@ -15,7 +15,7 @@ protected function setUp() global $apbct; $this->apbctBackup = $apbct; - // Setup mock $apbct global + // Setup mock for $apbct global $apbct = new \stdClass(); $apbct->fw_stats['multi_request_batch_size'] = 10; } From 258380cd1d7b93f765aabbe47953b1fe9cd1796d Mon Sep 17 00:00:00 2001 From: alexandergull Date: Mon, 19 Jan 2026 17:38:56 +0500 Subject: [PATCH 03/60] Test codecov - master. #2 --- tests/ApbctWP/Firewall/SFWUpdateHelperTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php b/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php index 9f7871a16..ff8454759 100644 --- a/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php +++ b/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php @@ -15,7 +15,7 @@ protected function setUp() global $apbct; $this->apbctBackup = $apbct; - // Setup mock for $apbct global + // Setup mock $apbct global $apbct = new \stdClass(); $apbct->fw_stats['multi_request_batch_size'] = 10; } From 6b63bc9b22b67465a82a6b2dd74c3ae721ab3617 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Mon, 19 Jan 2026 17:59:10 +0500 Subject: [PATCH 04/60] Fix. Codecov. --- .../ApbctWP/HTTP/HTTPMultiRequestFactory.php | 13 +++++++++- .../HTTP/TestHTTPMultiRequestFactory.php | 26 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestFactory.php b/lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestFactory.php index bcc66f4eb..20f4473b5 100644 --- a/lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestFactory.php +++ b/lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestFactory.php @@ -313,7 +313,7 @@ public function writeSuccessURLsContent($write_to_dir) $file_name = $write_to_dir . self::getFilenameFromUrl($single_contract->url); // Write content to file - $write_result = file_put_contents($file_name, $single_contract->content); + $write_result = $this->writeFile($file_name, $single_contract->content); // Check for write failure if (false === $write_result) { @@ -346,4 +346,15 @@ private static function getFilenameFromUrl($url) { return pathinfo($url, PATHINFO_FILENAME) . '.' . pathinfo($url, PATHINFO_EXTENSION); } + + /** + * Wrapper for file_put_contents. + * @param $filename + * @param $data + * @return false|int + */ + public function writeFile($filename, $data) + { + return @file_put_contents($filename, $data); + } } diff --git a/tests/ApbctWP/HTTP/TestHTTPMultiRequestFactory.php b/tests/ApbctWP/HTTP/TestHTTPMultiRequestFactory.php index 7b9ea3004..a5a298500 100644 --- a/tests/ApbctWP/HTTP/TestHTTPMultiRequestFactory.php +++ b/tests/ApbctWP/HTTP/TestHTTPMultiRequestFactory.php @@ -533,4 +533,30 @@ public function testFillMultiContractReturnsItself() $this->assertInstanceOf(HTTPMultiRequestFactory::class, $result); $this->assertSame($fabric, $result); } + + /** + * @test + */ + public function testWriteSuccessURLsContentHandlesFileWriteFailure() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) + ->setMethods(['writeFile']) + ->getMock(); + + // Mock writeFile to return false (simulating write failure) + $fabric->expects($this->once()) + ->method('writeFile') + ->willReturn(false); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $fabric->contracts = [$contract1]; + + $result = $fabric->writeSuccessURLsContent($this->testFolder); + + $this->assertIsString($result); + $this->assertStringContainsString('CAN NOT WRITE TO FILE', $result); + } } From 7bca54817cdcbdd7298b4d8f7e437515723b7e4f Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 21 Jan 2026 16:40:36 +0700 Subject: [PATCH 05/60] New. ShadowrootProtection. Implementation of form protection in Shadowroot elements, integration with Mailchimp shadowroot --- inc/cleantalk-integrations-by-hook.php | 7 +- inc/cleantalk-pluggable.php | 1 + js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- ...lic-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- ...ic-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- ...lic-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 389 ++++++++++------- .../apbct-public-bundle_ext-protection.js | 389 ++++++++++------- ...-public-bundle_ext-protection_gathering.js | 389 ++++++++++------- .../apbct-public-bundle_full-protection.js | 389 ++++++++++------- ...public-bundle_full-protection_gathering.js | 389 ++++++++++------- js/prebuild/apbct-public-bundle_gathering.js | 389 ++++++++++------- .../apbct-public-bundle_int-protection.js | 389 ++++++++++------- ...-public-bundle_int-protection_gathering.js | 389 ++++++++++------- js/src/public-1-main.js | 391 +++++++++++------- .../Integrations/MailChimpShadowRoot.php | 68 +++ 20 files changed, 2199 insertions(+), 1396 deletions(-) create mode 100644 lib/Cleantalk/Antispam/Integrations/MailChimpShadowRoot.php diff --git a/inc/cleantalk-integrations-by-hook.php b/inc/cleantalk-integrations-by-hook.php index 00f5a371f..6dbcccb8a 100755 --- a/inc/cleantalk-integrations-by-hook.php +++ b/inc/cleantalk-integrations-by-hook.php @@ -21,6 +21,11 @@ 'setting' => 'forms__check_external', 'ajax' => true ), + 'MailChimpShadowRoot' => array( + 'hook' => 'cleantalk_force_mailchimp_shadowroot_check', + 'setting' => 'forms__check_external', + 'ajax' => true + ), 'CleantalkPreprocessComment' => array( 'hook' => 'preprocess_comment', 'setting' => 'forms__comments_test', @@ -334,7 +339,7 @@ ), // Mail chimp integration works with ajax and POST via the same hook 'MailChimp' => array( - 'hook' => 'mc4wp_form_errors', + 'hook' => array('mc4wp_form_errors', 'cleantalk_force_mailchimp_shadowroot_check'), 'setting' => 'forms__registrations_test', 'ajax' => false ), diff --git a/inc/cleantalk-pluggable.php b/inc/cleantalk-pluggable.php index 9fa9bf170..382c2fd71 100644 --- a/inc/cleantalk-pluggable.php +++ b/inc/cleantalk-pluggable.php @@ -714,6 +714,7 @@ function apbct_is_skip_request($ajax = false, $ajax_message_obj = array()) 'nasa_process_login', //Nasa login 'leaky_paywall_validate_registration', //Leaky Paywall validation request 'cleantalk_force_ajax_check', //Force ajax check has direct integration + 'cleantalk_force_mailchimp_shadowroot_check', // Mailchimp ShadowRoot has direct integration 'cscf-submitform', // CSCF has direct integration 'mailpoet', // Mailpoet has direct integration 'wpcommunity_auth_login', // WPCommunity login diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index 13d2517c4..506829151 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,i,c,r,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,i=n,d=o||[],u=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return c=e,r=0,l=m,p.n=t,f}},function(e,t,n){if(1t||i=e.length?{done:!0}:{done:!1,value:e[i++]}},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===i[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===i[t].href||0!==i[t].href.indexOf("mailto:")&&0!==i[t].href.indexOf("tel:"))i[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i[t])},2e3);else{if(0===i[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==i[t].href.indexOf("tel:"))return 0;e="tel:"}var o=i[t].href.replace(e,""),a=i[t].innerHTML;i[t].innerHTML=a.replace(o,n.decoded_email),i[t].href=e+n.decoded_email,i[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})}i[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];i.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i)},2e3),i.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'):(i.innerHTML="Loading...",t&&this.load(t)),i.setAttribute("id","cleantalk-modal-content"),n.append(i),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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&n&&n[0]&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")&&n[1]&&n[1].body&&"string"==typeof n[1].body){try{a=JSON.parse(n[1].body)}catch(e){a={}}+ctPublic.settings__data__bot_detector_enabled?a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):a.ct_no_cookie_hidden_field=getNoCookieData(),n[1].body=JSON.stringify(a)}n&&n[0]&&n[0].includes("/wc/store/v1/cart/add-item")&&n&&n[1]&&n[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(i=JSON.parse(n[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(i.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),n[1].body=JSON.stringify(i)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&n&&n[0]&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1]&&n[1].body&&n[1].body instanceof FormData)){e.n=6;break}i=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(i.elements);try{for(r.s();!(l=r.n()).done;)c[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(u=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(u=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(u){e.n=7;break}return e.a(2,defaultFetch.apply(window,n));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n,o,a,i={found:!1,keepUnwrapped:!1};"string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(i.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(i.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(i.found="action=mailpoet"),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(i.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(i.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(i.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(i.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(i.found="action=drplus_signup",i.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(i.found="action=bt_cc",i.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&"none"===ctPublic.data__cookies_type&&(i.found="action=nf_ajax_submit",i.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(i.found="wc-ajax=add_to_cart"),!1!==i.found&&(o=n="",+ctPublic.settings__data__bot_detector_enabled?(a=(new c).toolGetEventToken())&&(n=i.keepUnwrapped?"ct_bot_detector_event_token="+a+"&":"data%5Bct_bot_detector_event_token%5D="+a+"&"):(o=getNoCookieData(),o=i.keepUnwrapped?"ct_no_cookie_hidden_field="+o+"&":"data%5Bct_no_cookie_hidden_field%5D="+o+"&"),t.data=o+n+t.data)}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&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,i=t.querySelector('[name*="apbct_email_id__"]'),c=null,r=(null!==i&&null!==i.value&&(c=i.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===i&&null===l||(e.preventDefault(),n=function(){null!==i&&i.parentNode.removeChild(i),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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,i,c,r,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(u.phrases.trpHeading),(i=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),i.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(r),c.append(" "),c.append(u.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),r.append(l)),i.append(c,r),a.append(i),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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function _(){}function r(){}function f(){}var t={},m=(u(t,o,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,o)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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 7bcf0a83d..c5d7b41dd 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1 +1 @@ -function _regenerator(){var _,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,i,r,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,d=o||[],u=!1,p={p:s=0,n:0,v:_,a:m,f:m.bind(_,4),d:function(e,t){return i=e,r=0,l=_,p.n=t,f}},function(e,t,n){if(1t||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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&n&&n[0]&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")&&n[1]&&n[1].body&&"string"==typeof n[1].body){try{a=JSON.parse(n[1].body)}catch(e){a={}}+ctPublic.settings__data__bot_detector_enabled?a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):a.ct_no_cookie_hidden_field=getNoCookieData(),n[1].body=JSON.stringify(a)}n&&n[0]&&n[0].includes("/wc/store/v1/cart/add-item")&&n&&n[1]&&n[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(c=JSON.parse(n[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(c.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),n[1].body=JSON.stringify(c)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&n&&n[0]&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1]&&n[1].body&&n[1].body instanceof FormData)){e.n=6;break}c=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(c.elements);try{for(r.s();!(l=r.n()).done;)i[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(a,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(u=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(u=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(u){e.n=7;break}return e.a(2,defaultFetch.apply(window,n));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n,o,a,c={found:!1,keepUnwrapped:!1};"string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(c.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(c.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(c.found="action=mailpoet"),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(c.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(c.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(c.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(c.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(c.found="action=drplus_signup",c.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(c.found="action=bt_cc",c.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&"none"===ctPublic.data__cookies_type&&(c.found="action=nf_ajax_submit",c.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(c.found="wc-ajax=add_to_cart"),!1!==c.found&&(o=n="",+ctPublic.settings__data__bot_detector_enabled?(a=(new i).toolGetEventToken())&&(n=c.keepUnwrapped?"ct_bot_detector_event_token="+a+"&":"data%5Bct_bot_detector_event_token%5D="+a+"&"):(o=getNoCookieData(),o=c.keepUnwrapped?"ct_no_cookie_hidden_field="+o+"&":"data%5Bct_no_cookie_hidden_field%5D="+o+"&"),t.data=o+n+t.data)}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(u.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(u.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function m(){}function r(){}function f(){}var t={},_=(u(t,o,function(){return this}),Object.getPrototypeOf),_=_&&_(_(x([]))),b=(_&&_!==e&&l.call(_,o)&&(t=_),f.prototype=m.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function v(e){this.tryEntries.push(e)}function g(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(v,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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_gathering.min.js b/js/apbct-public-bundle_ext-protection_gathering.min.js index 9068a8d3e..f7c0843b3 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1 +1 @@ -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function n(e,t,o,n){var c,a,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(c=e,a=o,u=n||[],d=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return i=e,r=0,l=m,p.n=t,f}},function(e,t,o){if(1t||a=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var n=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(n,o.decoded_email),a[t].href=e+o.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),o.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(o=c.n()).done;)n=n||e===o.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),o=0;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&o&&o[0]&&"function"==typeof o[0].includes&&o[0].includes("/wp-json/wp-recipe-maker/")&&o[1]&&o[1].body&&"string"==typeof o[1].body){try{c=JSON.parse(o[1].body)}catch(e){c={}}+ctPublic.settings__data__bot_detector_enabled?c.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):c.ct_no_cookie_hidden_field=getNoCookieData(),o[1].body=JSON.stringify(c)}o&&o[0]&&o[0].includes("/wc/store/v1/cart/add-item")&&o&&o[1]&&o[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(a=JSON.parse(o[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),o[1].body=JSON.stringify(a)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&o&&o[0]&&o[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&o[1]&&o[1].body&&o[1].body instanceof FormData)){e.n=6;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(a.elements);try{for(r.s();!(l=r.n()).done;)i[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(c,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,o,n){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(d=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(d=!0,(new ApbctShowForbidden).parseBlockMessage(e)),c(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(d){e.n=7;break}return e.a(2,defaultFetch.apply(window,o));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var o,n,c,a={found:!1,keepUnwrapped:!1};"string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(a.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(a.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(a.found="action=mailpoet"),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(a.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(a.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(a.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(a.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(a.found="action=drplus_signup",a.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(a.found="action=bt_cc",a.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&"none"===ctPublic.data__cookies_type&&(a.found="action=nf_ajax_submit",a.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(a.found="wc-ajax=add_to_cart"),!1!==a.found&&(n=o="",+ctPublic.settings__data__bot_detector_enabled?(c=(new i).toolGetEventToken())&&(o=a.keepUnwrapped?"ct_bot_detector_event_token="+c+"&":"data%5Bct_bot_detector_event_token%5D="+c+"&"):(n=getNoCookieData(),n=a.keepUnwrapped?"ct_no_cookie_hidden_field="+n+"&":"data%5Bct_no_cookie_hidden_field%5D="+n+"&"),t.data=n+o+t.data)}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var o;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),o=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(n))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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)),a.append(i,r),c.append(a),o.append(n),e.append(o),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function r(e,t,n,o){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=n,i=new k(o||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;n=d(a,c,i);if("normal"===n.type){if(r=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(r=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function m(){}var t={},f=(u(t,o,function(){return this}),Object.getPrototypeOf),f=f&&f(f(x([]))),b=(f&&f!==e&&l.call(f,o)&&(t=f),m.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(n,o){function e(){return new r(function(e,t){!function t(e,n,o,a){var c,e=d(i[e],i,n);if("throw"!==e.type)return(n=(c=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?r.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):r.resolve(n).then(function(e){c.value=e,o(c)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 5d6f240ad..28c4660ca 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1 +1 @@ -function _regenerator(){var _,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,i,r,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,d=o||[],u=!1,p={p:s=0,n:0,v:_,a:m,f:m.bind(_,4),d:function(e,t){return i=e,r=0,l=_,p.n=t,f}},function(e,t,n){if(1t||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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&n&&n[0]&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")&&n[1]&&n[1].body&&"string"==typeof n[1].body){try{a=JSON.parse(n[1].body)}catch(e){a={}}+ctPublic.settings__data__bot_detector_enabled?a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):a.ct_no_cookie_hidden_field=getNoCookieData(),n[1].body=JSON.stringify(a)}n&&n[0]&&n[0].includes("/wc/store/v1/cart/add-item")&&n&&n[1]&&n[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(c=JSON.parse(n[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(c.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),n[1].body=JSON.stringify(c)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&n&&n[0]&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1]&&n[1].body&&n[1].body instanceof FormData)){e.n=6;break}c=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(c.elements);try{for(r.s();!(l=r.n()).done;)i[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(a,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(u=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(u=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(u){e.n=7;break}return e.a(2,defaultFetch.apply(window,n));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n,o,a,c={found:!1,keepUnwrapped:!1};"string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(c.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(c.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(c.found="action=mailpoet"),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(c.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(c.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(c.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(c.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(c.found="action=drplus_signup",c.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(c.found="action=bt_cc",c.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&"none"===ctPublic.data__cookies_type&&(c.found="action=nf_ajax_submit",c.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(c.found="wc-ajax=add_to_cart"),!1!==c.found&&(o=n="",+ctPublic.settings__data__bot_detector_enabled?(a=(new i).toolGetEventToken())&&(n=c.keepUnwrapped?"ct_bot_detector_event_token="+a+"&":"data%5Bct_bot_detector_event_token%5D="+a+"&"):(o=getNoCookieData(),o=c.keepUnwrapped?"ct_no_cookie_hidden_field="+o+"&":"data%5Bct_no_cookie_hidden_field%5D="+o+"&"),t.data=o+n+t.data)}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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,c,i,r,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(u.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(u.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),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 _regeneratorRuntime(){_regeneratorRuntime=function(){return c};var s,c={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function i(e,t,n,o){var a,r,c,i,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,c=new k(o||[]),i=1,function(e,t){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===e)throw t;return{value:s,done:!0}}for(c.method=e,c.arg=t;;){var n=c.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,c);if(n){if(n===p)continue;return n}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(1===i)throw i=4,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);i=3;n=d(a,r,c);if("normal"===n.type){if(i=c.done?4:2,n.arg===p)continue;return{value:n.arg,done:c.done}}"throw"===n.type&&(i=4,c.method="throw",c.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}c.wrap=i;var p={};function m(){}function r(){}function f(){}var t={},_=(u(t,o,function(){return this}),Object.getPrototypeOf),_=_&&_(_(x([]))),b=(_&&_!==e&&l.call(_,o)&&(t=_),f.prototype=m.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(c,i){var t;u(this,"_invoke",function(n,o){function e(){return new i(function(e,t){!function t(e,n,o,a){var r,e=d(c[e],c,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?i.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):i.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function v(e){this.tryEntries.push(e)}function g(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(v,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index cecfc51b5..d5c5ad6f6 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1 +1 @@ -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function n(e,t,o,n){var c,a,i,r,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(c=e,a=o,d=n||[],u=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return i=e,r=0,l=m,p.n=t,f}},function(e,t,o){if(1t||a=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var n=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(n,o.decoded_email),a[t].href=e+o.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),o.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(o=c.n()).done;)n=n||e===o.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),o=0;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&o&&o[0]&&"function"==typeof o[0].includes&&o[0].includes("/wp-json/wp-recipe-maker/")&&o[1]&&o[1].body&&"string"==typeof o[1].body){try{c=JSON.parse(o[1].body)}catch(e){c={}}+ctPublic.settings__data__bot_detector_enabled?c.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):c.ct_no_cookie_hidden_field=getNoCookieData(),o[1].body=JSON.stringify(c)}o&&o[0]&&o[0].includes("/wc/store/v1/cart/add-item")&&o&&o[1]&&o[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(a=JSON.parse(o[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),o[1].body=JSON.stringify(a)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&o&&o[0]&&o[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&o[1]&&o[1].body&&o[1].body instanceof FormData)){e.n=6;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(a.elements);try{for(r.s();!(l=r.n()).done;)i[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(c,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,o,n){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(u=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(u=!0,(new ApbctShowForbidden).parseBlockMessage(e)),c(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(u){e.n=7;break}return e.a(2,defaultFetch.apply(window,o));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var o,n,c,a={found:!1,keepUnwrapped:!1};"string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(a.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(a.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(a.found="action=mailpoet"),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(a.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(a.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(a.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(a.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(a.found="action=drplus_signup",a.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(a.found="action=bt_cc",a.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&"none"===ctPublic.data__cookies_type&&(a.found="action=nf_ajax_submit",a.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(a.found="wc-ajax=add_to_cart"),!1!==a.found&&(n=o="",+ctPublic.settings__data__bot_detector_enabled?(c=(new i).toolGetEventToken())&&(o=a.keepUnwrapped?"ct_bot_detector_event_token="+c+"&":"data%5Bct_bot_detector_event_token%5D="+c+"&"):(n=getNoCookieData(),n=a.keepUnwrapped?"ct_no_cookie_hidden_field="+n+"&":"data%5Bct_no_cookie_hidden_field%5D="+n+"&"),t.data=n+o+t.data)}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var o;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),o=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(n))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 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,c,a,i,r,l,s,d;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",u.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(u.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(u.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),r.append(l)),a.append(i,r),c.append(a),o.append(n),e.append(o),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",c=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function r(e,t,n,o){var c,a,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(c=e,a=n,i=new k(o||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,c=t.i[o];if(c===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(c,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;c=o.arg;return c?c.done?(n[t.r]=c.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):c:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;n=d(c,a,i);if("normal"===n.type){if(r=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(r=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function a(){}function m(){}var t={},f=(u(t,o,function(){return this}),Object.getPrototypeOf),f=f&&f(f(x([]))),b=(f&&f!==e&&l.call(f,o)&&(t=f),m.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(n,o){function e(){return new r(function(e,t){!function t(e,n,o,c){var a,e=d(i[e],i,n);if("throw"!==e.type)return(n=(a=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?r.resolve(n.__await).then(function(e){t("next",e,o,c)},function(e){t("throw",e,o,c)}):r.resolve(n).then(function(e){a.value=e,o(a)},function(e){return t("throw",e,o,c)});c(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var o=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(o,n.decoded_email),a[t].href=e+n.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),n.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(n=c.n()).done;)o=o||e===n.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),n=0;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),n=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(o))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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)),a.append(i,r),c.append(a),n.append(o),e.append(n),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=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_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index c0832c2a2..946473443 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1 +1 @@ -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function n(e,t,o,n){var c,a,i,r,l,s,u,d,_,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(c=e,a=o,u=n||[],d=!1,_={p:s=0,n:0,v:m,a:p,f:p.bind(m,4),d:function(e,t){return i=e,r=0,l=m,_.n=t,f}},function(e,t,o){if(1t||a=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var n=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(n,o.decoded_email),a[t].href=e+o.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),o.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(o=c.n()).done;)n=n||e===o.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),o=0;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&o&&o[0]&&"function"==typeof o[0].includes&&o[0].includes("/wp-json/wp-recipe-maker/")&&o[1]&&o[1].body&&"string"==typeof o[1].body){try{c=JSON.parse(o[1].body)}catch(e){c={}}+ctPublic.settings__data__bot_detector_enabled?c.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):c.ct_no_cookie_hidden_field=getNoCookieData(),o[1].body=JSON.stringify(c)}o&&o[0]&&o[0].includes("/wc/store/v1/cart/add-item")&&o&&o[1]&&o[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(a=JSON.parse(o[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),o[1].body=JSON.stringify(a)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&o&&o[0]&&o[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&o[1]&&o[1].body&&o[1].body instanceof FormData)){e.n=6;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(a.elements);try{for(r.s();!(l=r.n()).done;)i[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(c,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,o,n){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(d=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(d=!0,(new ApbctShowForbidden).parseBlockMessage(e)),c(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(d){e.n=7;break}return e.a(2,defaultFetch.apply(window,o));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var o,n,c,a={found:!1,keepUnwrapped:!1};"string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(a.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(a.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(a.found="action=mailpoet"),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(a.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(a.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(a.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(a.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(a.found="action=drplus_signup",a.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(a.found="action=bt_cc",a.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&"none"===ctPublic.data__cookies_type&&(a.found="action=nf_ajax_submit",a.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(a.found="wc-ajax=add_to_cart"),!1!==a.found&&(n=o="",+ctPublic.settings__data__bot_detector_enabled?(c=(new i).toolGetEventToken())&&(o=a.keepUnwrapped?"ct_bot_detector_event_token="+c+"&":"data%5Bct_bot_detector_event_token%5D="+c+"&"):(n=getNoCookieData(),n=a.keepUnwrapped?"ct_no_cookie_hidden_field="+n+"&":"data%5Bct_no_cookie_hidden_field%5D="+n+"&"),t.data=n+o+t.data)}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var o;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),o=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(n))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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),_&&(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)),a.append(i,r),c.append(a),o.append(n),e.append(o),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,o,n){return Object.defineProperty(e,t,{value:o,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(s){u=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=o,i=new k(n||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,a=t.i[n];if(a===s)return o.delegate=null,"throw"===n&&t.i.return&&(o.method="return",o.arg=s,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;n=d(a,t.i,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;a=n.arg;return a?a.done?(o[t.r]=a.value,o.next=t.n,"return"!==o.method&&(o.method="next",o.arg=s),o.delegate=null,p):a:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}(o,i);if(o){if(o===p)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;o=d(a,c,i);if("normal"===o.type){if(r=i.done?4:2,o.arg===p)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=4,i.method="throw",i.arg=o.arg)}}),!0),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function f(){}var t={},m=(u(t,n,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,n)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,a){var c,e=d(i[e],i,o);if("throw"!==e.type)return(o=(c=e.arg).value)&&"object"==_typeof(o)&&l.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,a)},function(e){t("throw",e,n,a)}):r.resolve(o).then(function(e){c.value=e,n(c)},function(e){return t("throw",e,n,a)});a(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 9cebb66f0..0859b92d2 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1 +1 @@ -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,i,c,r,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,i=n,d=o||[],u=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return c=e,r=0,l=m,p.n=t,f}},function(e,t,n){if(1t||i=e.length?{done:!0}:{done:!1,value:e[i++]}},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===i[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===i[t].href||0!==i[t].href.indexOf("mailto:")&&0!==i[t].href.indexOf("tel:"))i[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i[t])},2e3);else{if(0===i[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==i[t].href.indexOf("tel:"))return 0;e="tel:"}var o=i[t].href.replace(e,""),a=i[t].innerHTML;i[t].innerHTML=a.replace(o,n.decoded_email),i[t].href=e+n.decoded_email,i[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})}i[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];i.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i)},2e3),i.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'):(i.innerHTML="Loading...",t&&this.load(t)),i.setAttribute("id","cleantalk-modal-content"),n.append(i),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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&n&&n[0]&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")&&n[1]&&n[1].body&&"string"==typeof n[1].body){try{a=JSON.parse(n[1].body)}catch(e){a={}}+ctPublic.settings__data__bot_detector_enabled?a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):a.ct_no_cookie_hidden_field=getNoCookieData(),n[1].body=JSON.stringify(a)}n&&n[0]&&n[0].includes("/wc/store/v1/cart/add-item")&&n&&n[1]&&n[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(i=JSON.parse(n[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(i.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),n[1].body=JSON.stringify(i)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&n&&n[0]&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1]&&n[1].body&&n[1].body instanceof FormData)){e.n=6;break}i=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(i.elements);try{for(r.s();!(l=r.n()).done;)c[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(u=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(u=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(u){e.n=7;break}return e.a(2,defaultFetch.apply(window,n));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n,o,a,i={found:!1,keepUnwrapped:!1};"string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(i.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(i.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(i.found="action=mailpoet"),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(i.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(i.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(i.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(i.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(i.found="action=drplus_signup",i.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(i.found="action=bt_cc",i.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&"none"===ctPublic.data__cookies_type&&(i.found="action=nf_ajax_submit",i.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(i.found="wc-ajax=add_to_cart"),!1!==i.found&&(o=n="",+ctPublic.settings__data__bot_detector_enabled?(a=(new c).toolGetEventToken())&&(n=i.keepUnwrapped?"ct_bot_detector_event_token="+a+"&":"data%5Bct_bot_detector_event_token%5D="+a+"&"):(o=getNoCookieData(),o=i.keepUnwrapped?"ct_no_cookie_hidden_field="+o+"&":"data%5Bct_no_cookie_hidden_field%5D="+o+"&"),t.data=o+n+t.data)}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&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,i=t.querySelector('[name*="apbct_email_id__"]'),c=null,r=(null!==i&&null!==i.value&&(c=i.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===i&&null===l||(e.preventDefault(),n=function(){null!==i&&i.parentNode.removeChild(i),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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,i,c,r,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(u.phrases.trpHeading),(i=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),i.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(r),c.append(" "),c.append(u.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),r.append(l)),i.append(c,r),a.append(i),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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function _(){}function r(){}function f(){}var t={},m=(u(t,o,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,o)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index 9021a0c0b..82825533b 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1 +1 @@ -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function n(e,t,o,n){var c,a,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(c=e,a=o,u=n||[],d=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return i=e,r=0,l=m,p.n=t,f}},function(e,t,o){if(1t||a=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var n=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(n,o.decoded_email),a[t].href=e+o.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),o.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(o=c.n()).done;)n=n||e===o.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),o=0;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&o&&o[0]&&"function"==typeof o[0].includes&&o[0].includes("/wp-json/wp-recipe-maker/")&&o[1]&&o[1].body&&"string"==typeof o[1].body){try{c=JSON.parse(o[1].body)}catch(e){c={}}+ctPublic.settings__data__bot_detector_enabled?c.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):c.ct_no_cookie_hidden_field=getNoCookieData(),o[1].body=JSON.stringify(c)}o&&o[0]&&o[0].includes("/wc/store/v1/cart/add-item")&&o&&o[1]&&o[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(a=JSON.parse(o[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),o[1].body=JSON.stringify(a)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&o&&o[0]&&o[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&o[1]&&o[1].body&&o[1].body instanceof FormData)){e.n=6;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(a.elements);try{for(r.s();!(l=r.n()).done;)i[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(c,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,o,n){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(d=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(d=!0,(new ApbctShowForbidden).parseBlockMessage(e)),c(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(d){e.n=7;break}return e.a(2,defaultFetch.apply(window,o));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var o,n,c,a={found:!1,keepUnwrapped:!1};"string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(a.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(a.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(a.found="action=mailpoet"),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(a.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(a.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(a.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(a.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(a.found="action=drplus_signup",a.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(a.found="action=bt_cc",a.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&"none"===ctPublic.data__cookies_type&&(a.found="action=nf_ajax_submit",a.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(a.found="wc-ajax=add_to_cart"),!1!==a.found&&(n=o="",+ctPublic.settings__data__bot_detector_enabled?(c=(new i).toolGetEventToken())&&(o=a.keepUnwrapped?"ct_bot_detector_event_token="+c+"&":"data%5Bct_bot_detector_event_token%5D="+c+"&"):(n=getNoCookieData(),n=a.keepUnwrapped?"ct_no_cookie_hidden_field="+n+"&":"data%5Bct_no_cookie_hidden_field%5D="+n+"&"),t.data=n+o+t.data)}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var o;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),o=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(n))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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)),a.append(i,r),c.append(a),o.append(n),e.append(o),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,o,n){return Object.defineProperty(e,t,{value:o,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(s){u=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=o,i=new k(n||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,a=t.i[n];if(a===s)return o.delegate=null,"throw"===n&&t.i.return&&(o.method="return",o.arg=s,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;n=d(a,t.i,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;a=n.arg;return a?a.done?(o[t.r]=a.value,o.next=t.n,"return"!==o.method&&(o.method="next",o.arg=s),o.delegate=null,p):a:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}(o,i);if(o){if(o===p)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;o=d(a,c,i);if("normal"===o.type){if(r=i.done?4:2,o.arg===p)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=4,i.method="throw",i.arg=o.arg)}}),!0),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function f(){}var t={},m=(u(t,n,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,n)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,a){var c,e=d(i[e],i,o);if("throw"!==e.type)return(o=(c=e.arg).value)&&"object"==_typeof(o)&&l.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,a)},function(e){t("throw",e,n,a)}):r.resolve(o).then(function(e){c.value=e,n(c)},function(e){return t("throw",e,n,a)});a(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 0d5ca2035..2b2ecd962 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -2933,177 +2933,258 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - setTimeout(function() { - if ( - ( - document.forms && document.forms.length > 0 && - ( - Array.from(document.forms).some((form) => - form.classList.contains('metform-form-content')) || - Array.from(document.forms).some((form) => - form.classList.contains('wprm-user-ratings-modal-stars-container')) || - Array.from(document.forms).some((form) => { - if (form.parentElement && - form.parentElement.classList.length > 0 && - form.parentElement.classList[0].indexOf('b24-form-content') !== -1 + const apbctShadowRootFormsConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + }, + }; + + let preventOriginalFetch = false; + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey - The form key from config (e.g., 'mailchimp') + * @param {object} config - The form config object with action, selector, etc. + * @param {string} bodyText - The request body as string + * @return {Promise} - true = block, false = allow + */ + async function apbctCheckShadowRootRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + // Prepare data for AJAX request + let data = { + action: config.action, + }; + + // Parse bodyText and add form fields + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + // If parsing fails, send raw body + data.raw_body = bodyText; + } + + // Add event token or no_cookie data + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) ) { - return true; + resolve(false); // false = allow + return; } - }) - ) - ) || - ( - document.querySelectorAll('button').length > 0 && - Array.from(document.querySelectorAll('button')).some((button) => { - return button.classList.contains('add_to_cart_button') || - button.classList.contains('ajax_add_to_cart') || - button.classList.contains('single_add_to_cart_button'); - }) - ) || - ( - document.links && document.links.length > 0 && - Array.from(document.links).some((link) => { - return link.classList.contains('add_to_cart_button'); - }) - ) - ) { - let preventOriginalFetch = false; - window.fetch = async function(...args) { - // Metform block - if ( - Array.from(document.forms).some((form) => form.classList.contains('metform-form-content')) && - args && - args[0] && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return false; - } - })()) - ) - ) { - if (args && args[1] && args[1].body) { - if (+ctPublic.settings__data__bot_detector_enabled) { - args[1].body.append( - 'ct_bot_detector_event_token', - apbctLocalStorage.get('bot_detector_event_token'), - ); - } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + resolve(true); // true = block + return; } - } + + // Default: allow + resolve(false); + }, + onErrorCallback: function(error) { + console.log('APBCT ShadowRoot check error:', error); + // On error, allow the request to proceed + resolve(false); + }, + }, + ); + }); + } + + window.fetch = async function(...args) { + // Reset flag for each new request + //preventOriginalFetch = false; + let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); + + // === ShadowRoot forms === + for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + // Get request body + let body = args[1] && args[1].body; + let bodyText = ''; + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) obj[key] = value; + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; } - // WP Recipe Maker block - if ( - Array.from(document.forms).some( - (form) => form.classList.contains('wprm-user-ratings-modal-stars-container'), - ) && - args && - args[0] && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - if (args[1] && args[1].body) { - if (typeof args[1].body === 'string') { - let bodyObj; - try { - bodyObj = JSON.parse(args[1].body); - } catch (e) { - bodyObj = {}; - } - if (+ctPublic.settings__data__bot_detector_enabled) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - } else { - bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); - } - args[1].body = JSON.stringify(bodyObj); - } + + const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); + if (shouldBlock) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + // If not blocking — continue to the original fetch + } + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; } + })()) + ) + ) { + if (args && args[1] && args[1].body) { + if (+ctPublic.settings__data__bot_detector_enabled) { + args[1].body.append( + 'ct_bot_detector_event_token', + apbctLocalStorage.get('bot_detector_event_token'), + ); + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); } + } + } - // WooCommerce add to cart request, like: - // /index.php?rest_route=/wc/store/v1/cart/add-item - if (args && args[0] && - args[0].includes('/wc/store/v1/cart/add-item') && - args && args[1] && args[1].body - ) { - if ( - +ctPublic.settings__data__bot_detector_enabled && - +ctPublic.settings__forms__wc_add_to_cart - ) { - try { - let bodyObj = JSON.parse(args[1].body); - if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - args[1].body = JSON.stringify(bodyObj); - } - } catch (e) { - return false; - } + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + if (args[1] && args[1].body) { + if (typeof args[1].body === 'string') { + let bodyObj; + try { + bodyObj = JSON.parse(args[1].body); + } catch (e) { + bodyObj = {}; + } + if (+ctPublic.settings__data__bot_detector_enabled) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); } + args[1].body = JSON.stringify(bodyObj); } + } + } - // bitrix24 EXTERNAL form - if (+ctPublic.settings__forms__check_external && - args && args[0] && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1] && args[1].body && args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args && args[0] && + args[0].includes('/wc/store/v1/cart/add-item') && + args && args[1] && args[1].body + ) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.settings__forms__wc_add_to_cart + ) { + try { + let bodyObj = JSON.parse(args[1].body); + if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); + args[1].body = JSON.stringify(bodyObj); } - - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } - - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } - - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); + } catch (e) { + return false; } + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args && args[0] && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1] && args[1].body && args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + let data = { + action: 'cleantalk_force_ajax_check', }; + for (const field of currentTargetForm.elements) { + data[field.name] = field.value; + } + + // check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function( result, data, params, obj ) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && ! +result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + + resolve(result); + }, + onErrorCallback: function( error ) { + console.log('AJAX error:', error); + reject(error); + }, + }, + ); + }); } - }, 1000); + + if (!preventOriginalFetch) { + return defaultFetch.apply(window, args); + } + }; } /** diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index e107cc884..2634dd185 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -2933,177 +2933,258 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - setTimeout(function() { - if ( - ( - document.forms && document.forms.length > 0 && - ( - Array.from(document.forms).some((form) => - form.classList.contains('metform-form-content')) || - Array.from(document.forms).some((form) => - form.classList.contains('wprm-user-ratings-modal-stars-container')) || - Array.from(document.forms).some((form) => { - if (form.parentElement && - form.parentElement.classList.length > 0 && - form.parentElement.classList[0].indexOf('b24-form-content') !== -1 + const apbctShadowRootFormsConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + }, + }; + + let preventOriginalFetch = false; + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey - The form key from config (e.g., 'mailchimp') + * @param {object} config - The form config object with action, selector, etc. + * @param {string} bodyText - The request body as string + * @return {Promise} - true = block, false = allow + */ + async function apbctCheckShadowRootRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + // Prepare data for AJAX request + let data = { + action: config.action, + }; + + // Parse bodyText and add form fields + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + // If parsing fails, send raw body + data.raw_body = bodyText; + } + + // Add event token or no_cookie data + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) ) { - return true; + resolve(false); // false = allow + return; } - }) - ) - ) || - ( - document.querySelectorAll('button').length > 0 && - Array.from(document.querySelectorAll('button')).some((button) => { - return button.classList.contains('add_to_cart_button') || - button.classList.contains('ajax_add_to_cart') || - button.classList.contains('single_add_to_cart_button'); - }) - ) || - ( - document.links && document.links.length > 0 && - Array.from(document.links).some((link) => { - return link.classList.contains('add_to_cart_button'); - }) - ) - ) { - let preventOriginalFetch = false; - window.fetch = async function(...args) { - // Metform block - if ( - Array.from(document.forms).some((form) => form.classList.contains('metform-form-content')) && - args && - args[0] && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return false; - } - })()) - ) - ) { - if (args && args[1] && args[1].body) { - if (+ctPublic.settings__data__bot_detector_enabled) { - args[1].body.append( - 'ct_bot_detector_event_token', - apbctLocalStorage.get('bot_detector_event_token'), - ); - } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + resolve(true); // true = block + return; } - } + + // Default: allow + resolve(false); + }, + onErrorCallback: function(error) { + console.log('APBCT ShadowRoot check error:', error); + // On error, allow the request to proceed + resolve(false); + }, + }, + ); + }); + } + + window.fetch = async function(...args) { + // Reset flag for each new request + //preventOriginalFetch = false; + let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); + + // === ShadowRoot forms === + for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + // Get request body + let body = args[1] && args[1].body; + let bodyText = ''; + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) obj[key] = value; + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; } - // WP Recipe Maker block - if ( - Array.from(document.forms).some( - (form) => form.classList.contains('wprm-user-ratings-modal-stars-container'), - ) && - args && - args[0] && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - if (args[1] && args[1].body) { - if (typeof args[1].body === 'string') { - let bodyObj; - try { - bodyObj = JSON.parse(args[1].body); - } catch (e) { - bodyObj = {}; - } - if (+ctPublic.settings__data__bot_detector_enabled) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - } else { - bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); - } - args[1].body = JSON.stringify(bodyObj); - } + + const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); + if (shouldBlock) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + // If not blocking — continue to the original fetch + } + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; } + })()) + ) + ) { + if (args && args[1] && args[1].body) { + if (+ctPublic.settings__data__bot_detector_enabled) { + args[1].body.append( + 'ct_bot_detector_event_token', + apbctLocalStorage.get('bot_detector_event_token'), + ); + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); } + } + } - // WooCommerce add to cart request, like: - // /index.php?rest_route=/wc/store/v1/cart/add-item - if (args && args[0] && - args[0].includes('/wc/store/v1/cart/add-item') && - args && args[1] && args[1].body - ) { - if ( - +ctPublic.settings__data__bot_detector_enabled && - +ctPublic.settings__forms__wc_add_to_cart - ) { - try { - let bodyObj = JSON.parse(args[1].body); - if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - args[1].body = JSON.stringify(bodyObj); - } - } catch (e) { - return false; - } + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + if (args[1] && args[1].body) { + if (typeof args[1].body === 'string') { + let bodyObj; + try { + bodyObj = JSON.parse(args[1].body); + } catch (e) { + bodyObj = {}; + } + if (+ctPublic.settings__data__bot_detector_enabled) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); } + args[1].body = JSON.stringify(bodyObj); } + } + } - // bitrix24 EXTERNAL form - if (+ctPublic.settings__forms__check_external && - args && args[0] && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1] && args[1].body && args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args && args[0] && + args[0].includes('/wc/store/v1/cart/add-item') && + args && args[1] && args[1].body + ) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.settings__forms__wc_add_to_cart + ) { + try { + let bodyObj = JSON.parse(args[1].body); + if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); + args[1].body = JSON.stringify(bodyObj); } - - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } - - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } - - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); + } catch (e) { + return false; } + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args && args[0] && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1] && args[1].body && args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + let data = { + action: 'cleantalk_force_ajax_check', }; + for (const field of currentTargetForm.elements) { + data[field.name] = field.value; + } + + // check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function( result, data, params, obj ) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && ! +result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + + resolve(result); + }, + onErrorCallback: function( error ) { + console.log('AJAX error:', error); + reject(error); + }, + }, + ); + }); } - }, 1000); + + if (!preventOriginalFetch) { + return defaultFetch.apply(window, args); + } + }; } /** diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index cd79ef81f..366ab38e7 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -2933,177 +2933,258 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - setTimeout(function() { - if ( - ( - document.forms && document.forms.length > 0 && - ( - Array.from(document.forms).some((form) => - form.classList.contains('metform-form-content')) || - Array.from(document.forms).some((form) => - form.classList.contains('wprm-user-ratings-modal-stars-container')) || - Array.from(document.forms).some((form) => { - if (form.parentElement && - form.parentElement.classList.length > 0 && - form.parentElement.classList[0].indexOf('b24-form-content') !== -1 + const apbctShadowRootFormsConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + }, + }; + + let preventOriginalFetch = false; + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey - The form key from config (e.g., 'mailchimp') + * @param {object} config - The form config object with action, selector, etc. + * @param {string} bodyText - The request body as string + * @return {Promise} - true = block, false = allow + */ + async function apbctCheckShadowRootRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + // Prepare data for AJAX request + let data = { + action: config.action, + }; + + // Parse bodyText and add form fields + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + // If parsing fails, send raw body + data.raw_body = bodyText; + } + + // Add event token or no_cookie data + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) ) { - return true; + resolve(false); // false = allow + return; } - }) - ) - ) || - ( - document.querySelectorAll('button').length > 0 && - Array.from(document.querySelectorAll('button')).some((button) => { - return button.classList.contains('add_to_cart_button') || - button.classList.contains('ajax_add_to_cart') || - button.classList.contains('single_add_to_cart_button'); - }) - ) || - ( - document.links && document.links.length > 0 && - Array.from(document.links).some((link) => { - return link.classList.contains('add_to_cart_button'); - }) - ) - ) { - let preventOriginalFetch = false; - window.fetch = async function(...args) { - // Metform block - if ( - Array.from(document.forms).some((form) => form.classList.contains('metform-form-content')) && - args && - args[0] && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return false; - } - })()) - ) - ) { - if (args && args[1] && args[1].body) { - if (+ctPublic.settings__data__bot_detector_enabled) { - args[1].body.append( - 'ct_bot_detector_event_token', - apbctLocalStorage.get('bot_detector_event_token'), - ); - } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + resolve(true); // true = block + return; } - } + + // Default: allow + resolve(false); + }, + onErrorCallback: function(error) { + console.log('APBCT ShadowRoot check error:', error); + // On error, allow the request to proceed + resolve(false); + }, + }, + ); + }); + } + + window.fetch = async function(...args) { + // Reset flag for each new request + //preventOriginalFetch = false; + let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); + + // === ShadowRoot forms === + for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + // Get request body + let body = args[1] && args[1].body; + let bodyText = ''; + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) obj[key] = value; + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; } - // WP Recipe Maker block - if ( - Array.from(document.forms).some( - (form) => form.classList.contains('wprm-user-ratings-modal-stars-container'), - ) && - args && - args[0] && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - if (args[1] && args[1].body) { - if (typeof args[1].body === 'string') { - let bodyObj; - try { - bodyObj = JSON.parse(args[1].body); - } catch (e) { - bodyObj = {}; - } - if (+ctPublic.settings__data__bot_detector_enabled) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - } else { - bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); - } - args[1].body = JSON.stringify(bodyObj); - } + + const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); + if (shouldBlock) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + // If not blocking — continue to the original fetch + } + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; } + })()) + ) + ) { + if (args && args[1] && args[1].body) { + if (+ctPublic.settings__data__bot_detector_enabled) { + args[1].body.append( + 'ct_bot_detector_event_token', + apbctLocalStorage.get('bot_detector_event_token'), + ); + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); } + } + } - // WooCommerce add to cart request, like: - // /index.php?rest_route=/wc/store/v1/cart/add-item - if (args && args[0] && - args[0].includes('/wc/store/v1/cart/add-item') && - args && args[1] && args[1].body - ) { - if ( - +ctPublic.settings__data__bot_detector_enabled && - +ctPublic.settings__forms__wc_add_to_cart - ) { - try { - let bodyObj = JSON.parse(args[1].body); - if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - args[1].body = JSON.stringify(bodyObj); - } - } catch (e) { - return false; - } + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + if (args[1] && args[1].body) { + if (typeof args[1].body === 'string') { + let bodyObj; + try { + bodyObj = JSON.parse(args[1].body); + } catch (e) { + bodyObj = {}; + } + if (+ctPublic.settings__data__bot_detector_enabled) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); } + args[1].body = JSON.stringify(bodyObj); } + } + } - // bitrix24 EXTERNAL form - if (+ctPublic.settings__forms__check_external && - args && args[0] && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1] && args[1].body && args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args && args[0] && + args[0].includes('/wc/store/v1/cart/add-item') && + args && args[1] && args[1].body + ) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.settings__forms__wc_add_to_cart + ) { + try { + let bodyObj = JSON.parse(args[1].body); + if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); + args[1].body = JSON.stringify(bodyObj); } - - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } - - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } - - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); + } catch (e) { + return false; } + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args && args[0] && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1] && args[1].body && args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + let data = { + action: 'cleantalk_force_ajax_check', }; + for (const field of currentTargetForm.elements) { + data[field.name] = field.value; + } + + // check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function( result, data, params, obj ) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && ! +result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + + resolve(result); + }, + onErrorCallback: function( error ) { + console.log('AJAX error:', error); + reject(error); + }, + }, + ); + }); } - }, 1000); + + if (!preventOriginalFetch) { + return defaultFetch.apply(window, args); + } + }; } /** diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 9de467250..754cbf254 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -2933,177 +2933,258 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - setTimeout(function() { - if ( - ( - document.forms && document.forms.length > 0 && - ( - Array.from(document.forms).some((form) => - form.classList.contains('metform-form-content')) || - Array.from(document.forms).some((form) => - form.classList.contains('wprm-user-ratings-modal-stars-container')) || - Array.from(document.forms).some((form) => { - if (form.parentElement && - form.parentElement.classList.length > 0 && - form.parentElement.classList[0].indexOf('b24-form-content') !== -1 + const apbctShadowRootFormsConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + }, + }; + + let preventOriginalFetch = false; + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey - The form key from config (e.g., 'mailchimp') + * @param {object} config - The form config object with action, selector, etc. + * @param {string} bodyText - The request body as string + * @return {Promise} - true = block, false = allow + */ + async function apbctCheckShadowRootRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + // Prepare data for AJAX request + let data = { + action: config.action, + }; + + // Parse bodyText and add form fields + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + // If parsing fails, send raw body + data.raw_body = bodyText; + } + + // Add event token or no_cookie data + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) ) { - return true; + resolve(false); // false = allow + return; } - }) - ) - ) || - ( - document.querySelectorAll('button').length > 0 && - Array.from(document.querySelectorAll('button')).some((button) => { - return button.classList.contains('add_to_cart_button') || - button.classList.contains('ajax_add_to_cart') || - button.classList.contains('single_add_to_cart_button'); - }) - ) || - ( - document.links && document.links.length > 0 && - Array.from(document.links).some((link) => { - return link.classList.contains('add_to_cart_button'); - }) - ) - ) { - let preventOriginalFetch = false; - window.fetch = async function(...args) { - // Metform block - if ( - Array.from(document.forms).some((form) => form.classList.contains('metform-form-content')) && - args && - args[0] && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return false; - } - })()) - ) - ) { - if (args && args[1] && args[1].body) { - if (+ctPublic.settings__data__bot_detector_enabled) { - args[1].body.append( - 'ct_bot_detector_event_token', - apbctLocalStorage.get('bot_detector_event_token'), - ); - } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + resolve(true); // true = block + return; } - } + + // Default: allow + resolve(false); + }, + onErrorCallback: function(error) { + console.log('APBCT ShadowRoot check error:', error); + // On error, allow the request to proceed + resolve(false); + }, + }, + ); + }); + } + + window.fetch = async function(...args) { + // Reset flag for each new request + //preventOriginalFetch = false; + let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); + + // === ShadowRoot forms === + for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + // Get request body + let body = args[1] && args[1].body; + let bodyText = ''; + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) obj[key] = value; + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; } - // WP Recipe Maker block - if ( - Array.from(document.forms).some( - (form) => form.classList.contains('wprm-user-ratings-modal-stars-container'), - ) && - args && - args[0] && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - if (args[1] && args[1].body) { - if (typeof args[1].body === 'string') { - let bodyObj; - try { - bodyObj = JSON.parse(args[1].body); - } catch (e) { - bodyObj = {}; - } - if (+ctPublic.settings__data__bot_detector_enabled) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - } else { - bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); - } - args[1].body = JSON.stringify(bodyObj); - } + + const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); + if (shouldBlock) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + // If not blocking — continue to the original fetch + } + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; } + })()) + ) + ) { + if (args && args[1] && args[1].body) { + if (+ctPublic.settings__data__bot_detector_enabled) { + args[1].body.append( + 'ct_bot_detector_event_token', + apbctLocalStorage.get('bot_detector_event_token'), + ); + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); } + } + } - // WooCommerce add to cart request, like: - // /index.php?rest_route=/wc/store/v1/cart/add-item - if (args && args[0] && - args[0].includes('/wc/store/v1/cart/add-item') && - args && args[1] && args[1].body - ) { - if ( - +ctPublic.settings__data__bot_detector_enabled && - +ctPublic.settings__forms__wc_add_to_cart - ) { - try { - let bodyObj = JSON.parse(args[1].body); - if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - args[1].body = JSON.stringify(bodyObj); - } - } catch (e) { - return false; - } + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + if (args[1] && args[1].body) { + if (typeof args[1].body === 'string') { + let bodyObj; + try { + bodyObj = JSON.parse(args[1].body); + } catch (e) { + bodyObj = {}; + } + if (+ctPublic.settings__data__bot_detector_enabled) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); } + args[1].body = JSON.stringify(bodyObj); } + } + } - // bitrix24 EXTERNAL form - if (+ctPublic.settings__forms__check_external && - args && args[0] && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1] && args[1].body && args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args && args[0] && + args[0].includes('/wc/store/v1/cart/add-item') && + args && args[1] && args[1].body + ) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.settings__forms__wc_add_to_cart + ) { + try { + let bodyObj = JSON.parse(args[1].body); + if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); + args[1].body = JSON.stringify(bodyObj); } - - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } - - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } - - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); + } catch (e) { + return false; } + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args && args[0] && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1] && args[1].body && args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + let data = { + action: 'cleantalk_force_ajax_check', }; + for (const field of currentTargetForm.elements) { + data[field.name] = field.value; + } + + // check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function( result, data, params, obj ) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && ! +result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + + resolve(result); + }, + onErrorCallback: function( error ) { + console.log('AJAX error:', error); + reject(error); + }, + }, + ); + }); } - }, 1000); + + if (!preventOriginalFetch) { + return defaultFetch.apply(window, args); + } + }; } /** diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 4cf3eb7ef..04b75338e 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -2933,177 +2933,258 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - setTimeout(function() { - if ( - ( - document.forms && document.forms.length > 0 && - ( - Array.from(document.forms).some((form) => - form.classList.contains('metform-form-content')) || - Array.from(document.forms).some((form) => - form.classList.contains('wprm-user-ratings-modal-stars-container')) || - Array.from(document.forms).some((form) => { - if (form.parentElement && - form.parentElement.classList.length > 0 && - form.parentElement.classList[0].indexOf('b24-form-content') !== -1 + const apbctShadowRootFormsConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + }, + }; + + let preventOriginalFetch = false; + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey - The form key from config (e.g., 'mailchimp') + * @param {object} config - The form config object with action, selector, etc. + * @param {string} bodyText - The request body as string + * @return {Promise} - true = block, false = allow + */ + async function apbctCheckShadowRootRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + // Prepare data for AJAX request + let data = { + action: config.action, + }; + + // Parse bodyText and add form fields + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + // If parsing fails, send raw body + data.raw_body = bodyText; + } + + // Add event token or no_cookie data + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) ) { - return true; + resolve(false); // false = allow + return; } - }) - ) - ) || - ( - document.querySelectorAll('button').length > 0 && - Array.from(document.querySelectorAll('button')).some((button) => { - return button.classList.contains('add_to_cart_button') || - button.classList.contains('ajax_add_to_cart') || - button.classList.contains('single_add_to_cart_button'); - }) - ) || - ( - document.links && document.links.length > 0 && - Array.from(document.links).some((link) => { - return link.classList.contains('add_to_cart_button'); - }) - ) - ) { - let preventOriginalFetch = false; - window.fetch = async function(...args) { - // Metform block - if ( - Array.from(document.forms).some((form) => form.classList.contains('metform-form-content')) && - args && - args[0] && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return false; - } - })()) - ) - ) { - if (args && args[1] && args[1].body) { - if (+ctPublic.settings__data__bot_detector_enabled) { - args[1].body.append( - 'ct_bot_detector_event_token', - apbctLocalStorage.get('bot_detector_event_token'), - ); - } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + resolve(true); // true = block + return; } - } + + // Default: allow + resolve(false); + }, + onErrorCallback: function(error) { + console.log('APBCT ShadowRoot check error:', error); + // On error, allow the request to proceed + resolve(false); + }, + }, + ); + }); + } + + window.fetch = async function(...args) { + // Reset flag for each new request + //preventOriginalFetch = false; + let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); + + // === ShadowRoot forms === + for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + // Get request body + let body = args[1] && args[1].body; + let bodyText = ''; + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) obj[key] = value; + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; } - // WP Recipe Maker block - if ( - Array.from(document.forms).some( - (form) => form.classList.contains('wprm-user-ratings-modal-stars-container'), - ) && - args && - args[0] && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - if (args[1] && args[1].body) { - if (typeof args[1].body === 'string') { - let bodyObj; - try { - bodyObj = JSON.parse(args[1].body); - } catch (e) { - bodyObj = {}; - } - if (+ctPublic.settings__data__bot_detector_enabled) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - } else { - bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); - } - args[1].body = JSON.stringify(bodyObj); - } + + const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); + if (shouldBlock) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + // If not blocking — continue to the original fetch + } + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; } + })()) + ) + ) { + if (args && args[1] && args[1].body) { + if (+ctPublic.settings__data__bot_detector_enabled) { + args[1].body.append( + 'ct_bot_detector_event_token', + apbctLocalStorage.get('bot_detector_event_token'), + ); + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); } + } + } - // WooCommerce add to cart request, like: - // /index.php?rest_route=/wc/store/v1/cart/add-item - if (args && args[0] && - args[0].includes('/wc/store/v1/cart/add-item') && - args && args[1] && args[1].body - ) { - if ( - +ctPublic.settings__data__bot_detector_enabled && - +ctPublic.settings__forms__wc_add_to_cart - ) { - try { - let bodyObj = JSON.parse(args[1].body); - if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - args[1].body = JSON.stringify(bodyObj); - } - } catch (e) { - return false; - } + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + if (args[1] && args[1].body) { + if (typeof args[1].body === 'string') { + let bodyObj; + try { + bodyObj = JSON.parse(args[1].body); + } catch (e) { + bodyObj = {}; + } + if (+ctPublic.settings__data__bot_detector_enabled) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); } + args[1].body = JSON.stringify(bodyObj); } + } + } - // bitrix24 EXTERNAL form - if (+ctPublic.settings__forms__check_external && - args && args[0] && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1] && args[1].body && args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args && args[0] && + args[0].includes('/wc/store/v1/cart/add-item') && + args && args[1] && args[1].body + ) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.settings__forms__wc_add_to_cart + ) { + try { + let bodyObj = JSON.parse(args[1].body); + if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); + args[1].body = JSON.stringify(bodyObj); } - - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } - - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } - - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); + } catch (e) { + return false; } + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args && args[0] && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1] && args[1].body && args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + let data = { + action: 'cleantalk_force_ajax_check', }; + for (const field of currentTargetForm.elements) { + data[field.name] = field.value; + } + + // check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function( result, data, params, obj ) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && ! +result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + + resolve(result); + }, + onErrorCallback: function( error ) { + console.log('AJAX error:', error); + reject(error); + }, + }, + ); + }); } - }, 1000); + + if (!preventOriginalFetch) { + return defaultFetch.apply(window, args); + } + }; } /** diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index e3d26507c..a97e56bb6 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -2933,177 +2933,258 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - setTimeout(function() { - if ( - ( - document.forms && document.forms.length > 0 && - ( - Array.from(document.forms).some((form) => - form.classList.contains('metform-form-content')) || - Array.from(document.forms).some((form) => - form.classList.contains('wprm-user-ratings-modal-stars-container')) || - Array.from(document.forms).some((form) => { - if (form.parentElement && - form.parentElement.classList.length > 0 && - form.parentElement.classList[0].indexOf('b24-form-content') !== -1 + const apbctShadowRootFormsConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + }, + }; + + let preventOriginalFetch = false; + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey - The form key from config (e.g., 'mailchimp') + * @param {object} config - The form config object with action, selector, etc. + * @param {string} bodyText - The request body as string + * @return {Promise} - true = block, false = allow + */ + async function apbctCheckShadowRootRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + // Prepare data for AJAX request + let data = { + action: config.action, + }; + + // Parse bodyText and add form fields + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + // If parsing fails, send raw body + data.raw_body = bodyText; + } + + // Add event token or no_cookie data + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) ) { - return true; + resolve(false); // false = allow + return; } - }) - ) - ) || - ( - document.querySelectorAll('button').length > 0 && - Array.from(document.querySelectorAll('button')).some((button) => { - return button.classList.contains('add_to_cart_button') || - button.classList.contains('ajax_add_to_cart') || - button.classList.contains('single_add_to_cart_button'); - }) - ) || - ( - document.links && document.links.length > 0 && - Array.from(document.links).some((link) => { - return link.classList.contains('add_to_cart_button'); - }) - ) - ) { - let preventOriginalFetch = false; - window.fetch = async function(...args) { - // Metform block - if ( - Array.from(document.forms).some((form) => form.classList.contains('metform-form-content')) && - args && - args[0] && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return false; - } - })()) - ) - ) { - if (args && args[1] && args[1].body) { - if (+ctPublic.settings__data__bot_detector_enabled) { - args[1].body.append( - 'ct_bot_detector_event_token', - apbctLocalStorage.get('bot_detector_event_token'), - ); - } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + resolve(true); // true = block + return; } - } + + // Default: allow + resolve(false); + }, + onErrorCallback: function(error) { + console.log('APBCT ShadowRoot check error:', error); + // On error, allow the request to proceed + resolve(false); + }, + }, + ); + }); + } + + window.fetch = async function(...args) { + // Reset flag for each new request + //preventOriginalFetch = false; + let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); + + // === ShadowRoot forms === + for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + // Get request body + let body = args[1] && args[1].body; + let bodyText = ''; + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) obj[key] = value; + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; } - // WP Recipe Maker block - if ( - Array.from(document.forms).some( - (form) => form.classList.contains('wprm-user-ratings-modal-stars-container'), - ) && - args && - args[0] && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - if (args[1] && args[1].body) { - if (typeof args[1].body === 'string') { - let bodyObj; - try { - bodyObj = JSON.parse(args[1].body); - } catch (e) { - bodyObj = {}; - } - if (+ctPublic.settings__data__bot_detector_enabled) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - } else { - bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); - } - args[1].body = JSON.stringify(bodyObj); - } + + const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); + if (shouldBlock) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + // If not blocking — continue to the original fetch + } + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; } + })()) + ) + ) { + if (args && args[1] && args[1].body) { + if (+ctPublic.settings__data__bot_detector_enabled) { + args[1].body.append( + 'ct_bot_detector_event_token', + apbctLocalStorage.get('bot_detector_event_token'), + ); + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); } + } + } - // WooCommerce add to cart request, like: - // /index.php?rest_route=/wc/store/v1/cart/add-item - if (args && args[0] && - args[0].includes('/wc/store/v1/cart/add-item') && - args && args[1] && args[1].body - ) { - if ( - +ctPublic.settings__data__bot_detector_enabled && - +ctPublic.settings__forms__wc_add_to_cart - ) { - try { - let bodyObj = JSON.parse(args[1].body); - if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - args[1].body = JSON.stringify(bodyObj); - } - } catch (e) { - return false; - } + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + if (args[1] && args[1].body) { + if (typeof args[1].body === 'string') { + let bodyObj; + try { + bodyObj = JSON.parse(args[1].body); + } catch (e) { + bodyObj = {}; + } + if (+ctPublic.settings__data__bot_detector_enabled) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); } + args[1].body = JSON.stringify(bodyObj); } + } + } - // bitrix24 EXTERNAL form - if (+ctPublic.settings__forms__check_external && - args && args[0] && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1] && args[1].body && args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args && args[0] && + args[0].includes('/wc/store/v1/cart/add-item') && + args && args[1] && args[1].body + ) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.settings__forms__wc_add_to_cart + ) { + try { + let bodyObj = JSON.parse(args[1].body); + if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); + args[1].body = JSON.stringify(bodyObj); } - - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } - - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } - - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); + } catch (e) { + return false; } + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args && args[0] && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1] && args[1].body && args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + let data = { + action: 'cleantalk_force_ajax_check', }; + for (const field of currentTargetForm.elements) { + data[field.name] = field.value; + } + + // check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function( result, data, params, obj ) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && ! +result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + + resolve(result); + }, + onErrorCallback: function( error ) { + console.log('AJAX error:', error); + reject(error); + }, + }, + ); + }); } - }, 1000); + + if (!preventOriginalFetch) { + return defaultFetch.apply(window, args); + } + }; } /** diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index fdee0fc4a..4a3e9699b 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -2933,177 +2933,258 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - setTimeout(function() { - if ( - ( - document.forms && document.forms.length > 0 && - ( - Array.from(document.forms).some((form) => - form.classList.contains('metform-form-content')) || - Array.from(document.forms).some((form) => - form.classList.contains('wprm-user-ratings-modal-stars-container')) || - Array.from(document.forms).some((form) => { - if (form.parentElement && - form.parentElement.classList.length > 0 && - form.parentElement.classList[0].indexOf('b24-form-content') !== -1 + const apbctShadowRootFormsConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + }, + }; + + let preventOriginalFetch = false; + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey - The form key from config (e.g., 'mailchimp') + * @param {object} config - The form config object with action, selector, etc. + * @param {string} bodyText - The request body as string + * @return {Promise} - true = block, false = allow + */ + async function apbctCheckShadowRootRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + // Prepare data for AJAX request + let data = { + action: config.action, + }; + + // Parse bodyText and add form fields + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + // If parsing fails, send raw body + data.raw_body = bodyText; + } + + // Add event token or no_cookie data + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) ) { - return true; + resolve(false); // false = allow + return; } - }) - ) - ) || - ( - document.querySelectorAll('button').length > 0 && - Array.from(document.querySelectorAll('button')).some((button) => { - return button.classList.contains('add_to_cart_button') || - button.classList.contains('ajax_add_to_cart') || - button.classList.contains('single_add_to_cart_button'); - }) - ) || - ( - document.links && document.links.length > 0 && - Array.from(document.links).some((link) => { - return link.classList.contains('add_to_cart_button'); - }) - ) - ) { - let preventOriginalFetch = false; - window.fetch = async function(...args) { - // Metform block - if ( - Array.from(document.forms).some((form) => form.classList.contains('metform-form-content')) && - args && - args[0] && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return false; - } - })()) - ) - ) { - if (args && args[1] && args[1].body) { - if (+ctPublic.settings__data__bot_detector_enabled) { - args[1].body.append( - 'ct_bot_detector_event_token', - apbctLocalStorage.get('bot_detector_event_token'), - ); - } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + resolve(true); // true = block + return; } - } + + // Default: allow + resolve(false); + }, + onErrorCallback: function(error) { + console.log('APBCT ShadowRoot check error:', error); + // On error, allow the request to proceed + resolve(false); + }, + }, + ); + }); + } + + window.fetch = async function(...args) { + // Reset flag for each new request + //preventOriginalFetch = false; + let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); + + // === ShadowRoot forms === + for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + // Get request body + let body = args[1] && args[1].body; + let bodyText = ''; + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) obj[key] = value; + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; } - // WP Recipe Maker block - if ( - Array.from(document.forms).some( - (form) => form.classList.contains('wprm-user-ratings-modal-stars-container'), - ) && - args && - args[0] && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - if (args[1] && args[1].body) { - if (typeof args[1].body === 'string') { - let bodyObj; - try { - bodyObj = JSON.parse(args[1].body); - } catch (e) { - bodyObj = {}; - } - if (+ctPublic.settings__data__bot_detector_enabled) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - } else { - bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); - } - args[1].body = JSON.stringify(bodyObj); - } + + const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); + if (shouldBlock) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + // If not blocking — continue to the original fetch + } + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; } + })()) + ) + ) { + if (args && args[1] && args[1].body) { + if (+ctPublic.settings__data__bot_detector_enabled) { + args[1].body.append( + 'ct_bot_detector_event_token', + apbctLocalStorage.get('bot_detector_event_token'), + ); + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); } + } + } - // WooCommerce add to cart request, like: - // /index.php?rest_route=/wc/store/v1/cart/add-item - if (args && args[0] && - args[0].includes('/wc/store/v1/cart/add-item') && - args && args[1] && args[1].body - ) { - if ( - +ctPublic.settings__data__bot_detector_enabled && - +ctPublic.settings__forms__wc_add_to_cart - ) { - try { - let bodyObj = JSON.parse(args[1].body); - if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - args[1].body = JSON.stringify(bodyObj); - } - } catch (e) { - return false; - } + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + if (args[1] && args[1].body) { + if (typeof args[1].body === 'string') { + let bodyObj; + try { + bodyObj = JSON.parse(args[1].body); + } catch (e) { + bodyObj = {}; + } + if (+ctPublic.settings__data__bot_detector_enabled) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); } + args[1].body = JSON.stringify(bodyObj); } + } + } - // bitrix24 EXTERNAL form - if (+ctPublic.settings__forms__check_external && - args && args[0] && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1] && args[1].body && args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args && args[0] && + args[0].includes('/wc/store/v1/cart/add-item') && + args && args[1] && args[1].body + ) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.settings__forms__wc_add_to_cart + ) { + try { + let bodyObj = JSON.parse(args[1].body); + if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); + args[1].body = JSON.stringify(bodyObj); } - - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } - - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } - - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); + } catch (e) { + return false; } + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args && args[0] && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1] && args[1].body && args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + let data = { + action: 'cleantalk_force_ajax_check', }; + for (const field of currentTargetForm.elements) { + data[field.name] = field.value; + } + + // check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function( result, data, params, obj ) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && ! +result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + + resolve(result); + }, + onErrorCallback: function( error ) { + console.log('AJAX error:', error); + reject(error); + }, + }, + ); + }); } - }, 1000); + + if (!preventOriginalFetch) { + return defaultFetch.apply(window, args); + } + }; } /** diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 5ccf28171..4d5b015d2 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -2933,177 +2933,258 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - setTimeout(function() { - if ( - ( - document.forms && document.forms.length > 0 && - ( - Array.from(document.forms).some((form) => - form.classList.contains('metform-form-content')) || - Array.from(document.forms).some((form) => - form.classList.contains('wprm-user-ratings-modal-stars-container')) || - Array.from(document.forms).some((form) => { - if (form.parentElement && - form.parentElement.classList.length > 0 && - form.parentElement.classList[0].indexOf('b24-form-content') !== -1 + const apbctShadowRootFormsConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + }, + }; + + let preventOriginalFetch = false; + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey - The form key from config (e.g., 'mailchimp') + * @param {object} config - The form config object with action, selector, etc. + * @param {string} bodyText - The request body as string + * @return {Promise} - true = block, false = allow + */ + async function apbctCheckShadowRootRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + // Prepare data for AJAX request + let data = { + action: config.action, + }; + + // Parse bodyText and add form fields + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + // If parsing fails, send raw body + data.raw_body = bodyText; + } + + // Add event token or no_cookie data + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) ) { - return true; + resolve(false); // false = allow + return; } - }) - ) - ) || - ( - document.querySelectorAll('button').length > 0 && - Array.from(document.querySelectorAll('button')).some((button) => { - return button.classList.contains('add_to_cart_button') || - button.classList.contains('ajax_add_to_cart') || - button.classList.contains('single_add_to_cart_button'); - }) - ) || - ( - document.links && document.links.length > 0 && - Array.from(document.links).some((link) => { - return link.classList.contains('add_to_cart_button'); - }) - ) - ) { - let preventOriginalFetch = false; - window.fetch = async function(...args) { - // Metform block - if ( - Array.from(document.forms).some((form) => form.classList.contains('metform-form-content')) && - args && - args[0] && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return false; - } - })()) - ) - ) { - if (args && args[1] && args[1].body) { - if (+ctPublic.settings__data__bot_detector_enabled) { - args[1].body.append( - 'ct_bot_detector_event_token', - apbctLocalStorage.get('bot_detector_event_token'), - ); - } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + resolve(true); // true = block + return; } - } + + // Default: allow + resolve(false); + }, + onErrorCallback: function(error) { + console.log('APBCT ShadowRoot check error:', error); + // On error, allow the request to proceed + resolve(false); + }, + }, + ); + }); + } + + window.fetch = async function(...args) { + // Reset flag for each new request + //preventOriginalFetch = false; + let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); + + // === ShadowRoot forms === + for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + // Get request body + let body = args[1] && args[1].body; + let bodyText = ''; + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) obj[key] = value; + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; } - // WP Recipe Maker block - if ( - Array.from(document.forms).some( - (form) => form.classList.contains('wprm-user-ratings-modal-stars-container'), - ) && - args && - args[0] && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - if (args[1] && args[1].body) { - if (typeof args[1].body === 'string') { - let bodyObj; - try { - bodyObj = JSON.parse(args[1].body); - } catch (e) { - bodyObj = {}; - } - if (+ctPublic.settings__data__bot_detector_enabled) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - } else { - bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); - } - args[1].body = JSON.stringify(bodyObj); - } + + const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); + if (shouldBlock) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + // If not blocking — continue to the original fetch + } + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; } + })()) + ) + ) { + if (args && args[1] && args[1].body) { + if (+ctPublic.settings__data__bot_detector_enabled) { + args[1].body.append( + 'ct_bot_detector_event_token', + apbctLocalStorage.get('bot_detector_event_token'), + ); + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); } + } + } - // WooCommerce add to cart request, like: - // /index.php?rest_route=/wc/store/v1/cart/add-item - if (args && args[0] && - args[0].includes('/wc/store/v1/cart/add-item') && - args && args[1] && args[1].body - ) { - if ( - +ctPublic.settings__data__bot_detector_enabled && - +ctPublic.settings__forms__wc_add_to_cart - ) { - try { - let bodyObj = JSON.parse(args[1].body); - if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - args[1].body = JSON.stringify(bodyObj); - } - } catch (e) { - return false; - } + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + if (args[1] && args[1].body) { + if (typeof args[1].body === 'string') { + let bodyObj; + try { + bodyObj = JSON.parse(args[1].body); + } catch (e) { + bodyObj = {}; + } + if (+ctPublic.settings__data__bot_detector_enabled) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); } + args[1].body = JSON.stringify(bodyObj); } + } + } - // bitrix24 EXTERNAL form - if (+ctPublic.settings__forms__check_external && - args && args[0] && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1] && args[1].body && args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args && args[0] && + args[0].includes('/wc/store/v1/cart/add-item') && + args && args[1] && args[1].body + ) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.settings__forms__wc_add_to_cart + ) { + try { + let bodyObj = JSON.parse(args[1].body); + if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); + args[1].body = JSON.stringify(bodyObj); } - - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } - - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } - - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); + } catch (e) { + return false; } + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args && args[0] && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1] && args[1].body && args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + let data = { + action: 'cleantalk_force_ajax_check', }; + for (const field of currentTargetForm.elements) { + data[field.name] = field.value; + } + + // check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function( result, data, params, obj ) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && ! +result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + + resolve(result); + }, + onErrorCallback: function( error ) { + console.log('AJAX error:', error); + reject(error); + }, + }, + ); + }); } - }, 1000); + + if (!preventOriginalFetch) { + return defaultFetch.apply(window, args); + } + }; } /** diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index 04fe4115b..ac4ea6b7a 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -591,177 +591,258 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - setTimeout(function() { - if ( - ( - document.forms && document.forms.length > 0 && - ( - Array.from(document.forms).some((form) => - form.classList.contains('metform-form-content')) || - Array.from(document.forms).some((form) => - form.classList.contains('wprm-user-ratings-modal-stars-container')) || - Array.from(document.forms).some((form) => { - if (form.parentElement && - form.parentElement.classList.length > 0 && - form.parentElement.classList[0].indexOf('b24-form-content') !== -1 + const apbctShadowRootFormsConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + }, + }; + + let preventOriginalFetch = false; + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey - The form key from config (e.g., 'mailchimp') + * @param {object} config - The form config object with action, selector, etc. + * @param {string} bodyText - The request body as string + * @return {Promise} - true = block, false = allow + */ + async function apbctCheckShadowRootRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + // Prepare data for AJAX request + let data = { + action: config.action, + }; + + // Parse bodyText and add form fields + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + // If parsing fails, send raw body + data.raw_body = bodyText; + } + + // Add event token or no_cookie data + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX( + data, + { + async: true, + callback: function(result) { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) ) { - return true; + resolve(false); // false = allow + return; } - }) - ) - ) || - ( - document.querySelectorAll('button').length > 0 && - Array.from(document.querySelectorAll('button')).some((button) => { - return button.classList.contains('add_to_cart_button') || - button.classList.contains('ajax_add_to_cart') || - button.classList.contains('single_add_to_cart_button'); - }) - ) || - ( - document.links && document.links.length > 0 && - Array.from(document.links).some((link) => { - return link.classList.contains('add_to_cart_button'); - }) - ) - ) { - let preventOriginalFetch = false; - - window.fetch = async function(...args) { - // Metform block - if ( - Array.from(document.forms).some((form) => form.classList.contains('metform-form-content')) && - args && - args[0] && - typeof args[0].includes === 'function' && - (args[0].includes('/wp-json/metform/') || - (ctPublicFunctions._rest_url && (() => { - try { - return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); - } catch (e) { - return false; - } - })()) - ) - ) { - if (args && args[1] && args[1].body) { - if (+ctPublic.settings__data__bot_detector_enabled) { - args[1].body.append( - 'ct_bot_detector_event_token', - apbctLocalStorage.get('bot_detector_event_token'), - ); - } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + resolve(true); // true = block + return; } - } + + // Default: allow + resolve(false); + }, + onErrorCallback: function(error) { + console.log('APBCT ShadowRoot check error:', error); + // On error, allow the request to proceed + resolve(false); + }, + }, + ); + }); + } + + window.fetch = async function(...args) { + // Reset flag for each new request + //preventOriginalFetch = false; + let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); + + // === ShadowRoot forms === + for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + // Get request body + let body = args[1] && args[1].body; + let bodyText = ''; + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) obj[key] = value; + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; } - // WP Recipe Maker block - if ( - Array.from(document.forms).some( - (form) => form.classList.contains('wprm-user-ratings-modal-stars-container'), - ) && - args && - args[0] && - typeof args[0].includes === 'function' && - args[0].includes('/wp-json/wp-recipe-maker/') - ) { - if (args[1] && args[1].body) { - if (typeof args[1].body === 'string') { - let bodyObj; - try { - bodyObj = JSON.parse(args[1].body); - } catch (e) { - bodyObj = {}; - } - if (+ctPublic.settings__data__bot_detector_enabled) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - } else { - bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); - } - args[1].body = JSON.stringify(bodyObj); - } + + const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); + if (shouldBlock) { + // Return a "blank" response that never completes + return new Promise(() => {}); + } + // If not blocking — continue to the original fetch + } + } + + // === Metform === + if ( + document.querySelectorAll('form.metform-form-content').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + (args[0].includes('/wp-json/metform/') || + (ctPublicFunctions._rest_url && (() => { + try { + return args[0].includes(new URL(ctPublicFunctions._rest_url).pathname + 'metform/'); + } catch (e) { + return false; } + })()) + ) + ) { + if (args && args[1] && args[1].body) { + if (+ctPublic.settings__data__bot_detector_enabled) { + args[1].body.append( + 'ct_bot_detector_event_token', + apbctLocalStorage.get('bot_detector_event_token'), + ); + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); } + } + } - // WooCommerce add to cart request, like: - // /index.php?rest_route=/wc/store/v1/cart/add-item - if (args && args[0] && - args[0].includes('/wc/store/v1/cart/add-item') && - args && args[1] && args[1].body - ) { - if ( - +ctPublic.settings__data__bot_detector_enabled && - +ctPublic.settings__forms__wc_add_to_cart - ) { - try { - let bodyObj = JSON.parse(args[1].body); - if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { - bodyObj.ct_bot_detector_event_token = - apbctLocalStorage.get('bot_detector_event_token'); - args[1].body = JSON.stringify(bodyObj); - } - } catch (e) { - return false; - } + // === WP Recipe Maker === + if ( + document.querySelectorAll('form.wprm-user-ratings-modal-stars-container').length > 0 && + args && args[0] && + typeof args[0].includes === 'function' && + args[0].includes('/wp-json/wp-recipe-maker/') + ) { + if (args[1] && args[1].body) { + if (typeof args[1].body === 'string') { + let bodyObj; + try { + bodyObj = JSON.parse(args[1].body); + } catch (e) { + bodyObj = {}; + } + if (+ctPublic.settings__data__bot_detector_enabled) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); } else { - args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + bodyObj.ct_no_cookie_hidden_field = getNoCookieData(); } + args[1].body = JSON.stringify(bodyObj); } + } + } - // bitrix24 EXTERNAL form - if (+ctPublic.settings__forms__check_external && - args && args[0] && - args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && - args[1] && args[1].body && args[1].body instanceof FormData - ) { - const currentTargetForm = document.querySelector('.b24-form form'); - let data = { - action: 'cleantalk_force_ajax_check', - }; - for (const field of currentTargetForm.elements) { - data[field.name] = field.value; + // === WooCommerce add to cart === + if ( + ( + document.querySelectorAll( + 'button.add_to_cart_button, button.ajax_add_to_cart, button.single_add_to_cart_button', + ).length > 0 || + document.querySelectorAll('a.add_to_cart_button').length > 0 + ) && + args && args[0] && + args[0].includes('/wc/store/v1/cart/add-item') && + args && args[1] && args[1].body + ) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + +ctPublic.settings__forms__wc_add_to_cart + ) { + try { + let bodyObj = JSON.parse(args[1].body); + if (!bodyObj.hasOwnProperty('ct_bot_detector_event_token')) { + bodyObj.ct_bot_detector_event_token = + apbctLocalStorage.get('bot_detector_event_token'); + args[1].body = JSON.stringify(bodyObj); } - - // check form request - wrap in Promise to wait for completion - await new Promise((resolve, reject) => { - apbct_public_sendAJAX( - data, - { - async: true, - callback: function( result, data, params, obj ) { - // allowed - if ((result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && ! +result.apbct.blocked) - ) { - preventOriginalFetch = false; - } - - // blocked - if ((result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - preventOriginalFetch = true; - new ApbctShowForbidden().parseBlockMessage(result); - } - - resolve(result); - }, - onErrorCallback: function( error ) { - console.log('AJAX error:', error); - reject(error); - }, - }, - ); - }); + } catch (e) { + return false; } + } else { + args[1].body.append('ct_no_cookie_hidden_field', getNoCookieData()); + } + } - if (!preventOriginalFetch) { - return defaultFetch.apply(window, args); - } + // === Bitrix24 external form === + if ( + +ctPublic.settings__forms__check_external && + document.querySelectorAll('.b24-form').length > 0 && + args && args[0] && + args[0].includes('bitrix/services/main/ajax.php?action=crm.site.form.fill') && + args[1] && args[1].body && args[1].body instanceof FormData + ) { + const currentTargetForm = document.querySelector('.b24-form form'); + let data = { + action: 'cleantalk_force_ajax_check', }; + for (const field of currentTargetForm.elements) { + data[field.name] = field.value; + } + + // check form request - wrap in Promise to wait for completion + await new Promise((resolve, reject) => { + apbct_public_sendAJAX( + data, + { + async: true, + callback: function( result, data, params, obj ) { + // allowed + if ((result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && ! +result.apbct.blocked) + ) { + preventOriginalFetch = false; + } + + // blocked + if ((result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + preventOriginalFetch = true; + new ApbctShowForbidden().parseBlockMessage(result); + } + + resolve(result); + }, + onErrorCallback: function( error ) { + console.log('AJAX error:', error); + reject(error); + }, + }, + ); + }); } - }, 1000); + + if (!preventOriginalFetch) { + return defaultFetch.apply(window, args); + } + }; } /** diff --git a/lib/Cleantalk/Antispam/Integrations/MailChimpShadowRoot.php b/lib/Cleantalk/Antispam/Integrations/MailChimpShadowRoot.php new file mode 100644 index 000000000..58323b77b --- /dev/null +++ b/lib/Cleantalk/Antispam/Integrations/MailChimpShadowRoot.php @@ -0,0 +1,68 @@ +stats['no_cookie_data_taken']) { + apbct_form__get_no_cookie_data(); + } + + $input_array = apply_filters('apbct__filter_post', $_POST); + + $data = ct_gfa_dto($input_array)->getArray(); + + // Handle event token from bot detector + if (isset($data['ct_bot_detector_event_token'])) { + $data['event_token'] = $data['ct_bot_detector_event_token']; + } + + return $data; + } + + return null; + } + + public function doBlock($message) + { + die( + json_encode( + array( + 'apbct' => array( + 'blocked' => true, + 'comment' => $message, + 'stop_script' => apbct__stop_script_after_ajax_checking() + ) + ) + ) + ); + } + + /** + * Allow the request to proceed + * @return void + */ + public function allow() + { + die( + json_encode( + array( + 'apbct' => array( + 'blocked' => false, + 'allow' => true, + ) + ) + ) + ); + } +} From d003cf906813d6c6a7ea2b4db157eaa4d7081ca9 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 21 Jan 2026 16:49:43 +0700 Subject: [PATCH 06/60] Fix. ShadowrootProtection. Removed the comment from the line --- js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- js/apbct-public-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- js/apbct-public-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- js/apbct-public-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 2 +- js/prebuild/apbct-public-bundle_ext-protection.js | 2 +- js/prebuild/apbct-public-bundle_ext-protection_gathering.js | 2 +- js/prebuild/apbct-public-bundle_full-protection.js | 2 +- js/prebuild/apbct-public-bundle_full-protection_gathering.js | 2 +- js/prebuild/apbct-public-bundle_gathering.js | 2 +- js/prebuild/apbct-public-bundle_int-protection.js | 2 +- js/prebuild/apbct-public-bundle_int-protection_gathering.js | 2 +- js/src/public-1-main.js | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index 506829151..7fda2c78a 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function _(){}function r(){}function f(){}var t={},m=(u(t,o,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,o)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function _(){}function r(){}function f(){}var t={},m=(u(t,o,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,o)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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 c5d7b41dd..290b5ca30 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1 +1 @@ -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function m(){}function r(){}function f(){}var t={},_=(u(t,o,function(){return this}),Object.getPrototypeOf),_=_&&_(_(x([]))),b=(_&&_!==e&&l.call(_,o)&&(t=_),f.prototype=m.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function v(e){this.tryEntries.push(e)}function g(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(v,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function m(){}function r(){}function f(){}var t={},_=(u(t,o,function(){return this}),Object.getPrototypeOf),_=_&&_(_(x([]))),b=(_&&_!==e&&l.call(_,o)&&(t=_),f.prototype=m.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function v(e){this.tryEntries.push(e)}function g(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(v,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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_gathering.min.js b/js/apbct-public-bundle_ext-protection_gathering.min.js index f7c0843b3..af79af92e 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1 +1 @@ -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function r(e,t,n,o){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=n,i=new k(o||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;n=d(a,c,i);if("normal"===n.type){if(r=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(r=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function m(){}var t={},f=(u(t,o,function(){return this}),Object.getPrototypeOf),f=f&&f(f(x([]))),b=(f&&f!==e&&l.call(f,o)&&(t=f),m.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(n,o){function e(){return new r(function(e,t){!function t(e,n,o,a){var c,e=d(i[e],i,n);if("throw"!==e.type)return(n=(c=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?r.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):r.resolve(n).then(function(e){c.value=e,o(c)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function r(e,t,n,o){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=n,i=new k(o||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;n=d(a,c,i);if("normal"===n.type){if(r=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(r=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function m(){}var t={},f=(u(t,o,function(){return this}),Object.getPrototypeOf),f=f&&f(f(x([]))),b=(f&&f!==e&&l.call(f,o)&&(t=f),m.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(n,o){function e(){return new r(function(e,t){!function t(e,n,o,a){var c,e=d(i[e],i,n);if("throw"!==e.type)return(n=(c=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?r.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):r.resolve(n).then(function(e){c.value=e,o(c)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 28c4660ca..4307be38d 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1 +1 @@ -function _regeneratorRuntime(){_regeneratorRuntime=function(){return c};var s,c={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function i(e,t,n,o){var a,r,c,i,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,c=new k(o||[]),i=1,function(e,t){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===e)throw t;return{value:s,done:!0}}for(c.method=e,c.arg=t;;){var n=c.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,c);if(n){if(n===p)continue;return n}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(1===i)throw i=4,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);i=3;n=d(a,r,c);if("normal"===n.type){if(i=c.done?4:2,n.arg===p)continue;return{value:n.arg,done:c.done}}"throw"===n.type&&(i=4,c.method="throw",c.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}c.wrap=i;var p={};function m(){}function r(){}function f(){}var t={},_=(u(t,o,function(){return this}),Object.getPrototypeOf),_=_&&_(_(x([]))),b=(_&&_!==e&&l.call(_,o)&&(t=_),f.prototype=m.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(c,i){var t;u(this,"_invoke",function(n,o){function e(){return new i(function(e,t){!function t(e,n,o,a){var r,e=d(c[e],c,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?i.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):i.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function v(e){this.tryEntries.push(e)}function g(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(v,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 _regeneratorRuntime(){_regeneratorRuntime=function(){return c};var s,c={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function i(e,t,n,o){var a,r,c,i,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,c=new k(o||[]),i=1,function(e,t){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===e)throw t;return{value:s,done:!0}}for(c.method=e,c.arg=t;;){var n=c.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,c);if(n){if(n===p)continue;return n}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(1===i)throw i=4,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);i=3;n=d(a,r,c);if("normal"===n.type){if(i=c.done?4:2,n.arg===p)continue;return{value:n.arg,done:c.done}}"throw"===n.type&&(i=4,c.method="throw",c.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}c.wrap=i;var p={};function m(){}function r(){}function f(){}var t={},_=(u(t,o,function(){return this}),Object.getPrototypeOf),_=_&&_(_(x([]))),b=(_&&_!==e&&l.call(_,o)&&(t=_),f.prototype=m.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(c,i){var t;u(this,"_invoke",function(n,o){function e(){return new i(function(e,t){!function t(e,n,o,a){var r,e=d(c[e],c,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?i.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):i.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function v(e){this.tryEntries.push(e)}function g(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(v,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index d5c5ad6f6..3f2063259 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1 +1 @@ -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",c=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function r(e,t,n,o){var c,a,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(c=e,a=n,i=new k(o||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,c=t.i[o];if(c===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(c,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;c=o.arg;return c?c.done?(n[t.r]=c.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):c:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;n=d(c,a,i);if("normal"===n.type){if(r=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(r=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function a(){}function m(){}var t={},f=(u(t,o,function(){return this}),Object.getPrototypeOf),f=f&&f(f(x([]))),b=(f&&f!==e&&l.call(f,o)&&(t=f),m.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(n,o){function e(){return new r(function(e,t){!function t(e,n,o,c){var a,e=d(i[e],i,n);if("throw"!==e.type)return(n=(a=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?r.resolve(n.__await).then(function(e){t("next",e,o,c)},function(e){t("throw",e,o,c)}):r.resolve(n).then(function(e){a.value=e,o(a)},function(e){return t("throw",e,o,c)});c(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var o=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(o,n.decoded_email),a[t].href=e+n.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),n.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(n=c.n()).done;)o=o||e===n.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),n=0;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),n=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(o))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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)),a.append(i,r),c.append(a),n.append(o),e.append(n),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",c=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function r(e,t,n,o){var c,a,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(c=e,a=n,i=new k(o||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,c=t.i[o];if(c===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(c,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;c=o.arg;return c?c.done?(n[t.r]=c.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):c:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;n=d(c,a,i);if("normal"===n.type){if(r=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(r=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function a(){}function m(){}var t={},f=(u(t,o,function(){return this}),Object.getPrototypeOf),f=f&&f(f(x([]))),b=(f&&f!==e&&l.call(f,o)&&(t=f),m.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(n,o){function e(){return new r(function(e,t){!function t(e,n,o,c){var a,e=d(i[e],i,n);if("throw"!==e.type)return(n=(a=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?r.resolve(n.__await).then(function(e){t("next",e,o,c)},function(e){t("throw",e,o,c)}):r.resolve(n).then(function(e){a.value=e,o(a)},function(e){return t("throw",e,o,c)});c(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var o=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(o,n.decoded_email),a[t].href=e+n.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),n.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(n=c.n()).done;)o=o||e===n.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),n=0;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),n=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(o))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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)),a.append(i,r),c.append(a),n.append(o),e.append(n),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=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_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index 946473443..2c8eec445 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1 +1 @@ -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,o,n){return Object.defineProperty(e,t,{value:o,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(s){u=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=o,i=new k(n||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,a=t.i[n];if(a===s)return o.delegate=null,"throw"===n&&t.i.return&&(o.method="return",o.arg=s,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;n=d(a,t.i,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;a=n.arg;return a?a.done?(o[t.r]=a.value,o.next=t.n,"return"!==o.method&&(o.method="next",o.arg=s),o.delegate=null,p):a:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}(o,i);if(o){if(o===p)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;o=d(a,c,i);if("normal"===o.type){if(r=i.done?4:2,o.arg===p)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=4,i.method="throw",i.arg=o.arg)}}),!0),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function f(){}var t={},m=(u(t,n,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,n)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,a){var c,e=d(i[e],i,o);if("throw"!==e.type)return(o=(c=e.arg).value)&&"object"==_typeof(o)&&l.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,a)},function(e){t("throw",e,n,a)}):r.resolve(o).then(function(e){c.value=e,n(c)},function(e){return t("throw",e,n,a)});a(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,o,n){return Object.defineProperty(e,t,{value:o,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(s){u=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=o,i=new k(n||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,a=t.i[n];if(a===s)return o.delegate=null,"throw"===n&&t.i.return&&(o.method="return",o.arg=s,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;n=d(a,t.i,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;a=n.arg;return a?a.done?(o[t.r]=a.value,o.next=t.n,"return"!==o.method&&(o.method="next",o.arg=s),o.delegate=null,p):a:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}(o,i);if(o){if(o===p)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;o=d(a,c,i);if("normal"===o.type){if(r=i.done?4:2,o.arg===p)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=4,i.method="throw",i.arg=o.arg)}}),!0),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function f(){}var t={},m=(u(t,n,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,n)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,a){var c,e=d(i[e],i,o);if("throw"!==e.type)return(o=(c=e.arg).value)&&"object"==_typeof(o)&&l.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,a)},function(e){t("throw",e,n,a)}):r.resolve(o).then(function(e){c.value=e,n(c)},function(e){return t("throw",e,n,a)});a(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 0859b92d2..e81bd712e 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1 +1 @@ -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function _(){}function r(){}function f(){}var t={},m=(u(t,o,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,o)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function _(){}function r(){}function f(){}var t={},m=(u(t,o,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,o)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index 82825533b..6c12098e6 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1 +1 @@ -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,o,n){return Object.defineProperty(e,t,{value:o,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(s){u=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=o,i=new k(n||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,a=t.i[n];if(a===s)return o.delegate=null,"throw"===n&&t.i.return&&(o.method="return",o.arg=s,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;n=d(a,t.i,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;a=n.arg;return a?a.done?(o[t.r]=a.value,o.next=t.n,"return"!==o.method&&(o.method="next",o.arg=s),o.delegate=null,p):a:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}(o,i);if(o){if(o===p)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;o=d(a,c,i);if("normal"===o.type){if(r=i.done?4:2,o.arg===p)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=4,i.method="throw",i.arg=o.arg)}}),!0),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function f(){}var t={},m=(u(t,n,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,n)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,a){var c,e=d(i[e],i,o);if("throw"!==e.type)return(o=(c=e.arg).value)&&"object"==_typeof(o)&&l.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,a)},function(e){t("throw",e,n,a)}):r.resolve(o).then(function(e){c.value=e,n(c)},function(e){return t("throw",e,n,a)});a(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,o,n){return Object.defineProperty(e,t,{value:o,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(s){u=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=o,i=new k(n||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,a=t.i[n];if(a===s)return o.delegate=null,"throw"===n&&t.i.return&&(o.method="return",o.arg=s,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;n=d(a,t.i,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;a=n.arg;return a?a.done?(o[t.r]=a.value,o.next=t.n,"return"!==o.method&&(o.method="next",o.arg=s),o.delegate=null,p):a:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}(o,i);if(o){if(o===p)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;o=d(a,c,i);if("normal"===o.type){if(r=i.done?4:2,o.arg===p)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=4,i.method="throw",i.arg=o.arg)}}),!0),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function f(){}var t={},m=(u(t,n,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,n)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,a){var c,e=d(i[e],i,o);if("throw"!==e.type)return(o=(c=e.arg).value)&&"object"==_typeof(o)&&l.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,a)},function(e){t("throw",e,n,a)}):r.resolve(o).then(function(e){c.value=e,n(c)},function(e){return t("throw",e,n,a)});a(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 2b2ecd962..0f477978a 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -3018,7 +3018,7 @@ class ApbctHandler { window.fetch = async function(...args) { // Reset flag for each new request - //preventOriginalFetch = false; + preventOriginalFetch = false; let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index 2634dd185..4daffa68a 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -3018,7 +3018,7 @@ class ApbctHandler { window.fetch = async function(...args) { // Reset flag for each new request - //preventOriginalFetch = false; + preventOriginalFetch = false; let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index 366ab38e7..11a084db6 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -3018,7 +3018,7 @@ class ApbctHandler { window.fetch = async function(...args) { // Reset flag for each new request - //preventOriginalFetch = false; + preventOriginalFetch = false; let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 754cbf254..049166de1 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -3018,7 +3018,7 @@ class ApbctHandler { window.fetch = async function(...args) { // Reset flag for each new request - //preventOriginalFetch = false; + preventOriginalFetch = false; let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 04b75338e..3b0f5f3e5 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -3018,7 +3018,7 @@ class ApbctHandler { window.fetch = async function(...args) { // Reset flag for each new request - //preventOriginalFetch = false; + preventOriginalFetch = false; let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index a97e56bb6..f0fc4de28 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -3018,7 +3018,7 @@ class ApbctHandler { window.fetch = async function(...args) { // Reset flag for each new request - //preventOriginalFetch = false; + preventOriginalFetch = false; let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index 4a3e9699b..fc4e37edd 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -3018,7 +3018,7 @@ class ApbctHandler { window.fetch = async function(...args) { // Reset flag for each new request - //preventOriginalFetch = false; + preventOriginalFetch = false; let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 4d5b015d2..4d89aa697 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -3018,7 +3018,7 @@ class ApbctHandler { window.fetch = async function(...args) { // Reset flag for each new request - //preventOriginalFetch = false; + preventOriginalFetch = false; let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index ac4ea6b7a..ff5aa9261 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -676,7 +676,7 @@ class ApbctHandler { window.fetch = async function(...args) { // Reset flag for each new request - //preventOriginalFetch = false; + preventOriginalFetch = false; let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === From f1ca02738259d874eb3f9c764a59f101f22b9ff4 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 21 Jan 2026 17:00:57 +0700 Subject: [PATCH 07/60] Fix. ShadowrootProtection. Removed unnecessary hook usage --- inc/cleantalk-integrations-by-hook.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inc/cleantalk-integrations-by-hook.php b/inc/cleantalk-integrations-by-hook.php index 6dbcccb8a..d4daf5b55 100755 --- a/inc/cleantalk-integrations-by-hook.php +++ b/inc/cleantalk-integrations-by-hook.php @@ -21,11 +21,6 @@ 'setting' => 'forms__check_external', 'ajax' => true ), - 'MailChimpShadowRoot' => array( - 'hook' => 'cleantalk_force_mailchimp_shadowroot_check', - 'setting' => 'forms__check_external', - 'ajax' => true - ), 'CleantalkPreprocessComment' => array( 'hook' => 'preprocess_comment', 'setting' => 'forms__comments_test', @@ -339,10 +334,15 @@ ), // Mail chimp integration works with ajax and POST via the same hook 'MailChimp' => array( - 'hook' => array('mc4wp_form_errors', 'cleantalk_force_mailchimp_shadowroot_check'), + 'hook' => 'mc4wp_form_errors', 'setting' => 'forms__registrations_test', 'ajax' => false ), + 'MailChimpShadowRoot' => array( + 'hook' => 'cleantalk_force_mailchimp_shadowroot_check', + 'setting' => 'forms__check_external', + 'ajax' => true + ), 'BloomForms' => array( 'hook' => 'bloom_subscribe', 'setting' => 'forms__contact_forms_test', From 61bf6e44fdd97b7bd11c3540a746b7f232d76369 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 3 Feb 2026 15:38:42 +0700 Subject: [PATCH 08/60] Fix. CurlMulti. Editing implementation comments --- .../ApbctWP/Firewall/SFWFilesDownloader.php | 26 +- ...actory.php => HTTPMultiRequestService.php} | 16 +- lib/Cleantalk/ApbctWP/HTTP/Request.php | 3 +- lib/Cleantalk/ApbctWP/State.php | 2 +- ...ry.php => TestHTTPMultiRequestService.php} | 1124 ++++++++--------- tests/ApbctWP/HTTP/TestSFWFilesDownloader.php | 880 ++++++------- 6 files changed, 1031 insertions(+), 1020 deletions(-) rename lib/Cleantalk/ApbctWP/HTTP/{HTTPMultiRequestFactory.php => HTTPMultiRequestService.php} (95%) rename tests/ApbctWP/HTTP/{TestHTTPMultiRequestFactory.php => TestHTTPMultiRequestService.php} (88%) diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFWFilesDownloader.php b/lib/Cleantalk/ApbctWP/Firewall/SFWFilesDownloader.php index 40f6f7d82..6eac9eb84 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/SFWFilesDownloader.php +++ b/lib/Cleantalk/ApbctWP/Firewall/SFWFilesDownloader.php @@ -2,7 +2,7 @@ namespace Cleantalk\ApbctWP\Firewall; -use Cleantalk\ApbctWP\HTTP\HTTPMultiRequestFactory; +use Cleantalk\ApbctWP\HTTP\HTTPMultiRequestService; use Cleantalk\Common\TT; /** @@ -14,11 +14,11 @@ class SFWFilesDownloader { /** - * HTTP multi-request fabric instance + * HTTP multi-request service instance * - * @var HTTPMultiRequestFactory + * @var HTTPMultiRequestService */ - private $http_multi_request_factory; + private $http_multi_request_service; /** * @var string @@ -33,12 +33,20 @@ class SFWFilesDownloader /** * SFWFilesDownloader constructor * - * @param HTTPMultiRequestFactory|null $factory Optional. Custom fabric instance for dependency injection. + * @param HTTPMultiRequestService|null $service Optional. Custom service instance for dependency injection. + * @throws \InvalidArgumentException If service is not an instance of HTTPMultiRequestService */ - public function __construct($factory = null) + public function __construct($service = null) { $this->deafult_error_prefix = basename(__CLASS__) . ': '; - $this->http_multi_request_factory = $factory ?: new HTTPMultiRequestFactory(); + + if ($service !== null && !$service instanceof HTTPMultiRequestService) { + throw new \InvalidArgumentException( + 'Service must be an instance of ' . HTTPMultiRequestService::class + ); + } + + $this->http_multi_request_service = $service ?: new HTTPMultiRequestService(); } /** @@ -95,7 +103,7 @@ public function downloadFiles($all_urls, $direct_update = false, $sleep = 3) if (!empty($current_batch_urls)) { // Execute multi-request for current batch - $multi_request_contract = $this->http_multi_request_factory->setMultiContract($current_batch_urls); + $multi_request_contract = $this->http_multi_request_service->setMultiContract($current_batch_urls); // Critical error: contract processing failed, stop update immediately if (!$multi_request_contract->process_done) { @@ -105,7 +113,7 @@ public function downloadFiles($all_urls, $direct_update = false, $sleep = 3) // Handle failed downloads in this batch if (!empty($multi_request_contract->getFailedURLs())) { - // Reduce batch size for retry if fabric suggests it + // Reduce batch size for retry if service suggests it if ($multi_request_contract->suggest_batch_reduce_to) { $on_repeat_batch_size = min($on_repeat_batch_size, $multi_request_contract->suggest_batch_reduce_to); } diff --git a/lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestFactory.php b/lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestService.php similarity index 95% rename from lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestFactory.php rename to lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestService.php index 20f4473b5..25ffdffaa 100644 --- a/lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestFactory.php +++ b/lib/Cleantalk/ApbctWP/HTTP/HTTPMultiRequestService.php @@ -5,16 +5,16 @@ use Cleantalk\Common\HTTP\Request as CommonRequest; /** - * Class HTTPMultiRequestFactory + * Class HTTPMultiRequestService * - * Factory for managing multiple HTTP requests with contract-based approach. + * Service for managing multiple HTTP requests with contract-based approach. * Handles batch HTTP requests, validates responses, tracks success/failure states, * and provides file writing capabilities for downloaded content. * * @package Cleantalk\ApbctWP\HTTP * @since 1.0.0 */ -class HTTPMultiRequestFactory +class HTTPMultiRequestService { /** * Array of HTTP request contracts @@ -48,7 +48,7 @@ class HTTPMultiRequestFactory /** * Initializes and executes multi-request contract for given URLs * - * Resets factory state, prepares contracts for each URL, executes HTTP requests, + * Resets service state, prepares contracts for each URL, executes HTTP requests, * and fills contracts with response data. This is the main entry point for batch processing. * * @param array $urls List of URLs to process @@ -57,7 +57,7 @@ class HTTPMultiRequestFactory */ public function setMultiContract($urls) { - // Reset factory state for new batch + // Reset service state for new batch $this->process_done = false; $this->suggest_batch_reduce_to = false; $this->contracts = []; @@ -196,7 +196,11 @@ private function allContractsCompleted() } /** - * Sends HTTP requests to multiple URLs using CommonRequest + * Sends HTTP requests to multiple URLs using CommonRequest (cURL) + * + * Uses CommonRequest directly (bypassing WP HTTP API) to ensure per-URL + * error tracking is available. This enables adaptive batch size reduction + * when individual downloads fail. * * @param array $urls Array of URLs to request * diff --git a/lib/Cleantalk/ApbctWP/HTTP/Request.php b/lib/Cleantalk/ApbctWP/HTTP/Request.php index a0ee8f8f0..a0ee3ee54 100644 --- a/lib/Cleantalk/ApbctWP/HTTP/Request.php +++ b/lib/Cleantalk/ApbctWP/HTTP/Request.php @@ -139,8 +139,7 @@ protected function requestMulti() foreach ( $responses_raw as $response ) { if ( $response instanceof \Exception ) { - $responses[$this->url] = new Response(['error' => $response->getMessage()], []); - continue; + return ['error' => 'WP HTTP API multi-request exception: ' . $response->getMessage()]; } if ( $response instanceof $response_class ) { $responses[$response->url] = new Response($response->body, ['http_code' => $response->status_code]); diff --git a/lib/Cleantalk/ApbctWP/State.php b/lib/Cleantalk/ApbctWP/State.php index 4d5a240d5..0aa8e6d92 100644 --- a/lib/Cleantalk/ApbctWP/State.php +++ b/lib/Cleantalk/ApbctWP/State.php @@ -380,7 +380,7 @@ class State extends \Cleantalk\Common\State private $connection_reports; /** - * @var ConnectionReports + * @var JsErrorsReport */ private $js_errors_report; diff --git a/tests/ApbctWP/HTTP/TestHTTPMultiRequestFactory.php b/tests/ApbctWP/HTTP/TestHTTPMultiRequestService.php similarity index 88% rename from tests/ApbctWP/HTTP/TestHTTPMultiRequestFactory.php rename to tests/ApbctWP/HTTP/TestHTTPMultiRequestService.php index a5a298500..2e06a0675 100644 --- a/tests/ApbctWP/HTTP/TestHTTPMultiRequestFactory.php +++ b/tests/ApbctWP/HTTP/TestHTTPMultiRequestService.php @@ -1,562 +1,562 @@ -testFolder = sys_get_temp_dir() . '/test_fabric_' . time() . '/'; - if (!is_dir($this->testFolder)) { - mkdir($this->testFolder, 0777, true); - } - } - - protected function tearDown() - { - parent::tearDown(); - - if (is_dir($this->testFolder)) { - $files = glob($this->testFolder . '/*'); - if ($files) { - foreach ($files as $file) { - if (is_file($file)) { - unlink($file); - } - } - } - rmdir($this->testFolder); - } - } - - /** - * @test - */ - public function testPrepareContractsWithEmptyUrlsSetsError() - { - $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->setMethods(['executeMultiContract', 'sendMultiRequest']) - ->getMock(); - - $fabric->expects($this->never()) - ->method('sendMultiRequest'); - - $fabric->setMultiContract([]); - - $this->assertNotNull($fabric->error_msg); - $this->assertStringContainsString('URLS SHOULD BE NOT EMPTY', $fabric->error_msg); - $this->assertEmpty($fabric->contracts); - } - - /** - * @test - */ - public function testPrepareContractsWithNonStringUrlSetsError() - { - $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->setMethods(['executeMultiContract']) - ->getMock(); - - $urls = [ - 'https://example.com/file1.gz', - 123, // Invalid - 'https://example.com/file3.gz' - ]; - - $fabric->setMultiContract($urls); - - $this->assertNotNull($fabric->error_msg); - $this->assertStringContainsString('SINGLE URL SHOULD BE A STRING', $fabric->error_msg); - $this->assertEmpty($fabric->contracts); - } - - /** - * @test - */ - public function testPrepareContractsCreatesHTTPRequestContracts() - { - $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->setMethods(['executeMultiContract']) - ->getMock(); - - $urls = [ - 'https://example.com/file1.gz', - 'https://example.com/file2.gz' - ]; - - $fabric->setMultiContract($urls); - - $this->assertCount(2, $fabric->contracts); - $this->assertContainsOnlyInstancesOf(HTTPRequestContract::class, $fabric->contracts); - $this->assertEquals($urls[0], $fabric->contracts[0]->url); - $this->assertEquals($urls[1], $fabric->contracts[1]->url); - } - - /** - * @test - */ - public function testGetAllURLsReturnsAllContractUrls() - { - $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->setMethods(['executeMultiContract']) - ->getMock(); - - $urls = [ - 'https://example.com/file1.gz', - 'https://example.com/file2.gz' - ]; - - $fabric->setMultiContract($urls); - - $this->assertEquals($urls, $fabric->getAllURLs()); - } - - /** - * @test - */ - public function testGetFailedURLsReturnsUrlsWithNoSuccess() - { - $fabric = new HTTPMultiRequestFactory(); - - $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); - $contract1->success = true; - $contract1->content = 'content'; - - $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); - $contract2->success = false; - - $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); - $contract3->success = true; - $contract3->content = ''; - - $fabric->contracts = [$contract1, $contract2, $contract3]; - - $failed = $fabric->getFailedURLs(); - - $this->assertCount(2, $failed); - $this->assertContains('https://example.com/file2.gz', $failed); - $this->assertContains('https://example.com/file3.gz', $failed); - } - - /** - * @test - */ - public function testGetSuccessURLsReturnsOnlySuccessfulUrls() - { - $fabric = new HTTPMultiRequestFactory(); - - $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); - $contract1->success = true; - $contract1->content = 'content1'; - - $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); - $contract2->success = false; - - $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); - $contract3->success = true; - $contract3->content = 'content3'; - - $fabric->contracts = [$contract1, $contract2, $contract3]; - - $success = $fabric->getSuccessURLs(); - - $this->assertCount(2, $success); - $this->assertEquals(['https://example.com/file1.gz', 'https://example.com/file3.gz'], $success); - } - - /** - * @test - */ - public function testFillMultiContractWithErrorArraySetsError() - { - $fabric = new HTTPMultiRequestFactory(); - - $fabric->fillMultiContract(['error' => 'CURL_ERROR']); - - $this->assertNotNull($fabric->error_msg); - $this->assertStringContainsString('HTTP_MULTI_RESULT ERROR', $fabric->error_msg); - } - - /** - * @test - */ - public function testFillMultiContractWithNonArraySetsError() - { - $fabric = new HTTPMultiRequestFactory(); - - $fabric->fillMultiContract('not an array'); - - $this->assertNotNull($fabric->error_msg); - $this->assertStringContainsString('HTTP_MULTI_RESULT INVALID', $fabric->error_msg); - } - - /** - * @test - */ - public function testFillMultiContractWithValidResultsFillsContracts() - { - $fabric = new HTTPMultiRequestFactory(); - - $fabric->contracts = [ - new HTTPRequestContract('https://example.com/file1.gz'), - new HTTPRequestContract('https://example.com/file2.gz') - ]; - - $results = [ - 'https://example.com/file1.gz' => 'content for file1', - 'https://example.com/file2.gz' => 'content for file2' - ]; - - $fabric->fillMultiContract($results); - - $this->assertTrue($fabric->contracts[0]->success); - $this->assertEquals('content for file1', $fabric->contracts[0]->content); - $this->assertTrue($fabric->contracts[1]->success); - $this->assertEquals('content for file2', $fabric->contracts[1]->content); - $this->assertTrue($fabric->process_done); - } - - /** - * @test - */ - public function testFillMultiContractWithNonStringContentSetsContractError() - { - $fabric = new HTTPMultiRequestFactory(); - - $fabric->contracts = [ - new HTTPRequestContract('https://example.com/file1.gz') - ]; - - $results = [ - 'https://example.com/file1.gz' => 123 - ]; - - $fabric->fillMultiContract($results); - - $this->assertFalse($fabric->contracts[0]->success); - $this->assertNotNull($fabric->contracts[0]->error_msg); - $this->assertStringContainsString('SHOULD BE A STRING', $fabric->contracts[0]->error_msg); - } - - /** - * @test - */ - public function testFillMultiContractWithEmptyContentSetsContractError() - { - $fabric = new HTTPMultiRequestFactory(); - - $fabric->contracts = [ - new HTTPRequestContract('https://example.com/file1.gz') - ]; - - $results = [ - 'https://example.com/file1.gz' => '' - ]; - - $fabric->fillMultiContract($results); - - $this->assertFalse($fabric->contracts[0]->success); - $this->assertNotNull($fabric->contracts[0]->error_msg); - $this->assertStringContainsString('SHOULD BE NOT EMPTY', $fabric->contracts[0]->error_msg); - } - - /** - * @test - */ - public function testFillMultiContractWithPartialSuccessSuggestsBatchReduce() - { - $fabric = new HTTPMultiRequestFactory(); - - $fabric->contracts = [ - new HTTPRequestContract('https://example.com/file1.gz'), - new HTTPRequestContract('https://example.com/file2.gz'), - new HTTPRequestContract('https://example.com/file3.gz') - ]; - - $results = [ - 'https://example.com/file1.gz' => 'content1', - 'https://example.com/file3.gz' => 'content3' - ]; - - $fabric->fillMultiContract($results); - - $this->assertEquals(2, $fabric->suggest_batch_reduce_to); - $this->assertTrue($fabric->process_done); - } - - /** - * @test - */ - public function testFillMultiContractWithAllFailedSuggestsMinimumBatchSize() - { - $fabric = new HTTPMultiRequestFactory(); - - $fabric->contracts = [ - new HTTPRequestContract('https://example.com/file1.gz'), - new HTTPRequestContract('https://example.com/file2.gz') - ]; - - $results = []; - - $fabric->fillMultiContract($results); - - $this->assertEquals(2, $fabric->suggest_batch_reduce_to); - $this->assertTrue($fabric->process_done); - } - - /** - * @test - */ - public function testFillMultiContractWithAllSuccessDoesNotSuggestBatchReduce() - { - $fabric = new HTTPMultiRequestFactory(); - - $fabric->contracts = [ - new HTTPRequestContract('https://example.com/file1.gz'), - new HTTPRequestContract('https://example.com/file2.gz') - ]; - - $results = [ - 'https://example.com/file1.gz' => 'content1', - 'https://example.com/file2.gz' => 'content2' - ]; - - $fabric->fillMultiContract($results); - - $this->assertFalse($fabric->suggest_batch_reduce_to); - $this->assertTrue($fabric->process_done); - } - - /** - * @test - */ - public function testGetContractsErrorsReturnsFormattedErrors() - { - $fabric = new HTTPMultiRequestFactory(); - - $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); - $contract1->error_msg = 'Connection timeout'; - - $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); - $contract2->success = true; - $contract2->content = 'content'; - - $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); - $contract3->error_msg = '404 Not Found'; - - $fabric->contracts = [$contract1, $contract2, $contract3]; - - $errors = $fabric->getContractsErrors(); - - $this->assertIsString($errors); - $this->assertStringContainsString('file1.gz', $errors); - $this->assertStringContainsString('Connection timeout', $errors); - $this->assertStringContainsString('file3.gz', $errors); - $this->assertStringContainsString('404 Not Found', $errors); - $this->assertStringNotContainsString('file2', $errors); - } - - /** - * @test - */ - public function testGetContractsErrorsReturnsFalseWhenNoErrors() - { - $fabric = new HTTPMultiRequestFactory(); - - $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); - $contract1->success = true; - $contract1->content = 'content1'; - - $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); - $contract2->success = true; - $contract2->content = 'content2'; - - $fabric->contracts = [$contract1, $contract2]; - - $errors = $fabric->getContractsErrors(); - - $this->assertFalse($errors); - } - - /** - * @test - */ - public function testWriteSuccessURLsContentWritesFiles() - { - $fabric = new HTTPMultiRequestFactory(); - - $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); - $contract1->success = true; - $contract1->content = 'content1'; - - $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); - $contract2->success = true; - $contract2->content = 'content2'; - - $fabric->contracts = [$contract1, $contract2]; - - $result = $fabric->writeSuccessURLsContent($this->testFolder); - - $this->assertIsArray($result); - $this->assertCount(2, $result); - $this->assertFileExists($this->testFolder . 'file1.gz'); - $this->assertFileExists($this->testFolder . 'file2.gz'); - $this->assertEquals('content1', file_get_contents($this->testFolder . 'file1.gz')); - $this->assertEquals('content2', file_get_contents($this->testFolder . 'file2.gz')); - } - - /** - * @test - */ - public function testWriteSuccessURLsContentSkipsFailedContracts() - { - $fabric = new HTTPMultiRequestFactory(); - - $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); - $contract1->success = true; - $contract1->content = 'content1'; - - $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); - $contract2->success = false; - - $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); - $contract3->success = true; - $contract3->content = 'content3'; - - $fabric->contracts = [$contract1, $contract2, $contract3]; - - $result = $fabric->writeSuccessURLsContent($this->testFolder); - - $this->assertIsArray($result); - $this->assertCount(2, $result); - $this->assertFileExists($this->testFolder . 'file1.gz'); - $this->assertFileNotExists($this->testFolder . 'file2.gz'); - $this->assertFileExists($this->testFolder . 'file3.gz'); - } - - /** - * @test - */ - public function testWriteSuccessURLsContentReturnsErrorWhenDirectoryNotExists() - { - $fabric = new HTTPMultiRequestFactory(); - - $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); - $contract1->success = true; - $contract1->content = 'content1'; - - $fabric->contracts = [$contract1]; - - $result = $fabric->writeSuccessURLsContent('/nonexistent/path/'); - - $this->assertIsString($result); - $this->assertStringContainsString('CAN NOT WRITE TO DIRECTORY', $result); - } - - /** - * @test - */ - public function testWriteSuccessURLsContentReturnsErrorWhenDirectoryNotWritable() - { - $fabric = new HTTPMultiRequestFactory(); - - $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); - $contract1->success = true; - $contract1->content = 'content1'; - - $fabric->contracts = [$contract1]; - - // Use root directory which is typically not writable - $result = $fabric->writeSuccessURLsContent('/nonexist'); - - $this->assertIsString($result); - $this->assertStringContainsString('CAN NOT WRITE', $result); - } - - /** - * @test - */ - public function testSetMultiContractResetsStateOnEachCall() - { - $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->setMethods(['executeMultiContract']) - ->getMock(); - - // First call - $fabric->setMultiContract(['https://example.com/file1.gz']); - $this->assertCount(1, $fabric->contracts); - $fabric->process_done = true; - $fabric->suggest_batch_reduce_to = 5; - $fabric->error_msg = 'some error'; - - // Second call should reset everything - $fabric->setMultiContract(['https://example.com/file2.gz', 'https://example.com/file3.gz']); - - $this->assertCount(2, $fabric->contracts); - $this->assertFalse($fabric->suggest_batch_reduce_to); - $this->assertNull($fabric->error_msg); - $this->assertFalse($fabric->process_done); - } - - /** - * @test - */ - public function testSetMultiContractReturnsItself() - { - $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->setMethods(['executeMultiContract']) - ->getMock(); - - $result = $fabric->setMultiContract(['https://example.com/file1.gz']); - - $this->assertInstanceOf(HTTPMultiRequestFactory::class, $result); - $this->assertSame($fabric, $result); - } - - /** - * @test - */ - public function testFillMultiContractReturnsItself() - { - $fabric = new HTTPMultiRequestFactory(); - - $result = $fabric->fillMultiContract([]); - - $this->assertInstanceOf(HTTPMultiRequestFactory::class, $result); - $this->assertSame($fabric, $result); - } - - /** - * @test - */ - public function testWriteSuccessURLsContentHandlesFileWriteFailure() - { - $fabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->setMethods(['writeFile']) - ->getMock(); - - // Mock writeFile to return false (simulating write failure) - $fabric->expects($this->once()) - ->method('writeFile') - ->willReturn(false); - - $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); - $contract1->success = true; - $contract1->content = 'content1'; - - $fabric->contracts = [$contract1]; - - $result = $fabric->writeSuccessURLsContent($this->testFolder); - - $this->assertIsString($result); - $this->assertStringContainsString('CAN NOT WRITE TO FILE', $result); - } -} +testFolder = sys_get_temp_dir() . '/test_fabric_' . time() . '/'; + if (!is_dir($this->testFolder)) { + mkdir($this->testFolder, 0777, true); + } + } + + protected function tearDown() + { + parent::tearDown(); + + if (is_dir($this->testFolder)) { + $files = glob($this->testFolder . '/*'); + if ($files) { + foreach ($files as $file) { + if (is_file($file)) { + unlink($file); + } + } + } + rmdir($this->testFolder); + } + } + + /** + * @test + */ + public function testPrepareContractsWithEmptyUrlsSetsError() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->setMethods(['executeMultiContract', 'sendMultiRequest']) + ->getMock(); + + $fabric->expects($this->never()) + ->method('sendMultiRequest'); + + $fabric->setMultiContract([]); + + $this->assertNotNull($fabric->error_msg); + $this->assertStringContainsString('URLS SHOULD BE NOT EMPTY', $fabric->error_msg); + $this->assertEmpty($fabric->contracts); + } + + /** + * @test + */ + public function testPrepareContractsWithNonStringUrlSetsError() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->setMethods(['executeMultiContract']) + ->getMock(); + + $urls = [ + 'https://example.com/file1.gz', + 123, // Invalid + 'https://example.com/file3.gz' + ]; + + $fabric->setMultiContract($urls); + + $this->assertNotNull($fabric->error_msg); + $this->assertStringContainsString('SINGLE URL SHOULD BE A STRING', $fabric->error_msg); + $this->assertEmpty($fabric->contracts); + } + + /** + * @test + */ + public function testPrepareContractsCreatesHTTPRequestContracts() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->setMethods(['executeMultiContract']) + ->getMock(); + + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz' + ]; + + $fabric->setMultiContract($urls); + + $this->assertCount(2, $fabric->contracts); + $this->assertContainsOnlyInstancesOf(HTTPRequestContract::class, $fabric->contracts); + $this->assertEquals($urls[0], $fabric->contracts[0]->url); + $this->assertEquals($urls[1], $fabric->contracts[1]->url); + } + + /** + * @test + */ + public function testGetAllURLsReturnsAllContractUrls() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->setMethods(['executeMultiContract']) + ->getMock(); + + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz' + ]; + + $fabric->setMultiContract($urls); + + $this->assertEquals($urls, $fabric->getAllURLs()); + } + + /** + * @test + */ + public function testGetFailedURLsReturnsUrlsWithNoSuccess() + { + $fabric = new HTTPMultiRequestService(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = false; + + $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); + $contract3->success = true; + $contract3->content = ''; + + $fabric->contracts = [$contract1, $contract2, $contract3]; + + $failed = $fabric->getFailedURLs(); + + $this->assertCount(2, $failed); + $this->assertContains('https://example.com/file2.gz', $failed); + $this->assertContains('https://example.com/file3.gz', $failed); + } + + /** + * @test + */ + public function testGetSuccessURLsReturnsOnlySuccessfulUrls() + { + $fabric = new HTTPMultiRequestService(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = false; + + $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); + $contract3->success = true; + $contract3->content = 'content3'; + + $fabric->contracts = [$contract1, $contract2, $contract3]; + + $success = $fabric->getSuccessURLs(); + + $this->assertCount(2, $success); + $this->assertEquals(['https://example.com/file1.gz', 'https://example.com/file3.gz'], $success); + } + + /** + * @test + */ + public function testFillMultiContractWithErrorArraySetsError() + { + $fabric = new HTTPMultiRequestService(); + + $fabric->fillMultiContract(['error' => 'CURL_ERROR']); + + $this->assertNotNull($fabric->error_msg); + $this->assertStringContainsString('HTTP_MULTI_RESULT ERROR', $fabric->error_msg); + } + + /** + * @test + */ + public function testFillMultiContractWithNonArraySetsError() + { + $fabric = new HTTPMultiRequestService(); + + $fabric->fillMultiContract('not an array'); + + $this->assertNotNull($fabric->error_msg); + $this->assertStringContainsString('HTTP_MULTI_RESULT INVALID', $fabric->error_msg); + } + + /** + * @test + */ + public function testFillMultiContractWithValidResultsFillsContracts() + { + $fabric = new HTTPMultiRequestService(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz'), + new HTTPRequestContract('https://example.com/file2.gz') + ]; + + $results = [ + 'https://example.com/file1.gz' => 'content for file1', + 'https://example.com/file2.gz' => 'content for file2' + ]; + + $fabric->fillMultiContract($results); + + $this->assertTrue($fabric->contracts[0]->success); + $this->assertEquals('content for file1', $fabric->contracts[0]->content); + $this->assertTrue($fabric->contracts[1]->success); + $this->assertEquals('content for file2', $fabric->contracts[1]->content); + $this->assertTrue($fabric->process_done); + } + + /** + * @test + */ + public function testFillMultiContractWithNonStringContentSetsContractError() + { + $fabric = new HTTPMultiRequestService(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz') + ]; + + $results = [ + 'https://example.com/file1.gz' => 123 + ]; + + $fabric->fillMultiContract($results); + + $this->assertFalse($fabric->contracts[0]->success); + $this->assertNotNull($fabric->contracts[0]->error_msg); + $this->assertStringContainsString('SHOULD BE A STRING', $fabric->contracts[0]->error_msg); + } + + /** + * @test + */ + public function testFillMultiContractWithEmptyContentSetsContractError() + { + $fabric = new HTTPMultiRequestService(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz') + ]; + + $results = [ + 'https://example.com/file1.gz' => '' + ]; + + $fabric->fillMultiContract($results); + + $this->assertFalse($fabric->contracts[0]->success); + $this->assertNotNull($fabric->contracts[0]->error_msg); + $this->assertStringContainsString('SHOULD BE NOT EMPTY', $fabric->contracts[0]->error_msg); + } + + /** + * @test + */ + public function testFillMultiContractWithPartialSuccessSuggestsBatchReduce() + { + $fabric = new HTTPMultiRequestService(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz'), + new HTTPRequestContract('https://example.com/file2.gz'), + new HTTPRequestContract('https://example.com/file3.gz') + ]; + + $results = [ + 'https://example.com/file1.gz' => 'content1', + 'https://example.com/file3.gz' => 'content3' + ]; + + $fabric->fillMultiContract($results); + + $this->assertEquals(2, $fabric->suggest_batch_reduce_to); + $this->assertTrue($fabric->process_done); + } + + /** + * @test + */ + public function testFillMultiContractWithAllFailedSuggestsMinimumBatchSize() + { + $fabric = new HTTPMultiRequestService(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz'), + new HTTPRequestContract('https://example.com/file2.gz') + ]; + + $results = []; + + $fabric->fillMultiContract($results); + + $this->assertEquals(2, $fabric->suggest_batch_reduce_to); + $this->assertTrue($fabric->process_done); + } + + /** + * @test + */ + public function testFillMultiContractWithAllSuccessDoesNotSuggestBatchReduce() + { + $fabric = new HTTPMultiRequestService(); + + $fabric->contracts = [ + new HTTPRequestContract('https://example.com/file1.gz'), + new HTTPRequestContract('https://example.com/file2.gz') + ]; + + $results = [ + 'https://example.com/file1.gz' => 'content1', + 'https://example.com/file2.gz' => 'content2' + ]; + + $fabric->fillMultiContract($results); + + $this->assertFalse($fabric->suggest_batch_reduce_to); + $this->assertTrue($fabric->process_done); + } + + /** + * @test + */ + public function testGetContractsErrorsReturnsFormattedErrors() + { + $fabric = new HTTPMultiRequestService(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->error_msg = 'Connection timeout'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = true; + $contract2->content = 'content'; + + $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); + $contract3->error_msg = '404 Not Found'; + + $fabric->contracts = [$contract1, $contract2, $contract3]; + + $errors = $fabric->getContractsErrors(); + + $this->assertIsString($errors); + $this->assertStringContainsString('file1.gz', $errors); + $this->assertStringContainsString('Connection timeout', $errors); + $this->assertStringContainsString('file3.gz', $errors); + $this->assertStringContainsString('404 Not Found', $errors); + $this->assertStringNotContainsString('file2', $errors); + } + + /** + * @test + */ + public function testGetContractsErrorsReturnsFalseWhenNoErrors() + { + $fabric = new HTTPMultiRequestService(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = true; + $contract2->content = 'content2'; + + $fabric->contracts = [$contract1, $contract2]; + + $errors = $fabric->getContractsErrors(); + + $this->assertFalse($errors); + } + + /** + * @test + */ + public function testWriteSuccessURLsContentWritesFiles() + { + $fabric = new HTTPMultiRequestService(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = true; + $contract2->content = 'content2'; + + $fabric->contracts = [$contract1, $contract2]; + + $result = $fabric->writeSuccessURLsContent($this->testFolder); + + $this->assertIsArray($result); + $this->assertCount(2, $result); + $this->assertFileExists($this->testFolder . 'file1.gz'); + $this->assertFileExists($this->testFolder . 'file2.gz'); + $this->assertEquals('content1', file_get_contents($this->testFolder . 'file1.gz')); + $this->assertEquals('content2', file_get_contents($this->testFolder . 'file2.gz')); + } + + /** + * @test + */ + public function testWriteSuccessURLsContentSkipsFailedContracts() + { + $fabric = new HTTPMultiRequestService(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $contract2 = new HTTPRequestContract('https://example.com/file2.gz'); + $contract2->success = false; + + $contract3 = new HTTPRequestContract('https://example.com/file3.gz'); + $contract3->success = true; + $contract3->content = 'content3'; + + $fabric->contracts = [$contract1, $contract2, $contract3]; + + $result = $fabric->writeSuccessURLsContent($this->testFolder); + + $this->assertIsArray($result); + $this->assertCount(2, $result); + $this->assertFileExists($this->testFolder . 'file1.gz'); + $this->assertFileNotExists($this->testFolder . 'file2.gz'); + $this->assertFileExists($this->testFolder . 'file3.gz'); + } + + /** + * @test + */ + public function testWriteSuccessURLsContentReturnsErrorWhenDirectoryNotExists() + { + $fabric = new HTTPMultiRequestService(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $fabric->contracts = [$contract1]; + + $result = $fabric->writeSuccessURLsContent('/nonexistent/path/'); + + $this->assertIsString($result); + $this->assertStringContainsString('CAN NOT WRITE TO DIRECTORY', $result); + } + + /** + * @test + */ + public function testWriteSuccessURLsContentReturnsErrorWhenDirectoryNotWritable() + { + $fabric = new HTTPMultiRequestService(); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $fabric->contracts = [$contract1]; + + // Use root directory which is typically not writable + $result = $fabric->writeSuccessURLsContent('/nonexist'); + + $this->assertIsString($result); + $this->assertStringContainsString('CAN NOT WRITE', $result); + } + + /** + * @test + */ + public function testSetMultiContractResetsStateOnEachCall() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->setMethods(['executeMultiContract']) + ->getMock(); + + // First call + $fabric->setMultiContract(['https://example.com/file1.gz']); + $this->assertCount(1, $fabric->contracts); + $fabric->process_done = true; + $fabric->suggest_batch_reduce_to = 5; + $fabric->error_msg = 'some error'; + + // Second call should reset everything + $fabric->setMultiContract(['https://example.com/file2.gz', 'https://example.com/file3.gz']); + + $this->assertCount(2, $fabric->contracts); + $this->assertFalse($fabric->suggest_batch_reduce_to); + $this->assertNull($fabric->error_msg); + $this->assertFalse($fabric->process_done); + } + + /** + * @test + */ + public function testSetMultiContractReturnsItself() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->setMethods(['executeMultiContract']) + ->getMock(); + + $result = $fabric->setMultiContract(['https://example.com/file1.gz']); + + $this->assertInstanceOf(HTTPMultiRequestService::class, $result); + $this->assertSame($fabric, $result); + } + + /** + * @test + */ + public function testFillMultiContractReturnsItself() + { + $fabric = new HTTPMultiRequestService(); + + $result = $fabric->fillMultiContract([]); + + $this->assertInstanceOf(HTTPMultiRequestService::class, $result); + $this->assertSame($fabric, $result); + } + + /** + * @test + */ + public function testWriteSuccessURLsContentHandlesFileWriteFailure() + { + $fabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->setMethods(['writeFile']) + ->getMock(); + + // Mock writeFile to return false (simulating write failure) + $fabric->expects($this->once()) + ->method('writeFile') + ->willReturn(false); + + $contract1 = new HTTPRequestContract('https://example.com/file1.gz'); + $contract1->success = true; + $contract1->content = 'content1'; + + $fabric->contracts = [$contract1]; + + $result = $fabric->writeSuccessURLsContent($this->testFolder); + + $this->assertIsString($result); + $this->assertStringContainsString('CAN NOT WRITE TO FILE', $result); + } +} diff --git a/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php b/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php index b8e54e4f6..652051069 100644 --- a/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php +++ b/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php @@ -1,440 +1,440 @@ -apbctBackup = $apbct; - - $this->testFolder = sys_get_temp_dir() . '/test_sfw_' . time() . '/'; - if (!is_dir($this->testFolder)) { - mkdir($this->testFolder, 0777, true); - } - - $apbct = new State('cleantalk', array('settings', 'data', 'errors', 'remote_calls', 'stats', 'fw_stats')); - $apbct->data = ['sfw_update__batch_size' => 10]; - $apbct->fw_stats = ['updating_folder' => $this->testFolder]; - $apbct->save = function($key) {}; - } - - protected function tearDown() - { - parent::tearDown(); - global $apbct; - - if (is_dir($this->testFolder)) { - $files = glob($this->testFolder . '/*'); - if ($files) { - foreach ($files as $file) { - if (is_file($file)) { - unlink($file); - } - } - } - rmdir($this->testFolder); - } - - $apbct = $this->apbctBackup; - } - - /** - * @test - */ - public function testReturnsErrorWhenFolderNotWritable() - { - global $apbct; - $apbct->fw_stats['updating_folder'] = '/nonexistent/path/'; - - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->getMock(); - - $downloader = new SFWFilesDownloader($mockFabric); - $result = $downloader->downloadFiles(['https://example.com/file1.gz'], false, 0); - - $this->assertIsArray($result); - $this->assertArrayHasKey('error', $result); - $this->assertStringContainsString('NOT WRITABLE', $result['error']); - $this->assertArrayNotHasKey('update_args', $result); - } - - /** - * @test - */ - public function testReturnsErrorWhenUrlsNotArray() - { - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->getMock(); - - $downloader = new SFWFilesDownloader($mockFabric); - $result = $downloader->downloadFiles('NOT AN ARRAY', false, 0); - - $this->assertIsArray($result); - $this->assertArrayHasKey('error', $result); - $this->assertStringContainsString('SHOULD BE AN ARRAY', $result['error']); - } - - /** - * @test - */ - public function testReturnsSuccessStageWhenEmptyUrlsArray() - { - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->getMock(); - - $downloader = new SFWFilesDownloader($mockFabric); - $result = $downloader->downloadFiles([], false, 0); - - $this->assertIsArray($result); - $this->assertArrayHasKey('next_stage', $result); - $this->assertEquals('apbct_sfw_update__create_tables', $result['next_stage']['name']); - } - - /** - * @test - */ - public function testReturnsTrueWhenEmptyUrlsAndDirectUpdateTrue() - { - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->getMock(); - - $downloader = new SFWFilesDownloader($mockFabric); - $result = $downloader->downloadFiles([], true, 0); - - $this->assertTrue((bool)$result); - } - - /** - * @test - */ - public function testReturnsErrorWhenContractProcessNotDone() - { - $urls = ['https://example.com/file1.gz']; - - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->setMethods(['setMultiContract']) - ->getMock(); - - $mockFabric->expects($this->once()) - ->method('setMultiContract') - ->with($urls) - ->willReturnCallback(function() use ($mockFabric) { - $mockFabric->process_done = false; - $mockFabric->error_msg = 'CONTRACT PROCESSING FAILED'; - return $mockFabric; - }); - - $downloader = new SFWFilesDownloader($mockFabric); - $result = $downloader->downloadFiles($urls, false, 0); - - $this->assertIsArray($result); - $this->assertArrayHasKey('error', $result); - $this->assertStringContainsString('CONTRACT PROCESSING FAILED', $result['error']); - } - - /** - * @test - */ - public function testReturnsRepeatStageWhenSomeFilesFailedToDownload() - { - global $apbct; - $apbct->fw_stats['multi_request_batch_size'] = 10; - - $urls = [ - 'https://example.com/file1.gz', - 'https://example.com/file2.gz', - 'https://example.com/file3.gz' - ]; - - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) - ->getMock(); - - $mockFabric->method('setMultiContract') - ->willReturnCallback(function() use ($mockFabric) { - $mockFabric->process_done = true; - $mockFabric->suggest_batch_reduce_to = 2; - return $mockFabric; - }); - - $mockFabric->method('getFailedURLs') - ->willReturn(['https://example.com/file2.gz']); - - $mockFabric->method('writeSuccessURLsContent') - ->willReturn(['https://example.com/file1.gz', 'https://example.com/file3.gz']); - - $downloader = new SFWFilesDownloader($mockFabric); - $result = $downloader->downloadFiles($urls, false, 0); - - $this->assertIsArray($result); - $this->assertArrayHasKey('error', $result); - $this->assertStringContainsString('NOT COMPLETED, TRYING AGAIN', $result['error']); - $this->assertArrayHasKey('update_args', $result); - $this->assertEquals(['https://example.com/file2.gz'], $result['update_args']['args']); - $this->assertEquals(2, $apbct->fw_stats['multi_request_batch_size']); - } - - /** - * @test - */ - public function testReturnsErrorWhenWriteToFileSystemFails() - { - $urls = ['https://example.com/file1.gz']; - - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) - ->getMock(); - - $mockFabric->method('setMultiContract') - ->willReturnCallback(function() use ($mockFabric) { - $mockFabric->process_done = true; - return $mockFabric; - }); - - $mockFabric->method('getFailedURLs') - ->willReturn([]); - - $mockFabric->method('writeSuccessURLsContent') - ->willReturn('CAN NOT WRITE TO FILE: /test/file1.gz'); - - $downloader = new SFWFilesDownloader($mockFabric); - $result = $downloader->downloadFiles($urls, false, 0); - - $this->assertIsArray($result); - $this->assertArrayHasKey('error', $result); - $this->assertStringContainsString('CAN NOT WRITE TO FILE', $result['error']); - $this->assertStringContainsString('/test/file1.gz', $result['error']); - } - - /** - * @test - */ - public function testReturnsNextStageWhenAllFilesDownloadedSuccessfully() - { - $urls = [ - 'https://example.com/file1.gz', - 'https://example.com/file2.gz' - ]; - - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) - ->getMock(); - - $mockFabric->method('setMultiContract') - ->willReturnCallback(function() use ($mockFabric) { - $mockFabric->process_done = true; - $mockFabric->suggest_batch_reduce_to = false; - return $mockFabric; - }); - - $mockFabric->method('getFailedURLs') - ->willReturn([]); - - $mockFabric->method('writeSuccessURLsContent') - ->willReturn($urls); - - $downloader = new SFWFilesDownloader($mockFabric); - $result = $downloader->downloadFiles($urls, false, 0); - - $this->assertIsArray($result); - $this->assertArrayHasKey('next_stage', $result); - $this->assertEquals('apbct_sfw_update__create_tables', $result['next_stage']['name']); - } - - /** - * @test - */ - public function testProcessesUrlsInBatchesAccordingToBatchSize() - { - global $apbct; - $apbct->fw_stats['multi_request_batch_size'] = 3; - - $urls = [ - 'https://example.com/file1.gz', - 'https://example.com/file2.gz', - 'https://example.com/file3.gz', - 'https://example.com/file4.gz', - 'https://example.com/file5.gz' - ]; - - $callCount = 0; - $receivedBatches = []; - - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) - ->getMock(); - - $mockFabric->method('setMultiContract') - ->willReturnCallback(function($batchUrls) use ($mockFabric, &$callCount, &$receivedBatches) { - $callCount++; - $receivedBatches[] = $batchUrls; - $mockFabric->process_done = true; - $mockFabric->suggest_batch_reduce_to = false; - return $mockFabric; - }); - - $mockFabric->method('getFailedURLs') - ->willReturn([]); - - $mockFabric->method('writeSuccessURLsContent') - ->willReturnCallback(function() use (&$receivedBatches, &$callCount) { - return $receivedBatches[$callCount - 1]; - }); - - $downloader = new SFWFilesDownloader($mockFabric); - $downloader->downloadFiles($urls, false, 0); - - $this->assertEquals(2, $callCount); - $this->assertCount(3, $receivedBatches[0]); - $this->assertCount(2, $receivedBatches[1]); - } - - /** - * @test - */ - public function testReducesBatchSizeToMinimumWhenMultipleSuggestions() - { - global $apbct; - $apbct->fw_stats['multi_request_batch_size'] = 10; - - $urls = []; - for ($i = 0; $i < 20; $i++) { - $urls[] = 'https://example.com/file' . $i . '.gz'; - } - - $callCount = 0; - - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) - ->getMock(); - - $mockFabric->method('setMultiContract') - ->willReturnCallback(function($batchUrls) use ($mockFabric, &$callCount) { - $callCount++; - $mockFabric->process_done = true; - $mockFabric->suggest_batch_reduce_to = $callCount === 1 ? 7 : 5; - return $mockFabric; - }); - - $mockFabric->method('getFailedURLs') - ->willReturnCallback(function() use (&$callCount, $urls) { - $batchStart = ($callCount - 1) * 10; - return [$urls[$batchStart]]; - }); - - $mockFabric->method('writeSuccessURLsContent') - ->willReturnCallback(function() use (&$callCount, $urls) { - $batchStart = ($callCount - 1) * 10; - $batchSize = min(10, count($urls) - $batchStart); - $result = []; - for ($i = 1; $i < $batchSize; $i++) { - $result[] = $urls[$batchStart + $i]; - } - return $result; - }); - - $downloader = new SFWFilesDownloader($mockFabric); - $downloader->downloadFiles($urls, false, 0); - - $this->assertEquals(5, $apbct->fw_stats['multi_request_batch_size']); - } - - /** - * @test - */ - public function testReturnsErrorWhenNotAllFilesDownloadedAfterBatches() - { - $urls = [ - 'https://example.com/file1.gz', - 'https://example.com/file2.gz' - ]; - - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent', 'getContractsErrors']) - ->getMock(); - - $mockFabric->method('setMultiContract') - ->willReturnCallback(function() use ($mockFabric) { - $mockFabric->process_done = true; - return $mockFabric; - }); - - $mockFabric->method('getFailedURLs') - ->willReturn([]); - - $mockFabric->method('writeSuccessURLsContent') - ->willReturn(['https://example.com/file1.gz']); - - $mockFabric->method('getContractsErrors') - ->willReturn('[url1]:[error1],[url2]:[error2]'); - - $downloader = new SFWFilesDownloader($mockFabric); - $result = $downloader->downloadFiles($urls, false, 0); - - $this->assertIsArray($result); - $this->assertArrayHasKey('error', $result); - $this->assertStringContainsString('NOT COMPLETED - STOP UPDATE', $result['error']); - $this->assertStringContainsString('[url1]:[error1],[url2]:[error2]', $result['error']); - } - - /** - * @test - */ - public function testRemovesDuplicateUrlsAndResetsKeys() - { - $urls = [ - 5 => 'https://example.com/file1.gz', - 7 => 'https://example.com/file1.gz', - 9 => 'https://example.com/file2.gz' - ]; - - $receivedUrls = null; - - $mockFabric = $this->getMockBuilder(HTTPMultiRequestFactory::class) - ->disableOriginalConstructor() - ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) - ->getMock(); - - $mockFabric->method('setMultiContract') - ->willReturnCallback(function($batchUrls) use ($mockFabric, &$receivedUrls) { - $receivedUrls = $batchUrls; - $mockFabric->process_done = true; - return $mockFabric; - }); - - $mockFabric->method('getFailedURLs') - ->willReturn([]); - - $mockFabric->method('writeSuccessURLsContent') - ->willReturn(['https://example.com/file1.gz', 'https://example.com/file2.gz']); - - $downloader = new SFWFilesDownloader($mockFabric); - $downloader->downloadFiles($urls, false, 0); - - $this->assertCount(2, $receivedUrls); - $this->assertEquals(['https://example.com/file1.gz', 'https://example.com/file2.gz'], $receivedUrls); - } -} +apbctBackup = $apbct; + + $this->testFolder = sys_get_temp_dir() . '/test_sfw_' . time() . '/'; + if (!is_dir($this->testFolder)) { + mkdir($this->testFolder, 0777, true); + } + + $apbct = new State('cleantalk', array('settings', 'data', 'errors', 'remote_calls', 'stats', 'fw_stats')); + $apbct->data = ['sfw_update__batch_size' => 10]; + $apbct->fw_stats = ['updating_folder' => $this->testFolder]; + $apbct->save = function($key) {}; + } + + protected function tearDown() + { + parent::tearDown(); + global $apbct; + + if (is_dir($this->testFolder)) { + $files = glob($this->testFolder . '/*'); + if ($files) { + foreach ($files as $file) { + if (is_file($file)) { + unlink($file); + } + } + } + rmdir($this->testFolder); + } + + $apbct = $this->apbctBackup; + } + + /** + * @test + */ + public function testReturnsErrorWhenFolderNotWritable() + { + global $apbct; + $apbct->fw_stats['updating_folder'] = '/nonexistent/path/'; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->getMock(); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles(['https://example.com/file1.gz'], false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('NOT WRITABLE', $result['error']); + $this->assertArrayNotHasKey('update_args', $result); + } + + /** + * @test + */ + public function testReturnsErrorWhenUrlsNotArray() + { + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->getMock(); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles('NOT AN ARRAY', false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('SHOULD BE AN ARRAY', $result['error']); + } + + /** + * @test + */ + public function testReturnsSuccessStageWhenEmptyUrlsArray() + { + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->getMock(); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles([], false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('next_stage', $result); + $this->assertEquals('apbct_sfw_update__create_tables', $result['next_stage']['name']); + } + + /** + * @test + */ + public function testReturnsTrueWhenEmptyUrlsAndDirectUpdateTrue() + { + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->getMock(); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles([], true, 0); + + $this->assertTrue((bool)$result); + } + + /** + * @test + */ + public function testReturnsErrorWhenContractProcessNotDone() + { + $urls = ['https://example.com/file1.gz']; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract']) + ->getMock(); + + $mockFabric->expects($this->once()) + ->method('setMultiContract') + ->with($urls) + ->willReturnCallback(function() use ($mockFabric) { + $mockFabric->process_done = false; + $mockFabric->error_msg = 'CONTRACT PROCESSING FAILED'; + return $mockFabric; + }); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles($urls, false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('CONTRACT PROCESSING FAILED', $result['error']); + } + + /** + * @test + */ + public function testReturnsRepeatStageWhenSomeFilesFailedToDownload() + { + global $apbct; + $apbct->fw_stats['multi_request_batch_size'] = 10; + + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz', + 'https://example.com/file3.gz' + ]; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function() use ($mockFabric) { + $mockFabric->process_done = true; + $mockFabric->suggest_batch_reduce_to = 2; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn(['https://example.com/file2.gz']); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturn(['https://example.com/file1.gz', 'https://example.com/file3.gz']); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles($urls, false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('NOT COMPLETED, TRYING AGAIN', $result['error']); + $this->assertArrayHasKey('update_args', $result); + $this->assertEquals(['https://example.com/file2.gz'], $result['update_args']['args']); + $this->assertEquals(2, $apbct->fw_stats['multi_request_batch_size']); + } + + /** + * @test + */ + public function testReturnsErrorWhenWriteToFileSystemFails() + { + $urls = ['https://example.com/file1.gz']; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function() use ($mockFabric) { + $mockFabric->process_done = true; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn([]); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturn('CAN NOT WRITE TO FILE: /test/file1.gz'); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles($urls, false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('CAN NOT WRITE TO FILE', $result['error']); + $this->assertStringContainsString('/test/file1.gz', $result['error']); + } + + /** + * @test + */ + public function testReturnsNextStageWhenAllFilesDownloadedSuccessfully() + { + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz' + ]; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function() use ($mockFabric) { + $mockFabric->process_done = true; + $mockFabric->suggest_batch_reduce_to = false; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn([]); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturn($urls); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles($urls, false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('next_stage', $result); + $this->assertEquals('apbct_sfw_update__create_tables', $result['next_stage']['name']); + } + + /** + * @test + */ + public function testProcessesUrlsInBatchesAccordingToBatchSize() + { + global $apbct; + $apbct->fw_stats['multi_request_batch_size'] = 3; + + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz', + 'https://example.com/file3.gz', + 'https://example.com/file4.gz', + 'https://example.com/file5.gz' + ]; + + $callCount = 0; + $receivedBatches = []; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function($batchUrls) use ($mockFabric, &$callCount, &$receivedBatches) { + $callCount++; + $receivedBatches[] = $batchUrls; + $mockFabric->process_done = true; + $mockFabric->suggest_batch_reduce_to = false; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn([]); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturnCallback(function() use (&$receivedBatches, &$callCount) { + return $receivedBatches[$callCount - 1]; + }); + + $downloader = new SFWFilesDownloader($mockFabric); + $downloader->downloadFiles($urls, false, 0); + + $this->assertEquals(2, $callCount); + $this->assertCount(3, $receivedBatches[0]); + $this->assertCount(2, $receivedBatches[1]); + } + + /** + * @test + */ + public function testReducesBatchSizeToMinimumWhenMultipleSuggestions() + { + global $apbct; + $apbct->fw_stats['multi_request_batch_size'] = 10; + + $urls = []; + for ($i = 0; $i < 20; $i++) { + $urls[] = 'https://example.com/file' . $i . '.gz'; + } + + $callCount = 0; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function($batchUrls) use ($mockFabric, &$callCount) { + $callCount++; + $mockFabric->process_done = true; + $mockFabric->suggest_batch_reduce_to = $callCount === 1 ? 7 : 5; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturnCallback(function() use (&$callCount, $urls) { + $batchStart = ($callCount - 1) * 10; + return [$urls[$batchStart]]; + }); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturnCallback(function() use (&$callCount, $urls) { + $batchStart = ($callCount - 1) * 10; + $batchSize = min(10, count($urls) - $batchStart); + $result = []; + for ($i = 1; $i < $batchSize; $i++) { + $result[] = $urls[$batchStart + $i]; + } + return $result; + }); + + $downloader = new SFWFilesDownloader($mockFabric); + $downloader->downloadFiles($urls, false, 0); + + $this->assertEquals(5, $apbct->fw_stats['multi_request_batch_size']); + } + + /** + * @test + */ + public function testReturnsErrorWhenNotAllFilesDownloadedAfterBatches() + { + $urls = [ + 'https://example.com/file1.gz', + 'https://example.com/file2.gz' + ]; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent', 'getContractsErrors']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function() use ($mockFabric) { + $mockFabric->process_done = true; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn([]); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturn(['https://example.com/file1.gz']); + + $mockFabric->method('getContractsErrors') + ->willReturn('[url1]:[error1],[url2]:[error2]'); + + $downloader = new SFWFilesDownloader($mockFabric); + $result = $downloader->downloadFiles($urls, false, 0); + + $this->assertIsArray($result); + $this->assertArrayHasKey('error', $result); + $this->assertStringContainsString('NOT COMPLETED - STOP UPDATE', $result['error']); + $this->assertStringContainsString('[url1]:[error1],[url2]:[error2]', $result['error']); + } + + /** + * @test + */ + public function testRemovesDuplicateUrlsAndResetsKeys() + { + $urls = [ + 5 => 'https://example.com/file1.gz', + 7 => 'https://example.com/file1.gz', + 9 => 'https://example.com/file2.gz' + ]; + + $receivedUrls = null; + + $mockFabric = $this->getMockBuilder(HTTPMultiRequestService::class) + ->disableOriginalConstructor() + ->setMethods(['setMultiContract', 'getFailedURLs', 'writeSuccessURLsContent']) + ->getMock(); + + $mockFabric->method('setMultiContract') + ->willReturnCallback(function($batchUrls) use ($mockFabric, &$receivedUrls) { + $receivedUrls = $batchUrls; + $mockFabric->process_done = true; + return $mockFabric; + }); + + $mockFabric->method('getFailedURLs') + ->willReturn([]); + + $mockFabric->method('writeSuccessURLsContent') + ->willReturn(['https://example.com/file1.gz', 'https://example.com/file2.gz']); + + $downloader = new SFWFilesDownloader($mockFabric); + $downloader->downloadFiles($urls, false, 0); + + $this->assertCount(2, $receivedUrls); + $this->assertEquals(['https://example.com/file1.gz', 'https://example.com/file2.gz'], $receivedUrls); + } +} From e2559213614ea72201657334ac75aeb349f5bd6a Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 3 Feb 2026 15:46:14 +0700 Subject: [PATCH 09/60] Fix. Tests. Editing tests for phpunit 8.5 version --- tests/ApbctWP/Firewall/SFWUpdateHelperTest.php | 4 ++-- tests/ApbctWP/HTTP/TestHTTPMultiRequestService.php | 4 ++-- tests/ApbctWP/HTTP/TestSFWFilesDownloader.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php b/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php index ff8454759..facb671a8 100644 --- a/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php +++ b/tests/ApbctWP/Firewall/SFWUpdateHelperTest.php @@ -9,7 +9,7 @@ class SFWUpdateHelperTest extends TestCase { private $apbctBackup; - protected function setUp() + protected function setUp(): void { parent::setUp(); global $apbct; @@ -20,7 +20,7 @@ protected function setUp() $apbct->fw_stats['multi_request_batch_size'] = 10; } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); global $apbct; diff --git a/tests/ApbctWP/HTTP/TestHTTPMultiRequestService.php b/tests/ApbctWP/HTTP/TestHTTPMultiRequestService.php index 2e06a0675..f59377d9c 100644 --- a/tests/ApbctWP/HTTP/TestHTTPMultiRequestService.php +++ b/tests/ApbctWP/HTTP/TestHTTPMultiRequestService.php @@ -10,7 +10,7 @@ class TestHTTPMultiRequestService extends TestCase { private $testFolder; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -20,7 +20,7 @@ protected function setUp() } } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); diff --git a/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php b/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php index 652051069..c57da478b 100644 --- a/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php +++ b/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php @@ -13,7 +13,7 @@ class TestSFWFilesDownloader extends TestCase private $apbctBackup; private $testFolder; - protected function setUp() + protected function setUp(): void { parent::setUp(); global $apbct; @@ -30,7 +30,7 @@ protected function setUp() $apbct->save = function($key) {}; } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); global $apbct; From e433087a2a1ed6fe1ccd6f6208cc159bd2c1a929 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 3 Feb 2026 16:21:51 +0700 Subject: [PATCH 10/60] Fix. Tests. Added verification of the argument type --- tests/ApbctWP/HTTP/TestSFWFilesDownloader.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php b/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php index c57da478b..901ff4be8 100644 --- a/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php +++ b/tests/ApbctWP/HTTP/TestSFWFilesDownloader.php @@ -50,6 +50,18 @@ protected function tearDown(): void $apbct = $this->apbctBackup; } + /** + * @test + */ + public function testThrowsExceptionWhenInvalidServicePassed() + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Service must be an instance of'); + + // Pass an invalid object (not HTTPMultiRequestService) + new SFWFilesDownloader(new \stdClass()); + } + /** * @test */ From e9f0f7074a22754415bf89ab239312b2a37355c5 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 3 Feb 2026 19:19:03 +0700 Subject: [PATCH 11/60] Merge dev --- js/apbct-public-bundle.min.js | 6 +- js/apbct-public-bundle_ext-protection.min.js | 6 +- ...lic-bundle_ext-protection_gathering.min.js | 6 +- js/apbct-public-bundle_full-protection.min.js | 6 +- ...ic-bundle_full-protection_gathering.min.js | 6 +- js/apbct-public-bundle_gathering.min.js | 6 +- js/apbct-public-bundle_int-protection.min.js | 6 +- ...lic-bundle_int-protection_gathering.min.js | 6 +- js/prebuild/apbct-public-bundle.js | 231 +----------------- .../apbct-public-bundle_ext-protection.js | 231 +----------------- ...-public-bundle_ext-protection_gathering.js | 231 +----------------- .../apbct-public-bundle_full-protection.js | 231 +----------------- ...public-bundle_full-protection_gathering.js | 231 +----------------- js/prebuild/apbct-public-bundle_gathering.js | 231 +----------------- .../apbct-public-bundle_int-protection.js | 231 +----------------- ...-public-bundle_int-protection_gathering.js | 231 +----------------- js/src/public-1-main.js | 231 +----------------- 17 files changed, 53 insertions(+), 2074 deletions(-) diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index 7d1a6bca5..7f18ad197 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1,5 +1 @@ -<<<<<<< HEAD -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function _(){}function r(){}function f(){}var t={},m=(u(t,o,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,o)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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)})}))}); -======= -function _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,i,r,c,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,i=n,d=o||[],u=!1,p={p:s=0,n:0,v:f,a:_,f:_.bind(f,4),d:function(e,t){return r=e,c=0,l=f,p.n=t,m}},function(e,t,n){if(1t||i=e.length?{done:!0}:{done:!1,value:e[i++]}},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(r.data.forEach(function(e){e.encoded_email===i[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===i[t].href||0!==i[t].href.indexOf("mailto:")&&0!==i[t].href.indexOf("tel:"))i[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i[t])},2e3);else{if(0===i[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==i[t].href.indexOf("tel:"))return 0;e="tel:"}var o=i[t].href.replace(e,""),a=i[t].innerHTML;i[t].innerHTML=a.replace(o,n.decoded_email),i[t].href=e+n.decoded_email,i[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}i[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];i.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i)},2e3),i.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'):(i.innerHTML="Loading...",t&&this.load(t)),i.setAttribute("id","cleantalk-modal-content"),n.append(i),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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&n&&n[0]&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")&&n[1]&&n[1].body&&"string"==typeof n[1].body){try{a=JSON.parse(n[1].body)}catch(e){a={}}+ctPublic.settings__data__bot_detector_enabled?a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):a.ct_no_cookie_hidden_field=getNoCookieData(),n[1].body=JSON.stringify(a)}n&&n[0]&&n[0].includes("/wc/store/v1/cart/add-item")&&n&&n[1]&&n[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(i=JSON.parse(n[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(i.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),n[1].body=JSON.stringify(i)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&n&&n[0]&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1]&&n[1].body&&n[1].body instanceof FormData)){e.n=6;break}i=document.querySelector(".b24-form form"),r={action:"cleantalk_force_ajax_check"},c=_createForOfIteratorHelper(i.elements);try{for(c.s();!(l=c.n()).done;)r[(s=l.value).name]=s.value}catch(e){c.e(e)}finally{c.f()}return e.n=6,new Promise(function(a,t){apbct_public_sendAJAX(r,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(u=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(u=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(u){e.n=7;break}return e.a(2,defaultFetch.apply(window,n));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",i="";if(+ctPublic.settings__data__bot_detector_enabled?(r=(new c).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+r+"&":"data%5Bct_bot_detector_event_token%5D="+r+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var r=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(r=n?n.extract(t.data):r))try{i="apbct_visible_fields="+encodeURIComponent(r)+"&"}catch(e){}}t.data=a+o+i+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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,i=t.querySelector('[name*="apbct_email_id__"]'),r=null,c=(null!==i&&null!==i.value&&(r=i.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===i&&null===l||(e.preventDefault(),n=function(){null!==i&&i.parentNode.removeChild(i),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==r&&(o.apbct_search_form__honeypot_value=r),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 i=o.value,r=this.findParentContainer(i);if(r){var c=this.getIdFromHTML(r);if(c===n){var l=r.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,i,r,c,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(u.phrases.trpHeading),(i=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),i.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(c),r.append(" "),r.append(u.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),c.append(l)),i.append(r,c),a.append(i),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)})}))}); ->>>>>>> 334f6ae40cc5a200cb4c57d504a17fd760a48176 +function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function r(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{r({},"")}catch(l){r=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),o=new P(o||[]);return u(t,"_invoke",{value:(a=e,r=n,i=o,c=p,function(e,t){if(c===f)throw Error("Generator is already running");if(c===m){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.iterator[o];if(a===l)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),b;o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}(n,i);if(n){if(n===b)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(c===p)throw c=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=f;n=d(a,r,i);if("normal"===n.type){if(c=i.done?m:_,n.arg===b)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=m,i.method="throw",i.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p="suspendedStart",_="suspendedYield",f="executing",m="completed",b={};function h(){}function y(){}function v(){}var t={},g=(r(t,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(A([]))),k=(g&&g!==e&&s.call(g,o)&&(t=g),v.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){r(e,t,function(e){return this._invoke(t,e)})})}function E(i,c){var t;u(this,"_invoke",{value:function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function A(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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 560c885c9..2688476e3 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1,5 +1 @@ -<<<<<<< HEAD -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function m(){}function r(){}function f(){}var t={},_=(u(t,o,function(){return this}),Object.getPrototypeOf),_=_&&_(_(x([]))),b=(_&&_!==e&&l.call(_,o)&&(t=_),f.prototype=m.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function v(e){this.tryEntries.push(e)}function g(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(v,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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)})}))}); -======= -function _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,i,c,r,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,i=n,d=o||[],u=!1,p={p:s=0,n:0,v:f,a:m,f:m.bind(f,4),d:function(e,t){return c=e,r=0,l=f,p.n=t,_}},function(e,t,n){if(1t||i=e.length?{done:!0}:{done:!1,value:e[i++]}},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===i[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===i[t].href||0!==i[t].href.indexOf("mailto:")&&0!==i[t].href.indexOf("tel:"))i[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i[t])},2e3);else{if(0===i[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==i[t].href.indexOf("tel:"))return 0;e="tel:"}var o=i[t].href.replace(e,""),a=i[t].innerHTML;i[t].innerHTML=a.replace(o,n.decoded_email),i[t].href=e+n.decoded_email,i[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})}i[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];i.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i)},2e3),i.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'):(i.innerHTML="Loading...",t&&this.load(t)),i.setAttribute("id","cleantalk-modal-content"),n.append(i),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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&n&&n[0]&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")&&n[1]&&n[1].body&&"string"==typeof n[1].body){try{a=JSON.parse(n[1].body)}catch(e){a={}}+ctPublic.settings__data__bot_detector_enabled?a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):a.ct_no_cookie_hidden_field=getNoCookieData(),n[1].body=JSON.stringify(a)}n&&n[0]&&n[0].includes("/wc/store/v1/cart/add-item")&&n&&n[1]&&n[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(i=JSON.parse(n[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(i.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),n[1].body=JSON.stringify(i)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&n&&n[0]&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1]&&n[1].body&&n[1].body instanceof FormData)){e.n=6;break}i=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(i.elements);try{for(r.s();!(l=r.n()).done;)c[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(u=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(u=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(u){e.n=7;break}return e.a(2,defaultFetch.apply(window,n));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",i="";if(+ctPublic.settings__data__bot_detector_enabled?(c=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+c+"&":"data%5Bct_bot_detector_event_token%5D="+c+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var c=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(c=n?n.extract(t.data):c))try{i="apbct_visible_fields="+encodeURIComponent(c)+"&"}catch(e){}}t.data=a+o+i+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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,i=t.querySelector('[name*="apbct_email_id__"]'),c=null,r=(null!==i&&null!==i.value&&(c=i.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===i&&null===l||(e.preventDefault(),n=function(){null!==i&&i.parentNode.removeChild(i),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,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 i=o.value,c=this.findParentContainer(i);if(c){var r=this.getIdFromHTML(c);if(r===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,i,c,r,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(u.phrases.trpHeading),(i=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),i.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(r),c.append(" "),c.append(u.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),r.append(l)),i.append(c,r),a.append(i),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)})}))}); ->>>>>>> 334f6ae40cc5a200cb4c57d504a17fd760a48176 +function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function r(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{r({},"")}catch(l){r=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),o=new A(o||[]);return u(t,"_invoke",{value:(a=e,r=n,i=o,c=p,function(e,t){if(c===f)throw Error("Generator is already running");if(c===_){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.iterator[o];if(a===l)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),b;o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}(n,i);if(n){if(n===b)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(c===p)throw c=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=f;n=d(a,r,i);if("normal"===n.type){if(c=i.done?_:m,n.arg===b)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=_,i.method="throw",i.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p="suspendedStart",m="suspendedYield",f="executing",_="completed",b={};function h(){}function y(){}function v(){}var t={},g=(r(t,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(P([]))),k=(g&&g!==e&&s.call(g,o)&&(t=g),v.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){r(e,t,function(e){return this._invoke(t,e)})})}function E(i,c){var t;u(this,"_invoke",{value:function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function P(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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_gathering.min.js b/js/apbct-public-bundle_ext-protection_gathering.min.js index b0d2d2d34..0d367dcf5 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1,5 +1 @@ -<<<<<<< HEAD -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function r(e,t,n,o){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=n,i=new k(o||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;n=d(a,c,i);if("normal"===n.type){if(r=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(r=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function m(){}var t={},f=(u(t,o,function(){return this}),Object.getPrototypeOf),f=f&&f(f(x([]))),b=(f&&f!==e&&l.call(f,o)&&(t=f),m.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(n,o){function e(){return new r(function(e,t){!function t(e,n,o,a){var c,e=d(i[e],i,n);if("throw"!==e.type)return(n=(c=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?r.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):r.resolve(n).then(function(e){c.value=e,o(c)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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)})}))}); -======= -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,u=o||[],d=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return i=e,r=0,l=m,p.n=t,f}},function(e,t,n){if(1t||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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&n&&n[0]&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")&&n[1]&&n[1].body&&"string"==typeof n[1].body){try{a=JSON.parse(n[1].body)}catch(e){a={}}+ctPublic.settings__data__bot_detector_enabled?a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):a.ct_no_cookie_hidden_field=getNoCookieData(),n[1].body=JSON.stringify(a)}n&&n[0]&&n[0].includes("/wc/store/v1/cart/add-item")&&n&&n[1]&&n[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(c=JSON.parse(n[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(c.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),n[1].body=JSON.stringify(c)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&n&&n[0]&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1]&&n[1].body&&n[1].body instanceof FormData)){e.n=6;break}c=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(c.elements);try{for(r.s();!(l=r.n()).done;)i[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(a,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(d=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(d=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(d){e.n=7;break}return e.a(2,defaultFetch.apply(window,n));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var i=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(i=n?n.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+o+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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)})}))}); ->>>>>>> 334f6ae40cc5a200cb4c57d504a17fd760a48176 +function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(l){c=function(e,t,n){return e[t]=n}}function r(e,t,n,o){var a,c,i,r,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),o=new w(o||[]);return u(t,"_invoke",{value:(a=e,c=n,i=o,r=p,function(e,t){if(r===m)throw Error("Generator is already running");if(r===f){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.iterator[o];if(a===l)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),b;o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}(n,i);if(n){if(n===b)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===p)throw r=f,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=m;n=d(a,c,i);if("normal"===n.type){if(r=i.done?f:_,n.arg===b)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(r=f,i.method="throw",i.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p="suspendedStart",_="suspendedYield",m="executing",f="completed",b={};function h(){}function y(){}function g(){}var t={},v=(c(t,o,function(){return this}),Object.getPrototypeOf),v=v&&v(v(A([]))),k=(v&&v!==e&&s.call(v,o)&&(t=v),g.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(i,r){var t;u(this,"_invoke",{value:function(n,o){function e(){return new r(function(e,t){!function t(e,n,o,a){var c,e=d(i[e],i,n);if("throw"!==e.type)return(n=(c=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?r.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):r.resolve(n).then(function(e){c.value=e,o(c)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function A(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 a620770d3..6cc722d38 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1,5 +1 @@ -<<<<<<< HEAD -function _regeneratorRuntime(){_regeneratorRuntime=function(){return c};var s,c={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function i(e,t,n,o){var a,r,c,i,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,c=new k(o||[]),i=1,function(e,t){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===e)throw t;return{value:s,done:!0}}for(c.method=e,c.arg=t;;){var n=c.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,c);if(n){if(n===p)continue;return n}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(1===i)throw i=4,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);i=3;n=d(a,r,c);if("normal"===n.type){if(i=c.done?4:2,n.arg===p)continue;return{value:n.arg,done:c.done}}"throw"===n.type&&(i=4,c.method="throw",c.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}c.wrap=i;var p={};function m(){}function r(){}function f(){}var t={},_=(u(t,o,function(){return this}),Object.getPrototypeOf),_=_&&_(_(x([]))),b=(_&&_!==e&&l.call(_,o)&&(t=_),f.prototype=m.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(c,i){var t;u(this,"_invoke",function(n,o){function e(){return new i(function(e,t){!function t(e,n,o,a){var r,e=d(c[e],c,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?i.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):i.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function v(e){this.tryEntries.push(e)}function g(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(v,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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)})}))}); -======= -function _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,i,r,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,d=o||[],u=!1,p={p:s=0,n:0,v:f,a:m,f:m.bind(f,4),d:function(e,t){return i=e,r=0,l=f,p.n=t,_}},function(e,t,n){if(1t||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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&n&&n[0]&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")&&n[1]&&n[1].body&&"string"==typeof n[1].body){try{a=JSON.parse(n[1].body)}catch(e){a={}}+ctPublic.settings__data__bot_detector_enabled?a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):a.ct_no_cookie_hidden_field=getNoCookieData(),n[1].body=JSON.stringify(a)}n&&n[0]&&n[0].includes("/wc/store/v1/cart/add-item")&&n&&n[1]&&n[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(c=JSON.parse(n[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(c.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),n[1].body=JSON.stringify(c)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&n&&n[0]&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1]&&n[1].body&&n[1].body instanceof FormData)){e.n=6;break}c=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(c.elements);try{for(r.s();!(l=r.n()).done;)i[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(a,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(u=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(u=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(u){e.n=7;break}return e.a(2,defaultFetch.apply(window,n));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var i=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(i=n?n.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+o+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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}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,c,i,r,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(u.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(u.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),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)})}))}); ->>>>>>> 334f6ae40cc5a200cb4c57d504a17fd760a48176 +function _regeneratorRuntime(){_regeneratorRuntime=function(){return c};var l,c={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function r(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{r({},"")}catch(l){r=function(e,t,n){return e[t]=n}}function i(e,t,n,o){var a,r,c,i,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),o=new P(o||[]);return u(t,"_invoke",{value:(a=e,r=n,c=o,i=p,function(e,t){if(i===f)throw Error("Generator is already running");if(i===_){if("throw"===e)throw t;return{value:l,done:!0}}for(c.method=e,c.arg=t;;){var n=c.delegate;if(n){n=function e(t,n){var o=n.method,a=t.iterator[o];if(a===l)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),b;o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}(n,c);if(n){if(n===b)continue;return n}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(i===p)throw i=_,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);i=f;n=d(a,r,c);if("normal"===n.type){if(i=c.done?_:m,n.arg===b)continue;return{value:n.arg,done:c.done}}"throw"===n.type&&(i=_,c.method="throw",c.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}c.wrap=i;var p="suspendedStart",m="suspendedYield",f="executing",_="completed",b={};function h(){}function y(){}function v(){}var t={},g=(r(t,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(A([]))),k=(g&&g!==e&&s.call(g,o)&&(t=g),v.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){r(e,t,function(e){return this._invoke(t,e)})})}function E(c,i){var t;u(this,"_invoke",{value:function(n,o){function e(){return new i(function(e,t){!function t(e,n,o,a){var r,e=d(c[e],c,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?i.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):i.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function A(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index 944b35a4c..061eb46a2 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1,5 +1 @@ -<<<<<<< HEAD -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",c=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function r(e,t,n,o){var c,a,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(c=e,a=n,i=new k(o||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,c=t.i[o];if(c===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(c,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;c=o.arg;return c?c.done?(n[t.r]=c.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):c:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;n=d(c,a,i);if("normal"===n.type){if(r=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(r=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function a(){}function m(){}var t={},f=(u(t,o,function(){return this}),Object.getPrototypeOf),f=f&&f(f(x([]))),b=(f&&f!==e&&l.call(f,o)&&(t=f),m.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(n,o){function e(){return new r(function(e,t){!function t(e,n,o,c){var a,e=d(i[e],i,n);if("throw"!==e.type)return(n=(a=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?r.resolve(n.__await).then(function(e){t("next",e,o,c)},function(e){t("throw",e,o,c)}):r.resolve(n).then(function(e){a.value=e,o(a)},function(e){return t("throw",e,o,c)});c(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var o=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(o,n.decoded_email),a[t].href=e+n.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),n.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(n=c.n()).done;)o=o||e===n.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),n=0;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),n=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(o))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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)),a.append(i,r),c.append(a),n.append(o),e.append(n),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(o){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),o.addEventListener("touchend",function(){var n=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=setTimeout(function(){var e=o.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); -======= -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function n(e,t,o,n){var c,a,i,r,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(c=e,a=o,d=n||[],u=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return i=e,r=0,l=m,p.n=t,f}},function(e,t,o){if(1t||a=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var n=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(n,o.decoded_email),a[t].href=e+o.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),o.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(o=c.n()).done;)n=n||e===o.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),o=0;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&o&&o[0]&&"function"==typeof o[0].includes&&o[0].includes("/wp-json/wp-recipe-maker/")&&o[1]&&o[1].body&&"string"==typeof o[1].body){try{c=JSON.parse(o[1].body)}catch(e){c={}}+ctPublic.settings__data__bot_detector_enabled?c.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):c.ct_no_cookie_hidden_field=getNoCookieData(),o[1].body=JSON.stringify(c)}o&&o[0]&&o[0].includes("/wc/store/v1/cart/add-item")&&o&&o[1]&&o[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(a=JSON.parse(o[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),o[1].body=JSON.stringify(a)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&o&&o[0]&&o[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&o[1]&&o[1].body&&o[1].body instanceof FormData)){e.n=6;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(a.elements);try{for(r.s();!(l=r.n()).done;)i[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(c,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,o,n){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(u=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(u=!0,(new ApbctShowForbidden).parseBlockMessage(e)),c(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(u){e.n=7;break}return e.a(2,defaultFetch.apply(window,o));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var o={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(o.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(o.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(o.found="action=mailpoet",o.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(o.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(o.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(o.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(o.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(o.found="action=drplus_signup",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(o.found="action=bt_cc",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(o.found="action=nf_ajax_submit",o.keepUnwrapped=!0,o.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(o.found="wc-ajax=add_to_cart"),!1!==o.found){var n="",c="",a="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(n=o.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(c=getNoCookieData(),c=o.keepUnwrapped?"ct_no_cookie_hidden_field="+c+"&":"data%5Bct_no_cookie_hidden_field%5D="+c+"&"),o.attachVisibleFieldsData){var i=!1,o=ApbctVisibleFieldsExtractor.createExtractor(o.found);if("string"==typeof(i=o?o.extract(t.data):i))try{a="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=c+n+a+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var o;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),o=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(n))&&0!==c.length?ctSetAlternativeCookie(c,{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,c=_createForOfIteratorHelper(t);try{for(c.s();!(n=c.n()).done;){var a=n.value,i=this.findParentContainer(a);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){c.e(e)}finally{c.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};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 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,c,a,i,r,l,s,d;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",u.imgPersonUrl),n.setAttribute("class","apbct-real-user-popup-img"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(u.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.setAttribute("style","white-space: nowrap"),(i=document.createElement("div")).append(r),i.append(" "),i.append(u.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),r.append(l)),a.append(i,r),c.append(a),o.append(n),e.append(o),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); ->>>>>>> 334f6ae40cc5a200cb4c57d504a17fd760a48176 +function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,o){e[t]=o.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",c=t.toStringTag||"@@toStringTag";function a(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(l){a=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var c,a,i,r,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),n=new w(n||[]);return u(t,"_invoke",{value:(c=e,a=o,i=n,r=p,function(e,t){if(r===m)throw Error("Generator is already running");if(r===f){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,c=t.iterator[n];if(c===l)return o.delegate=null,"throw"===n&&t.iterator.return&&(o.method="return",o.arg=l,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;n=d(c,t.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,b;c=n.arg;return c?c.done?(o[t.resultName]=c.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=l),o.delegate=null,b):c:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,b)}(o,i);if(o){if(o===b)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===p)throw r=f,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=m;o=d(c,a,i);if("normal"===o.type){if(r=i.done?f:_,o.arg===b)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=f,i.method="throw",i.arg=o.arg)}})}),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p="suspendedStart",_="suspendedYield",m="executing",f="completed",b={};function h(){}function y(){}function v(){}var t={},g=(a(t,n,function(){return this}),Object.getPrototypeOf),g=g&&g(g(A([]))),k=(g&&g!==e&&s.call(g,n)&&(t=g),v.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function S(i,r){var t;u(this,"_invoke",{value:function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,c){var a,e=d(i[e],i,o);if("throw"!==e.type)return(o=(a=e.arg).value)&&"object"==_typeof(o)&&s.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,c)},function(e){t("throw",e,n,c)}):r.resolve(o).then(function(e){a.value=e,n(a)},function(e){return t("throw",e,n,c)});c(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()}})}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function A(t){if(t||""===t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var n=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(n,o.decoded_email),a[t].href=e+o.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),o.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(o=c.n()).done;)n=n||e===o.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),o=0;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),o=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(n))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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)),a.append(i,r),c.append(a),o.append(n),e.append(o),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=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 b3a9f09ab..84456ad0c 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1,5 +1 @@ -<<<<<<< HEAD -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,o,n){return Object.defineProperty(e,t,{value:o,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(s){u=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=o,i=new k(n||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,a=t.i[n];if(a===s)return o.delegate=null,"throw"===n&&t.i.return&&(o.method="return",o.arg=s,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;n=d(a,t.i,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;a=n.arg;return a?a.done?(o[t.r]=a.value,o.next=t.n,"return"!==o.method&&(o.method="next",o.arg=s),o.delegate=null,p):a:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}(o,i);if(o){if(o===p)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;o=d(a,c,i);if("normal"===o.type){if(r=i.done?4:2,o.arg===p)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=4,i.method="throw",i.arg=o.arg)}}),!0),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function f(){}var t={},m=(u(t,n,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,n)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,a){var c,e=d(i[e],i,o);if("throw"!==e.type)return(o=(c=e.arg).value)&&"object"==_typeof(o)&&l.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,a)},function(e){t("throw",e,n,a)}):r.resolve(o).then(function(e){c.value=e,n(c)},function(e){return t("throw",e,n,a)});a(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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)})}))}); -======= -function _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function n(e,t,o,n){var a,c,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=o,u=n||[],d=!1,p={p:s=0,n:0,v:f,a:_,f:_.bind(f,4),d:function(e,t){return i=e,r=0,l=f,p.n=t,m}},function(e,t,o){if(1t||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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&o&&o[0]&&"function"==typeof o[0].includes&&o[0].includes("/wp-json/wp-recipe-maker/")&&o[1]&&o[1].body&&"string"==typeof o[1].body){try{a=JSON.parse(o[1].body)}catch(e){a={}}+ctPublic.settings__data__bot_detector_enabled?a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):a.ct_no_cookie_hidden_field=getNoCookieData(),o[1].body=JSON.stringify(a)}o&&o[0]&&o[0].includes("/wc/store/v1/cart/add-item")&&o&&o[1]&&o[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(c=JSON.parse(o[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(c.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),o[1].body=JSON.stringify(c)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&o&&o[0]&&o[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&o[1]&&o[1].body&&o[1].body instanceof FormData)){e.n=6;break}c=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(c.elements);try{for(r.s();!(l=r.n()).done;)i[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(a,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,o,n){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(d=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(d=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(d){e.n=7;break}return e.a(2,defaultFetch.apply(window,o));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var o={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(o.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(o.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(o.found="action=mailpoet",o.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(o.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(o.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(o.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(o.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(o.found="action=drplus_signup",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(o.found="action=bt_cc",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(o.found="action=nf_ajax_submit",o.keepUnwrapped=!0,o.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(o.found="wc-ajax=add_to_cart"),!1!==o.found){var n="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(n=o.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=o.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),o.attachVisibleFieldsData){var i=!1,o=ApbctVisibleFieldsExtractor.createExtractor(o.found);if("string"==typeof(i=o?o.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+n+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var o;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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)})}))}); ->>>>>>> 334f6ae40cc5a200cb4c57d504a17fd760a48176 +function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,o){e[t]=o.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",c=t.toStringTag||"@@toStringTag";function a(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(l){a=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var c,a,i,r,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),n=new w(n||[]);return u(t,"_invoke",{value:(c=e,a=o,i=n,r=p,function(e,t){if(r===f)throw Error("Generator is already running");if(r===m){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,c=t.iterator[n];if(c===l)return o.delegate=null,"throw"===n&&t.iterator.return&&(o.method="return",o.arg=l,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;n=d(c,t.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,b;c=n.arg;return c?c.done?(o[t.resultName]=c.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=l),o.delegate=null,b):c:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,b)}(o,i);if(o){if(o===b)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===p)throw r=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=f;o=d(c,a,i);if("normal"===o.type){if(r=i.done?m:_,o.arg===b)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=m,i.method="throw",i.arg=o.arg)}})}),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p="suspendedStart",_="suspendedYield",f="executing",m="completed",b={};function h(){}function y(){}function g(){}var t={},v=(a(t,n,function(){return this}),Object.getPrototypeOf),v=v&&v(v(A([]))),k=(v&&v!==e&&s.call(v,n)&&(t=v),g.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function S(i,r){var t;u(this,"_invoke",{value:function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,c){var a,e=d(i[e],i,o);if("throw"!==e.type)return(o=(a=e.arg).value)&&"object"==_typeof(o)&&s.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,c)},function(e){t("throw",e,n,c)}):r.resolve(o).then(function(e){a.value=e,n(a)},function(e){return t("throw",e,n,c)});c(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()}})}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function A(t){if(t||""===t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var n=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(n,o.decoded_email),a[t].href=e+o.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),o.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(o=c.n()).done;)n=n||e===o.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),o=0;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),o=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(n))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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)),a.append(i,r),c.append(a),o.append(n),e.append(o),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=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 1e78423a4..b7a8c5acb 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1,5 +1 @@ -<<<<<<< HEAD -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,n,o){return Object.defineProperty(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o})}try{u({},"")}catch(s){u=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,r=n,i=new k(o||[]),c=1,function(e,t){if(3===c)throw Error("Generator is already running");if(4===c){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.i[o];if(a===s)return n.delegate=null,"throw"===o&&t.i.return&&(n.method="return",n.arg=s,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),p;o=d(a,t.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;a=o.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=s),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}(n,i);if(n){if(n===p)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===c)throw c=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=3;n=d(a,r,i);if("normal"===n.type){if(c=i.done?4:2,n.arg===p)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=4,i.method="throw",i.arg=n.arg)}}),!0),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p={};function _(){}function r(){}function f(){}var t={},m=(u(t,o,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,o)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,c){var t;u(this,"_invoke",function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&l.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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)})}))}); -======= -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,i,r,c,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,i=n,d=o||[],u=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return r=e,c=0,l=m,p.n=t,f}},function(e,t,n){if(1t||i=e.length?{done:!0}:{done:!1,value:e[i++]}},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(r.data.forEach(function(e){e.encoded_email===i[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===i[t].href||0!==i[t].href.indexOf("mailto:")&&0!==i[t].href.indexOf("tel:"))i[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i[t])},2e3);else{if(0===i[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==i[t].href.indexOf("tel:"))return 0;e="tel:"}var o=i[t].href.replace(e,""),a=i[t].innerHTML;i[t].innerHTML=a.replace(o,n.decoded_email),i[t].href=e+n.decoded_email,i[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}i[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];i.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i)},2e3),i.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'):(i.innerHTML="Loading...",t&&this.load(t)),i.setAttribute("id","cleantalk-modal-content"),n.append(i),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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&n&&n[0]&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")&&n[1]&&n[1].body&&"string"==typeof n[1].body){try{a=JSON.parse(n[1].body)}catch(e){a={}}+ctPublic.settings__data__bot_detector_enabled?a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):a.ct_no_cookie_hidden_field=getNoCookieData(),n[1].body=JSON.stringify(a)}n&&n[0]&&n[0].includes("/wc/store/v1/cart/add-item")&&n&&n[1]&&n[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(i=JSON.parse(n[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(i.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),n[1].body=JSON.stringify(i)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&n&&n[0]&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1]&&n[1].body&&n[1].body instanceof FormData)){e.n=6;break}i=document.querySelector(".b24-form form"),r={action:"cleantalk_force_ajax_check"},c=_createForOfIteratorHelper(i.elements);try{for(c.s();!(l=c.n()).done;)r[(s=l.value).name]=s.value}catch(e){c.e(e)}finally{c.f()}return e.n=6,new Promise(function(a,t){apbct_public_sendAJAX(r,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(u=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(u=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(u){e.n=7;break}return e.a(2,defaultFetch.apply(window,n));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",i="";if(+ctPublic.settings__data__bot_detector_enabled?(r=(new c).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+r+"&":"data%5Bct_bot_detector_event_token%5D="+r+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var r=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(r=n?n.extract(t.data):r))try{i="apbct_visible_fields="+encodeURIComponent(r)+"&"}catch(e){}}t.data=a+o+i+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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,i=t.querySelector('[name*="apbct_email_id__"]'),r=null,c=(null!==i&&null!==i.value&&(r=i.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===i&&null===l||(e.preventDefault(),n=function(){null!==i&&i.parentNode.removeChild(i),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==r&&(o.apbct_search_form__honeypot_value=r),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 i=o.value,r=this.findParentContainer(i);if(r){var c=this.getIdFromHTML(r);if(c===n){var l=r.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,i,r,c,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(u.phrases.trpHeading),(i=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),i.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(c),r.append(" "),r.append(u.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),c.append(l)),i.append(r,c),a.append(i),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)})}))}); ->>>>>>> 334f6ae40cc5a200cb4c57d504a17fd760a48176 +function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function r(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{r({},"")}catch(l){r=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),o=new P(o||[]);return u(t,"_invoke",{value:(a=e,r=n,i=o,c=p,function(e,t){if(c===f)throw Error("Generator is already running");if(c===m){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.iterator[o];if(a===l)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),b;o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}(n,i);if(n){if(n===b)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(c===p)throw c=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=f;n=d(a,r,i);if("normal"===n.type){if(c=i.done?m:_,n.arg===b)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=m,i.method="throw",i.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p="suspendedStart",_="suspendedYield",f="executing",m="completed",b={};function h(){}function y(){}function v(){}var t={},g=(r(t,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(A([]))),k=(g&&g!==e&&s.call(g,o)&&(t=g),v.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){r(e,t,function(e){return this._invoke(t,e)})})}function E(i,c){var t;u(this,"_invoke",{value:function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function A(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&n&&n[1]&&n[1].body&&(+ctPublic.settings__data__bot_detector_enabled?n[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):n[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index 14973b0ea..6a2451f73 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1,5 +1 @@ -<<<<<<< HEAD -function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var s,i={},e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function u(e,t,o,n){return Object.defineProperty(e,t,{value:o,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(s){u=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var a,c,i,r,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return u(t,"_invoke",(a=e,c=o,i=new k(n||[]),r=1,function(e,t){if(3===r)throw Error("Generator is already running");if(4===r){if("throw"===e)throw t;return{value:s,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,a=t.i[n];if(a===s)return o.delegate=null,"throw"===n&&t.i.return&&(o.method="return",o.arg=s,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;n=d(a,t.i,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;a=n.arg;return a?a.done?(o[t.r]=a.value,o.next=t.n,"return"!==o.method&&(o.method="next",o.arg=s),o.delegate=null,p):a:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}(o,i);if(o){if(o===p)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(1===r)throw r=4,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=3;o=d(a,c,i);if("normal"===o.type){if(r=i.done?4:2,o.arg===p)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=4,i.method="throw",i.arg=o.arg)}}),!0),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p={};function _(){}function c(){}function f(){}var t={},m=(u(t,n,function(){return this}),Object.getPrototypeOf),m=m&&m(m(x([]))),b=(m&&m!==e&&l.call(m,n)&&(t=m),f.prototype=_.prototype=Object.create(t));function h(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function y(i,r){var t;u(this,"_invoke",function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,a){var c,e=d(i[e],i,o);if("throw"!==e.type)return(o=(c=e.arg).value)&&"object"==_typeof(o)&&l.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,a)},function(e){t("throw",e,n,a)}):r.resolve(o).then(function(e){c.value=e,n(c)},function(e){return t("throw",e,n,a)});a(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()},!0)}function g(e){this.tryEntries.push(e)}function v(e){var t=e[4]||{};t.type="normal",t.arg=s,e[4]=t}function k(e){this.tryEntries=[[-1]],e.forEach(g,this),this.reset(!0)}function x(t){if(null!=t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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)})}))}); -======= -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function n(e,t,o,n){var c,a,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(c=e,a=o,u=n||[],d=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return i=e,r=0,l=m,p.n=t,f}},function(e,t,o){if(1t||a=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var n=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(n,o.decoded_email),a[t].href=e+o.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),o.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(o=c.n()).done;)n=n||e===o.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),o=0;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&o&&o[0]&&"function"==typeof o[0].includes&&o[0].includes("/wp-json/wp-recipe-maker/")&&o[1]&&o[1].body&&"string"==typeof o[1].body){try{c=JSON.parse(o[1].body)}catch(e){c={}}+ctPublic.settings__data__bot_detector_enabled?c.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"):c.ct_no_cookie_hidden_field=getNoCookieData(),o[1].body=JSON.stringify(c)}o&&o[0]&&o[0].includes("/wc/store/v1/cart/add-item")&&o&&o[1]&&o[1].body?+ctPublic.settings__data__bot_detector_enabled&&+ctPublic.settings__forms__wc_add_to_cart?(e.p=1,(a=JSON.parse(o[1].body)).hasOwnProperty("ct_bot_detector_event_token")||(a.ct_bot_detector_event_token=apbctLocalStorage.get("bot_detector_event_token"),o[1].body=JSON.stringify(a)),e.n=3):e.n=4:e.n=5;break;case 2:return e.p=2,e.a(2,!1);case 3:e.n=5;break;case 4:o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData());case 5:if(!(+ctPublic.settings__forms__check_external&&o&&o[0]&&o[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&o[1]&&o[1].body&&o[1].body instanceof FormData)){e.n=6;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(a.elements);try{for(r.s();!(l=r.n()).done;)i[(s=l.value).name]=s.value}catch(e){r.e(e)}finally{r.f()}return e.n=6,new Promise(function(c,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,o,n){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(d=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(d=!0,(new ApbctShowForbidden).parseBlockMessage(e)),c(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 6:if(d){e.n=7;break}return e.a(2,defaultFetch.apply(window,o));case 7:return e.a(2)}},e,null,[[1,2]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var o={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(o.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(o.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(o.found="action=mailpoet",o.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(o.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(o.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(o.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(o.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(o.found="action=drplus_signup",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(o.found="action=bt_cc",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(o.found="action=nf_ajax_submit",o.keepUnwrapped=!0,o.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(o.found="wc-ajax=add_to_cart"),!1!==o.found){var n="",c="",a="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(n=o.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(c=getNoCookieData(),c=o.keepUnwrapped?"ct_no_cookie_hidden_field="+c+"&":"data%5Bct_no_cookie_hidden_field%5D="+c+"&"),o.attachVisibleFieldsData){var i=!1,o=ApbctVisibleFieldsExtractor.createExtractor(o.found);if("string"==typeof(i=o?o.extract(t.data):i))try{a="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=c+n+a+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var o;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),o=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(n))&&0!==c.length?ctSetAlternativeCookie(c,{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,c=_createForOfIteratorHelper(t);try{for(c.s();!(n=c.n()).done;){var a=n.value,i=this.findParentContainer(a);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){c.e(e)}finally{c.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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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)),a.append(i,r),c.append(a),o.append(n),e.append(o),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); ->>>>>>> 334f6ae40cc5a200cb4c57d504a17fd760a48176 +function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,o){e[t]=o.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",c=t.toStringTag||"@@toStringTag";function a(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(l){a=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var c,a,i,r,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),n=new w(n||[]);return u(t,"_invoke",{value:(c=e,a=o,i=n,r=p,function(e,t){if(r===f)throw Error("Generator is already running");if(r===m){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,c=t.iterator[n];if(c===l)return o.delegate=null,"throw"===n&&t.iterator.return&&(o.method="return",o.arg=l,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;n=d(c,t.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,b;c=n.arg;return c?c.done?(o[t.resultName]=c.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=l),o.delegate=null,b):c:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,b)}(o,i);if(o){if(o===b)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===p)throw r=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=f;o=d(c,a,i);if("normal"===o.type){if(r=i.done?m:_,o.arg===b)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=m,i.method="throw",i.arg=o.arg)}})}),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p="suspendedStart",_="suspendedYield",f="executing",m="completed",b={};function h(){}function y(){}function g(){}var t={},v=(a(t,n,function(){return this}),Object.getPrototypeOf),v=v&&v(v(C([]))),k=(v&&v!==e&&s.call(v,n)&&(t=v),g.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function S(i,r){var t;u(this,"_invoke",{value:function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,c){var a,e=d(i[e],i,o);if("throw"!==e.type)return(o=(a=e.arg).value)&&"object"==_typeof(o)&&s.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,c)},function(e){t("throw",e,n,c)}):r.resolve(o).then(function(e){a.value=e,n(a)},function(e){return t("throw",e,n,c)});c(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()}})}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function C(t){if(t||""===t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var n=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(n,o.decoded_email),a[t].href=e+o.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),o.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(o=c.n()).done;)n=n||e===o.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),o=0;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){}})())&&o&&o[1]&&o[1].body&&(+ctPublic.settings__data__bot_detector_enabled?o[1].body.append("ct_bot_detector_event_token",apbctLocalStorage.get("bot_detector_event_token")):o[1].body.append("ct_no_cookie_hidden_field",getNoCookieData())),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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),o=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(n))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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)),a.append(i,r),c.append(a),o.append(n),e.append(o),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=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/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 8ca136b8b..0f477978a 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -3204,7 +3204,6 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, - 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3217,7 +3216,6 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; - sourceSign.attachVisibleFieldsData = true; } if ( @@ -3246,11 +3244,11 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; } if ( - settings.data.indexOf('action=nf_ajax_submit') !== -1 + settings.data.indexOf('action=nf_ajax_submit') !== -1 && + ctPublic.data__cookies_type === 'none' ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; - sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3262,7 +3260,6 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; - let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3281,26 +3278,7 @@ class ApbctHandler { } } - if (sourceSign.attachVisibleFieldsData) { - let visibleFieldsSearchResult = false; - - const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); - if (extractor) { // Check if extractor was created - visibleFieldsSearchResult = extractor.extract(settings.data); - } - - if (typeof visibleFieldsSearchResult === 'string') { - let encoded = null; - try { - encoded = encodeURIComponent(visibleFieldsSearchResult); - visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; - } catch (e) { - // do nothing - } - } - } - - settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; + settings.data = noCookieData + eventToken + settings.data; } }, }); @@ -3313,13 +3291,8 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if ( - typeof options !== 'object' || - options === null || - !options.hasOwnProperty('data') || - typeof options.data === 'undefined' || - !options.hasOwnProperty('path') || - typeof options.path === 'undefined' + if (typeof options !== 'object' || options === null || + !options.hasOwnProperty('data') || !options.hasOwnProperty('path') ) { return next(options); } @@ -3596,200 +3569,6 @@ class ApbctShowForbidden { } } -/** - * Base class for extracting visible fields from form plugins - */ -class ApbctVisibleFieldsExtractor { - /** - * Factory method to create appropriate extractor instance - * @param {string} sourceSignAction - Action identifier - * @return {ApbctVisibleFieldsExtractor|null} - */ - static createExtractor(sourceSignAction) { - switch (sourceSignAction) { - case 'action=nf_ajax_submit': - return new ApbctNinjaFormsVisibleFields(); - case 'action=mailpoet': - return new ApbctMailpoetVisibleFields(); - default: - return null; - } - } - /** - * Extracts visible fields string from form AJAX data - * @param {string} ajaxData - AJAX form data - * @return {string|false} Visible fields value or false if not found - */ - extract(ajaxData) { - if (!ajaxData || typeof ajaxData !== 'string') { - return false; - } - - try { - ajaxData = decodeURIComponent(ajaxData); - } catch (e) { - return false; - } - - const forms = document.querySelectorAll('form'); - const formIdFromAjax = this.getIdFromAjax(ajaxData); - if (!formIdFromAjax) { - return false; - } - - for (let form of forms) { - const container = this.findParentContainer(form); - if (!container) { - continue; - } - - const formIdFromHtml = this.getIdFromHTML(container); - if (formIdFromHtml !== formIdFromAjax) { - continue; - } - - const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); - if (visibleFields?.value) { - return visibleFields.value; - } - } - - return false; - } - - /** - * Override in child classes to define specific extraction patterns - * @param {string} ajaxData - Decoded AJAX data string - * @return {number|null} Form ID or null if not found - */ - getIdFromAjax(ajaxData) { - console.warn('getIdFromAjax must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define container search logic - * @param {HTMLElement} form - Form element to start search from - * @return {HTMLElement|null} Container element or null - */ - findParentContainer(form) { - console.warn('findParentContainer must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define ID extraction from HTML - * @param {HTMLElement} container - Container element - * @return {number|null} Form ID or null if not found - */ - getIdFromHTML(container) { - console.warn('getIdFromHTML must be implemented by child class'); - return null; - } -} - -/** - * Ninja Forms specific implementation - */ -class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} - /form_id\s*[:\s]*"?(\d+)"/, - /nf-form-(\d+)/, - /"id":(\d+)/, // Fallback for simple cases - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - let el = form; - while (el && el !== document.body) { - if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { - return el; - } - el = el.parentElement; - } - return null; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - const match = container.id.match(/^nf-form-(\d+)-cont$/); - return match ? parseInt(match[1], 10) : null; - } -} - -/** - * Mailpoet specific implementation - */ -class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /form_id\s*[:\s]*"?(\d+)"/, - /data\[form_id\]=(\d+)/, - /form_id=(\d+)/, - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - // Mailpoet uses the form itself as container - return form; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - if (!container.action) { - return null; - } - - const formMatch = container.action.match(/mailpoet_subscription_form/); - if (!formMatch) { - return null; - } - - const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); - if (!hiddenFieldWithID || !hiddenFieldWithID.value) { - return null; - } - - return parseInt(hiddenFieldWithID.value, 10); - } -} - /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index 82802faa8..affc1aab5 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -3204,7 +3204,6 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, - 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3217,7 +3216,6 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; - sourceSign.attachVisibleFieldsData = true; } if ( @@ -3246,11 +3244,11 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; } if ( - settings.data.indexOf('action=nf_ajax_submit') !== -1 + settings.data.indexOf('action=nf_ajax_submit') !== -1 && + ctPublic.data__cookies_type === 'none' ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; - sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3262,7 +3260,6 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; - let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3281,26 +3278,7 @@ class ApbctHandler { } } - if (sourceSign.attachVisibleFieldsData) { - let visibleFieldsSearchResult = false; - - const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); - if (extractor) { // Check if extractor was created - visibleFieldsSearchResult = extractor.extract(settings.data); - } - - if (typeof visibleFieldsSearchResult === 'string') { - let encoded = null; - try { - encoded = encodeURIComponent(visibleFieldsSearchResult); - visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; - } catch (e) { - // do nothing - } - } - } - - settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; + settings.data = noCookieData + eventToken + settings.data; } }, }); @@ -3313,13 +3291,8 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if ( - typeof options !== 'object' || - options === null || - !options.hasOwnProperty('data') || - typeof options.data === 'undefined' || - !options.hasOwnProperty('path') || - typeof options.path === 'undefined' + if (typeof options !== 'object' || options === null || + !options.hasOwnProperty('data') || !options.hasOwnProperty('path') ) { return next(options); } @@ -3596,200 +3569,6 @@ class ApbctShowForbidden { } } -/** - * Base class for extracting visible fields from form plugins - */ -class ApbctVisibleFieldsExtractor { - /** - * Factory method to create appropriate extractor instance - * @param {string} sourceSignAction - Action identifier - * @return {ApbctVisibleFieldsExtractor|null} - */ - static createExtractor(sourceSignAction) { - switch (sourceSignAction) { - case 'action=nf_ajax_submit': - return new ApbctNinjaFormsVisibleFields(); - case 'action=mailpoet': - return new ApbctMailpoetVisibleFields(); - default: - return null; - } - } - /** - * Extracts visible fields string from form AJAX data - * @param {string} ajaxData - AJAX form data - * @return {string|false} Visible fields value or false if not found - */ - extract(ajaxData) { - if (!ajaxData || typeof ajaxData !== 'string') { - return false; - } - - try { - ajaxData = decodeURIComponent(ajaxData); - } catch (e) { - return false; - } - - const forms = document.querySelectorAll('form'); - const formIdFromAjax = this.getIdFromAjax(ajaxData); - if (!formIdFromAjax) { - return false; - } - - for (let form of forms) { - const container = this.findParentContainer(form); - if (!container) { - continue; - } - - const formIdFromHtml = this.getIdFromHTML(container); - if (formIdFromHtml !== formIdFromAjax) { - continue; - } - - const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); - if (visibleFields?.value) { - return visibleFields.value; - } - } - - return false; - } - - /** - * Override in child classes to define specific extraction patterns - * @param {string} ajaxData - Decoded AJAX data string - * @return {number|null} Form ID or null if not found - */ - getIdFromAjax(ajaxData) { - console.warn('getIdFromAjax must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define container search logic - * @param {HTMLElement} form - Form element to start search from - * @return {HTMLElement|null} Container element or null - */ - findParentContainer(form) { - console.warn('findParentContainer must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define ID extraction from HTML - * @param {HTMLElement} container - Container element - * @return {number|null} Form ID or null if not found - */ - getIdFromHTML(container) { - console.warn('getIdFromHTML must be implemented by child class'); - return null; - } -} - -/** - * Ninja Forms specific implementation - */ -class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} - /form_id\s*[:\s]*"?(\d+)"/, - /nf-form-(\d+)/, - /"id":(\d+)/, // Fallback for simple cases - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - let el = form; - while (el && el !== document.body) { - if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { - return el; - } - el = el.parentElement; - } - return null; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - const match = container.id.match(/^nf-form-(\d+)-cont$/); - return match ? parseInt(match[1], 10) : null; - } -} - -/** - * Mailpoet specific implementation - */ -class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /form_id\s*[:\s]*"?(\d+)"/, - /data\[form_id\]=(\d+)/, - /form_id=(\d+)/, - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - // Mailpoet uses the form itself as container - return form; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - if (!container.action) { - return null; - } - - const formMatch = container.action.match(/mailpoet_subscription_form/); - if (!formMatch) { - return null; - } - - const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); - if (!hiddenFieldWithID || !hiddenFieldWithID.value) { - return null; - } - - return parseInt(hiddenFieldWithID.value, 10); - } -} - /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index 46644851e..6227585b8 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -3204,7 +3204,6 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, - 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3217,7 +3216,6 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; - sourceSign.attachVisibleFieldsData = true; } if ( @@ -3246,11 +3244,11 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; } if ( - settings.data.indexOf('action=nf_ajax_submit') !== -1 + settings.data.indexOf('action=nf_ajax_submit') !== -1 && + ctPublic.data__cookies_type === 'none' ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; - sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3262,7 +3260,6 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; - let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3281,26 +3278,7 @@ class ApbctHandler { } } - if (sourceSign.attachVisibleFieldsData) { - let visibleFieldsSearchResult = false; - - const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); - if (extractor) { // Check if extractor was created - visibleFieldsSearchResult = extractor.extract(settings.data); - } - - if (typeof visibleFieldsSearchResult === 'string') { - let encoded = null; - try { - encoded = encodeURIComponent(visibleFieldsSearchResult); - visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; - } catch (e) { - // do nothing - } - } - } - - settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; + settings.data = noCookieData + eventToken + settings.data; } }, }); @@ -3313,13 +3291,8 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if ( - typeof options !== 'object' || - options === null || - !options.hasOwnProperty('data') || - typeof options.data === 'undefined' || - !options.hasOwnProperty('path') || - typeof options.path === 'undefined' + if (typeof options !== 'object' || options === null || + !options.hasOwnProperty('data') || !options.hasOwnProperty('path') ) { return next(options); } @@ -3596,200 +3569,6 @@ class ApbctShowForbidden { } } -/** - * Base class for extracting visible fields from form plugins - */ -class ApbctVisibleFieldsExtractor { - /** - * Factory method to create appropriate extractor instance - * @param {string} sourceSignAction - Action identifier - * @return {ApbctVisibleFieldsExtractor|null} - */ - static createExtractor(sourceSignAction) { - switch (sourceSignAction) { - case 'action=nf_ajax_submit': - return new ApbctNinjaFormsVisibleFields(); - case 'action=mailpoet': - return new ApbctMailpoetVisibleFields(); - default: - return null; - } - } - /** - * Extracts visible fields string from form AJAX data - * @param {string} ajaxData - AJAX form data - * @return {string|false} Visible fields value or false if not found - */ - extract(ajaxData) { - if (!ajaxData || typeof ajaxData !== 'string') { - return false; - } - - try { - ajaxData = decodeURIComponent(ajaxData); - } catch (e) { - return false; - } - - const forms = document.querySelectorAll('form'); - const formIdFromAjax = this.getIdFromAjax(ajaxData); - if (!formIdFromAjax) { - return false; - } - - for (let form of forms) { - const container = this.findParentContainer(form); - if (!container) { - continue; - } - - const formIdFromHtml = this.getIdFromHTML(container); - if (formIdFromHtml !== formIdFromAjax) { - continue; - } - - const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); - if (visibleFields?.value) { - return visibleFields.value; - } - } - - return false; - } - - /** - * Override in child classes to define specific extraction patterns - * @param {string} ajaxData - Decoded AJAX data string - * @return {number|null} Form ID or null if not found - */ - getIdFromAjax(ajaxData) { - console.warn('getIdFromAjax must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define container search logic - * @param {HTMLElement} form - Form element to start search from - * @return {HTMLElement|null} Container element or null - */ - findParentContainer(form) { - console.warn('findParentContainer must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define ID extraction from HTML - * @param {HTMLElement} container - Container element - * @return {number|null} Form ID or null if not found - */ - getIdFromHTML(container) { - console.warn('getIdFromHTML must be implemented by child class'); - return null; - } -} - -/** - * Ninja Forms specific implementation - */ -class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} - /form_id\s*[:\s]*"?(\d+)"/, - /nf-form-(\d+)/, - /"id":(\d+)/, // Fallback for simple cases - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - let el = form; - while (el && el !== document.body) { - if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { - return el; - } - el = el.parentElement; - } - return null; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - const match = container.id.match(/^nf-form-(\d+)-cont$/); - return match ? parseInt(match[1], 10) : null; - } -} - -/** - * Mailpoet specific implementation - */ -class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /form_id\s*[:\s]*"?(\d+)"/, - /data\[form_id\]=(\d+)/, - /form_id=(\d+)/, - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - // Mailpoet uses the form itself as container - return form; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - if (!container.action) { - return null; - } - - const formMatch = container.action.match(/mailpoet_subscription_form/); - if (!formMatch) { - return null; - } - - const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); - if (!hiddenFieldWithID || !hiddenFieldWithID.value) { - return null; - } - - return parseInt(hiddenFieldWithID.value, 10); - } -} - /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 8270b1b19..6bf3ed4a8 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -3204,7 +3204,6 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, - 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3217,7 +3216,6 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; - sourceSign.attachVisibleFieldsData = true; } if ( @@ -3246,11 +3244,11 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; } if ( - settings.data.indexOf('action=nf_ajax_submit') !== -1 + settings.data.indexOf('action=nf_ajax_submit') !== -1 && + ctPublic.data__cookies_type === 'none' ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; - sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3262,7 +3260,6 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; - let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3281,26 +3278,7 @@ class ApbctHandler { } } - if (sourceSign.attachVisibleFieldsData) { - let visibleFieldsSearchResult = false; - - const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); - if (extractor) { // Check if extractor was created - visibleFieldsSearchResult = extractor.extract(settings.data); - } - - if (typeof visibleFieldsSearchResult === 'string') { - let encoded = null; - try { - encoded = encodeURIComponent(visibleFieldsSearchResult); - visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; - } catch (e) { - // do nothing - } - } - } - - settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; + settings.data = noCookieData + eventToken + settings.data; } }, }); @@ -3313,13 +3291,8 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if ( - typeof options !== 'object' || - options === null || - !options.hasOwnProperty('data') || - typeof options.data === 'undefined' || - !options.hasOwnProperty('path') || - typeof options.path === 'undefined' + if (typeof options !== 'object' || options === null || + !options.hasOwnProperty('data') || !options.hasOwnProperty('path') ) { return next(options); } @@ -3596,200 +3569,6 @@ class ApbctShowForbidden { } } -/** - * Base class for extracting visible fields from form plugins - */ -class ApbctVisibleFieldsExtractor { - /** - * Factory method to create appropriate extractor instance - * @param {string} sourceSignAction - Action identifier - * @return {ApbctVisibleFieldsExtractor|null} - */ - static createExtractor(sourceSignAction) { - switch (sourceSignAction) { - case 'action=nf_ajax_submit': - return new ApbctNinjaFormsVisibleFields(); - case 'action=mailpoet': - return new ApbctMailpoetVisibleFields(); - default: - return null; - } - } - /** - * Extracts visible fields string from form AJAX data - * @param {string} ajaxData - AJAX form data - * @return {string|false} Visible fields value or false if not found - */ - extract(ajaxData) { - if (!ajaxData || typeof ajaxData !== 'string') { - return false; - } - - try { - ajaxData = decodeURIComponent(ajaxData); - } catch (e) { - return false; - } - - const forms = document.querySelectorAll('form'); - const formIdFromAjax = this.getIdFromAjax(ajaxData); - if (!formIdFromAjax) { - return false; - } - - for (let form of forms) { - const container = this.findParentContainer(form); - if (!container) { - continue; - } - - const formIdFromHtml = this.getIdFromHTML(container); - if (formIdFromHtml !== formIdFromAjax) { - continue; - } - - const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); - if (visibleFields?.value) { - return visibleFields.value; - } - } - - return false; - } - - /** - * Override in child classes to define specific extraction patterns - * @param {string} ajaxData - Decoded AJAX data string - * @return {number|null} Form ID or null if not found - */ - getIdFromAjax(ajaxData) { - console.warn('getIdFromAjax must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define container search logic - * @param {HTMLElement} form - Form element to start search from - * @return {HTMLElement|null} Container element or null - */ - findParentContainer(form) { - console.warn('findParentContainer must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define ID extraction from HTML - * @param {HTMLElement} container - Container element - * @return {number|null} Form ID or null if not found - */ - getIdFromHTML(container) { - console.warn('getIdFromHTML must be implemented by child class'); - return null; - } -} - -/** - * Ninja Forms specific implementation - */ -class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} - /form_id\s*[:\s]*"?(\d+)"/, - /nf-form-(\d+)/, - /"id":(\d+)/, // Fallback for simple cases - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - let el = form; - while (el && el !== document.body) { - if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { - return el; - } - el = el.parentElement; - } - return null; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - const match = container.id.match(/^nf-form-(\d+)-cont$/); - return match ? parseInt(match[1], 10) : null; - } -} - -/** - * Mailpoet specific implementation - */ -class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /form_id\s*[:\s]*"?(\d+)"/, - /data\[form_id\]=(\d+)/, - /form_id=(\d+)/, - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - // Mailpoet uses the form itself as container - return form; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - if (!container.action) { - return null; - } - - const formMatch = container.action.match(/mailpoet_subscription_form/); - if (!formMatch) { - return null; - } - - const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); - if (!hiddenFieldWithID || !hiddenFieldWithID.value) { - return null; - } - - return parseInt(hiddenFieldWithID.value, 10); - } -} - /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 227f880fa..a83755097 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -3204,7 +3204,6 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, - 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3217,7 +3216,6 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; - sourceSign.attachVisibleFieldsData = true; } if ( @@ -3246,11 +3244,11 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; } if ( - settings.data.indexOf('action=nf_ajax_submit') !== -1 + settings.data.indexOf('action=nf_ajax_submit') !== -1 && + ctPublic.data__cookies_type === 'none' ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; - sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3262,7 +3260,6 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; - let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3281,26 +3278,7 @@ class ApbctHandler { } } - if (sourceSign.attachVisibleFieldsData) { - let visibleFieldsSearchResult = false; - - const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); - if (extractor) { // Check if extractor was created - visibleFieldsSearchResult = extractor.extract(settings.data); - } - - if (typeof visibleFieldsSearchResult === 'string') { - let encoded = null; - try { - encoded = encodeURIComponent(visibleFieldsSearchResult); - visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; - } catch (e) { - // do nothing - } - } - } - - settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; + settings.data = noCookieData + eventToken + settings.data; } }, }); @@ -3313,13 +3291,8 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if ( - typeof options !== 'object' || - options === null || - !options.hasOwnProperty('data') || - typeof options.data === 'undefined' || - !options.hasOwnProperty('path') || - typeof options.path === 'undefined' + if (typeof options !== 'object' || options === null || + !options.hasOwnProperty('data') || !options.hasOwnProperty('path') ) { return next(options); } @@ -3596,200 +3569,6 @@ class ApbctShowForbidden { } } -/** - * Base class for extracting visible fields from form plugins - */ -class ApbctVisibleFieldsExtractor { - /** - * Factory method to create appropriate extractor instance - * @param {string} sourceSignAction - Action identifier - * @return {ApbctVisibleFieldsExtractor|null} - */ - static createExtractor(sourceSignAction) { - switch (sourceSignAction) { - case 'action=nf_ajax_submit': - return new ApbctNinjaFormsVisibleFields(); - case 'action=mailpoet': - return new ApbctMailpoetVisibleFields(); - default: - return null; - } - } - /** - * Extracts visible fields string from form AJAX data - * @param {string} ajaxData - AJAX form data - * @return {string|false} Visible fields value or false if not found - */ - extract(ajaxData) { - if (!ajaxData || typeof ajaxData !== 'string') { - return false; - } - - try { - ajaxData = decodeURIComponent(ajaxData); - } catch (e) { - return false; - } - - const forms = document.querySelectorAll('form'); - const formIdFromAjax = this.getIdFromAjax(ajaxData); - if (!formIdFromAjax) { - return false; - } - - for (let form of forms) { - const container = this.findParentContainer(form); - if (!container) { - continue; - } - - const formIdFromHtml = this.getIdFromHTML(container); - if (formIdFromHtml !== formIdFromAjax) { - continue; - } - - const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); - if (visibleFields?.value) { - return visibleFields.value; - } - } - - return false; - } - - /** - * Override in child classes to define specific extraction patterns - * @param {string} ajaxData - Decoded AJAX data string - * @return {number|null} Form ID or null if not found - */ - getIdFromAjax(ajaxData) { - console.warn('getIdFromAjax must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define container search logic - * @param {HTMLElement} form - Form element to start search from - * @return {HTMLElement|null} Container element or null - */ - findParentContainer(form) { - console.warn('findParentContainer must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define ID extraction from HTML - * @param {HTMLElement} container - Container element - * @return {number|null} Form ID or null if not found - */ - getIdFromHTML(container) { - console.warn('getIdFromHTML must be implemented by child class'); - return null; - } -} - -/** - * Ninja Forms specific implementation - */ -class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} - /form_id\s*[:\s]*"?(\d+)"/, - /nf-form-(\d+)/, - /"id":(\d+)/, // Fallback for simple cases - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - let el = form; - while (el && el !== document.body) { - if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { - return el; - } - el = el.parentElement; - } - return null; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - const match = container.id.match(/^nf-form-(\d+)-cont$/); - return match ? parseInt(match[1], 10) : null; - } -} - -/** - * Mailpoet specific implementation - */ -class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /form_id\s*[:\s]*"?(\d+)"/, - /data\[form_id\]=(\d+)/, - /form_id=(\d+)/, - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - // Mailpoet uses the form itself as container - return form; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - if (!container.action) { - return null; - } - - const formMatch = container.action.match(/mailpoet_subscription_form/); - if (!formMatch) { - return null; - } - - const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); - if (!hiddenFieldWithID || !hiddenFieldWithID.value) { - return null; - } - - return parseInt(hiddenFieldWithID.value, 10); - } -} - /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index 19b8e9271..f0fc4de28 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -3204,7 +3204,6 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, - 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3217,7 +3216,6 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; - sourceSign.attachVisibleFieldsData = true; } if ( @@ -3246,11 +3244,11 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; } if ( - settings.data.indexOf('action=nf_ajax_submit') !== -1 + settings.data.indexOf('action=nf_ajax_submit') !== -1 && + ctPublic.data__cookies_type === 'none' ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; - sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3262,7 +3260,6 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; - let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3281,26 +3278,7 @@ class ApbctHandler { } } - if (sourceSign.attachVisibleFieldsData) { - let visibleFieldsSearchResult = false; - - const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); - if (extractor) { // Check if extractor was created - visibleFieldsSearchResult = extractor.extract(settings.data); - } - - if (typeof visibleFieldsSearchResult === 'string') { - let encoded = null; - try { - encoded = encodeURIComponent(visibleFieldsSearchResult); - visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; - } catch (e) { - // do nothing - } - } - } - - settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; + settings.data = noCookieData + eventToken + settings.data; } }, }); @@ -3313,13 +3291,8 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if ( - typeof options !== 'object' || - options === null || - !options.hasOwnProperty('data') || - typeof options.data === 'undefined' || - !options.hasOwnProperty('path') || - typeof options.path === 'undefined' + if (typeof options !== 'object' || options === null || + !options.hasOwnProperty('data') || !options.hasOwnProperty('path') ) { return next(options); } @@ -3596,200 +3569,6 @@ class ApbctShowForbidden { } } -/** - * Base class for extracting visible fields from form plugins - */ -class ApbctVisibleFieldsExtractor { - /** - * Factory method to create appropriate extractor instance - * @param {string} sourceSignAction - Action identifier - * @return {ApbctVisibleFieldsExtractor|null} - */ - static createExtractor(sourceSignAction) { - switch (sourceSignAction) { - case 'action=nf_ajax_submit': - return new ApbctNinjaFormsVisibleFields(); - case 'action=mailpoet': - return new ApbctMailpoetVisibleFields(); - default: - return null; - } - } - /** - * Extracts visible fields string from form AJAX data - * @param {string} ajaxData - AJAX form data - * @return {string|false} Visible fields value or false if not found - */ - extract(ajaxData) { - if (!ajaxData || typeof ajaxData !== 'string') { - return false; - } - - try { - ajaxData = decodeURIComponent(ajaxData); - } catch (e) { - return false; - } - - const forms = document.querySelectorAll('form'); - const formIdFromAjax = this.getIdFromAjax(ajaxData); - if (!formIdFromAjax) { - return false; - } - - for (let form of forms) { - const container = this.findParentContainer(form); - if (!container) { - continue; - } - - const formIdFromHtml = this.getIdFromHTML(container); - if (formIdFromHtml !== formIdFromAjax) { - continue; - } - - const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); - if (visibleFields?.value) { - return visibleFields.value; - } - } - - return false; - } - - /** - * Override in child classes to define specific extraction patterns - * @param {string} ajaxData - Decoded AJAX data string - * @return {number|null} Form ID or null if not found - */ - getIdFromAjax(ajaxData) { - console.warn('getIdFromAjax must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define container search logic - * @param {HTMLElement} form - Form element to start search from - * @return {HTMLElement|null} Container element or null - */ - findParentContainer(form) { - console.warn('findParentContainer must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define ID extraction from HTML - * @param {HTMLElement} container - Container element - * @return {number|null} Form ID or null if not found - */ - getIdFromHTML(container) { - console.warn('getIdFromHTML must be implemented by child class'); - return null; - } -} - -/** - * Ninja Forms specific implementation - */ -class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} - /form_id\s*[:\s]*"?(\d+)"/, - /nf-form-(\d+)/, - /"id":(\d+)/, // Fallback for simple cases - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - let el = form; - while (el && el !== document.body) { - if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { - return el; - } - el = el.parentElement; - } - return null; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - const match = container.id.match(/^nf-form-(\d+)-cont$/); - return match ? parseInt(match[1], 10) : null; - } -} - -/** - * Mailpoet specific implementation - */ -class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /form_id\s*[:\s]*"?(\d+)"/, - /data\[form_id\]=(\d+)/, - /form_id=(\d+)/, - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - // Mailpoet uses the form itself as container - return form; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - if (!container.action) { - return null; - } - - const formMatch = container.action.match(/mailpoet_subscription_form/); - if (!formMatch) { - return null; - } - - const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); - if (!hiddenFieldWithID || !hiddenFieldWithID.value) { - return null; - } - - return parseInt(hiddenFieldWithID.value, 10); - } -} - /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index b1425715b..fc4e37edd 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -3204,7 +3204,6 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, - 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3217,7 +3216,6 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; - sourceSign.attachVisibleFieldsData = true; } if ( @@ -3246,11 +3244,11 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; } if ( - settings.data.indexOf('action=nf_ajax_submit') !== -1 + settings.data.indexOf('action=nf_ajax_submit') !== -1 && + ctPublic.data__cookies_type === 'none' ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; - sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3262,7 +3260,6 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; - let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3281,26 +3278,7 @@ class ApbctHandler { } } - if (sourceSign.attachVisibleFieldsData) { - let visibleFieldsSearchResult = false; - - const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); - if (extractor) { // Check if extractor was created - visibleFieldsSearchResult = extractor.extract(settings.data); - } - - if (typeof visibleFieldsSearchResult === 'string') { - let encoded = null; - try { - encoded = encodeURIComponent(visibleFieldsSearchResult); - visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; - } catch (e) { - // do nothing - } - } - } - - settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; + settings.data = noCookieData + eventToken + settings.data; } }, }); @@ -3313,13 +3291,8 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if ( - typeof options !== 'object' || - options === null || - !options.hasOwnProperty('data') || - typeof options.data === 'undefined' || - !options.hasOwnProperty('path') || - typeof options.path === 'undefined' + if (typeof options !== 'object' || options === null || + !options.hasOwnProperty('data') || !options.hasOwnProperty('path') ) { return next(options); } @@ -3596,200 +3569,6 @@ class ApbctShowForbidden { } } -/** - * Base class for extracting visible fields from form plugins - */ -class ApbctVisibleFieldsExtractor { - /** - * Factory method to create appropriate extractor instance - * @param {string} sourceSignAction - Action identifier - * @return {ApbctVisibleFieldsExtractor|null} - */ - static createExtractor(sourceSignAction) { - switch (sourceSignAction) { - case 'action=nf_ajax_submit': - return new ApbctNinjaFormsVisibleFields(); - case 'action=mailpoet': - return new ApbctMailpoetVisibleFields(); - default: - return null; - } - } - /** - * Extracts visible fields string from form AJAX data - * @param {string} ajaxData - AJAX form data - * @return {string|false} Visible fields value or false if not found - */ - extract(ajaxData) { - if (!ajaxData || typeof ajaxData !== 'string') { - return false; - } - - try { - ajaxData = decodeURIComponent(ajaxData); - } catch (e) { - return false; - } - - const forms = document.querySelectorAll('form'); - const formIdFromAjax = this.getIdFromAjax(ajaxData); - if (!formIdFromAjax) { - return false; - } - - for (let form of forms) { - const container = this.findParentContainer(form); - if (!container) { - continue; - } - - const formIdFromHtml = this.getIdFromHTML(container); - if (formIdFromHtml !== formIdFromAjax) { - continue; - } - - const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); - if (visibleFields?.value) { - return visibleFields.value; - } - } - - return false; - } - - /** - * Override in child classes to define specific extraction patterns - * @param {string} ajaxData - Decoded AJAX data string - * @return {number|null} Form ID or null if not found - */ - getIdFromAjax(ajaxData) { - console.warn('getIdFromAjax must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define container search logic - * @param {HTMLElement} form - Form element to start search from - * @return {HTMLElement|null} Container element or null - */ - findParentContainer(form) { - console.warn('findParentContainer must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define ID extraction from HTML - * @param {HTMLElement} container - Container element - * @return {number|null} Form ID or null if not found - */ - getIdFromHTML(container) { - console.warn('getIdFromHTML must be implemented by child class'); - return null; - } -} - -/** - * Ninja Forms specific implementation - */ -class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} - /form_id\s*[:\s]*"?(\d+)"/, - /nf-form-(\d+)/, - /"id":(\d+)/, // Fallback for simple cases - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - let el = form; - while (el && el !== document.body) { - if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { - return el; - } - el = el.parentElement; - } - return null; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - const match = container.id.match(/^nf-form-(\d+)-cont$/); - return match ? parseInt(match[1], 10) : null; - } -} - -/** - * Mailpoet specific implementation - */ -class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /form_id\s*[:\s]*"?(\d+)"/, - /data\[form_id\]=(\d+)/, - /form_id=(\d+)/, - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - // Mailpoet uses the form itself as container - return form; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - if (!container.action) { - return null; - } - - const formMatch = container.action.match(/mailpoet_subscription_form/); - if (!formMatch) { - return null; - } - - const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); - if (!hiddenFieldWithID || !hiddenFieldWithID.value) { - return null; - } - - return parseInt(hiddenFieldWithID.value, 10); - } -} - /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index a5a140298..4d89aa697 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -3204,7 +3204,6 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, - 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3217,7 +3216,6 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; - sourceSign.attachVisibleFieldsData = true; } if ( @@ -3246,11 +3244,11 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; } if ( - settings.data.indexOf('action=nf_ajax_submit') !== -1 + settings.data.indexOf('action=nf_ajax_submit') !== -1 && + ctPublic.data__cookies_type === 'none' ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; - sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3262,7 +3260,6 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; - let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3281,26 +3278,7 @@ class ApbctHandler { } } - if (sourceSign.attachVisibleFieldsData) { - let visibleFieldsSearchResult = false; - - const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); - if (extractor) { // Check if extractor was created - visibleFieldsSearchResult = extractor.extract(settings.data); - } - - if (typeof visibleFieldsSearchResult === 'string') { - let encoded = null; - try { - encoded = encodeURIComponent(visibleFieldsSearchResult); - visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; - } catch (e) { - // do nothing - } - } - } - - settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; + settings.data = noCookieData + eventToken + settings.data; } }, }); @@ -3313,13 +3291,8 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if ( - typeof options !== 'object' || - options === null || - !options.hasOwnProperty('data') || - typeof options.data === 'undefined' || - !options.hasOwnProperty('path') || - typeof options.path === 'undefined' + if (typeof options !== 'object' || options === null || + !options.hasOwnProperty('data') || !options.hasOwnProperty('path') ) { return next(options); } @@ -3596,200 +3569,6 @@ class ApbctShowForbidden { } } -/** - * Base class for extracting visible fields from form plugins - */ -class ApbctVisibleFieldsExtractor { - /** - * Factory method to create appropriate extractor instance - * @param {string} sourceSignAction - Action identifier - * @return {ApbctVisibleFieldsExtractor|null} - */ - static createExtractor(sourceSignAction) { - switch (sourceSignAction) { - case 'action=nf_ajax_submit': - return new ApbctNinjaFormsVisibleFields(); - case 'action=mailpoet': - return new ApbctMailpoetVisibleFields(); - default: - return null; - } - } - /** - * Extracts visible fields string from form AJAX data - * @param {string} ajaxData - AJAX form data - * @return {string|false} Visible fields value or false if not found - */ - extract(ajaxData) { - if (!ajaxData || typeof ajaxData !== 'string') { - return false; - } - - try { - ajaxData = decodeURIComponent(ajaxData); - } catch (e) { - return false; - } - - const forms = document.querySelectorAll('form'); - const formIdFromAjax = this.getIdFromAjax(ajaxData); - if (!formIdFromAjax) { - return false; - } - - for (let form of forms) { - const container = this.findParentContainer(form); - if (!container) { - continue; - } - - const formIdFromHtml = this.getIdFromHTML(container); - if (formIdFromHtml !== formIdFromAjax) { - continue; - } - - const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); - if (visibleFields?.value) { - return visibleFields.value; - } - } - - return false; - } - - /** - * Override in child classes to define specific extraction patterns - * @param {string} ajaxData - Decoded AJAX data string - * @return {number|null} Form ID or null if not found - */ - getIdFromAjax(ajaxData) { - console.warn('getIdFromAjax must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define container search logic - * @param {HTMLElement} form - Form element to start search from - * @return {HTMLElement|null} Container element or null - */ - findParentContainer(form) { - console.warn('findParentContainer must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define ID extraction from HTML - * @param {HTMLElement} container - Container element - * @return {number|null} Form ID or null if not found - */ - getIdFromHTML(container) { - console.warn('getIdFromHTML must be implemented by child class'); - return null; - } -} - -/** - * Ninja Forms specific implementation - */ -class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} - /form_id\s*[:\s]*"?(\d+)"/, - /nf-form-(\d+)/, - /"id":(\d+)/, // Fallback for simple cases - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - let el = form; - while (el && el !== document.body) { - if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { - return el; - } - el = el.parentElement; - } - return null; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - const match = container.id.match(/^nf-form-(\d+)-cont$/); - return match ? parseInt(match[1], 10) : null; - } -} - -/** - * Mailpoet specific implementation - */ -class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /form_id\s*[:\s]*"?(\d+)"/, - /data\[form_id\]=(\d+)/, - /form_id=(\d+)/, - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - // Mailpoet uses the form itself as container - return form; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - if (!container.action) { - return null; - } - - const formMatch = container.action.match(/mailpoet_subscription_form/); - if (!formMatch) { - return null; - } - - const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); - if (!hiddenFieldWithID || !hiddenFieldWithID.value) { - return null; - } - - return parseInt(hiddenFieldWithID.value, 10); - } -} - /** * Ready function */ diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index eb0fc7a42..ff5aa9261 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -862,7 +862,6 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, - 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -875,7 +874,6 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; - sourceSign.attachVisibleFieldsData = true; } if ( @@ -904,11 +902,11 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; } if ( - settings.data.indexOf('action=nf_ajax_submit') !== -1 + settings.data.indexOf('action=nf_ajax_submit') !== -1 && + ctPublic.data__cookies_type === 'none' ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; - sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -920,7 +918,6 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; - let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -939,26 +936,7 @@ class ApbctHandler { } } - if (sourceSign.attachVisibleFieldsData) { - let visibleFieldsSearchResult = false; - - const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); - if (extractor) { // Check if extractor was created - visibleFieldsSearchResult = extractor.extract(settings.data); - } - - if (typeof visibleFieldsSearchResult === 'string') { - let encoded = null; - try { - encoded = encodeURIComponent(visibleFieldsSearchResult); - visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; - } catch (e) { - // do nothing - } - } - } - - settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; + settings.data = noCookieData + eventToken + settings.data; } }, }); @@ -971,13 +949,8 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if ( - typeof options !== 'object' || - options === null || - !options.hasOwnProperty('data') || - typeof options.data === 'undefined' || - !options.hasOwnProperty('path') || - typeof options.path === 'undefined' + if (typeof options !== 'object' || options === null || + !options.hasOwnProperty('data') || !options.hasOwnProperty('path') ) { return next(options); } @@ -1254,200 +1227,6 @@ class ApbctShowForbidden { } } -/** - * Base class for extracting visible fields from form plugins - */ -class ApbctVisibleFieldsExtractor { - /** - * Factory method to create appropriate extractor instance - * @param {string} sourceSignAction - Action identifier - * @return {ApbctVisibleFieldsExtractor|null} - */ - static createExtractor(sourceSignAction) { - switch (sourceSignAction) { - case 'action=nf_ajax_submit': - return new ApbctNinjaFormsVisibleFields(); - case 'action=mailpoet': - return new ApbctMailpoetVisibleFields(); - default: - return null; - } - } - /** - * Extracts visible fields string from form AJAX data - * @param {string} ajaxData - AJAX form data - * @return {string|false} Visible fields value or false if not found - */ - extract(ajaxData) { - if (!ajaxData || typeof ajaxData !== 'string') { - return false; - } - - try { - ajaxData = decodeURIComponent(ajaxData); - } catch (e) { - return false; - } - - const forms = document.querySelectorAll('form'); - const formIdFromAjax = this.getIdFromAjax(ajaxData); - if (!formIdFromAjax) { - return false; - } - - for (let form of forms) { - const container = this.findParentContainer(form); - if (!container) { - continue; - } - - const formIdFromHtml = this.getIdFromHTML(container); - if (formIdFromHtml !== formIdFromAjax) { - continue; - } - - const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); - if (visibleFields?.value) { - return visibleFields.value; - } - } - - return false; - } - - /** - * Override in child classes to define specific extraction patterns - * @param {string} ajaxData - Decoded AJAX data string - * @return {number|null} Form ID or null if not found - */ - getIdFromAjax(ajaxData) { - console.warn('getIdFromAjax must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define container search logic - * @param {HTMLElement} form - Form element to start search from - * @return {HTMLElement|null} Container element or null - */ - findParentContainer(form) { - console.warn('findParentContainer must be implemented by child class'); - return null; - } - - /** - * Override in child classes to define ID extraction from HTML - * @param {HTMLElement} container - Container element - * @return {number|null} Form ID or null if not found - */ - getIdFromHTML(container) { - console.warn('getIdFromHTML must be implemented by child class'); - return null; - } -} - -/** - * Ninja Forms specific implementation - */ -class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} - /form_id\s*[:\s]*"?(\d+)"/, - /nf-form-(\d+)/, - /"id":(\d+)/, // Fallback for simple cases - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - let el = form; - while (el && el !== document.body) { - if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { - return el; - } - el = el.parentElement; - } - return null; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - const match = container.id.match(/^nf-form-(\d+)-cont$/); - return match ? parseInt(match[1], 10) : null; - } -} - -/** - * Mailpoet specific implementation - */ -class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { - /** - * @inheritDoc - */ - getIdFromAjax(ajaxData) { - const regexes = [ - /form_id\s*[:\s]*"?(\d+)"/, - /data\[form_id\]=(\d+)/, - /form_id=(\d+)/, - ]; - - for (let regex of regexes) { - const match = ajaxData.match(regex); - if (match && match[1]) { - return parseInt(match[1], 10); - } - } - - return null; - } - - /** - * @inheritDoc - */ - findParentContainer(form) { - // Mailpoet uses the form itself as container - return form; - } - - /** - * @inheritDoc - */ - getIdFromHTML(container) { - if (!container.action) { - return null; - } - - const formMatch = container.action.match(/mailpoet_subscription_form/); - if (!formMatch) { - return null; - } - - const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); - if (!hiddenFieldWithID || !hiddenFieldWithID.value) { - return null; - } - - return parseInt(hiddenFieldWithID.value, 10); - } -} - /** * Ready function */ From 3f063e9709fdfd536db88e9c79279cc54a9cef31 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 4 Feb 2026 16:18:42 +0700 Subject: [PATCH 12/60] Mod. ShadowrootPrt. Architectural changes in logic, the addition of situational callbacks --- gulpfile.js | 24 ++ js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- ...lic-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- ...ic-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- ...lic-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 288 +++++++++++------- .../apbct-public-bundle_ext-protection.js | 288 +++++++++++------- ...-public-bundle_ext-protection_gathering.js | 288 +++++++++++------- .../apbct-public-bundle_full-protection.js | 288 +++++++++++------- ...public-bundle_full-protection_gathering.js | 288 +++++++++++------- js/prebuild/apbct-public-bundle_gathering.js | 288 +++++++++++------- .../apbct-public-bundle_int-protection.js | 288 +++++++++++------- ...-public-bundle_int-protection_gathering.js | 288 +++++++++++------- .../ApbctShadowRootCallbacks.js | 29 ++ .../ApbctShadowRootConfig.js | 13 + .../ApbctShadowRootProtection.js | 136 +++++++++ js/src/public-1-main.js | 110 +------ 21 files changed, 1679 insertions(+), 953 deletions(-) create mode 100644 js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js create mode 100644 js/src/ShadowrootProtection/ApbctShadowRootConfig.js create mode 100644 js/src/ShadowrootProtection/ApbctShadowRootProtection.js diff --git a/gulpfile.js b/gulpfile.js index cff9c5a91..7ad25355d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -67,6 +67,9 @@ function bundle_public_default() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', + 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', + 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', + 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', 'js/src/public-1*.js', 'js/src/public-3*.js', ]) @@ -82,6 +85,9 @@ function bundle_public_default_with_gathering() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', + 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', + 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', + 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', 'js/src/public-1*.js', 'js/src/public-2-gathering-data.js', 'js/src/public-3*.js', @@ -98,6 +104,9 @@ function bundle_public_external_protection() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', + 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', + 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', + 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', 'js/src/public-1*.js', 'js/src/public-2-external-forms.js', '!js/src/public-2-gathering-data.js', @@ -115,6 +124,9 @@ function bundle_public_external_protection_with_gathering() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', + 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', + 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', + 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', 'js/src/public-1*.js', 'js/src/public-2-external-forms.js', 'js/src/public-2-gathering-data.js', @@ -132,6 +144,9 @@ function bundle_public_internal_protection() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', + 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', + 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', + 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', 'js/src/public-1*.js', 'js/src/public-2-internal-forms.js', 'js/src/public-3*.js', @@ -148,6 +163,9 @@ function bundle_public_internal_protection_with_gathering() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', + 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', + 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', + 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', 'js/src/public-1*.js', 'js/src/public-2-internal-forms.js', 'js/src/public-2-gathering-data.js', @@ -165,6 +183,9 @@ function bundle_public_full_protection() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', + 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', + 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', + 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', 'js/src/public-1*.js', 'js/src/public-2*.js', '!js/src/public-2-gathering-data.js', @@ -182,6 +203,9 @@ function bundle_public_full_protection_with_gathering() { 'js/src/common-decoder.js', 'js/src/common-cleantalk-modal.js', 'js/src/public-0*.js', + 'js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js', + 'js/src/ShadowrootProtection/ApbctShadowRootConfig.js', + 'js/src/ShadowrootProtection/ApbctShadowRootProtection.js', 'js/src/public-1*.js', 'js/src/public-2*.js', 'js/src/public-3*.js', diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index d1a1f3c95..112f7d278 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,a,r,i,c=[],l=!0,s=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(c.push(o.value),c.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw a}}return c}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function r(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{r({},"")}catch(l){r=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype),o=new P(o||[]);return u(t,"_invoke",{value:(a=e,r=n,i=o,c=p,function(e,t){if(c===f)throw Error("Generator is already running");if(c===m){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.iterator[o];if(a===l)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),h;o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,h):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,i);if(n){if(n===h)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(c===p)throw c=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=f;n=d(a,r,i);if("normal"===n.type){if(c=i.done?m:_,n.arg===h)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=m,i.method="throw",i.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p="suspendedStart",_="suspendedYield",f="executing",m="completed",h={};function b(){}function y(){}function v(){}var t={},g=(r(t,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(A([]))),k=(g&&g!==e&&s.call(g,o)&&(t=g),v.prototype=b.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){r(e,t,function(e){return this._invoke(t,e)})})}function w(i,c){var t;u(this,"_invoke",{value:function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function A(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=21,n[1].body=S(n[1].body,E(+ctPublic.settings__data__bot_detector_enabled)),e.next=28):e.next=28;break;case 25:return e.prev=25,e.t0=e.catch(21),e.abrupt("return",defaultFetch.apply(window,n));case 28: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=11,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,n));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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 21841a29a..30f8ca634 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1 +1 @@ -function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,a,r,i,c=[],l=!0,s=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(c.push(o.value),c.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw a}}return c}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function r(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{r({},"")}catch(l){r=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),o=new A(o||[]);return u(t,"_invoke",{value:(a=e,r=n,i=o,c=p,function(e,t){if(c===m)throw Error("Generator is already running");if(c===_){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.iterator[o];if(a===l)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),b;o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}(n,i);if(n){if(n===b)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(c===p)throw c=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=m;n=d(a,r,i);if("normal"===n.type){if(c=i.done?_:f,n.arg===b)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=_,i.method="throw",i.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p="suspendedStart",f="suspendedYield",m="executing",_="completed",b={};function h(){}function y(){}function v(){}var t={},g=(r(t,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(P([]))),k=(g&&g!==e&&s.call(g,o)&&(t=g),v.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){r(e,t,function(e){return this._invoke(t,e)})})}function E(i,c){var t;u(this,"_invoke",{value:function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function P(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=21,n[1].body=S(n[1].body,w(+ctPublic.settings__data__bot_detector_enabled)),e.next=28):e.next=28;break;case 25:return e.prev=25,e.t0=e.catch(21),e.abrupt("return",defaultFetch.apply(window,n));case 28: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=11,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,n));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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 659aeecf4..939565b82 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1 +1 @@ -function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,a,c,i,r=[],l=!0,s=!1;try{if(c=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=c.call(n)).done)&&(r.push(o.value),r.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw a}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(l){c=function(e,t,n){return e[t]=n}}function r(e,t,n,o){var a,c,i,r,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),o=new w(o||[]);return u(t,"_invoke",{value:(a=e,c=n,i=o,r=p,function(e,t){if(r===f)throw Error("Generator is already running");if(r===m){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.iterator[o];if(a===l)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),b;o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}(n,i);if(n){if(n===b)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===p)throw r=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=f;n=d(a,c,i);if("normal"===n.type){if(r=i.done?m:_,n.arg===b)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(r=m,i.method="throw",i.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p="suspendedStart",_="suspendedYield",f="executing",m="completed",b={};function h(){}function y(){}function v(){}var t={},g=(c(t,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(A([]))),k=(g&&g!==e&&s.call(g,o)&&(t=g),v.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(i,r){var t;u(this,"_invoke",{value:function(n,o){function e(){return new r(function(e,t){!function t(e,n,o,a){var c,e=d(i[e],i,n);if("throw"!==e.type)return(n=(c=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?r.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):r.resolve(n).then(function(e){c.value=e,o(c)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function A(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=21,n[1].body=P(n[1].body,E(+ctPublic.settings__data__bot_detector_enabled)),e.next=28):e.next=28;break;case 25:return e.prev=25,e.t0=e.catch(21),e.abrupt("return",defaultFetch.apply(window,n));case 28: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=11,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,n));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 83a1fe784..794642981 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1 +1 @@ -function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,a,r,c,i=[],l=!0,s=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(i.push(o.value),i.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=n.return&&(c=n.return(),Object(c)!==c))return}finally{if(s)throw a}}return i}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return c};var l,c={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function r(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{r({},"")}catch(l){r=function(e,t,n){return e[t]=n}}function i(e,t,n,o){var a,r,c,i,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),o=new P(o||[]);return u(t,"_invoke",{value:(a=e,r=n,c=o,i=p,function(e,t){if(i===m)throw Error("Generator is already running");if(i===_){if("throw"===e)throw t;return{value:l,done:!0}}for(c.method=e,c.arg=t;;){var n=c.delegate;if(n){n=function e(t,n){var o=n.method,a=t.iterator[o];if(a===l)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),b;o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}(n,c);if(n){if(n===b)continue;return n}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(i===p)throw i=_,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);i=m;n=d(a,r,c);if("normal"===n.type){if(i=c.done?_:f,n.arg===b)continue;return{value:n.arg,done:c.done}}"throw"===n.type&&(i=_,c.method="throw",c.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}c.wrap=i;var p="suspendedStart",f="suspendedYield",m="executing",_="completed",b={};function h(){}function y(){}function v(){}var t={},g=(r(t,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(A([]))),k=(g&&g!==e&&s.call(g,o)&&(t=g),v.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){r(e,t,function(e){return this._invoke(t,e)})})}function E(c,i){var t;u(this,"_invoke",{value:function(n,o){function e(){return new i(function(e,t){!function t(e,n,o,a){var r,e=d(c[e],c,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?i.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):i.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function A(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=21,n[1].body=S(n[1].body,w(+ctPublic.settings__data__bot_detector_enabled)),e.next=28):e.next=28;break;case 25:return e.prev=25,e.t0=e.catch(21),e.abrupt("return",defaultFetch.apply(window,n));case 28: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=11,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,n));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index 4b0660737..50586d1d4 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1 +1 @@ -function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,a,c,i,r=[],l=!0,s=!1;try{if(c=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=c.call(n)).done)&&(r.push(o.value),r.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw a}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(l){c=function(e,t,n){return e[t]=n}}function r(e,t,n,o){var a,c,i,r,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),o=new w(o||[]);return u(t,"_invoke",{value:(a=e,c=n,i=o,r=p,function(e,t){if(r===f)throw Error("Generator is already running");if(r===m){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.iterator[o];if(a===l)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),b;o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}(n,i);if(n){if(n===b)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===p)throw r=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=f;n=d(a,c,i);if("normal"===n.type){if(r=i.done?m:_,n.arg===b)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(r=m,i.method="throw",i.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p="suspendedStart",_="suspendedYield",f="executing",m="completed",b={};function h(){}function y(){}function v(){}var t={},g=(c(t,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(A([]))),k=(g&&g!==e&&s.call(g,o)&&(t=g),v.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(i,r){var t;u(this,"_invoke",{value:function(n,o){function e(){return new r(function(e,t){!function t(e,n,o,a){var c,e=d(i[e],i,n);if("throw"!==e.type)return(n=(c=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?r.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):r.resolve(n).then(function(e){c.value=e,o(c)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function A(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=21,n[1].body=P(n[1].body,E(+ctPublic.settings__data__bot_detector_enabled)),e.next=28):e.next=28;break;case 25:return e.prev=25,e.t0=e.catch(21),e.abrupt("return",defaultFetch.apply(window,n));case 28: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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;e=e.length?{done:!0}:{done:!1,value:e[a++]}},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===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};if(void 0===a[t].href||0!==a[t].href.indexOf("mailto:")&&0!==a[t].href.indexOf("tel:"))a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3);else{if(0===a[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==a[t].href.indexOf("tel:"))return 0;e="tel:"}var n=a[t].href.replace(e,""),c=a[t].innerHTML;a[t].innerHTML=c.replace(n,o.decoded_email),a[t].href=e+o.decoded_email,a[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})}a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var o=i.data[0];a.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a)},2e3),a.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'):(a.innerHTML="Loading...",t&&this.load(t)),a.setAttribute("id","cleantalk-modal-content"),o.append(a),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("_","")}),c=0;c(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,c=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(c.s();!(o=c.n()).done;)n=n||e===o.value}catch(e){c.e(e)}finally{c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(c=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=c.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 c(){for(var e=arguments.length,t=new Array(e),o=0;o{return _createClass(function e(){_classCallCheck(this,e),this.config=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=11,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,o));case 18: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,c,a=t.querySelector('[name*="apbct_email_id__"]'),i=null,r=(null!==a&&null!==a.value&&(i=a.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===a&&null===l||(e.preventDefault(),o=function(){null!==a&&a.parentNode.removeChild(a),"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!==(c=JSON.stringify(n))&&0!==c.length?ctSetAlternativeCookie(c,{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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,c=new ApbctHandler;if(c.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 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,c,a,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"),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(d.phrases.trpHeading),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),a.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)),a.append(i,r),c.append(a),o.append(n),e.append(o),e.append(c))}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var c=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;c=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(c),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){c=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;c=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(c),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(c=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 e767c6d2d..7e24ed6a2 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1 +1 @@ -function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,a,c,i,r=[],l=!0,s=!1;try{if(c=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;l=!1}else for(;!(l=(n=c.call(o)).done)&&(r.push(n.value),r.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=o.return&&(i=o.return(),Object(i)!==i))return}finally{if(s)throw a}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,o){e[t]=o.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function c(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(l){c=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var a,c,i,r,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),n=new E(n||[]);return u(t,"_invoke",{value:(a=e,c=o,i=n,r=p,function(e,t){if(r===f)throw Error("Generator is already running");if(r===m){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,a=t.iterator[n];if(a===l)return o.delegate=null,"throw"===n&&t.iterator.return&&(o.method="return",o.arg=l,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;n=d(a,t.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,b;a=n.arg;return a?a.done?(o[t.resultName]=a.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=l),o.delegate=null,b):a:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,b)}(o,i);if(o){if(o===b)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===p)throw r=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=f;o=d(a,c,i);if("normal"===o.type){if(r=i.done?m:_,o.arg===b)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=m,i.method="throw",i.arg=o.arg)}})}),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p="suspendedStart",_="suspendedYield",f="executing",m="completed",b={};function h(){}function y(){}function g(){}var t={},v=(c(t,n,function(){return this}),Object.getPrototypeOf),v=v&&v(v(A([]))),k=(v&&v!==e&&s.call(v,n)&&(t=v),g.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(i,r){var t;u(this,"_invoke",{value:function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,a){var c,e=d(i[e],i,o);if("throw"!==e.type)return(o=(c=e.arg).value)&&"object"==_typeof(o)&&s.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,a)},function(e){t("throw",e,n,a)}):r.resolve(o).then(function(e){c.value=e,n(c)},function(e){return t("throw",e,n,a)});a(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()}})}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function A(t){if(t||""===t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=21,o[1].body=w(o[1].body,P(+ctPublic.settings__data__bot_detector_enabled)),e.next=28):e.next=28;break;case 25:return e.prev=25,e.t0=e.catch(21),e.abrupt("return",defaultFetch.apply(window,o));case 28: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=11,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,o));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 8d63eba3d..68d95bf86 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1 +1 @@ -function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,a,r,i,c=[],l=!0,s=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=r.call(n)).done)&&(c.push(o.value),c.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw a}}return c}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function r(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{r({},"")}catch(l){r=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a,r,i,c,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype),o=new P(o||[]);return u(t,"_invoke",{value:(a=e,r=n,i=o,c=p,function(e,t){if(c===f)throw Error("Generator is already running");if(c===m){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var n=i.delegate;if(n){n=function e(t,n){var o=n.method,a=t.iterator[o];if(a===l)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),h;o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,h):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,i);if(n){if(n===h)continue;return n}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(c===p)throw c=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);c=f;n=d(a,r,i);if("normal"===n.type){if(c=i.done?m:_,n.arg===h)continue;return{value:n.arg,done:i.done}}"throw"===n.type&&(c=m,i.method="throw",i.arg=n.arg)}})}),t}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var p="suspendedStart",_="suspendedYield",f="executing",m="completed",h={};function b(){}function y(){}function v(){}var t={},g=(r(t,o,function(){return this}),Object.getPrototypeOf),g=g&&g(g(A([]))),k=(g&&g!==e&&s.call(g,o)&&(t=g),v.prototype=b.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){r(e,t,function(e){return this._invoke(t,e)})})}function w(i,c){var t;u(this,"_invoke",{value:function(n,o){function e(){return new c(function(e,t){!function t(e,n,o,a){var r,e=d(i[e],i,n);if("throw"!==e.type)return(n=(r=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):c.resolve(n).then(function(e){r.value=e,o(r)},function(e){return t("throw",e,o,a)});a(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function A(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n=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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=21,n[1].body=S(n[1].body,E(+ctPublic.settings__data__bot_detector_enabled)),e.next=28):e.next=28;break;case 25:return e.prev=25,e.t0=e.catch(21),e.abrupt("return",defaultFetch.apply(window,n));case 28: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=11,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,n));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index 1802af513..0446f55c1 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1 +1 @@ -function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,a,c,i,r=[],l=!0,s=!1;try{if(c=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;l=!1}else for(;!(l=(n=c.call(o)).done)&&(r.push(n.value),r.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=o.return&&(i=o.return(),Object(i)!==i))return}finally{if(s)throw a}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return i};var l,i={},e=Object.prototype,s=e.hasOwnProperty,u=Object.defineProperty||function(e,t,o){e[t]=o.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.asyncIterator||"@@asyncIterator",a=t.toStringTag||"@@toStringTag";function c(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(l){c=function(e,t,o){return e[t]=o}}function r(e,t,o,n){var a,c,i,r,t=t&&t.prototype instanceof h?t:h,t=Object.create(t.prototype),n=new E(n||[]);return u(t,"_invoke",{value:(a=e,c=o,i=n,r=p,function(e,t){if(r===f)throw Error("Generator is already running");if(r===m){if("throw"===e)throw t;return{value:l,done:!0}}for(i.method=e,i.arg=t;;){var o=i.delegate;if(o){o=function e(t,o){var n=o.method,a=t.iterator[n];if(a===l)return o.delegate=null,"throw"===n&&t.iterator.return&&(o.method="return",o.arg=l,e(t,o),"throw"===o.method)||"return"!==n&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;n=d(a,t.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,b;a=n.arg;return a?a.done?(o[t.resultName]=a.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=l),o.delegate=null,b):a:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,b)}(o,i);if(o){if(o===b)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===p)throw r=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=f;o=d(a,c,i);if("normal"===o.type){if(r=i.done?m:_,o.arg===b)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(r=m,i.method="throw",i.arg=o.arg)}})}),t}function d(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}i.wrap=r;var p="suspendedStart",_="suspendedYield",f="executing",m="completed",b={};function h(){}function y(){}function g(){}var t={},v=(c(t,n,function(){return this}),Object.getPrototypeOf),v=v&&v(v(A([]))),k=(v&&v!==e&&s.call(v,n)&&(t=v),g.prototype=h.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(i,r){var t;u(this,"_invoke",{value:function(o,n){function e(){return new r(function(e,t){!function t(e,o,n,a){var c,e=d(i[e],i,o);if("throw"!==e.type)return(o=(c=e.arg).value)&&"object"==_typeof(o)&&s.call(o,"__await")?r.resolve(o.__await).then(function(e){t("next",e,n,a)},function(e){t("throw",e,n,a)}):r.resolve(o).then(function(e){c.value=e,n(c)},function(e){return t("throw",e,n,a)});a(e.arg)}(o,n,e,t)})}return t=t?t.then(e,e):e()}})}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function A(t){if(t||""===t){var o,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return o=-1,(e=function e(){for(;++o=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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 l(){_classCallCheck(this,l)}return _createClass(l,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=21,o[1].body=w(o[1].body,P(+ctPublic.settings__data__bot_detector_enabled)),e.next=28):e.next=28;break;case 25:return e.prev=25,e.t0=e.catch(21),e.abrupt("return",defaultFetch.apply(window,o));case 28: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=11,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,o));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 84f794ab3..b0a5e40fc 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -1806,6 +1806,184 @@ if (!Object.prototype.hasOwn) { }); } +/** + * Callbacks for ShadowRoot integrations + */ +const ApbctShadowRootCallbacks = { + /** + * Mailchimp block callback - clears localStorage by mcforms mask + * @param {object} result + */ + mailchimpBlock: function(result) { + try { + for (let i = localStorage.length - 1; i >= 0; i--) { + const key = localStorage.key(i); + if (key && key.indexOf('mcforms') !== -1) { + localStorage.removeItem(key); + } + } + } catch (e) { + console.warn('Error clearing localStorage by mcforms mask:', e); + } + }, + + // /** + // * Next integration block callback + // * @param {object} result + // */ + // nextIntegrationBlock: function(result) { + // // Custom logic + // }, +}; +/** + * Config for ShadowRoot integrations + */ +const ApbctShadowRootConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + callbackAllow: false, + callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + }, +}; +/** + * Class for handling ShadowRoot forms + */ +class ApbctShadowRootProtection { + constructor() { + this.config = ApbctShadowRootConfig; + } + + /** + * Find matching config for URL + * @param {string} url + * @return {object|null} { formKey, config } or null + */ + findMatchingConfig(url) { + for (const [formKey, config] of Object.entries(this.config)) { + // Shadowroot can send both external and internal requests + // If the form is external, then we check whether the setting is enabled. + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + return {formKey, config}; + } + } + return null; + } + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey + * @param {object} config + * @param {string} bodyText + * @return {Promise} true = block, false = allow + */ + async checkRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + let data = { + action: config.action, + }; + + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + data.raw_body = bodyText; + } + + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX(data, { + async: true, + callback: (result) => { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + if (typeof config.callbackAllow === 'function') { + config.callbackAllow(result); + } + resolve(false); + return; + } + + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + if (typeof config.callbackBlock === 'function') { + config.callbackBlock(result); + } + resolve(true); + return; + } + + resolve(false); + }, + onErrorCallback: (error) => { + console.log('APBCT ShadowRoot check error:', error); + resolve(false); + }, + }); + }); + } + + /** + * Extract body text from fetch args + * @param {array} args + * @return {string} + */ + extractBodyText(args) { + let body = args[1] && args[1].body; + let bodyText = ''; + + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) { + obj[key] = value; + } + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; + } + + return bodyText; + } + + /** + * Process fetch request for ShadowRoot forms + * @param {array} args - fetch arguments + * @return {Promise} true = block, false = allow, null = not matched + */ + async processFetch(args) { + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); + const match = this.findMatchingConfig(url); + + if (!match) { + return null; + } + + const bodyText = this.extractBodyText(args); + return await this.checkRequest(match.formKey, match.config, bodyText); + } +} /** * Set init params */ @@ -2995,89 +3173,9 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const apbctShadowRootFormsConfig = { - 'mailchimp': { - selector: '.mcforms-wrapper', - urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', - externalForm: true, - action: 'cleantalk_force_mailchimp_shadowroot_check', - }, - }; - + const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - /** - * Check ShadowRoot form request via CleanTalk AJAX - * @param {string} formKey - The form key from config (e.g., 'mailchimp') - * @param {object} config - The form config object with action, selector, etc. - * @param {string} bodyText - The request body as string - * @return {Promise} - true = block, false = allow - */ - async function apbctCheckShadowRootRequest(formKey, config, bodyText) { - return new Promise((resolve) => { - // Prepare data for AJAX request - let data = { - action: config.action, - }; - - // Parse bodyText and add form fields - try { - const bodyObj = JSON.parse(bodyText); - for (const [key, value] of Object.entries(bodyObj)) { - data[key] = value; - } - } catch (e) { - // If parsing fails, send raw body - data.raw_body = bodyText; - } - - // Add event token or no_cookie data - if (+ctPublic.settings__data__bot_detector_enabled) { - const eventToken = new ApbctHandler().toolGetEventToken(); - if (eventToken) { - data.ct_bot_detector_event_token = eventToken; - } - } else { - data.ct_no_cookie_hidden_field = getNoCookieData(); - } - - apbct_public_sendAJAX( - data, - { - async: true, - callback: function(result) { - // Allowed - if ( - (result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && !+result.apbct.blocked) - ) { - resolve(false); // false = allow - return; - } - - // Blocked - if ( - (result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - new ApbctShowForbidden().parseBlockMessage(result); - resolve(true); // true = block - return; - } - - // Default: allow - resolve(false); - }, - onErrorCallback: function(error) { - console.log('APBCT ShadowRoot check error:', error); - // On error, allow the request to proceed - resolve(false); - }, - }, - ); - }); - } - /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3136,30 +3234,10 @@ class ApbctHandler { let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === - for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { - if ( - (!config.externalForm || +ctPublic.settings__forms__check_external) && - document.querySelectorAll(config.selector).length > 0 && - url && url.includes(config.urlPattern) - ) { - // Get request body - let body = args[1] && args[1].body; - let bodyText = ''; - if (body instanceof FormData) { - let obj = {}; - for (let [key, value] of body.entries()) obj[key] = value; - bodyText = JSON.stringify(obj); - } else if (typeof body === 'string') { - bodyText = body; - } - - const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); - if (shouldBlock) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } - // If not blocking — continue to the original fetch - } + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); } // === Metform === diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index 9d3bf2c81..bfda81c7d 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -1806,6 +1806,184 @@ if (!Object.prototype.hasOwn) { }); } +/** + * Callbacks for ShadowRoot integrations + */ +const ApbctShadowRootCallbacks = { + /** + * Mailchimp block callback - clears localStorage by mcforms mask + * @param {object} result + */ + mailchimpBlock: function(result) { + try { + for (let i = localStorage.length - 1; i >= 0; i--) { + const key = localStorage.key(i); + if (key && key.indexOf('mcforms') !== -1) { + localStorage.removeItem(key); + } + } + } catch (e) { + console.warn('Error clearing localStorage by mcforms mask:', e); + } + }, + + // /** + // * Next integration block callback + // * @param {object} result + // */ + // nextIntegrationBlock: function(result) { + // // Custom logic + // }, +}; +/** + * Config for ShadowRoot integrations + */ +const ApbctShadowRootConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + callbackAllow: false, + callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + }, +}; +/** + * Class for handling ShadowRoot forms + */ +class ApbctShadowRootProtection { + constructor() { + this.config = ApbctShadowRootConfig; + } + + /** + * Find matching config for URL + * @param {string} url + * @return {object|null} { formKey, config } or null + */ + findMatchingConfig(url) { + for (const [formKey, config] of Object.entries(this.config)) { + // Shadowroot can send both external and internal requests + // If the form is external, then we check whether the setting is enabled. + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + return {formKey, config}; + } + } + return null; + } + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey + * @param {object} config + * @param {string} bodyText + * @return {Promise} true = block, false = allow + */ + async checkRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + let data = { + action: config.action, + }; + + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + data.raw_body = bodyText; + } + + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX(data, { + async: true, + callback: (result) => { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + if (typeof config.callbackAllow === 'function') { + config.callbackAllow(result); + } + resolve(false); + return; + } + + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + if (typeof config.callbackBlock === 'function') { + config.callbackBlock(result); + } + resolve(true); + return; + } + + resolve(false); + }, + onErrorCallback: (error) => { + console.log('APBCT ShadowRoot check error:', error); + resolve(false); + }, + }); + }); + } + + /** + * Extract body text from fetch args + * @param {array} args + * @return {string} + */ + extractBodyText(args) { + let body = args[1] && args[1].body; + let bodyText = ''; + + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) { + obj[key] = value; + } + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; + } + + return bodyText; + } + + /** + * Process fetch request for ShadowRoot forms + * @param {array} args - fetch arguments + * @return {Promise} true = block, false = allow, null = not matched + */ + async processFetch(args) { + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); + const match = this.findMatchingConfig(url); + + if (!match) { + return null; + } + + const bodyText = this.extractBodyText(args); + return await this.checkRequest(match.formKey, match.config, bodyText); + } +} /** * Set init params */ @@ -2995,89 +3173,9 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const apbctShadowRootFormsConfig = { - 'mailchimp': { - selector: '.mcforms-wrapper', - urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', - externalForm: true, - action: 'cleantalk_force_mailchimp_shadowroot_check', - }, - }; - + const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - /** - * Check ShadowRoot form request via CleanTalk AJAX - * @param {string} formKey - The form key from config (e.g., 'mailchimp') - * @param {object} config - The form config object with action, selector, etc. - * @param {string} bodyText - The request body as string - * @return {Promise} - true = block, false = allow - */ - async function apbctCheckShadowRootRequest(formKey, config, bodyText) { - return new Promise((resolve) => { - // Prepare data for AJAX request - let data = { - action: config.action, - }; - - // Parse bodyText and add form fields - try { - const bodyObj = JSON.parse(bodyText); - for (const [key, value] of Object.entries(bodyObj)) { - data[key] = value; - } - } catch (e) { - // If parsing fails, send raw body - data.raw_body = bodyText; - } - - // Add event token or no_cookie data - if (+ctPublic.settings__data__bot_detector_enabled) { - const eventToken = new ApbctHandler().toolGetEventToken(); - if (eventToken) { - data.ct_bot_detector_event_token = eventToken; - } - } else { - data.ct_no_cookie_hidden_field = getNoCookieData(); - } - - apbct_public_sendAJAX( - data, - { - async: true, - callback: function(result) { - // Allowed - if ( - (result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && !+result.apbct.blocked) - ) { - resolve(false); // false = allow - return; - } - - // Blocked - if ( - (result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - new ApbctShowForbidden().parseBlockMessage(result); - resolve(true); // true = block - return; - } - - // Default: allow - resolve(false); - }, - onErrorCallback: function(error) { - console.log('APBCT ShadowRoot check error:', error); - // On error, allow the request to proceed - resolve(false); - }, - }, - ); - }); - } - /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3136,30 +3234,10 @@ class ApbctHandler { let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === - for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { - if ( - (!config.externalForm || +ctPublic.settings__forms__check_external) && - document.querySelectorAll(config.selector).length > 0 && - url && url.includes(config.urlPattern) - ) { - // Get request body - let body = args[1] && args[1].body; - let bodyText = ''; - if (body instanceof FormData) { - let obj = {}; - for (let [key, value] of body.entries()) obj[key] = value; - bodyText = JSON.stringify(obj); - } else if (typeof body === 'string') { - bodyText = body; - } - - const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); - if (shouldBlock) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } - // If not blocking — continue to the original fetch - } + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); } // === Metform === diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index ae8a44caa..bc3d483ac 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -1806,6 +1806,184 @@ if (!Object.prototype.hasOwn) { }); } +/** + * Callbacks for ShadowRoot integrations + */ +const ApbctShadowRootCallbacks = { + /** + * Mailchimp block callback - clears localStorage by mcforms mask + * @param {object} result + */ + mailchimpBlock: function(result) { + try { + for (let i = localStorage.length - 1; i >= 0; i--) { + const key = localStorage.key(i); + if (key && key.indexOf('mcforms') !== -1) { + localStorage.removeItem(key); + } + } + } catch (e) { + console.warn('Error clearing localStorage by mcforms mask:', e); + } + }, + + // /** + // * Next integration block callback + // * @param {object} result + // */ + // nextIntegrationBlock: function(result) { + // // Custom logic + // }, +}; +/** + * Config for ShadowRoot integrations + */ +const ApbctShadowRootConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + callbackAllow: false, + callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + }, +}; +/** + * Class for handling ShadowRoot forms + */ +class ApbctShadowRootProtection { + constructor() { + this.config = ApbctShadowRootConfig; + } + + /** + * Find matching config for URL + * @param {string} url + * @return {object|null} { formKey, config } or null + */ + findMatchingConfig(url) { + for (const [formKey, config] of Object.entries(this.config)) { + // Shadowroot can send both external and internal requests + // If the form is external, then we check whether the setting is enabled. + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + return {formKey, config}; + } + } + return null; + } + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey + * @param {object} config + * @param {string} bodyText + * @return {Promise} true = block, false = allow + */ + async checkRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + let data = { + action: config.action, + }; + + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + data.raw_body = bodyText; + } + + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX(data, { + async: true, + callback: (result) => { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + if (typeof config.callbackAllow === 'function') { + config.callbackAllow(result); + } + resolve(false); + return; + } + + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + if (typeof config.callbackBlock === 'function') { + config.callbackBlock(result); + } + resolve(true); + return; + } + + resolve(false); + }, + onErrorCallback: (error) => { + console.log('APBCT ShadowRoot check error:', error); + resolve(false); + }, + }); + }); + } + + /** + * Extract body text from fetch args + * @param {array} args + * @return {string} + */ + extractBodyText(args) { + let body = args[1] && args[1].body; + let bodyText = ''; + + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) { + obj[key] = value; + } + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; + } + + return bodyText; + } + + /** + * Process fetch request for ShadowRoot forms + * @param {array} args - fetch arguments + * @return {Promise} true = block, false = allow, null = not matched + */ + async processFetch(args) { + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); + const match = this.findMatchingConfig(url); + + if (!match) { + return null; + } + + const bodyText = this.extractBodyText(args); + return await this.checkRequest(match.formKey, match.config, bodyText); + } +} /** * Set init params */ @@ -2995,89 +3173,9 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const apbctShadowRootFormsConfig = { - 'mailchimp': { - selector: '.mcforms-wrapper', - urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', - externalForm: true, - action: 'cleantalk_force_mailchimp_shadowroot_check', - }, - }; - + const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - /** - * Check ShadowRoot form request via CleanTalk AJAX - * @param {string} formKey - The form key from config (e.g., 'mailchimp') - * @param {object} config - The form config object with action, selector, etc. - * @param {string} bodyText - The request body as string - * @return {Promise} - true = block, false = allow - */ - async function apbctCheckShadowRootRequest(formKey, config, bodyText) { - return new Promise((resolve) => { - // Prepare data for AJAX request - let data = { - action: config.action, - }; - - // Parse bodyText and add form fields - try { - const bodyObj = JSON.parse(bodyText); - for (const [key, value] of Object.entries(bodyObj)) { - data[key] = value; - } - } catch (e) { - // If parsing fails, send raw body - data.raw_body = bodyText; - } - - // Add event token or no_cookie data - if (+ctPublic.settings__data__bot_detector_enabled) { - const eventToken = new ApbctHandler().toolGetEventToken(); - if (eventToken) { - data.ct_bot_detector_event_token = eventToken; - } - } else { - data.ct_no_cookie_hidden_field = getNoCookieData(); - } - - apbct_public_sendAJAX( - data, - { - async: true, - callback: function(result) { - // Allowed - if ( - (result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && !+result.apbct.blocked) - ) { - resolve(false); // false = allow - return; - } - - // Blocked - if ( - (result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - new ApbctShowForbidden().parseBlockMessage(result); - resolve(true); // true = block - return; - } - - // Default: allow - resolve(false); - }, - onErrorCallback: function(error) { - console.log('APBCT ShadowRoot check error:', error); - // On error, allow the request to proceed - resolve(false); - }, - }, - ); - }); - } - /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3136,30 +3234,10 @@ class ApbctHandler { let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === - for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { - if ( - (!config.externalForm || +ctPublic.settings__forms__check_external) && - document.querySelectorAll(config.selector).length > 0 && - url && url.includes(config.urlPattern) - ) { - // Get request body - let body = args[1] && args[1].body; - let bodyText = ''; - if (body instanceof FormData) { - let obj = {}; - for (let [key, value] of body.entries()) obj[key] = value; - bodyText = JSON.stringify(obj); - } else if (typeof body === 'string') { - bodyText = body; - } - - const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); - if (shouldBlock) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } - // If not blocking — continue to the original fetch - } + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); } // === Metform === diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index af08be89c..1b9db18f3 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -1806,6 +1806,184 @@ if (!Object.prototype.hasOwn) { }); } +/** + * Callbacks for ShadowRoot integrations + */ +const ApbctShadowRootCallbacks = { + /** + * Mailchimp block callback - clears localStorage by mcforms mask + * @param {object} result + */ + mailchimpBlock: function(result) { + try { + for (let i = localStorage.length - 1; i >= 0; i--) { + const key = localStorage.key(i); + if (key && key.indexOf('mcforms') !== -1) { + localStorage.removeItem(key); + } + } + } catch (e) { + console.warn('Error clearing localStorage by mcforms mask:', e); + } + }, + + // /** + // * Next integration block callback + // * @param {object} result + // */ + // nextIntegrationBlock: function(result) { + // // Custom logic + // }, +}; +/** + * Config for ShadowRoot integrations + */ +const ApbctShadowRootConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + callbackAllow: false, + callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + }, +}; +/** + * Class for handling ShadowRoot forms + */ +class ApbctShadowRootProtection { + constructor() { + this.config = ApbctShadowRootConfig; + } + + /** + * Find matching config for URL + * @param {string} url + * @return {object|null} { formKey, config } or null + */ + findMatchingConfig(url) { + for (const [formKey, config] of Object.entries(this.config)) { + // Shadowroot can send both external and internal requests + // If the form is external, then we check whether the setting is enabled. + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + return {formKey, config}; + } + } + return null; + } + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey + * @param {object} config + * @param {string} bodyText + * @return {Promise} true = block, false = allow + */ + async checkRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + let data = { + action: config.action, + }; + + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + data.raw_body = bodyText; + } + + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX(data, { + async: true, + callback: (result) => { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + if (typeof config.callbackAllow === 'function') { + config.callbackAllow(result); + } + resolve(false); + return; + } + + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + if (typeof config.callbackBlock === 'function') { + config.callbackBlock(result); + } + resolve(true); + return; + } + + resolve(false); + }, + onErrorCallback: (error) => { + console.log('APBCT ShadowRoot check error:', error); + resolve(false); + }, + }); + }); + } + + /** + * Extract body text from fetch args + * @param {array} args + * @return {string} + */ + extractBodyText(args) { + let body = args[1] && args[1].body; + let bodyText = ''; + + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) { + obj[key] = value; + } + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; + } + + return bodyText; + } + + /** + * Process fetch request for ShadowRoot forms + * @param {array} args - fetch arguments + * @return {Promise} true = block, false = allow, null = not matched + */ + async processFetch(args) { + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); + const match = this.findMatchingConfig(url); + + if (!match) { + return null; + } + + const bodyText = this.extractBodyText(args); + return await this.checkRequest(match.formKey, match.config, bodyText); + } +} /** * Set init params */ @@ -2995,89 +3173,9 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const apbctShadowRootFormsConfig = { - 'mailchimp': { - selector: '.mcforms-wrapper', - urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', - externalForm: true, - action: 'cleantalk_force_mailchimp_shadowroot_check', - }, - }; - + const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - /** - * Check ShadowRoot form request via CleanTalk AJAX - * @param {string} formKey - The form key from config (e.g., 'mailchimp') - * @param {object} config - The form config object with action, selector, etc. - * @param {string} bodyText - The request body as string - * @return {Promise} - true = block, false = allow - */ - async function apbctCheckShadowRootRequest(formKey, config, bodyText) { - return new Promise((resolve) => { - // Prepare data for AJAX request - let data = { - action: config.action, - }; - - // Parse bodyText and add form fields - try { - const bodyObj = JSON.parse(bodyText); - for (const [key, value] of Object.entries(bodyObj)) { - data[key] = value; - } - } catch (e) { - // If parsing fails, send raw body - data.raw_body = bodyText; - } - - // Add event token or no_cookie data - if (+ctPublic.settings__data__bot_detector_enabled) { - const eventToken = new ApbctHandler().toolGetEventToken(); - if (eventToken) { - data.ct_bot_detector_event_token = eventToken; - } - } else { - data.ct_no_cookie_hidden_field = getNoCookieData(); - } - - apbct_public_sendAJAX( - data, - { - async: true, - callback: function(result) { - // Allowed - if ( - (result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && !+result.apbct.blocked) - ) { - resolve(false); // false = allow - return; - } - - // Blocked - if ( - (result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - new ApbctShowForbidden().parseBlockMessage(result); - resolve(true); // true = block - return; - } - - // Default: allow - resolve(false); - }, - onErrorCallback: function(error) { - console.log('APBCT ShadowRoot check error:', error); - // On error, allow the request to proceed - resolve(false); - }, - }, - ); - }); - } - /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3136,30 +3234,10 @@ class ApbctHandler { let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === - for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { - if ( - (!config.externalForm || +ctPublic.settings__forms__check_external) && - document.querySelectorAll(config.selector).length > 0 && - url && url.includes(config.urlPattern) - ) { - // Get request body - let body = args[1] && args[1].body; - let bodyText = ''; - if (body instanceof FormData) { - let obj = {}; - for (let [key, value] of body.entries()) obj[key] = value; - bodyText = JSON.stringify(obj); - } else if (typeof body === 'string') { - bodyText = body; - } - - const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); - if (shouldBlock) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } - // If not blocking — continue to the original fetch - } + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); } // === Metform === diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 360308cab..02e551143 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -1806,6 +1806,184 @@ if (!Object.prototype.hasOwn) { }); } +/** + * Callbacks for ShadowRoot integrations + */ +const ApbctShadowRootCallbacks = { + /** + * Mailchimp block callback - clears localStorage by mcforms mask + * @param {object} result + */ + mailchimpBlock: function(result) { + try { + for (let i = localStorage.length - 1; i >= 0; i--) { + const key = localStorage.key(i); + if (key && key.indexOf('mcforms') !== -1) { + localStorage.removeItem(key); + } + } + } catch (e) { + console.warn('Error clearing localStorage by mcforms mask:', e); + } + }, + + // /** + // * Next integration block callback + // * @param {object} result + // */ + // nextIntegrationBlock: function(result) { + // // Custom logic + // }, +}; +/** + * Config for ShadowRoot integrations + */ +const ApbctShadowRootConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + callbackAllow: false, + callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + }, +}; +/** + * Class for handling ShadowRoot forms + */ +class ApbctShadowRootProtection { + constructor() { + this.config = ApbctShadowRootConfig; + } + + /** + * Find matching config for URL + * @param {string} url + * @return {object|null} { formKey, config } or null + */ + findMatchingConfig(url) { + for (const [formKey, config] of Object.entries(this.config)) { + // Shadowroot can send both external and internal requests + // If the form is external, then we check whether the setting is enabled. + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + return {formKey, config}; + } + } + return null; + } + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey + * @param {object} config + * @param {string} bodyText + * @return {Promise} true = block, false = allow + */ + async checkRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + let data = { + action: config.action, + }; + + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + data.raw_body = bodyText; + } + + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX(data, { + async: true, + callback: (result) => { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + if (typeof config.callbackAllow === 'function') { + config.callbackAllow(result); + } + resolve(false); + return; + } + + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + if (typeof config.callbackBlock === 'function') { + config.callbackBlock(result); + } + resolve(true); + return; + } + + resolve(false); + }, + onErrorCallback: (error) => { + console.log('APBCT ShadowRoot check error:', error); + resolve(false); + }, + }); + }); + } + + /** + * Extract body text from fetch args + * @param {array} args + * @return {string} + */ + extractBodyText(args) { + let body = args[1] && args[1].body; + let bodyText = ''; + + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) { + obj[key] = value; + } + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; + } + + return bodyText; + } + + /** + * Process fetch request for ShadowRoot forms + * @param {array} args - fetch arguments + * @return {Promise} true = block, false = allow, null = not matched + */ + async processFetch(args) { + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); + const match = this.findMatchingConfig(url); + + if (!match) { + return null; + } + + const bodyText = this.extractBodyText(args); + return await this.checkRequest(match.formKey, match.config, bodyText); + } +} /** * Set init params */ @@ -2995,89 +3173,9 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const apbctShadowRootFormsConfig = { - 'mailchimp': { - selector: '.mcforms-wrapper', - urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', - externalForm: true, - action: 'cleantalk_force_mailchimp_shadowroot_check', - }, - }; - + const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - /** - * Check ShadowRoot form request via CleanTalk AJAX - * @param {string} formKey - The form key from config (e.g., 'mailchimp') - * @param {object} config - The form config object with action, selector, etc. - * @param {string} bodyText - The request body as string - * @return {Promise} - true = block, false = allow - */ - async function apbctCheckShadowRootRequest(formKey, config, bodyText) { - return new Promise((resolve) => { - // Prepare data for AJAX request - let data = { - action: config.action, - }; - - // Parse bodyText and add form fields - try { - const bodyObj = JSON.parse(bodyText); - for (const [key, value] of Object.entries(bodyObj)) { - data[key] = value; - } - } catch (e) { - // If parsing fails, send raw body - data.raw_body = bodyText; - } - - // Add event token or no_cookie data - if (+ctPublic.settings__data__bot_detector_enabled) { - const eventToken = new ApbctHandler().toolGetEventToken(); - if (eventToken) { - data.ct_bot_detector_event_token = eventToken; - } - } else { - data.ct_no_cookie_hidden_field = getNoCookieData(); - } - - apbct_public_sendAJAX( - data, - { - async: true, - callback: function(result) { - // Allowed - if ( - (result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && !+result.apbct.blocked) - ) { - resolve(false); // false = allow - return; - } - - // Blocked - if ( - (result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - new ApbctShowForbidden().parseBlockMessage(result); - resolve(true); // true = block - return; - } - - // Default: allow - resolve(false); - }, - onErrorCallback: function(error) { - console.log('APBCT ShadowRoot check error:', error); - // On error, allow the request to proceed - resolve(false); - }, - }, - ); - }); - } - /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3136,30 +3234,10 @@ class ApbctHandler { let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === - for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { - if ( - (!config.externalForm || +ctPublic.settings__forms__check_external) && - document.querySelectorAll(config.selector).length > 0 && - url && url.includes(config.urlPattern) - ) { - // Get request body - let body = args[1] && args[1].body; - let bodyText = ''; - if (body instanceof FormData) { - let obj = {}; - for (let [key, value] of body.entries()) obj[key] = value; - bodyText = JSON.stringify(obj); - } else if (typeof body === 'string') { - bodyText = body; - } - - const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); - if (shouldBlock) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } - // If not blocking — continue to the original fetch - } + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); } // === Metform === diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index c29d7f67e..f7a5d22e2 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -1806,6 +1806,184 @@ if (!Object.prototype.hasOwn) { }); } +/** + * Callbacks for ShadowRoot integrations + */ +const ApbctShadowRootCallbacks = { + /** + * Mailchimp block callback - clears localStorage by mcforms mask + * @param {object} result + */ + mailchimpBlock: function(result) { + try { + for (let i = localStorage.length - 1; i >= 0; i--) { + const key = localStorage.key(i); + if (key && key.indexOf('mcforms') !== -1) { + localStorage.removeItem(key); + } + } + } catch (e) { + console.warn('Error clearing localStorage by mcforms mask:', e); + } + }, + + // /** + // * Next integration block callback + // * @param {object} result + // */ + // nextIntegrationBlock: function(result) { + // // Custom logic + // }, +}; +/** + * Config for ShadowRoot integrations + */ +const ApbctShadowRootConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + callbackAllow: false, + callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + }, +}; +/** + * Class for handling ShadowRoot forms + */ +class ApbctShadowRootProtection { + constructor() { + this.config = ApbctShadowRootConfig; + } + + /** + * Find matching config for URL + * @param {string} url + * @return {object|null} { formKey, config } or null + */ + findMatchingConfig(url) { + for (const [formKey, config] of Object.entries(this.config)) { + // Shadowroot can send both external and internal requests + // If the form is external, then we check whether the setting is enabled. + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + return {formKey, config}; + } + } + return null; + } + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey + * @param {object} config + * @param {string} bodyText + * @return {Promise} true = block, false = allow + */ + async checkRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + let data = { + action: config.action, + }; + + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + data.raw_body = bodyText; + } + + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX(data, { + async: true, + callback: (result) => { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + if (typeof config.callbackAllow === 'function') { + config.callbackAllow(result); + } + resolve(false); + return; + } + + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + if (typeof config.callbackBlock === 'function') { + config.callbackBlock(result); + } + resolve(true); + return; + } + + resolve(false); + }, + onErrorCallback: (error) => { + console.log('APBCT ShadowRoot check error:', error); + resolve(false); + }, + }); + }); + } + + /** + * Extract body text from fetch args + * @param {array} args + * @return {string} + */ + extractBodyText(args) { + let body = args[1] && args[1].body; + let bodyText = ''; + + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) { + obj[key] = value; + } + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; + } + + return bodyText; + } + + /** + * Process fetch request for ShadowRoot forms + * @param {array} args - fetch arguments + * @return {Promise} true = block, false = allow, null = not matched + */ + async processFetch(args) { + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); + const match = this.findMatchingConfig(url); + + if (!match) { + return null; + } + + const bodyText = this.extractBodyText(args); + return await this.checkRequest(match.formKey, match.config, bodyText); + } +} /** * Set init params */ @@ -2995,89 +3173,9 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const apbctShadowRootFormsConfig = { - 'mailchimp': { - selector: '.mcforms-wrapper', - urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', - externalForm: true, - action: 'cleantalk_force_mailchimp_shadowroot_check', - }, - }; - + const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - /** - * Check ShadowRoot form request via CleanTalk AJAX - * @param {string} formKey - The form key from config (e.g., 'mailchimp') - * @param {object} config - The form config object with action, selector, etc. - * @param {string} bodyText - The request body as string - * @return {Promise} - true = block, false = allow - */ - async function apbctCheckShadowRootRequest(formKey, config, bodyText) { - return new Promise((resolve) => { - // Prepare data for AJAX request - let data = { - action: config.action, - }; - - // Parse bodyText and add form fields - try { - const bodyObj = JSON.parse(bodyText); - for (const [key, value] of Object.entries(bodyObj)) { - data[key] = value; - } - } catch (e) { - // If parsing fails, send raw body - data.raw_body = bodyText; - } - - // Add event token or no_cookie data - if (+ctPublic.settings__data__bot_detector_enabled) { - const eventToken = new ApbctHandler().toolGetEventToken(); - if (eventToken) { - data.ct_bot_detector_event_token = eventToken; - } - } else { - data.ct_no_cookie_hidden_field = getNoCookieData(); - } - - apbct_public_sendAJAX( - data, - { - async: true, - callback: function(result) { - // Allowed - if ( - (result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && !+result.apbct.blocked) - ) { - resolve(false); // false = allow - return; - } - - // Blocked - if ( - (result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - new ApbctShowForbidden().parseBlockMessage(result); - resolve(true); // true = block - return; - } - - // Default: allow - resolve(false); - }, - onErrorCallback: function(error) { - console.log('APBCT ShadowRoot check error:', error); - // On error, allow the request to proceed - resolve(false); - }, - }, - ); - }); - } - /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3136,30 +3234,10 @@ class ApbctHandler { let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === - for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { - if ( - (!config.externalForm || +ctPublic.settings__forms__check_external) && - document.querySelectorAll(config.selector).length > 0 && - url && url.includes(config.urlPattern) - ) { - // Get request body - let body = args[1] && args[1].body; - let bodyText = ''; - if (body instanceof FormData) { - let obj = {}; - for (let [key, value] of body.entries()) obj[key] = value; - bodyText = JSON.stringify(obj); - } else if (typeof body === 'string') { - bodyText = body; - } - - const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); - if (shouldBlock) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } - // If not blocking — continue to the original fetch - } + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); } // === Metform === diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index fce0b5e7b..2503cb949 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -1806,6 +1806,184 @@ if (!Object.prototype.hasOwn) { }); } +/** + * Callbacks for ShadowRoot integrations + */ +const ApbctShadowRootCallbacks = { + /** + * Mailchimp block callback - clears localStorage by mcforms mask + * @param {object} result + */ + mailchimpBlock: function(result) { + try { + for (let i = localStorage.length - 1; i >= 0; i--) { + const key = localStorage.key(i); + if (key && key.indexOf('mcforms') !== -1) { + localStorage.removeItem(key); + } + } + } catch (e) { + console.warn('Error clearing localStorage by mcforms mask:', e); + } + }, + + // /** + // * Next integration block callback + // * @param {object} result + // */ + // nextIntegrationBlock: function(result) { + // // Custom logic + // }, +}; +/** + * Config for ShadowRoot integrations + */ +const ApbctShadowRootConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + callbackAllow: false, + callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + }, +}; +/** + * Class for handling ShadowRoot forms + */ +class ApbctShadowRootProtection { + constructor() { + this.config = ApbctShadowRootConfig; + } + + /** + * Find matching config for URL + * @param {string} url + * @return {object|null} { formKey, config } or null + */ + findMatchingConfig(url) { + for (const [formKey, config] of Object.entries(this.config)) { + // Shadowroot can send both external and internal requests + // If the form is external, then we check whether the setting is enabled. + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + return {formKey, config}; + } + } + return null; + } + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey + * @param {object} config + * @param {string} bodyText + * @return {Promise} true = block, false = allow + */ + async checkRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + let data = { + action: config.action, + }; + + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + data.raw_body = bodyText; + } + + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX(data, { + async: true, + callback: (result) => { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + if (typeof config.callbackAllow === 'function') { + config.callbackAllow(result); + } + resolve(false); + return; + } + + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + if (typeof config.callbackBlock === 'function') { + config.callbackBlock(result); + } + resolve(true); + return; + } + + resolve(false); + }, + onErrorCallback: (error) => { + console.log('APBCT ShadowRoot check error:', error); + resolve(false); + }, + }); + }); + } + + /** + * Extract body text from fetch args + * @param {array} args + * @return {string} + */ + extractBodyText(args) { + let body = args[1] && args[1].body; + let bodyText = ''; + + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) { + obj[key] = value; + } + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; + } + + return bodyText; + } + + /** + * Process fetch request for ShadowRoot forms + * @param {array} args - fetch arguments + * @return {Promise} true = block, false = allow, null = not matched + */ + async processFetch(args) { + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); + const match = this.findMatchingConfig(url); + + if (!match) { + return null; + } + + const bodyText = this.extractBodyText(args); + return await this.checkRequest(match.formKey, match.config, bodyText); + } +} /** * Set init params */ @@ -2995,89 +3173,9 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const apbctShadowRootFormsConfig = { - 'mailchimp': { - selector: '.mcforms-wrapper', - urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', - externalForm: true, - action: 'cleantalk_force_mailchimp_shadowroot_check', - }, - }; - + const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - /** - * Check ShadowRoot form request via CleanTalk AJAX - * @param {string} formKey - The form key from config (e.g., 'mailchimp') - * @param {object} config - The form config object with action, selector, etc. - * @param {string} bodyText - The request body as string - * @return {Promise} - true = block, false = allow - */ - async function apbctCheckShadowRootRequest(formKey, config, bodyText) { - return new Promise((resolve) => { - // Prepare data for AJAX request - let data = { - action: config.action, - }; - - // Parse bodyText and add form fields - try { - const bodyObj = JSON.parse(bodyText); - for (const [key, value] of Object.entries(bodyObj)) { - data[key] = value; - } - } catch (e) { - // If parsing fails, send raw body - data.raw_body = bodyText; - } - - // Add event token or no_cookie data - if (+ctPublic.settings__data__bot_detector_enabled) { - const eventToken = new ApbctHandler().toolGetEventToken(); - if (eventToken) { - data.ct_bot_detector_event_token = eventToken; - } - } else { - data.ct_no_cookie_hidden_field = getNoCookieData(); - } - - apbct_public_sendAJAX( - data, - { - async: true, - callback: function(result) { - // Allowed - if ( - (result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && !+result.apbct.blocked) - ) { - resolve(false); // false = allow - return; - } - - // Blocked - if ( - (result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - new ApbctShowForbidden().parseBlockMessage(result); - resolve(true); // true = block - return; - } - - // Default: allow - resolve(false); - }, - onErrorCallback: function(error) { - console.log('APBCT ShadowRoot check error:', error); - // On error, allow the request to proceed - resolve(false); - }, - }, - ); - }); - } - /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3136,30 +3234,10 @@ class ApbctHandler { let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === - for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { - if ( - (!config.externalForm || +ctPublic.settings__forms__check_external) && - document.querySelectorAll(config.selector).length > 0 && - url && url.includes(config.urlPattern) - ) { - // Get request body - let body = args[1] && args[1].body; - let bodyText = ''; - if (body instanceof FormData) { - let obj = {}; - for (let [key, value] of body.entries()) obj[key] = value; - bodyText = JSON.stringify(obj); - } else if (typeof body === 'string') { - bodyText = body; - } - - const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); - if (shouldBlock) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } - // If not blocking — continue to the original fetch - } + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); } // === Metform === diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 84d115147..db3233681 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -1806,6 +1806,184 @@ if (!Object.prototype.hasOwn) { }); } +/** + * Callbacks for ShadowRoot integrations + */ +const ApbctShadowRootCallbacks = { + /** + * Mailchimp block callback - clears localStorage by mcforms mask + * @param {object} result + */ + mailchimpBlock: function(result) { + try { + for (let i = localStorage.length - 1; i >= 0; i--) { + const key = localStorage.key(i); + if (key && key.indexOf('mcforms') !== -1) { + localStorage.removeItem(key); + } + } + } catch (e) { + console.warn('Error clearing localStorage by mcforms mask:', e); + } + }, + + // /** + // * Next integration block callback + // * @param {object} result + // */ + // nextIntegrationBlock: function(result) { + // // Custom logic + // }, +}; +/** + * Config for ShadowRoot integrations + */ +const ApbctShadowRootConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + callbackAllow: false, + callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + }, +}; +/** + * Class for handling ShadowRoot forms + */ +class ApbctShadowRootProtection { + constructor() { + this.config = ApbctShadowRootConfig; + } + + /** + * Find matching config for URL + * @param {string} url + * @return {object|null} { formKey, config } or null + */ + findMatchingConfig(url) { + for (const [formKey, config] of Object.entries(this.config)) { + // Shadowroot can send both external and internal requests + // If the form is external, then we check whether the setting is enabled. + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + return {formKey, config}; + } + } + return null; + } + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey + * @param {object} config + * @param {string} bodyText + * @return {Promise} true = block, false = allow + */ + async checkRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + let data = { + action: config.action, + }; + + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + data.raw_body = bodyText; + } + + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX(data, { + async: true, + callback: (result) => { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + if (typeof config.callbackAllow === 'function') { + config.callbackAllow(result); + } + resolve(false); + return; + } + + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + if (typeof config.callbackBlock === 'function') { + config.callbackBlock(result); + } + resolve(true); + return; + } + + resolve(false); + }, + onErrorCallback: (error) => { + console.log('APBCT ShadowRoot check error:', error); + resolve(false); + }, + }); + }); + } + + /** + * Extract body text from fetch args + * @param {array} args + * @return {string} + */ + extractBodyText(args) { + let body = args[1] && args[1].body; + let bodyText = ''; + + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) { + obj[key] = value; + } + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; + } + + return bodyText; + } + + /** + * Process fetch request for ShadowRoot forms + * @param {array} args - fetch arguments + * @return {Promise} true = block, false = allow, null = not matched + */ + async processFetch(args) { + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); + const match = this.findMatchingConfig(url); + + if (!match) { + return null; + } + + const bodyText = this.extractBodyText(args); + return await this.checkRequest(match.formKey, match.config, bodyText); + } +} /** * Set init params */ @@ -2995,89 +3173,9 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const apbctShadowRootFormsConfig = { - 'mailchimp': { - selector: '.mcforms-wrapper', - urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', - externalForm: true, - action: 'cleantalk_force_mailchimp_shadowroot_check', - }, - }; - + const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - /** - * Check ShadowRoot form request via CleanTalk AJAX - * @param {string} formKey - The form key from config (e.g., 'mailchimp') - * @param {object} config - The form config object with action, selector, etc. - * @param {string} bodyText - The request body as string - * @return {Promise} - true = block, false = allow - */ - async function apbctCheckShadowRootRequest(formKey, config, bodyText) { - return new Promise((resolve) => { - // Prepare data for AJAX request - let data = { - action: config.action, - }; - - // Parse bodyText and add form fields - try { - const bodyObj = JSON.parse(bodyText); - for (const [key, value] of Object.entries(bodyObj)) { - data[key] = value; - } - } catch (e) { - // If parsing fails, send raw body - data.raw_body = bodyText; - } - - // Add event token or no_cookie data - if (+ctPublic.settings__data__bot_detector_enabled) { - const eventToken = new ApbctHandler().toolGetEventToken(); - if (eventToken) { - data.ct_bot_detector_event_token = eventToken; - } - } else { - data.ct_no_cookie_hidden_field = getNoCookieData(); - } - - apbct_public_sendAJAX( - data, - { - async: true, - callback: function(result) { - // Allowed - if ( - (result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && !+result.apbct.blocked) - ) { - resolve(false); // false = allow - return; - } - - // Blocked - if ( - (result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - new ApbctShowForbidden().parseBlockMessage(result); - resolve(true); // true = block - return; - } - - // Default: allow - resolve(false); - }, - onErrorCallback: function(error) { - console.log('APBCT ShadowRoot check error:', error); - // On error, allow the request to proceed - resolve(false); - }, - }, - ); - }); - } - /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -3136,30 +3234,10 @@ class ApbctHandler { let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === - for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { - if ( - (!config.externalForm || +ctPublic.settings__forms__check_external) && - document.querySelectorAll(config.selector).length > 0 && - url && url.includes(config.urlPattern) - ) { - // Get request body - let body = args[1] && args[1].body; - let bodyText = ''; - if (body instanceof FormData) { - let obj = {}; - for (let [key, value] of body.entries()) obj[key] = value; - bodyText = JSON.stringify(obj); - } else if (typeof body === 'string') { - bodyText = body; - } - - const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); - if (shouldBlock) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } - // If not blocking — continue to the original fetch - } + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); } // === Metform === diff --git a/js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js b/js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js new file mode 100644 index 000000000..7ab87608d --- /dev/null +++ b/js/src/ShadowrootProtection/ApbctShadowRootCallbacks.js @@ -0,0 +1,29 @@ +/** + * Callbacks for ShadowRoot integrations + */ +const ApbctShadowRootCallbacks = { + /** + * Mailchimp block callback - clears localStorage by mcforms mask + * @param {object} result + */ + mailchimpBlock: function(result) { + try { + for (let i = localStorage.length - 1; i >= 0; i--) { + const key = localStorage.key(i); + if (key && key.indexOf('mcforms') !== -1) { + localStorage.removeItem(key); + } + } + } catch (e) { + console.warn('Error clearing localStorage by mcforms mask:', e); + } + }, + + // /** + // * Next integration block callback + // * @param {object} result + // */ + // nextIntegrationBlock: function(result) { + // // Custom logic + // }, +}; \ No newline at end of file diff --git a/js/src/ShadowrootProtection/ApbctShadowRootConfig.js b/js/src/ShadowrootProtection/ApbctShadowRootConfig.js new file mode 100644 index 000000000..4155a2f90 --- /dev/null +++ b/js/src/ShadowrootProtection/ApbctShadowRootConfig.js @@ -0,0 +1,13 @@ +/** + * Config for ShadowRoot integrations + */ +const ApbctShadowRootConfig = { + 'mailchimp': { + selector: '.mcforms-wrapper', + urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', + externalForm: true, + action: 'cleantalk_force_mailchimp_shadowroot_check', + callbackAllow: false, + callbackBlock: ApbctShadowRootCallbacks.mailchimpBlock, + }, +}; \ No newline at end of file diff --git a/js/src/ShadowrootProtection/ApbctShadowRootProtection.js b/js/src/ShadowrootProtection/ApbctShadowRootProtection.js new file mode 100644 index 000000000..c42b9c18b --- /dev/null +++ b/js/src/ShadowrootProtection/ApbctShadowRootProtection.js @@ -0,0 +1,136 @@ +/** + * Class for handling ShadowRoot forms + */ +class ApbctShadowRootProtection { + constructor() { + this.config = ApbctShadowRootConfig; + } + + /** + * Find matching config for URL + * @param {string} url + * @return {object|null} { formKey, config } or null + */ + findMatchingConfig(url) { + for (const [formKey, config] of Object.entries(this.config)) { + // Shadowroot can send both external and internal requests + // If the form is external, then we check whether the setting is enabled. + if ( + (!config.externalForm || +ctPublic.settings__forms__check_external) && + document.querySelectorAll(config.selector).length > 0 && + url && url.includes(config.urlPattern) + ) { + return {formKey, config}; + } + } + return null; + } + + /** + * Check ShadowRoot form request via CleanTalk AJAX + * @param {string} formKey + * @param {object} config + * @param {string} bodyText + * @return {Promise} true = block, false = allow + */ + async checkRequest(formKey, config, bodyText) { + return new Promise((resolve) => { + let data = { + action: config.action, + }; + + try { + const bodyObj = JSON.parse(bodyText); + for (const [key, value] of Object.entries(bodyObj)) { + data[key] = value; + } + } catch (e) { + data.raw_body = bodyText; + } + + if (+ctPublic.settings__data__bot_detector_enabled) { + const eventToken = new ApbctHandler().toolGetEventToken(); + if (eventToken) { + data.ct_bot_detector_event_token = eventToken; + } + } else { + data.ct_no_cookie_hidden_field = getNoCookieData(); + } + + apbct_public_sendAJAX(data, { + async: true, + callback: (result) => { + // Allowed + if ( + (result.apbct === undefined && result.data === undefined) || + (result.apbct !== undefined && !+result.apbct.blocked) + ) { + if (typeof config.callbackAllow === 'function') { + config.callbackAllow(result); + } + resolve(false); + return; + } + + // Blocked + if ( + (result.apbct !== undefined && +result.apbct.blocked) || + (result.data !== undefined && result.data.message !== undefined) + ) { + new ApbctShowForbidden().parseBlockMessage(result); + if (typeof config.callbackBlock === 'function') { + config.callbackBlock(result); + } + resolve(true); + return; + } + + resolve(false); + }, + onErrorCallback: (error) => { + console.log('APBCT ShadowRoot check error:', error); + resolve(false); + }, + }); + }); + } + + /** + * Extract body text from fetch args + * @param {array} args + * @return {string} + */ + extractBodyText(args) { + let body = args[1] && args[1].body; + let bodyText = ''; + + if (body instanceof FormData) { + let obj = {}; + for (let [key, value] of body.entries()) { + obj[key] = value; + } + bodyText = JSON.stringify(obj); + } else if (typeof body === 'string') { + bodyText = body; + } + + return bodyText; + } + + /** + * Process fetch request for ShadowRoot forms + * @param {array} args - fetch arguments + * @return {Promise} true = block, false = allow, null = not matched + */ + async processFetch(args) { + const url = typeof args[0] === 'string' ? args[0] : (args[0]?.url || ''); + const match = this.findMatchingConfig(url); + + if (!match) { + return null; + } + + 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/public-1-main.js b/js/src/public-1-main.js index 7aacfb5bb..d3cfdccb5 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -653,89 +653,9 @@ class ApbctHandler { * @return {void} */ catchFetchRequest() { - const apbctShadowRootFormsConfig = { - 'mailchimp': { - selector: '.mcforms-wrapper', - urlPattern: 'mcf-integrations-mcmktg.mlchmpcompprduse2.iks2.a.intuit.com/gateway/receive', - externalForm: true, - action: 'cleantalk_force_mailchimp_shadowroot_check', - }, - }; - + const shadowRootProtection = new ApbctShadowRootProtection(); let preventOriginalFetch = false; - /** - * Check ShadowRoot form request via CleanTalk AJAX - * @param {string} formKey - The form key from config (e.g., 'mailchimp') - * @param {object} config - The form config object with action, selector, etc. - * @param {string} bodyText - The request body as string - * @return {Promise} - true = block, false = allow - */ - async function apbctCheckShadowRootRequest(formKey, config, bodyText) { - return new Promise((resolve) => { - // Prepare data for AJAX request - let data = { - action: config.action, - }; - - // Parse bodyText and add form fields - try { - const bodyObj = JSON.parse(bodyText); - for (const [key, value] of Object.entries(bodyObj)) { - data[key] = value; - } - } catch (e) { - // If parsing fails, send raw body - data.raw_body = bodyText; - } - - // Add event token or no_cookie data - if (+ctPublic.settings__data__bot_detector_enabled) { - const eventToken = new ApbctHandler().toolGetEventToken(); - if (eventToken) { - data.ct_bot_detector_event_token = eventToken; - } - } else { - data.ct_no_cookie_hidden_field = getNoCookieData(); - } - - apbct_public_sendAJAX( - data, - { - async: true, - callback: function(result) { - // Allowed - if ( - (result.apbct === undefined && result.data === undefined) || - (result.apbct !== undefined && !+result.apbct.blocked) - ) { - resolve(false); // false = allow - return; - } - - // Blocked - if ( - (result.apbct !== undefined && +result.apbct.blocked) || - (result.data !== undefined && result.data.message !== undefined) - ) { - new ApbctShowForbidden().parseBlockMessage(result); - resolve(true); // true = block - return; - } - - // Default: allow - resolve(false); - }, - onErrorCallback: function(error) { - console.log('APBCT ShadowRoot check error:', error); - // On error, allow the request to proceed - resolve(false); - }, - }, - ); - }); - } - /** * Select key/value pair depending on botDetectorEnabled flag * @param {bool} botDetectorEnabled @@ -794,30 +714,10 @@ class ApbctHandler { let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); // === ShadowRoot forms === - for (const [formKey, config] of Object.entries(apbctShadowRootFormsConfig)) { - if ( - (!config.externalForm || +ctPublic.settings__forms__check_external) && - document.querySelectorAll(config.selector).length > 0 && - url && url.includes(config.urlPattern) - ) { - // Get request body - let body = args[1] && args[1].body; - let bodyText = ''; - if (body instanceof FormData) { - let obj = {}; - for (let [key, value] of body.entries()) obj[key] = value; - bodyText = JSON.stringify(obj); - } else if (typeof body === 'string') { - bodyText = body; - } - - const shouldBlock = await apbctCheckShadowRootRequest(formKey, config, bodyText); - if (shouldBlock) { - // Return a "blank" response that never completes - return new Promise(() => {}); - } - // If not blocking — continue to the original fetch - } + const shadowRootResult = await shadowRootProtection.processFetch(args); + if (shadowRootResult === true) { + // Return a "blank" response that never completes + return new Promise(() => {}); } // === Metform === From d99d984c9d348a1b3f5fedc2d0fa6e3c833b1f75 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 4 Feb 2026 16:27:04 +0700 Subject: [PATCH 13/60] ESLint fix --- js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- js/apbct-public-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- js/apbct-public-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- js/apbct-public-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 2 -- js/prebuild/apbct-public-bundle_ext-protection.js | 2 -- js/prebuild/apbct-public-bundle_ext-protection_gathering.js | 2 -- js/prebuild/apbct-public-bundle_full-protection.js | 2 -- js/prebuild/apbct-public-bundle_full-protection_gathering.js | 2 -- js/prebuild/apbct-public-bundle_gathering.js | 2 -- js/prebuild/apbct-public-bundle_int-protection.js | 2 -- js/prebuild/apbct-public-bundle_int-protection_gathering.js | 2 -- js/src/public-1-main.js | 2 -- 17 files changed, 8 insertions(+), 26 deletions(-) diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index d9cb2df46..873bbc26f 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=11,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,n));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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 1f494cc43..f3667dc3e 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=11,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,n));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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 bcadcd7b5..4c902a88b 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=11,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,n));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 597e98945..c6b99793c 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=11,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,n));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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 diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index 50c226f47..ddb18be4a 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 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=11,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,o));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 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 +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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=10,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,o));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 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 afc9612a1..fed39bb80 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=11,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,o));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=10,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,o));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 2161564b4..f60257ae2 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=11,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,n));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index ec0f6ccda..b48139ccf 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=11,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=18):e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(11),e.abrupt("return",defaultFetch.apply(window,o));case 18: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=10,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,o));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index d60ba5c2b..7ee2dfe91 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -3231,8 +3231,6 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); - // === ShadowRoot forms === const shadowRootResult = await shadowRootProtection.processFetch(args); if (shadowRootResult === true) { diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index 3be9c3a20..5ffe8be70 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -3231,8 +3231,6 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); - // === ShadowRoot forms === const shadowRootResult = await shadowRootProtection.processFetch(args); if (shadowRootResult === true) { diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index 091ee8ab6..e5455b97a 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -3231,8 +3231,6 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); - // === ShadowRoot forms === const shadowRootResult = await shadowRootProtection.processFetch(args); if (shadowRootResult === true) { diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index ed0758747..345c62c40 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -3231,8 +3231,6 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); - // === ShadowRoot forms === const shadowRootResult = await shadowRootProtection.processFetch(args); if (shadowRootResult === true) { diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 0a627b503..9fa6f2980 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -3231,8 +3231,6 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); - // === ShadowRoot forms === const shadowRootResult = await shadowRootProtection.processFetch(args); if (shadowRootResult === true) { diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index bd8f9809a..705dfd0bc 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -3231,8 +3231,6 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); - // === ShadowRoot forms === const shadowRootResult = await shadowRootProtection.processFetch(args); if (shadowRootResult === true) { diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index d95ad657d..65602cf99 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -3231,8 +3231,6 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); - // === ShadowRoot forms === const shadowRootResult = await shadowRootProtection.processFetch(args); if (shadowRootResult === true) { diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 10394c7d8..abd654213 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -3231,8 +3231,6 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); - // === ShadowRoot forms === const shadowRootResult = await shadowRootProtection.processFetch(args); if (shadowRootResult === true) { diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index a95a29254..555d0965e 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -711,8 +711,6 @@ class ApbctHandler { return defaultFetch.apply(window, args); } - let url = typeof args[0] === 'string' ? args[0] : (args[0] && args[0].url ? args[0].url : ''); - // === ShadowRoot forms === const shadowRootResult = await shadowRootProtection.processFetch(args); if (shadowRootResult === true) { From 62ec39ed2696925fbffb50599d746a8645e06632 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 4 Feb 2026 16:47:49 +0700 Subject: [PATCH 14/60] New. Tests. Test TestMailChimpShadowRoot --- .../TestMailChimpShadowRoot.php | 290 ++++++++++++++++++ 1 file changed, 290 insertions(+) create mode 100644 tests/Antispam/IntegrationsByHook/TestMailChimpShadowRoot.php diff --git a/tests/Antispam/IntegrationsByHook/TestMailChimpShadowRoot.php b/tests/Antispam/IntegrationsByHook/TestMailChimpShadowRoot.php new file mode 100644 index 000000000..8c97f0c14 --- /dev/null +++ b/tests/Antispam/IntegrationsByHook/TestMailChimpShadowRoot.php @@ -0,0 +1,290 @@ +integration = new MailChimpShadowRoot(); + } + + protected function tearDown(): void + { + global $apbct; + unset($apbct); + $_POST = []; + Post::getInstance()->variables = []; + parent::tearDown(); + } + + /** + * Test with valid email data + */ + public function testGetDataForCheckingWithValidEmail() + { + $_POST['email'] = 'test@example.com'; + $_POST['firstName'] = 'John'; + $_POST['lastName'] = 'Doe'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + $this->assertArrayHasKey('email', $result); + $this->assertEquals('test@example.com', $result['email']); + } + + /** + * Test with empty POST data + */ + public function testGetDataForCheckingWithEmptyPost() + { + $_POST = []; + + $result = $this->integration->getDataForChecking(null); + + $this->assertNull($result); + } + + /** + * Test with only email field + */ + public function testGetDataForCheckingWithOnlyEmail() + { + $_POST['email'] = 'subscriber@example.com'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + $this->assertArrayHasKey('email', $result); + } + + /** + * Test with special characters in data + */ + public function testGetDataForCheckingWithSpecialCharacters() + { + $_POST['email'] = 'test+tag@example.com'; + $_POST['firstName'] = "O'Brien"; + $_POST['lastName'] = 'Müller-Schmidt'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + $this->assertEquals('test+tag@example.com', $result['email']); + } + + /** + * Test with raw_body field (when JSON parsing fails on JS side) + */ + public function testGetDataForCheckingWithRawBody() + { + $_POST['raw_body'] = 'email=raw@example.com&name=Test'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with Mailchimp typical fields + */ + public function testGetDataForCheckingWithMailchimpFields() + { + $_POST['email'] = 'mailchimp@example.com'; + $_POST['FNAME'] = 'First'; + $_POST['LNAME'] = 'Last'; + $_POST['PHONE'] = '+1234567890'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + $this->assertArrayHasKey('email', $result); + } + + /** + * Test with bot detector token + */ + public function testGetDataForCheckingWithBotDetectorToken() + { + $_POST['email'] = 'bot-detector@example.com'; + $_POST['ct_bot_detector_event_token'] = 'test-token-123'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with no cookie hidden field + */ + public function testGetDataForCheckingWithNoCookieField() + { + $_POST['email'] = 'no-cookie@example.com'; + $_POST['ct_no_cookie_hidden_field'] = 'encoded-data'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with empty email + */ + public function testGetDataForCheckingWithEmptyEmail() + { + $_POST['email'] = ''; + $_POST['firstName'] = 'Test'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with invalid email format + */ + public function testGetDataForCheckingWithInvalidEmailFormat() + { + $_POST['email'] = 'not-an-email'; + $_POST['firstName'] = 'Test'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with multiple email fields (Mailchimp forms may have different field names) + */ + public function testGetDataForCheckingWithMultipleEmailFields() + { + $_POST['email'] = 'primary@example.com'; + $_POST['EMAIL'] = 'secondary@example.com'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + $this->assertArrayHasKey('email', $result); + } + + /** + * Test with whitespace in data + */ + public function testGetDataForCheckingWithWhitespace() + { + $_POST['email'] = ' whitespace@example.com '; + $_POST['firstName'] = ' John '; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with unicode characters + */ + public function testGetDataForCheckingWithUnicodeCharacters() + { + $_POST['email'] = 'unicode@example.com'; + $_POST['firstName'] = '日本語'; + $_POST['lastName'] = 'Кириллица'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with very long field values + */ + public function testGetDataForCheckingWithLongValues() + { + $_POST['email'] = 'long@example.com'; + $_POST['firstName'] = str_repeat('a', 1000); + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with numeric field values + */ + public function testGetDataForCheckingWithNumericValues() + { + $_POST['email'] = 'numeric@example.com'; + $_POST['phone'] = 1234567890; + $_POST['zip'] = 12345; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with array values in POST + */ + public function testGetDataForCheckingWithArrayValues() + { + $_POST['email'] = 'array@example.com'; + $_POST['interests'] = ['option1', 'option2']; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with no_cookie_data_taken flag already set + */ + public function testGetDataForCheckingWithNoCookieDataAlreadyTaken() + { + global $apbct; + $apbct->stats['no_cookie_data_taken'] = true; + + $_POST['email'] = 'already-taken@example.com'; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with XSS attempt in data + */ + public function testGetDataForCheckingWithXssAttempt() + { + $_POST['email'] = 'xss@example.com'; + $_POST['firstName'] = ''; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } + + /** + * Test with SQL injection attempt in data + */ + public function testGetDataForCheckingWithSqlInjectionAttempt() + { + $_POST['email'] = 'sql@example.com'; + $_POST['firstName'] = "'; DROP TABLE users; --"; + + $result = $this->integration->getDataForChecking(null); + + $this->assertIsArray($result); + } +} \ No newline at end of file From 8fde59074d59d7fede4af88e75300160db746f8b Mon Sep 17 00:00:00 2001 From: Glomberg Date: Thu, 5 Feb 2026 14:08:46 +0300 Subject: [PATCH 15/60] Version: 6.72.99-dev. --- cleantalk.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleantalk.php b/cleantalk.php index f6d2b86af..f17bb4b25 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.72 + Version: 6.72.99-dev Author: CleanTalk - Anti-Spam Protection Author URI: https://cleantalk.org Text Domain: cleantalk-spam-protect From 0e32e8dac6055c1450344220256a8c053cb15f53 Mon Sep 17 00:00:00 2001 From: Glomberg Date: Thu, 5 Feb 2026 14:09:34 +0300 Subject: [PATCH 16/60] Version: 6.72.99-fix. --- cleantalk.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleantalk.php b/cleantalk.php index f6d2b86af..8d0b08beb 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.72 + Version: 6.72.99-fix Author: CleanTalk - Anti-Spam Protection Author URI: https://cleantalk.org Text Domain: cleantalk-spam-protect From bb7ca8dd257835f676f1bf2f846ffb7c0e460cbe Mon Sep 17 00:00:00 2001 From: alexandergull Date: Thu, 5 Feb 2026 16:30:16 +0500 Subject: [PATCH 17/60] Fix. Integration. Ninja forms. Filter NF common fields before processing. --- .../Antispam/Integrations/NinjaForms.php | 15 ++++++-- .../IntegrationsByHook/TestNinjaForms.php | 34 +++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/lib/Cleantalk/Antispam/Integrations/NinjaForms.php b/lib/Cleantalk/Antispam/Integrations/NinjaForms.php index e284d9746..8d0acba4c 100644 --- a/lib/Cleantalk/Antispam/Integrations/NinjaForms.php +++ b/lib/Cleantalk/Antispam/Integrations/NinjaForms.php @@ -184,18 +184,27 @@ public function getGFANew(): GetFieldsAnyDTO if ( ! $form_data ) { $form_data = json_decode(stripslashes(TT::toString(Post::get('formData'))), true); } - if ( ! isset($form_data['fields']) ) { + + if ( ! isset($form_data['fields'])) { throw new \Exception('No form data is provided'); } + + $form_id = $form_data['id'] ?? null; + if ( ! $form_id ) { + throw new \Exception('No form id provided'); + } + if ( ! function_exists('Ninja_Forms') ) { throw new \Exception('No `Ninja_Forms` class exists'); } - $nf_form_info = Ninja_Forms()->form(); + + $nf_form_info = Ninja_Forms()->form($form_id); + if (!class_exists('\NF_Abstracts_ModelFactory') || ! ($nf_form_info instanceof \NF_Abstracts_ModelFactory) ) { throw new \Exception('Getting NF form failed'); } $nf_form_fields_info = $nf_form_info->get_fields(); - if ( ! is_array($nf_form_fields_info) && count($nf_form_fields_info) === 0 ) { + if ( ! is_array($nf_form_fields_info) || count($nf_form_fields_info) === 0 ) { throw new \Exception('No fields are provided'); } $nf_form_fields_info_array = []; diff --git a/tests/Antispam/IntegrationsByHook/TestNinjaForms.php b/tests/Antispam/IntegrationsByHook/TestNinjaForms.php index 9ec74f0f5..27ff679ca 100644 --- a/tests/Antispam/IntegrationsByHook/TestNinjaForms.php +++ b/tests/Antispam/IntegrationsByHook/TestNinjaForms.php @@ -166,4 +166,38 @@ public function testXmlFieldsAreRemoved() // Assert $this->assertArrayNotHasKey('nf-field-1-', $result['message']); } + + public function testNoFormID() + { + + Post::getInstance()->variables = []; + // Arrange + $_POST['formData'] = json_encode(['fields' => [ + ['id' => 1, 'value' => 'malicious'], + ]]); + + $this->expectException(\Exception::class); + $this->expectExceptionMessage('No form id provided'); + // Act + $result = $this->ninjaForms->getGFANew(); + + // Assert + $this->assertNotNull('nf-field-1-', $result['message']); + } + + public function testNoFormData() + { + + Post::getInstance()->variables = []; + // Arrange + $_POST['formData'] = json_encode(['id' => 1]); + + $this->expectException(\Exception::class); + $this->expectExceptionMessage('No form data is provided'); + // Act + $result = $this->ninjaForms->getGFANew(); + + // Assert + $this->assertNotNull('nf-field-1-', $result['message']); + } } From 22510228433b2489ff94632663fcfa96bd0a9d37 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Thu, 5 Feb 2026 23:27:47 +0500 Subject: [PATCH 18/60] Fix. Exclusions. "woocommerce-abandoned-cart" --- inc/cleantalk-pluggable.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/cleantalk-pluggable.php b/inc/cleantalk-pluggable.php index 23ceef5d9..ce17e8ac1 100644 --- a/inc/cleantalk-pluggable.php +++ b/inc/cleantalk-pluggable.php @@ -1675,6 +1675,14 @@ class_exists('Cleantalk\Antispam\Integrations\CleantalkInternalForms') ) { return 'spoki_abandoned_card_for_woocommerce'; } + + //https://wordpress.org/plugins/woocommerce-abandoned-cart/ + if ( + apbct_is_plugin_active('woocommerce-abandoned-cart\woocommerce-ac.php') && + Post::equal('action', 'save_data') + ) { + return 'woocommerce-abandoned-cart'; + } } else { /*****************************************/ /* Here is non-ajax requests skipping */ From dda9b0828269e81d03c5059e6bae6f0026433783 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Thu, 5 Feb 2026 23:28:04 +0500 Subject: [PATCH 19/60] Fix. Exclusions. "woo-abandoned-cart-recovery" --- inc/cleantalk-pluggable.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/cleantalk-pluggable.php b/inc/cleantalk-pluggable.php index ce17e8ac1..bfffa970b 100644 --- a/inc/cleantalk-pluggable.php +++ b/inc/cleantalk-pluggable.php @@ -1683,6 +1683,14 @@ class_exists('Cleantalk\Antispam\Integrations\CleantalkInternalForms') ) { return 'woocommerce-abandoned-cart'; } + + //https://wordpress.org/plugins/woo-abandoned-cart-recovery/ + if ( + apbct_is_plugin_active('woo-abandoned-cart-recovery/woo-abandoned-cart-recovery.php') && + Post::equal('action', 'wacv_get_info ') + ) { + return 'woo-abandoned-cart-recovery'; + } } else { /*****************************************/ /* Here is non-ajax requests skipping */ From b1c993827d8905dcd302bf80fd45b890b3c4fa90 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Thu, 5 Feb 2026 23:28:15 +0500 Subject: [PATCH 20/60] Fix. Exclusions. "abandoned-cart-capture" --- inc/cleantalk-pluggable.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/cleantalk-pluggable.php b/inc/cleantalk-pluggable.php index bfffa970b..2e4311fb8 100644 --- a/inc/cleantalk-pluggable.php +++ b/inc/cleantalk-pluggable.php @@ -1691,6 +1691,14 @@ class_exists('Cleantalk\Antispam\Integrations\CleantalkInternalForms') ) { return 'woo-abandoned-cart-recovery'; } + + //unknown wc plugin from https://app.doboard.com/1/task/41205 + if ( + apbct_is_plugin_active('abandoned-cart-capture/abandoned-cart-capture.php') && + Post::equal('action', 'acc_save_data') + ) { + return 'abandoned-cart-capture'; + } } else { /*****************************************/ /* Here is non-ajax requests skipping */ From b717fa3c57785bbf1e4fd30ce2a80b5a5d3b0c8a Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Fri, 6 Feb 2026 18:27:22 +0700 Subject: [PATCH 21/60] Fix. Code. Returned the lost code during the merge --- js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- ...lic-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- ...ic-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- ...lic-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 228 +++++++++++++++++- .../apbct-public-bundle_ext-protection.js | 228 +++++++++++++++++- ...-public-bundle_ext-protection_gathering.js | 228 +++++++++++++++++- .../apbct-public-bundle_full-protection.js | 228 +++++++++++++++++- ...public-bundle_full-protection_gathering.js | 228 +++++++++++++++++- js/prebuild/apbct-public-bundle_gathering.js | 228 +++++++++++++++++- .../apbct-public-bundle_int-protection.js | 228 +++++++++++++++++- ...-public-bundle_int-protection_gathering.js | 228 +++++++++++++++++- js/src/public-1-main.js | 228 +++++++++++++++++- 17 files changed, 2033 insertions(+), 35 deletions(-) diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index 873bbc26f..e1aeeba5f 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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 f3667dc3e..bc301c35f 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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_gathering.min.js b/js/apbct-public-bundle_ext-protection_gathering.min.js index 4c902a88b..58230ee0c 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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 0309743f7..bcc1b12f6 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n_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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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 diff --git a/js/apbct-public-bundle_full-protection_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index 6db338872..60e74847b 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 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=10,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,o));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 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 +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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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 diff --git a/js/apbct-public-bundle_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index fed39bb80..870c14d51 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=10,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,o));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=10,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,o));case 17: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 a5907d115..379ce84a0 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||"undefined"==typeof ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var n=0;n .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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index 7e82e2b94..a956e7e04 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=10,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,o));case 17: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")}}]))();function apbct_ready(){(new ApbctShowForbidden).prepareBlockForAjaxForms();var e,t,a=new ApbctHandler;if(a.detectForcedAltCookiesForms(),+ctPublic.settings__data__bot_detector_enabled||void 0===ApbctGatheringData||((e=new ApbctGatheringData).setSessionId(),e.writeReferrersToSessionStorage(),e.setCookiesType(),e.startFieldsListening(),e.listenAutocomplete(),e.gatheringTypoData()),"function"==typeof initParams)try{initParams()}catch(e){console.log("initParams error:",e)}setTimeout(function(){+ctPublic.settings__data__bot_detector_enabled&&((e=new ApbctEventTokenTransport).attachEventTokenToMultipageGravityForms(),e.attachEventTokenToWoocommerceGetRequestAddToCart());var e,t=new ApbctAttachData;+ctPublic.settings__data__bot_detector_enabled||t.attachHiddenFieldsToForms();for(var o=0;o_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 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 7ee2dfe91..77060130a 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -3373,6 +3373,7 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, + 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3385,6 +3386,7 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; + sourceSign.attachVisibleFieldsData = true; } if ( @@ -3422,6 +3424,7 @@ class ApbctHandler { ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; + sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3433,6 +3436,7 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; + let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3451,7 +3455,26 @@ class ApbctHandler { } } - settings.data = noCookieData + eventToken + settings.data; + if (sourceSign.attachVisibleFieldsData) { + let visibleFieldsSearchResult = false; + + const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); + if (extractor) { // Check if extractor was created + visibleFieldsSearchResult = extractor.extract(settings.data); + } + + if (typeof visibleFieldsSearchResult === 'string') { + let encoded = null; + try { + encoded = encodeURIComponent(visibleFieldsSearchResult); + visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; + } catch (e) { + // do nothing + } + } + } + + settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; } }, }); @@ -3464,8 +3487,13 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if (typeof options !== 'object' || options === null || - !options.hasOwnProperty('data') || !options.hasOwnProperty('path') + if ( + typeof options !== 'object' || + options === null || + !options.hasOwnProperty('data') || + typeof options.data === 'undefined' || + !options.hasOwnProperty('path') || + typeof options.path === 'undefined' ) { return next(options); } @@ -3742,6 +3770,200 @@ class ApbctShowForbidden { } } +/** + * Base class for extracting visible fields from form plugins + */ +class ApbctVisibleFieldsExtractor { + /** + * Factory method to create appropriate extractor instance + * @param {string} sourceSignAction - Action identifier + * @return {ApbctVisibleFieldsExtractor|null} + */ + static createExtractor(sourceSignAction) { + switch (sourceSignAction) { + case 'action=nf_ajax_submit': + return new ApbctNinjaFormsVisibleFields(); + case 'action=mailpoet': + return new ApbctMailpoetVisibleFields(); + default: + return null; + } + } + /** + * Extracts visible fields string from form AJAX data + * @param {string} ajaxData - AJAX form data + * @return {string|false} Visible fields value or false if not found + */ + extract(ajaxData) { + if (!ajaxData || typeof ajaxData !== 'string') { + return false; + } + + try { + ajaxData = decodeURIComponent(ajaxData); + } catch (e) { + return false; + } + + const forms = document.querySelectorAll('form'); + const formIdFromAjax = this.getIdFromAjax(ajaxData); + if (!formIdFromAjax) { + return false; + } + + for (let form of forms) { + const container = this.findParentContainer(form); + if (!container) { + continue; + } + + const formIdFromHtml = this.getIdFromHTML(container); + if (formIdFromHtml !== formIdFromAjax) { + continue; + } + + const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); + if (visibleFields?.value) { + return visibleFields.value; + } + } + + return false; + } + + /** + * Override in child classes to define specific extraction patterns + * @param {string} ajaxData - Decoded AJAX data string + * @return {number|null} Form ID or null if not found + */ + getIdFromAjax(ajaxData) { + console.warn('getIdFromAjax must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define container search logic + * @param {HTMLElement} form - Form element to start search from + * @return {HTMLElement|null} Container element or null + */ + findParentContainer(form) { + console.warn('findParentContainer must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define ID extraction from HTML + * @param {HTMLElement} container - Container element + * @return {number|null} Form ID or null if not found + */ + getIdFromHTML(container) { + console.warn('getIdFromHTML must be implemented by child class'); + return null; + } +} + +/** + * Ninja Forms specific implementation + */ +class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} + /form_id\s*[:\s]*"?(\d+)"/, + /nf-form-(\d+)/, + /"id":(\d+)/, // Fallback for simple cases + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + let el = form; + while (el && el !== document.body) { + if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { + return el; + } + el = el.parentElement; + } + return null; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + const match = container.id.match(/^nf-form-(\d+)-cont$/); + return match ? parseInt(match[1], 10) : null; + } +} + +/** + * Mailpoet specific implementation + */ +class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /form_id\s*[:\s]*"?(\d+)"/, + /data\[form_id\]=(\d+)/, + /form_id=(\d+)/, + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + // Mailpoet uses the form itself as container + return form; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + if (!container.action) { + return null; + } + + const formMatch = container.action.match(/mailpoet_subscription_form/); + if (!formMatch) { + return null; + } + + const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); + if (!hiddenFieldWithID || !hiddenFieldWithID.value) { + return null; + } + + return parseInt(hiddenFieldWithID.value, 10); + } +} + /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index 5ffe8be70..0cf4eb990 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -3373,6 +3373,7 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, + 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3385,6 +3386,7 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; + sourceSign.attachVisibleFieldsData = true; } if ( @@ -3422,6 +3424,7 @@ class ApbctHandler { ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; + sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3433,6 +3436,7 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; + let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3451,7 +3455,26 @@ class ApbctHandler { } } - settings.data = noCookieData + eventToken + settings.data; + if (sourceSign.attachVisibleFieldsData) { + let visibleFieldsSearchResult = false; + + const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); + if (extractor) { // Check if extractor was created + visibleFieldsSearchResult = extractor.extract(settings.data); + } + + if (typeof visibleFieldsSearchResult === 'string') { + let encoded = null; + try { + encoded = encodeURIComponent(visibleFieldsSearchResult); + visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; + } catch (e) { + // do nothing + } + } + } + + settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; } }, }); @@ -3464,8 +3487,13 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if (typeof options !== 'object' || options === null || - !options.hasOwnProperty('data') || !options.hasOwnProperty('path') + if ( + typeof options !== 'object' || + options === null || + !options.hasOwnProperty('data') || + typeof options.data === 'undefined' || + !options.hasOwnProperty('path') || + typeof options.path === 'undefined' ) { return next(options); } @@ -3742,6 +3770,200 @@ class ApbctShowForbidden { } } +/** + * Base class for extracting visible fields from form plugins + */ +class ApbctVisibleFieldsExtractor { + /** + * Factory method to create appropriate extractor instance + * @param {string} sourceSignAction - Action identifier + * @return {ApbctVisibleFieldsExtractor|null} + */ + static createExtractor(sourceSignAction) { + switch (sourceSignAction) { + case 'action=nf_ajax_submit': + return new ApbctNinjaFormsVisibleFields(); + case 'action=mailpoet': + return new ApbctMailpoetVisibleFields(); + default: + return null; + } + } + /** + * Extracts visible fields string from form AJAX data + * @param {string} ajaxData - AJAX form data + * @return {string|false} Visible fields value or false if not found + */ + extract(ajaxData) { + if (!ajaxData || typeof ajaxData !== 'string') { + return false; + } + + try { + ajaxData = decodeURIComponent(ajaxData); + } catch (e) { + return false; + } + + const forms = document.querySelectorAll('form'); + const formIdFromAjax = this.getIdFromAjax(ajaxData); + if (!formIdFromAjax) { + return false; + } + + for (let form of forms) { + const container = this.findParentContainer(form); + if (!container) { + continue; + } + + const formIdFromHtml = this.getIdFromHTML(container); + if (formIdFromHtml !== formIdFromAjax) { + continue; + } + + const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); + if (visibleFields?.value) { + return visibleFields.value; + } + } + + return false; + } + + /** + * Override in child classes to define specific extraction patterns + * @param {string} ajaxData - Decoded AJAX data string + * @return {number|null} Form ID or null if not found + */ + getIdFromAjax(ajaxData) { + console.warn('getIdFromAjax must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define container search logic + * @param {HTMLElement} form - Form element to start search from + * @return {HTMLElement|null} Container element or null + */ + findParentContainer(form) { + console.warn('findParentContainer must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define ID extraction from HTML + * @param {HTMLElement} container - Container element + * @return {number|null} Form ID or null if not found + */ + getIdFromHTML(container) { + console.warn('getIdFromHTML must be implemented by child class'); + return null; + } +} + +/** + * Ninja Forms specific implementation + */ +class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} + /form_id\s*[:\s]*"?(\d+)"/, + /nf-form-(\d+)/, + /"id":(\d+)/, // Fallback for simple cases + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + let el = form; + while (el && el !== document.body) { + if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { + return el; + } + el = el.parentElement; + } + return null; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + const match = container.id.match(/^nf-form-(\d+)-cont$/); + return match ? parseInt(match[1], 10) : null; + } +} + +/** + * Mailpoet specific implementation + */ +class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /form_id\s*[:\s]*"?(\d+)"/, + /data\[form_id\]=(\d+)/, + /form_id=(\d+)/, + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + // Mailpoet uses the form itself as container + return form; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + if (!container.action) { + return null; + } + + const formMatch = container.action.match(/mailpoet_subscription_form/); + if (!formMatch) { + return null; + } + + const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); + if (!hiddenFieldWithID || !hiddenFieldWithID.value) { + return null; + } + + return parseInt(hiddenFieldWithID.value, 10); + } +} + /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index e5455b97a..94fc41f9a 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -3373,6 +3373,7 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, + 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3385,6 +3386,7 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; + sourceSign.attachVisibleFieldsData = true; } if ( @@ -3422,6 +3424,7 @@ class ApbctHandler { ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; + sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3433,6 +3436,7 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; + let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3451,7 +3455,26 @@ class ApbctHandler { } } - settings.data = noCookieData + eventToken + settings.data; + if (sourceSign.attachVisibleFieldsData) { + let visibleFieldsSearchResult = false; + + const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); + if (extractor) { // Check if extractor was created + visibleFieldsSearchResult = extractor.extract(settings.data); + } + + if (typeof visibleFieldsSearchResult === 'string') { + let encoded = null; + try { + encoded = encodeURIComponent(visibleFieldsSearchResult); + visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; + } catch (e) { + // do nothing + } + } + } + + settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; } }, }); @@ -3464,8 +3487,13 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if (typeof options !== 'object' || options === null || - !options.hasOwnProperty('data') || !options.hasOwnProperty('path') + if ( + typeof options !== 'object' || + options === null || + !options.hasOwnProperty('data') || + typeof options.data === 'undefined' || + !options.hasOwnProperty('path') || + typeof options.path === 'undefined' ) { return next(options); } @@ -3742,6 +3770,200 @@ class ApbctShowForbidden { } } +/** + * Base class for extracting visible fields from form plugins + */ +class ApbctVisibleFieldsExtractor { + /** + * Factory method to create appropriate extractor instance + * @param {string} sourceSignAction - Action identifier + * @return {ApbctVisibleFieldsExtractor|null} + */ + static createExtractor(sourceSignAction) { + switch (sourceSignAction) { + case 'action=nf_ajax_submit': + return new ApbctNinjaFormsVisibleFields(); + case 'action=mailpoet': + return new ApbctMailpoetVisibleFields(); + default: + return null; + } + } + /** + * Extracts visible fields string from form AJAX data + * @param {string} ajaxData - AJAX form data + * @return {string|false} Visible fields value or false if not found + */ + extract(ajaxData) { + if (!ajaxData || typeof ajaxData !== 'string') { + return false; + } + + try { + ajaxData = decodeURIComponent(ajaxData); + } catch (e) { + return false; + } + + const forms = document.querySelectorAll('form'); + const formIdFromAjax = this.getIdFromAjax(ajaxData); + if (!formIdFromAjax) { + return false; + } + + for (let form of forms) { + const container = this.findParentContainer(form); + if (!container) { + continue; + } + + const formIdFromHtml = this.getIdFromHTML(container); + if (formIdFromHtml !== formIdFromAjax) { + continue; + } + + const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); + if (visibleFields?.value) { + return visibleFields.value; + } + } + + return false; + } + + /** + * Override in child classes to define specific extraction patterns + * @param {string} ajaxData - Decoded AJAX data string + * @return {number|null} Form ID or null if not found + */ + getIdFromAjax(ajaxData) { + console.warn('getIdFromAjax must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define container search logic + * @param {HTMLElement} form - Form element to start search from + * @return {HTMLElement|null} Container element or null + */ + findParentContainer(form) { + console.warn('findParentContainer must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define ID extraction from HTML + * @param {HTMLElement} container - Container element + * @return {number|null} Form ID or null if not found + */ + getIdFromHTML(container) { + console.warn('getIdFromHTML must be implemented by child class'); + return null; + } +} + +/** + * Ninja Forms specific implementation + */ +class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} + /form_id\s*[:\s]*"?(\d+)"/, + /nf-form-(\d+)/, + /"id":(\d+)/, // Fallback for simple cases + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + let el = form; + while (el && el !== document.body) { + if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { + return el; + } + el = el.parentElement; + } + return null; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + const match = container.id.match(/^nf-form-(\d+)-cont$/); + return match ? parseInt(match[1], 10) : null; + } +} + +/** + * Mailpoet specific implementation + */ +class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /form_id\s*[:\s]*"?(\d+)"/, + /data\[form_id\]=(\d+)/, + /form_id=(\d+)/, + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + // Mailpoet uses the form itself as container + return form; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + if (!container.action) { + return null; + } + + const formMatch = container.action.match(/mailpoet_subscription_form/); + if (!formMatch) { + return null; + } + + const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); + if (!hiddenFieldWithID || !hiddenFieldWithID.value) { + return null; + } + + return parseInt(hiddenFieldWithID.value, 10); + } +} + /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 2f4528150..f39853f51 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -3373,6 +3373,7 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, + 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3385,6 +3386,7 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; + sourceSign.attachVisibleFieldsData = true; } if ( @@ -3422,6 +3424,7 @@ class ApbctHandler { ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; + sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3433,6 +3436,7 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; + let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3451,7 +3455,26 @@ class ApbctHandler { } } - settings.data = noCookieData + eventToken + settings.data; + if (sourceSign.attachVisibleFieldsData) { + let visibleFieldsSearchResult = false; + + const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); + if (extractor) { // Check if extractor was created + visibleFieldsSearchResult = extractor.extract(settings.data); + } + + if (typeof visibleFieldsSearchResult === 'string') { + let encoded = null; + try { + encoded = encodeURIComponent(visibleFieldsSearchResult); + visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; + } catch (e) { + // do nothing + } + } + } + + settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; } }, }); @@ -3464,8 +3487,13 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if (typeof options !== 'object' || options === null || - !options.hasOwnProperty('data') || !options.hasOwnProperty('path') + if ( + typeof options !== 'object' || + options === null || + !options.hasOwnProperty('data') || + typeof options.data === 'undefined' || + !options.hasOwnProperty('path') || + typeof options.path === 'undefined' ) { return next(options); } @@ -3742,6 +3770,200 @@ class ApbctShowForbidden { } } +/** + * Base class for extracting visible fields from form plugins + */ +class ApbctVisibleFieldsExtractor { + /** + * Factory method to create appropriate extractor instance + * @param {string} sourceSignAction - Action identifier + * @return {ApbctVisibleFieldsExtractor|null} + */ + static createExtractor(sourceSignAction) { + switch (sourceSignAction) { + case 'action=nf_ajax_submit': + return new ApbctNinjaFormsVisibleFields(); + case 'action=mailpoet': + return new ApbctMailpoetVisibleFields(); + default: + return null; + } + } + /** + * Extracts visible fields string from form AJAX data + * @param {string} ajaxData - AJAX form data + * @return {string|false} Visible fields value or false if not found + */ + extract(ajaxData) { + if (!ajaxData || typeof ajaxData !== 'string') { + return false; + } + + try { + ajaxData = decodeURIComponent(ajaxData); + } catch (e) { + return false; + } + + const forms = document.querySelectorAll('form'); + const formIdFromAjax = this.getIdFromAjax(ajaxData); + if (!formIdFromAjax) { + return false; + } + + for (let form of forms) { + const container = this.findParentContainer(form); + if (!container) { + continue; + } + + const formIdFromHtml = this.getIdFromHTML(container); + if (formIdFromHtml !== formIdFromAjax) { + continue; + } + + const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); + if (visibleFields?.value) { + return visibleFields.value; + } + } + + return false; + } + + /** + * Override in child classes to define specific extraction patterns + * @param {string} ajaxData - Decoded AJAX data string + * @return {number|null} Form ID or null if not found + */ + getIdFromAjax(ajaxData) { + console.warn('getIdFromAjax must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define container search logic + * @param {HTMLElement} form - Form element to start search from + * @return {HTMLElement|null} Container element or null + */ + findParentContainer(form) { + console.warn('findParentContainer must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define ID extraction from HTML + * @param {HTMLElement} container - Container element + * @return {number|null} Form ID or null if not found + */ + getIdFromHTML(container) { + console.warn('getIdFromHTML must be implemented by child class'); + return null; + } +} + +/** + * Ninja Forms specific implementation + */ +class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} + /form_id\s*[:\s]*"?(\d+)"/, + /nf-form-(\d+)/, + /"id":(\d+)/, // Fallback for simple cases + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + let el = form; + while (el && el !== document.body) { + if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { + return el; + } + el = el.parentElement; + } + return null; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + const match = container.id.match(/^nf-form-(\d+)-cont$/); + return match ? parseInt(match[1], 10) : null; + } +} + +/** + * Mailpoet specific implementation + */ +class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /form_id\s*[:\s]*"?(\d+)"/, + /data\[form_id\]=(\d+)/, + /form_id=(\d+)/, + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + // Mailpoet uses the form itself as container + return form; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + if (!container.action) { + return null; + } + + const formMatch = container.action.match(/mailpoet_subscription_form/); + if (!formMatch) { + return null; + } + + const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); + if (!hiddenFieldWithID || !hiddenFieldWithID.value) { + return null; + } + + return parseInt(hiddenFieldWithID.value, 10); + } +} + /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 289ac7ec6..d9f240cfd 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -3373,6 +3373,7 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, + 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3385,6 +3386,7 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; + sourceSign.attachVisibleFieldsData = true; } if ( @@ -3422,6 +3424,7 @@ class ApbctHandler { ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; + sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3433,6 +3436,7 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; + let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3451,7 +3455,26 @@ class ApbctHandler { } } - settings.data = noCookieData + eventToken + settings.data; + if (sourceSign.attachVisibleFieldsData) { + let visibleFieldsSearchResult = false; + + const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); + if (extractor) { // Check if extractor was created + visibleFieldsSearchResult = extractor.extract(settings.data); + } + + if (typeof visibleFieldsSearchResult === 'string') { + let encoded = null; + try { + encoded = encodeURIComponent(visibleFieldsSearchResult); + visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; + } catch (e) { + // do nothing + } + } + } + + settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; } }, }); @@ -3464,8 +3487,13 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if (typeof options !== 'object' || options === null || - !options.hasOwnProperty('data') || !options.hasOwnProperty('path') + if ( + typeof options !== 'object' || + options === null || + !options.hasOwnProperty('data') || + typeof options.data === 'undefined' || + !options.hasOwnProperty('path') || + typeof options.path === 'undefined' ) { return next(options); } @@ -3742,6 +3770,200 @@ class ApbctShowForbidden { } } +/** + * Base class for extracting visible fields from form plugins + */ +class ApbctVisibleFieldsExtractor { + /** + * Factory method to create appropriate extractor instance + * @param {string} sourceSignAction - Action identifier + * @return {ApbctVisibleFieldsExtractor|null} + */ + static createExtractor(sourceSignAction) { + switch (sourceSignAction) { + case 'action=nf_ajax_submit': + return new ApbctNinjaFormsVisibleFields(); + case 'action=mailpoet': + return new ApbctMailpoetVisibleFields(); + default: + return null; + } + } + /** + * Extracts visible fields string from form AJAX data + * @param {string} ajaxData - AJAX form data + * @return {string|false} Visible fields value or false if not found + */ + extract(ajaxData) { + if (!ajaxData || typeof ajaxData !== 'string') { + return false; + } + + try { + ajaxData = decodeURIComponent(ajaxData); + } catch (e) { + return false; + } + + const forms = document.querySelectorAll('form'); + const formIdFromAjax = this.getIdFromAjax(ajaxData); + if (!formIdFromAjax) { + return false; + } + + for (let form of forms) { + const container = this.findParentContainer(form); + if (!container) { + continue; + } + + const formIdFromHtml = this.getIdFromHTML(container); + if (formIdFromHtml !== formIdFromAjax) { + continue; + } + + const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); + if (visibleFields?.value) { + return visibleFields.value; + } + } + + return false; + } + + /** + * Override in child classes to define specific extraction patterns + * @param {string} ajaxData - Decoded AJAX data string + * @return {number|null} Form ID or null if not found + */ + getIdFromAjax(ajaxData) { + console.warn('getIdFromAjax must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define container search logic + * @param {HTMLElement} form - Form element to start search from + * @return {HTMLElement|null} Container element or null + */ + findParentContainer(form) { + console.warn('findParentContainer must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define ID extraction from HTML + * @param {HTMLElement} container - Container element + * @return {number|null} Form ID or null if not found + */ + getIdFromHTML(container) { + console.warn('getIdFromHTML must be implemented by child class'); + return null; + } +} + +/** + * Ninja Forms specific implementation + */ +class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} + /form_id\s*[:\s]*"?(\d+)"/, + /nf-form-(\d+)/, + /"id":(\d+)/, // Fallback for simple cases + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + let el = form; + while (el && el !== document.body) { + if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { + return el; + } + el = el.parentElement; + } + return null; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + const match = container.id.match(/^nf-form-(\d+)-cont$/); + return match ? parseInt(match[1], 10) : null; + } +} + +/** + * Mailpoet specific implementation + */ +class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /form_id\s*[:\s]*"?(\d+)"/, + /data\[form_id\]=(\d+)/, + /form_id=(\d+)/, + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + // Mailpoet uses the form itself as container + return form; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + if (!container.action) { + return null; + } + + const formMatch = container.action.match(/mailpoet_subscription_form/); + if (!formMatch) { + return null; + } + + const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); + if (!hiddenFieldWithID || !hiddenFieldWithID.value) { + return null; + } + + return parseInt(hiddenFieldWithID.value, 10); + } +} + /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index 705dfd0bc..611639a6f 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -3373,6 +3373,7 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, + 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3385,6 +3386,7 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; + sourceSign.attachVisibleFieldsData = true; } if ( @@ -3422,6 +3424,7 @@ class ApbctHandler { ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; + sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3433,6 +3436,7 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; + let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3451,7 +3455,26 @@ class ApbctHandler { } } - settings.data = noCookieData + eventToken + settings.data; + if (sourceSign.attachVisibleFieldsData) { + let visibleFieldsSearchResult = false; + + const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); + if (extractor) { // Check if extractor was created + visibleFieldsSearchResult = extractor.extract(settings.data); + } + + if (typeof visibleFieldsSearchResult === 'string') { + let encoded = null; + try { + encoded = encodeURIComponent(visibleFieldsSearchResult); + visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; + } catch (e) { + // do nothing + } + } + } + + settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; } }, }); @@ -3464,8 +3487,13 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if (typeof options !== 'object' || options === null || - !options.hasOwnProperty('data') || !options.hasOwnProperty('path') + if ( + typeof options !== 'object' || + options === null || + !options.hasOwnProperty('data') || + typeof options.data === 'undefined' || + !options.hasOwnProperty('path') || + typeof options.path === 'undefined' ) { return next(options); } @@ -3742,6 +3770,200 @@ class ApbctShowForbidden { } } +/** + * Base class for extracting visible fields from form plugins + */ +class ApbctVisibleFieldsExtractor { + /** + * Factory method to create appropriate extractor instance + * @param {string} sourceSignAction - Action identifier + * @return {ApbctVisibleFieldsExtractor|null} + */ + static createExtractor(sourceSignAction) { + switch (sourceSignAction) { + case 'action=nf_ajax_submit': + return new ApbctNinjaFormsVisibleFields(); + case 'action=mailpoet': + return new ApbctMailpoetVisibleFields(); + default: + return null; + } + } + /** + * Extracts visible fields string from form AJAX data + * @param {string} ajaxData - AJAX form data + * @return {string|false} Visible fields value or false if not found + */ + extract(ajaxData) { + if (!ajaxData || typeof ajaxData !== 'string') { + return false; + } + + try { + ajaxData = decodeURIComponent(ajaxData); + } catch (e) { + return false; + } + + const forms = document.querySelectorAll('form'); + const formIdFromAjax = this.getIdFromAjax(ajaxData); + if (!formIdFromAjax) { + return false; + } + + for (let form of forms) { + const container = this.findParentContainer(form); + if (!container) { + continue; + } + + const formIdFromHtml = this.getIdFromHTML(container); + if (formIdFromHtml !== formIdFromAjax) { + continue; + } + + const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); + if (visibleFields?.value) { + return visibleFields.value; + } + } + + return false; + } + + /** + * Override in child classes to define specific extraction patterns + * @param {string} ajaxData - Decoded AJAX data string + * @return {number|null} Form ID or null if not found + */ + getIdFromAjax(ajaxData) { + console.warn('getIdFromAjax must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define container search logic + * @param {HTMLElement} form - Form element to start search from + * @return {HTMLElement|null} Container element or null + */ + findParentContainer(form) { + console.warn('findParentContainer must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define ID extraction from HTML + * @param {HTMLElement} container - Container element + * @return {number|null} Form ID or null if not found + */ + getIdFromHTML(container) { + console.warn('getIdFromHTML must be implemented by child class'); + return null; + } +} + +/** + * Ninja Forms specific implementation + */ +class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} + /form_id\s*[:\s]*"?(\d+)"/, + /nf-form-(\d+)/, + /"id":(\d+)/, // Fallback for simple cases + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + let el = form; + while (el && el !== document.body) { + if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { + return el; + } + el = el.parentElement; + } + return null; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + const match = container.id.match(/^nf-form-(\d+)-cont$/); + return match ? parseInt(match[1], 10) : null; + } +} + +/** + * Mailpoet specific implementation + */ +class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /form_id\s*[:\s]*"?(\d+)"/, + /data\[form_id\]=(\d+)/, + /form_id=(\d+)/, + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + // Mailpoet uses the form itself as container + return form; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + if (!container.action) { + return null; + } + + const formMatch = container.action.match(/mailpoet_subscription_form/); + if (!formMatch) { + return null; + } + + const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); + if (!hiddenFieldWithID || !hiddenFieldWithID.value) { + return null; + } + + return parseInt(hiddenFieldWithID.value, 10); + } +} + /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index 20f2bee70..45a657326 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -3373,6 +3373,7 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, + 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3385,6 +3386,7 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; + sourceSign.attachVisibleFieldsData = true; } if ( @@ -3422,6 +3424,7 @@ class ApbctHandler { ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; + sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3433,6 +3436,7 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; + let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3451,7 +3455,26 @@ class ApbctHandler { } } - settings.data = noCookieData + eventToken + settings.data; + if (sourceSign.attachVisibleFieldsData) { + let visibleFieldsSearchResult = false; + + const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); + if (extractor) { // Check if extractor was created + visibleFieldsSearchResult = extractor.extract(settings.data); + } + + if (typeof visibleFieldsSearchResult === 'string') { + let encoded = null; + try { + encoded = encodeURIComponent(visibleFieldsSearchResult); + visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; + } catch (e) { + // do nothing + } + } + } + + settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; } }, }); @@ -3464,8 +3487,13 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if (typeof options !== 'object' || options === null || - !options.hasOwnProperty('data') || !options.hasOwnProperty('path') + if ( + typeof options !== 'object' || + options === null || + !options.hasOwnProperty('data') || + typeof options.data === 'undefined' || + !options.hasOwnProperty('path') || + typeof options.path === 'undefined' ) { return next(options); } @@ -3742,6 +3770,200 @@ class ApbctShowForbidden { } } +/** + * Base class for extracting visible fields from form plugins + */ +class ApbctVisibleFieldsExtractor { + /** + * Factory method to create appropriate extractor instance + * @param {string} sourceSignAction - Action identifier + * @return {ApbctVisibleFieldsExtractor|null} + */ + static createExtractor(sourceSignAction) { + switch (sourceSignAction) { + case 'action=nf_ajax_submit': + return new ApbctNinjaFormsVisibleFields(); + case 'action=mailpoet': + return new ApbctMailpoetVisibleFields(); + default: + return null; + } + } + /** + * Extracts visible fields string from form AJAX data + * @param {string} ajaxData - AJAX form data + * @return {string|false} Visible fields value or false if not found + */ + extract(ajaxData) { + if (!ajaxData || typeof ajaxData !== 'string') { + return false; + } + + try { + ajaxData = decodeURIComponent(ajaxData); + } catch (e) { + return false; + } + + const forms = document.querySelectorAll('form'); + const formIdFromAjax = this.getIdFromAjax(ajaxData); + if (!formIdFromAjax) { + return false; + } + + for (let form of forms) { + const container = this.findParentContainer(form); + if (!container) { + continue; + } + + const formIdFromHtml = this.getIdFromHTML(container); + if (formIdFromHtml !== formIdFromAjax) { + continue; + } + + const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); + if (visibleFields?.value) { + return visibleFields.value; + } + } + + return false; + } + + /** + * Override in child classes to define specific extraction patterns + * @param {string} ajaxData - Decoded AJAX data string + * @return {number|null} Form ID or null if not found + */ + getIdFromAjax(ajaxData) { + console.warn('getIdFromAjax must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define container search logic + * @param {HTMLElement} form - Form element to start search from + * @return {HTMLElement|null} Container element or null + */ + findParentContainer(form) { + console.warn('findParentContainer must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define ID extraction from HTML + * @param {HTMLElement} container - Container element + * @return {number|null} Form ID or null if not found + */ + getIdFromHTML(container) { + console.warn('getIdFromHTML must be implemented by child class'); + return null; + } +} + +/** + * Ninja Forms specific implementation + */ +class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} + /form_id\s*[:\s]*"?(\d+)"/, + /nf-form-(\d+)/, + /"id":(\d+)/, // Fallback for simple cases + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + let el = form; + while (el && el !== document.body) { + if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { + return el; + } + el = el.parentElement; + } + return null; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + const match = container.id.match(/^nf-form-(\d+)-cont$/); + return match ? parseInt(match[1], 10) : null; + } +} + +/** + * Mailpoet specific implementation + */ +class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /form_id\s*[:\s]*"?(\d+)"/, + /data\[form_id\]=(\d+)/, + /form_id=(\d+)/, + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + // Mailpoet uses the form itself as container + return form; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + if (!container.action) { + return null; + } + + const formMatch = container.action.match(/mailpoet_subscription_form/); + if (!formMatch) { + return null; + } + + const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); + if (!hiddenFieldWithID || !hiddenFieldWithID.value) { + return null; + } + + return parseInt(hiddenFieldWithID.value, 10); + } +} + /** * Ready function */ diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index 93d8aa197..596494cdb 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -3373,6 +3373,7 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, + 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -3385,6 +3386,7 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; + sourceSign.attachVisibleFieldsData = true; } if ( @@ -3422,6 +3424,7 @@ class ApbctHandler { ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; + sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -3433,6 +3436,7 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; + let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -3451,7 +3455,26 @@ class ApbctHandler { } } - settings.data = noCookieData + eventToken + settings.data; + if (sourceSign.attachVisibleFieldsData) { + let visibleFieldsSearchResult = false; + + const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); + if (extractor) { // Check if extractor was created + visibleFieldsSearchResult = extractor.extract(settings.data); + } + + if (typeof visibleFieldsSearchResult === 'string') { + let encoded = null; + try { + encoded = encodeURIComponent(visibleFieldsSearchResult); + visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; + } catch (e) { + // do nothing + } + } + } + + settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; } }, }); @@ -3464,8 +3487,13 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if (typeof options !== 'object' || options === null || - !options.hasOwnProperty('data') || !options.hasOwnProperty('path') + if ( + typeof options !== 'object' || + options === null || + !options.hasOwnProperty('data') || + typeof options.data === 'undefined' || + !options.hasOwnProperty('path') || + typeof options.path === 'undefined' ) { return next(options); } @@ -3742,6 +3770,200 @@ class ApbctShowForbidden { } } +/** + * Base class for extracting visible fields from form plugins + */ +class ApbctVisibleFieldsExtractor { + /** + * Factory method to create appropriate extractor instance + * @param {string} sourceSignAction - Action identifier + * @return {ApbctVisibleFieldsExtractor|null} + */ + static createExtractor(sourceSignAction) { + switch (sourceSignAction) { + case 'action=nf_ajax_submit': + return new ApbctNinjaFormsVisibleFields(); + case 'action=mailpoet': + return new ApbctMailpoetVisibleFields(); + default: + return null; + } + } + /** + * Extracts visible fields string from form AJAX data + * @param {string} ajaxData - AJAX form data + * @return {string|false} Visible fields value or false if not found + */ + extract(ajaxData) { + if (!ajaxData || typeof ajaxData !== 'string') { + return false; + } + + try { + ajaxData = decodeURIComponent(ajaxData); + } catch (e) { + return false; + } + + const forms = document.querySelectorAll('form'); + const formIdFromAjax = this.getIdFromAjax(ajaxData); + if (!formIdFromAjax) { + return false; + } + + for (let form of forms) { + const container = this.findParentContainer(form); + if (!container) { + continue; + } + + const formIdFromHtml = this.getIdFromHTML(container); + if (formIdFromHtml !== formIdFromAjax) { + continue; + } + + const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); + if (visibleFields?.value) { + return visibleFields.value; + } + } + + return false; + } + + /** + * Override in child classes to define specific extraction patterns + * @param {string} ajaxData - Decoded AJAX data string + * @return {number|null} Form ID or null if not found + */ + getIdFromAjax(ajaxData) { + console.warn('getIdFromAjax must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define container search logic + * @param {HTMLElement} form - Form element to start search from + * @return {HTMLElement|null} Container element or null + */ + findParentContainer(form) { + console.warn('findParentContainer must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define ID extraction from HTML + * @param {HTMLElement} container - Container element + * @return {number|null} Form ID or null if not found + */ + getIdFromHTML(container) { + console.warn('getIdFromHTML must be implemented by child class'); + return null; + } +} + +/** + * Ninja Forms specific implementation + */ +class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} + /form_id\s*[:\s]*"?(\d+)"/, + /nf-form-(\d+)/, + /"id":(\d+)/, // Fallback for simple cases + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + let el = form; + while (el && el !== document.body) { + if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { + return el; + } + el = el.parentElement; + } + return null; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + const match = container.id.match(/^nf-form-(\d+)-cont$/); + return match ? parseInt(match[1], 10) : null; + } +} + +/** + * Mailpoet specific implementation + */ +class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /form_id\s*[:\s]*"?(\d+)"/, + /data\[form_id\]=(\d+)/, + /form_id=(\d+)/, + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + // Mailpoet uses the form itself as container + return form; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + if (!container.action) { + return null; + } + + const formMatch = container.action.match(/mailpoet_subscription_form/); + if (!formMatch) { + return null; + } + + const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); + if (!hiddenFieldWithID || !hiddenFieldWithID.value) { + return null; + } + + return parseInt(hiddenFieldWithID.value, 10); + } +} + /** * Ready function */ diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index 555d0965e..9be09cb30 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -853,6 +853,7 @@ class ApbctHandler { let sourceSign = { 'found': false, 'keepUnwrapped': false, + 'attachVisibleFieldsData': false, }; // settings data is string (important!) if ( typeof settings.data === 'string' ) { @@ -865,6 +866,7 @@ class ApbctHandler { if (settings.data.indexOf('action=mailpoet') !== -1) { sourceSign.found = 'action=mailpoet'; + sourceSign.attachVisibleFieldsData = true; } if ( @@ -902,6 +904,7 @@ class ApbctHandler { ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; + sourceSign.attachVisibleFieldsData = true; } } if ( typeof settings.url === 'string' ) { @@ -913,6 +916,7 @@ class ApbctHandler { if (sourceSign.found !== false) { let eventToken = ''; let noCookieData = ''; + let visibleFieldsString = ''; if (+ctPublic.settings__data__bot_detector_enabled) { const token = new ApbctHandler().toolGetEventToken(); if (token) { @@ -931,7 +935,26 @@ class ApbctHandler { } } - settings.data = noCookieData + eventToken + settings.data; + if (sourceSign.attachVisibleFieldsData) { + let visibleFieldsSearchResult = false; + + const extractor = ApbctVisibleFieldsExtractor.createExtractor(sourceSign.found); + if (extractor) { // Check if extractor was created + visibleFieldsSearchResult = extractor.extract(settings.data); + } + + if (typeof visibleFieldsSearchResult === 'string') { + let encoded = null; + try { + encoded = encodeURIComponent(visibleFieldsSearchResult); + visibleFieldsString = 'apbct_visible_fields=' + encoded + '&'; + } catch (e) { + // do nothing + } + } + } + + settings.data = noCookieData + eventToken + visibleFieldsString + settings.data; } }, }); @@ -944,8 +967,13 @@ class ApbctHandler { */ catchWCRestRequestAsMiddleware() { const ctPinDataToRequest = (options, next) => { - if (typeof options !== 'object' || options === null || - !options.hasOwnProperty('data') || !options.hasOwnProperty('path') + if ( + typeof options !== 'object' || + options === null || + !options.hasOwnProperty('data') || + typeof options.data === 'undefined' || + !options.hasOwnProperty('path') || + typeof options.path === 'undefined' ) { return next(options); } @@ -1222,6 +1250,200 @@ class ApbctShowForbidden { } } +/** + * Base class for extracting visible fields from form plugins + */ +class ApbctVisibleFieldsExtractor { + /** + * Factory method to create appropriate extractor instance + * @param {string} sourceSignAction - Action identifier + * @return {ApbctVisibleFieldsExtractor|null} + */ + static createExtractor(sourceSignAction) { + switch (sourceSignAction) { + case 'action=nf_ajax_submit': + return new ApbctNinjaFormsVisibleFields(); + case 'action=mailpoet': + return new ApbctMailpoetVisibleFields(); + default: + return null; + } + } + /** + * Extracts visible fields string from form AJAX data + * @param {string} ajaxData - AJAX form data + * @return {string|false} Visible fields value or false if not found + */ + extract(ajaxData) { + if (!ajaxData || typeof ajaxData !== 'string') { + return false; + } + + try { + ajaxData = decodeURIComponent(ajaxData); + } catch (e) { + return false; + } + + const forms = document.querySelectorAll('form'); + const formIdFromAjax = this.getIdFromAjax(ajaxData); + if (!formIdFromAjax) { + return false; + } + + for (let form of forms) { + const container = this.findParentContainer(form); + if (!container) { + continue; + } + + const formIdFromHtml = this.getIdFromHTML(container); + if (formIdFromHtml !== formIdFromAjax) { + continue; + } + + const visibleFields = container.querySelector('input[id^=apbct_visible_fields_]'); + if (visibleFields?.value) { + return visibleFields.value; + } + } + + return false; + } + + /** + * Override in child classes to define specific extraction patterns + * @param {string} ajaxData - Decoded AJAX data string + * @return {number|null} Form ID or null if not found + */ + getIdFromAjax(ajaxData) { + console.warn('getIdFromAjax must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define container search logic + * @param {HTMLElement} form - Form element to start search from + * @return {HTMLElement|null} Container element or null + */ + findParentContainer(form) { + console.warn('findParentContainer must be implemented by child class'); + return null; + } + + /** + * Override in child classes to define ID extraction from HTML + * @param {HTMLElement} container - Container element + * @return {number|null} Form ID or null if not found + */ + getIdFromHTML(container) { + console.warn('getIdFromHTML must be implemented by child class'); + return null; + } +} + +/** + * Ninja Forms specific implementation + */ +class ApbctNinjaFormsVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /"id"\s*:\s*"?(\d+)"/, // {"id":"2"} or {"id":2} + /form_id\s*[:\s]*"?(\d+)"/, + /nf-form-(\d+)/, + /"id":(\d+)/, // Fallback for simple cases + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + let el = form; + while (el && el !== document.body) { + if (el.id && /^nf-form-\d+-cont$/.test(el.id)) { + return el; + } + el = el.parentElement; + } + return null; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + const match = container.id.match(/^nf-form-(\d+)-cont$/); + return match ? parseInt(match[1], 10) : null; + } +} + +/** + * Mailpoet specific implementation + */ +class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { + /** + * @inheritDoc + */ + getIdFromAjax(ajaxData) { + const regexes = [ + /form_id\s*[:\s]*"?(\d+)"/, + /data\[form_id\]=(\d+)/, + /form_id=(\d+)/, + ]; + + for (let regex of regexes) { + const match = ajaxData.match(regex); + if (match && match[1]) { + return parseInt(match[1], 10); + } + } + + return null; + } + + /** + * @inheritDoc + */ + findParentContainer(form) { + // Mailpoet uses the form itself as container + return form; + } + + /** + * @inheritDoc + */ + getIdFromHTML(container) { + if (!container.action) { + return null; + } + + const formMatch = container.action.match(/mailpoet_subscription_form/); + if (!formMatch) { + return null; + } + + const hiddenFieldWithID = container.querySelector('input[type="hidden"][name="data[form_id]"]'); + if (!hiddenFieldWithID || !hiddenFieldWithID.value) { + return null; + } + + return parseInt(hiddenFieldWithID.value, 10); + } +} + /** * Ready function */ From 29b67de32d3287c6a46532cd50c3ecfa14c1acfb Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Fri, 6 Feb 2026 18:30:44 +0700 Subject: [PATCH 22/60] Fix. Code. Returned the lost code during the merge --- js/src/public-1-main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index 9be09cb30..3273c3f76 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -899,8 +899,7 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; } if ( - settings.data.indexOf('action=nf_ajax_submit') !== -1 && - ctPublic.data__cookies_type === 'none' + settings.data.indexOf('action=nf_ajax_submit') !== -1 ) { sourceSign.found = 'action=nf_ajax_submit'; sourceSign.keepUnwrapped = true; From fa9aac64bdfa50989ef793e43981965ea468b78c Mon Sep 17 00:00:00 2001 From: alexandergull Date: Fri, 6 Feb 2026 17:13:07 +0500 Subject: [PATCH 23/60] Fix. FluentForm. Vendor integration compliance fixed. --- .../Antispam/Integrations/FluentForm.php | 40 ++++++ .../IntegrationsByHook/TestFluentForms.php | 123 ++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 tests/Antispam/IntegrationsByHook/TestFluentForms.php diff --git a/lib/Cleantalk/Antispam/Integrations/FluentForm.php b/lib/Cleantalk/Antispam/Integrations/FluentForm.php index 63ea2e2f2..23c1a0f63 100644 --- a/lib/Cleantalk/Antispam/Integrations/FluentForm.php +++ b/lib/Cleantalk/Antispam/Integrations/FluentForm.php @@ -3,6 +3,7 @@ namespace Cleantalk\Antispam\Integrations; use Cleantalk\ApbctWP\GetFieldsAny; +use Cleantalk\Common\TT; class FluentForm extends IntegrationBase { @@ -11,6 +12,13 @@ public function getDataForChecking($argument) global $apbct; $event_token = ''; + $probably_skip_due_vendor = $this->skipDueVendorIntegration(); + + if ($probably_skip_due_vendor) { + do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . TT::toString($probably_skip_due_vendor), $_POST); + return null; + } + /** * Do not use Post:get() there - it uses sanitize_textarea and drops special symbols, * including whitespaces - this could concatenate parts of data in single string! @@ -73,4 +81,36 @@ public function doBlock($message) 422 ); } + + /** + * Detect if vendor integration is active + * @return false|string + */ + public function skipDueVendorIntegration() + { + /* + * This is global flag set up if vendor integration already executed + */ + global $fluentformCleantalkExecuted; + + // if flag is set and true - already executed, skip + if ( isset($fluentformCleantalkExecuted) ) { + if (true === $fluentformCleantalkExecuted) { + return 'FLUENTFORM_VENDOR_ACTIVE_INTEGRATION_EXECUTED'; + } + } else { + // if flag is not set, check state of cleantalk integration, + // this is useful if hooks order changed or global flag changed + $vendor_integration_option = get_option('_fluentform_cleantalk_details', []); + $vendor_integration_active = ( + is_array($vendor_integration_option) && + isset($vendor_integration_option['status']) && + true === $vendor_integration_option['status'] + ); + if ($vendor_integration_active) { + return 'FLUENTFORM_VENDOR_ACTIVE_INTEGRATION_FOUND'; + } + } + return false; + } } diff --git a/tests/Antispam/IntegrationsByHook/TestFluentForms.php b/tests/Antispam/IntegrationsByHook/TestFluentForms.php new file mode 100644 index 000000000..51183a620 --- /dev/null +++ b/tests/Antispam/IntegrationsByHook/TestFluentForms.php @@ -0,0 +1,123 @@ +fluentForm = new FluentForm(); + $this->post = array ( + 'ct_bot_detector_event_token' => 'e38086feb53a3e02c9e65631bbe538575cfba5cacac48bb4925776db6a00386e', + 'apbct_visible_fields' => 'eyIwIjp7InZpc2libGVfZmllbGRzIjoibmYtZmllbGQtNS10ZXh0Ym94IGVtYWlsIG5mLWZpZWxkLTciLCJ2aXNpYmxlX2ZpZWxkc19jb3VudCI6MywiaW52aXNpYmxlX2ZpZWxkcyI6Im5mLWZpZWxkLWhwIGN0X2JvdF9kZXRlY3Rvcl9ldmVudF90b2tlbiIsImludmlzaWJsZV9maWVsZHNfY291bnQiOjJ9fQ==', + 'action' => 'fluentform_submit', + 'form_id' => '1', + 'data' => 'ff_ct_form_load_time%3D1770377495%26__fluent_form_embded_post_id%3D38%26_fluentform_1_fluentformnonce%3Db7c8107641%26_wp_http_referer%3D%252F%253Fpage_id%253D38%26names%255Bfirst_name%255D%3DAlexander%26names%255Blast_name%255D%3DG.%26email%3Ds%2540cleantalk.org%26subject%3D%26message%3Dss%26ct_bot_detector_event_token%3D1d6087b3ed1b1944f5e48aea8395ac8e185b125bc0ba4917ad63ecd39b247d56%26apbct_visible_fields%3DeyIwIjp7InZpc2libGVfZmllbGRzIjoibmFtZXNbZmlyc3RfbmFtZV0gbmFtZXNbbGFzdF9uYW1lXSBlbWFpbCBzdWJqZWN0IG1lc3NhZ2UiLCJ2aXNpYmxlX2ZpZWxkc19jb3VudCI6NSwiaW52aXNpYmxlX2ZpZWxkcyI6ImZmX2N0X2Zvcm1fbG9hZF90aW1lIF9fZmx1ZW50X2Zvcm1fZW1iZGVkX3Bvc3RfaWQgX2ZsdWVudGZvcm1fMV9mbHVlbnRmb3Jtbm9uY2UgX3dwX2h0dHBfcmVmZXJlciBjdF9ib3RfZGV0ZWN0b3JfZXZlbnRfdG9rZW4iLCJpbnZpc2libGVfZmllbGRzX2NvdW50Ijo1fX0%253D', + ); + delete_option('_fluentform_cleantalk_details'); + } + + protected function tearDown(): void + { + global $apbct; + unset($apbct); + $_POST = []; + global $fluentformCleantalkExecuted; + $fluentformCleantalkExecuted = null; + global $cleantalk_executed; + $cleantalk_executed = false; + } + + public function testGetDataForChecking_SkipsOnCleantalkExecuted() + { + global $cleantalk_executed; + $cleantalk_executed = true; + // Arrange + $_POST = []; + $_GET = []; + + // Act & Assert + $result = $this->fluentForm->getDataForChecking(null); + $this->assertNull($result); + + $cleantalk_executed = false; + } + + public function testGetGFAOld_ReturnsDtoWithPostData() + { + // Mock apply_filters + $_POST = $this->post; + $input_array = apply_filters('apbct__filter_post', $this->post); + + // Act + $dto = $this->fluentForm->getDataForChecking($input_array); + + // Assert + $this->assertIsArray($dto); + $this->assertArrayHasKey('email', $dto); + $this->assertArrayHasKey('nickname', $dto); + $this->assertArrayHasKey('message', $dto); + } + + public function testVendorExcludedByGlobal() + { + global $fluentformCleantalkExecuted; + $fluentformCleantalkExecuted = true; + // Act + $skipped = $this->fluentForm->skipDueVendorIntegration(); + $this->assertIsString($skipped); + $this->assertStringContainsString('FLUENTFORM_VENDOR_ACTIVE_INTEGRATION_EXECUTED', $skipped); + } + + public function testVendorExcludedByGlobalNegative() + { + global $fluentformCleantalkExecuted; + $fluentformCleantalkExecuted = false; + // Act + $skipped = $this->fluentForm->skipDueVendorIntegration(); + $this->assertFalse($skipped); + } + + public function testVendorExcludedByGlobalUnset() + { + // Act + $skipped = $this->fluentForm->skipDueVendorIntegration(); + $this->assertFalse($skipped); + } + + public function testVendorExcludedByOption() + { + $updated = update_option('_fluentform_cleantalk_details', ['status'=>true], false); + $this->assertTrue($updated); + // Act + $skipped = $this->fluentForm->skipDueVendorIntegration(); + $this->assertIsString($skipped); + $this->assertStringContainsString('FLUENTFORM_VENDOR_ACTIVE_INTEGRATION_FOUND', $skipped); + } + + public function testVendorExcludedByOptionNegative() + { + $updated = update_option('_fluentform_cleantalk_details', ['status'=>false], false); + $this->assertTrue($updated); + // Act + $skipped = $this->fluentForm->skipDueVendorIntegration(); + $this->assertFalse($skipped); + } + + public function testVendorExcludedByOptionUnset() + { + // Act + $skipped = $this->fluentForm->skipDueVendorIntegration(); + $this->assertFalse($skipped); + } +} From 8743ccd9e46ea845f92276b727bdafc9574bc814 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Fri, 6 Feb 2026 17:23:11 +0500 Subject: [PATCH 24/60] Code. PHP Unit. TestDbColumnCreator fixed. --- .../UpdatePlugin/TestDbColumnCreator.php | 78 +++++++++++++++++-- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/tests/ApbctWP/UpdatePlugin/TestDbColumnCreator.php b/tests/ApbctWP/UpdatePlugin/TestDbColumnCreator.php index ba7bf1e70..2b8fdb9ad 100644 --- a/tests/ApbctWP/UpdatePlugin/TestDbColumnCreator.php +++ b/tests/ApbctWP/UpdatePlugin/TestDbColumnCreator.php @@ -84,10 +84,12 @@ public function testIndexesUpdateWhenChanged($tableKey, $schema) // Change indexes to incorrect ones $this->dropAllNonPrimaryIndexes($tableName); - $firstColumn = $this->getFirstNonIdColumn($schema); - if ($firstColumn) { + + // FIX: Find a non-TEXT column to create index on (to avoid key length issue) + $firstNonTextColumn = $this->getFirstNonTextColumn($tableName, $schema); + if ($firstNonTextColumn) { global $wpdb; - $wpdb->query("ALTER TABLE `{$tableName}` ADD INDEX `wrong_single_idx` (`{$firstColumn}`)"); + $wpdb->query("ALTER TABLE `{$tableName}` ADD INDEX `wrong_single_idx` (`{$firstNonTextColumn}`)"); } // Act @@ -124,10 +126,29 @@ public function testRemoveExcessIndexes($tableKey, $schema) // Add extra indexes global $wpdb; $columns = array_keys($schema); + $nonTextColumnAdded = false; + + // FIX: Try to add index on non-TEXT columns first foreach ($columns as $column) { if ($column !== 'id' && $column !== '__indexes' && $column !== '__createkey') { - $wpdb->query("ALTER TABLE `{$tableName}` ADD INDEX `excess_{$column}_idx` (`{$column}`)"); - break; + // Check if this is a TEXT column by looking at the schema definition + $isTextColumn = $this->isTextColumn($schema[$column]); + if (!$isTextColumn) { + $wpdb->query("ALTER TABLE `{$tableName}` ADD INDEX `excess_{$column}_idx` (`{$column}`)"); + $nonTextColumnAdded = true; + break; + } + } + } + + // FIX: If all columns are TEXT, add index with key length + if (!$nonTextColumnAdded) { + foreach ($columns as $column) { + if ($column !== 'id' && $column !== '__indexes' && $column !== '__createkey') { + // Add key length for TEXT columns + $wpdb->query("ALTER TABLE `{$tableName}` ADD INDEX `excess_{$column}_idx` (`{$column}`(50))"); + break; + } } } @@ -354,6 +375,53 @@ private function getFirstNonIdColumn($schema) return null; } + /** + * NEW: Check if column is TEXT/BLOB type + */ + private function isTextColumn($columnDefinition) + { + $definition = strtoupper($columnDefinition); + return strpos($definition, 'TEXT') !== false || + strpos($definition, 'BLOB') !== false || + strpos($definition, 'LONGTEXT') !== false || + strpos($definition, 'MEDIUMTEXT') !== false || + strpos($definition, 'TINYTEXT') !== false; + } + + /** + * NEW: Get first non-TEXT column from table + */ + private function getFirstNonTextColumn($tableName, $schema) + { + global $wpdb; + + // Get column information from database + $columnsInfo = $wpdb->get_results("DESCRIBE `{$tableName}`", ARRAY_A); + + foreach ($columnsInfo as $columnInfo) { + $columnName = $columnInfo['Field']; + $columnType = strtoupper($columnInfo['Type']); + + // Skip id and special columns + if ($columnName === 'id' || + $columnName === '__indexes' || + $columnName === '__createkey') { + continue; + } + + // Check if column is not TEXT/BLOB + if (strpos($columnType, 'TEXT') === false && + strpos($columnType, 'BLOB') === false && + strpos($columnType, 'LONGTEXT') === false && + strpos($columnType, 'MEDIUMTEXT') === false && + strpos($columnType, 'TINYTEXT') === false) { + return $columnName; + } + } + + return null; + } + /** * Call private method updateIndexes via reflection */ From 08b8c00f042354bd46351151e568976433be6302 Mon Sep 17 00:00:00 2001 From: SVFCode Date: Mon, 9 Feb 2026 10:10:54 +0300 Subject: [PATCH 25/60] Upd. Integrations. Elementor UltimateAddons Register integration handler to use ajax middleware. (#725) * Upd. Integrations. Elementor UltimateAddons Register integration handler to use ajax middleware. * Fix. Code. Re-minified JS. --------- Co-authored-by: Glomberg --- js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- js/apbct-public-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- js/apbct-public-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- js/apbct-public-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 9 +++++++-- js/prebuild/apbct-public-bundle_ext-protection.js | 9 +++++++-- .../apbct-public-bundle_ext-protection_gathering.js | 9 +++++++-- js/prebuild/apbct-public-bundle_full-protection.js | 9 +++++++-- .../apbct-public-bundle_full-protection_gathering.js | 9 +++++++-- js/prebuild/apbct-public-bundle_gathering.js | 9 +++++++-- js/prebuild/apbct-public-bundle_int-protection.js | 9 +++++++-- .../apbct-public-bundle_int-protection_gathering.js | 9 +++++++-- js/src/public-1-main.js | 9 +++++++-- .../Integrations/ElementorUltimateAddonsRegister.php | 6 +----- 18 files changed, 72 insertions(+), 31 deletions(-) diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index abd1cc19a..f40264587 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,i,r,c,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,i=n,d=o||[],u=!1,p={p:s=0,n:0,v:f,a:_,f:_.bind(f,4),d:function(e,t){return r=e,c=0,l=f,p.n=t,m}},function(e,t,n){if(1t||i=e.length?{done:!0}:{done:!1,value:e[i++]}},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(r.data.forEach(function(e){e.encoded_email===i[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===i[t].href||0!==i[t].href.indexOf("mailto:")&&0!==i[t].href.indexOf("tel:"))i[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i[t])},2e3);else{if(0===i[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==i[t].href.indexOf("tel:"))return 0;e="tel:"}var o=i[t].href.replace(e,""),a=i[t].innerHTML;i[t].innerHTML=a.replace(o,n.decoded_email),i[t].href=e+n.decoded_email,i[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}i[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];i.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i)},2e3),i.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'):(i.innerHTML="Loading...",t&&this.load(t)),i.setAttribute("id","cleantalk-modal-content"),n.append(i),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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(a.elements);try{for(r.s();!(c=r.n()).done;)i[(l=c.value).name]=l.value}catch(e){r.e(e)}finally{r.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",i="";if(+ctPublic.settings__data__bot_detector_enabled?(r=(new c).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+r+"&":"data%5Bct_bot_detector_event_token%5D="+r+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var r=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(r=n?n.extract(t.data):r))try{i="apbct_visible_fields="+encodeURIComponent(r)+"&"}catch(e){}}t.data=a+o+i+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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,i=t.querySelector('[name*="apbct_email_id__"]'),r=null,c=(null!==i&&null!==i.value&&(r=i.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===i&&null===l||(e.preventDefault(),n=function(){null!==i&&i.parentNode.removeChild(i),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==r&&(o.apbct_search_form__honeypot_value=r),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 i=o.value,r=this.findParentContainer(i);if(r){var c=this.getIdFromHTML(r);if(c===n){var l=r.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,i,r,c,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(u.phrases.trpHeading),(i=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),i.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(c),r.append(" "),r.append(u.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),c.append(l)),i.append(r,c),a.append(i),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 _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,i,r,c,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,i=n,d=o||[],u=!1,p={p:s=0,n:0,v:f,a:_,f:_.bind(f,4),d:function(e,t){return r=e,c=0,l=f,p.n=t,m}},function(e,t,n){if(1t||i=e.length?{done:!0}:{done:!1,value:e[i++]}},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(r.data.forEach(function(e){e.encoded_email===i[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===i[t].href||0!==i[t].href.indexOf("mailto:")&&0!==i[t].href.indexOf("tel:"))i[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i[t])},2e3);else{if(0===i[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==i[t].href.indexOf("tel:"))return 0;e="tel:"}var o=i[t].href.replace(e,""),a=i[t].innerHTML;i[t].innerHTML=a.replace(o,n.decoded_email),i[t].href=e+n.decoded_email,i[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}i[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];i.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i)},2e3),i.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'):(i.innerHTML="Loading...",t&&this.load(t)),i.setAttribute("id","cleantalk-modal-content"),n.append(i),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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(a.elements);try{for(r.s();!(c=r.n()).done;)i[(l=c.value).name]=l.value}catch(e){r.e(e)}finally{r.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit")&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=uael_register_user"))&&"none"===ctPublic.data__cookies_type&&(n.found="action=uael_register_user",n.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",i="";if(+ctPublic.settings__data__bot_detector_enabled?(r=(new c).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+r+"&":"data%5Bct_bot_detector_event_token%5D="+r+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var r=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(r=n?n.extract(t.data):r))try{i="apbct_visible_fields="+encodeURIComponent(r)+"&"}catch(e){}}t.data=a+o+i+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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,i=t.querySelector('[name*="apbct_email_id__"]'),r=null,c=(null!==i&&null!==i.value&&(r=i.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===i&&null===l||(e.preventDefault(),n=function(){null!==i&&i.parentNode.removeChild(i),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==r&&(o.apbct_search_form__honeypot_value=r),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 i=o.value,r=this.findParentContainer(i);if(r){var c=this.getIdFromHTML(r);if(c===n){var l=r.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,i,r,c,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(c=document.createElement("strong")).append(u.phrases.trpHeading),(i=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),i.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(c),r.append(" "),r.append(u.phrases.trpContent1),(c=document.createElement("div")).style.display="flex",c.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),c.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),c.append(l)),i.append(r,c),a.append(i),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 10dc18fc4..6f76c17d1 100644 --- a/js/apbct-public-bundle_ext-protection.min.js +++ b/js/apbct-public-bundle_ext-protection.min.js @@ -1 +1 @@ -function _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,i,c,r,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,i=n,d=o||[],u=!1,p={p:s=0,n:0,v:f,a:m,f:m.bind(f,4),d:function(e,t){return c=e,r=0,l=f,p.n=t,_}},function(e,t,n){if(1t||i=e.length?{done:!0}:{done:!1,value:e[i++]}},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===i[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===i[t].href||0!==i[t].href.indexOf("mailto:")&&0!==i[t].href.indexOf("tel:"))i[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i[t])},2e3);else{if(0===i[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==i[t].href.indexOf("tel:"))return 0;e="tel:"}var o=i[t].href.replace(e,""),a=i[t].innerHTML;i[t].innerHTML=a.replace(o,n.decoded_email),i[t].href=e+n.decoded_email,i[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})}i[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];i.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i)},2e3),i.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'):(i.innerHTML="Loading...",t&&this.load(t)),i.setAttribute("id","cleantalk-modal-content"),n.append(i),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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},c=_createForOfIteratorHelper(a.elements);try{for(c.s();!(r=c.n()).done;)i[(l=r.value).name]=l.value}catch(e){c.e(e)}finally{c.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",i="";if(+ctPublic.settings__data__bot_detector_enabled?(c=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+c+"&":"data%5Bct_bot_detector_event_token%5D="+c+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var c=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(c=n?n.extract(t.data):c))try{i="apbct_visible_fields="+encodeURIComponent(c)+"&"}catch(e){}}t.data=a+o+i+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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,i=t.querySelector('[name*="apbct_email_id__"]'),c=null,r=(null!==i&&null!==i.value&&(c=i.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===i&&null===l||(e.preventDefault(),n=function(){null!==i&&i.parentNode.removeChild(i),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,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 i=o.value,c=this.findParentContainer(i);if(c){var r=this.getIdFromHTML(c);if(r===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,i,c,r,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(u.phrases.trpHeading),(i=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),i.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(r),c.append(" "),c.append(u.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),r.append(l)),i.append(c,r),a.append(i),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 _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,i,c,r,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,i=n,d=o||[],u=!1,p={p:s=0,n:0,v:f,a:m,f:m.bind(f,4),d:function(e,t){return c=e,r=0,l=f,p.n=t,_}},function(e,t,n){if(1t||i=e.length?{done:!0}:{done:!1,value:e[i++]}},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===i[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===i[t].href||0!==i[t].href.indexOf("mailto:")&&0!==i[t].href.indexOf("tel:"))i[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i[t])},2e3);else{if(0===i[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==i[t].href.indexOf("tel:"))return 0;e="tel:"}var o=i[t].href.replace(e,""),a=i[t].innerHTML;i[t].innerHTML=a.replace(o,n.decoded_email),i[t].href=e+n.decoded_email,i[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})}i[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=c.data[0];i.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i)},2e3),i.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'):(i.innerHTML="Loading...",t&&this.load(t)),i.setAttribute("id","cleantalk-modal-content"),n.append(i),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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},c=_createForOfIteratorHelper(a.elements);try{for(c.s();!(r=c.n()).done;)i[(l=r.value).name]=l.value}catch(e){c.e(e)}finally{c.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit")&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=uael_register_user"))&&"none"===ctPublic.data__cookies_type&&(n.found="action=uael_register_user",n.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",i="";if(+ctPublic.settings__data__bot_detector_enabled?(c=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+c+"&":"data%5Bct_bot_detector_event_token%5D="+c+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var c=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(c=n?n.extract(t.data):c))try{i="apbct_visible_fields="+encodeURIComponent(c)+"&"}catch(e){}}t.data=a+o+i+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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,i=t.querySelector('[name*="apbct_email_id__"]'),c=null,r=(null!==i&&null!==i.value&&(c=i.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===r&&null===i&&null===l||(e.preventDefault(),n=function(){null!==i&&i.parentNode.removeChild(i),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=r,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 i=o.value,c=this.findParentContainer(i);if(c){var r=this.getIdFromHTML(c);if(r===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,i,c,r,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(u.phrases.trpHeading),(i=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),i.setAttribute("style","white-space: nowrap"),(c=document.createElement("div")).append(r),c.append(" "),c.append(u.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),r.append(l)),i.append(c,r),a.append(i),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 02501b199..0e59e8807 100644 --- a/js/apbct-public-bundle_ext-protection_gathering.min.js +++ b/js/apbct-public-bundle_ext-protection_gathering.min.js @@ -1 +1 @@ -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,u=o||[],d=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return i=e,r=0,l=m,p.n=t,f}},function(e,t,n){if(1t||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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},i=_createForOfIteratorHelper(a.elements);try{for(i.s();!(r=i.n()).done;)c[(l=r.value).name]=l.value}catch(e){i.e(e)}finally{i.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var i=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(i=n?n.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+o+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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 _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,u=o||[],d=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return i=e,r=0,l=m,p.n=t,f}},function(e,t,n){if(1t||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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},i=_createForOfIteratorHelper(a.elements);try{for(i.s();!(r=i.n()).done;)c[(l=r.value).name]=l.value}catch(e){i.e(e)}finally{i.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit")&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=uael_register_user"))&&"none"===ctPublic.data__cookies_type&&(n.found="action=uael_register_user",n.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var i=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(i=n?n.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+o+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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 32d6aab01..7c080c845 100644 --- a/js/apbct-public-bundle_full-protection.min.js +++ b/js/apbct-public-bundle_full-protection.min.js @@ -1 +1 @@ -function _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,r,i,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,d=o||[],u=!1,p={p:s=0,n:0,v:f,a:m,f:m.bind(f,4),d:function(e,t){return r=e,i=0,l=f,p.n=t,_}},function(e,t,n){if(1t||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(r.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="";r.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=r.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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(a.elements);try{for(r.s();!(i=r.n()).done;)c[(l=i.value).name]=l.value}catch(e){r.e(e)}finally{r.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(r=(new i).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+r+"&":"data%5Bct_bot_detector_event_token%5D="+r+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var r=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(r=n?n.extract(t.data):r))try{c="apbct_visible_fields="+encodeURIComponent(r)+"&"}catch(e){}}t.data=a+o+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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__"]'),r=null,i=(null!==c&&null!==c.value&&(r=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&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=i,null!==r&&(o.apbct_search_form__honeypot_value=r),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,r=this.findParentContainer(c);if(r){var i=this.getIdFromHTML(r);if(i===n){var l=r.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,c,r,i,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(i),r.append(" "),r.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),c.append(r,i),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 _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,i,r,l,s,d,u,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,d=o||[],u=!1,p={p:s=0,n:0,v:f,a:m,f:m.bind(f,4),d:function(e,t){return i=e,r=0,l=f,p.n=t,_}},function(e,t,n){if(1t||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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},i=_createForOfIteratorHelper(a.elements);try{for(i.s();!(r=i.n()).done;)c[(l=r.value).name]=l.value}catch(e){i.e(e)}finally{i.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit")&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=uael_register_user"))&&"none"===ctPublic.data__cookies_type&&(n.found="action=uael_register_user",n.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var i=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(i=n?n.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+o+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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}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,c,i,r,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(r=document.createElement("strong")).append(u.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(u.phrases.trpContent1),(r=document.createElement("div")).style.display="flex",r.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),r.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),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_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index 81b99f8c5..a7f04a62a 100644 --- a/js/apbct-public-bundle_full-protection_gathering.min.js +++ b/js/apbct-public-bundle_full-protection_gathering.min.js @@ -1 +1 @@ -function _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,u=o||[],d=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return i=e,r=0,l=m,p.n=t,f}},function(e,t,n){if(1t||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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},i=_createForOfIteratorHelper(a.elements);try{for(i.s();!(r=i.n()).done;)c[(l=r.value).name]=l.value}catch(e){i.e(e)}finally{i.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var i=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(i=n?n.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+o+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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 _regenerator(){var m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,u=o||[],d=!1,p={p:s=0,n:0,v:m,a:_,f:_.bind(m,4),d:function(e,t){return i=e,r=0,l=m,p.n=t,f}},function(e,t,n){if(1t||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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},i=_createForOfIteratorHelper(a.elements);try{for(i.s();!(r=i.n()).done;)c[(l=r.value).name]=l.value}catch(e){i.e(e)}finally{i.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit")&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=uael_register_user"))&&"none"===ctPublic.data__cookies_type&&(n.found="action=uael_register_user",n.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var i=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(i=n?n.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+o+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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 diff --git a/js/apbct-public-bundle_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index 548f02525..5c9efc711 100644 --- a/js/apbct-public-bundle_gathering.min.js +++ b/js/apbct-public-bundle_gathering.min.js @@ -1 +1 @@ -function _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function n(e,t,o,n){var a,c,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=o,u=n||[],d=!1,p={p:s=0,n:0,v:f,a:_,f:_.bind(f,4),d:function(e,t){return i=e,r=0,l=f,p.n=t,m}},function(e,t,o){if(1t||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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=2,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,o));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof o[0].includes&&o[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,o));case 7:"function"==typeof o[0].includes&&o[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,o));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof o[0].includes&&o[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&o[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},i=_createForOfIteratorHelper(a.elements);try{for(i.s();!(r=i.n()).done;)c[(l=r.value).name]=l.value}catch(e){i.e(e)}finally{i.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,o,n){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,o));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var o={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(o.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(o.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(o.found="action=mailpoet",o.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(o.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(o.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(o.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(o.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(o.found="action=drplus_signup",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(o.found="action=bt_cc",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(o.found="action=wpr_form_builder_email",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(o.found="action=nf_ajax_submit",o.keepUnwrapped=!0,o.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(o.found="wc-ajax=add_to_cart"),!1!==o.found){var n="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(n=o.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=o.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),o.attachVisibleFieldsData){var i=!1,o=ApbctVisibleFieldsExtractor.createExtractor(o.found);if("string"==typeof(i=o?o.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+n+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var o;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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 _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function n(e,t,o,n){var a,c,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=o,u=n||[],d=!1,p={p:s=0,n:0,v:f,a:_,f:_.bind(f,4),d:function(e,t){return i=e,r=0,l=f,p.n=t,m}},function(e,t,o){if(1t||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;oMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=2,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,o));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof o[0].includes&&o[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,o));case 7:"function"==typeof o[0].includes&&o[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,o));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof o[0].includes&&o[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&o[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},i=_createForOfIteratorHelper(a.elements);try{for(i.s();!(r=i.n()).done;)c[(l=r.value).name]=l.value}catch(e){i.e(e)}finally{i.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,o,n){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,o));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var o={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(o.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(o.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(o.found="action=mailpoet",o.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(o.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(o.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(o.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(o.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(o.found="action=drplus_signup",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(o.found="action=bt_cc",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(o.found="action=wpr_form_builder_email",o.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit")&&(o.found="action=nf_ajax_submit",o.keepUnwrapped=!0,o.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=uael_register_user"))&&"none"===ctPublic.data__cookies_type&&(o.found="action=uael_register_user",o.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(o.found="wc-ajax=add_to_cart"),!1!==o.found){var n="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(n=o.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=o.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),o.attachVisibleFieldsData){var i=!1,o=ApbctVisibleFieldsExtractor.createExtractor(o.found);if("string"==typeof(i=o?o.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+n+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var o;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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 0cc1b5040..d997a75dc 100644 --- a/js/apbct-public-bundle_int-protection.min.js +++ b/js/apbct-public-bundle_int-protection.min.js @@ -1 +1 @@ -function _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,i,r,c,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,i=n,u=o||[],d=!1,p={p:s=0,n:0,v:f,a:_,f:_.bind(f,4),d:function(e,t){return r=e,c=0,l=f,p.n=t,m}},function(e,t,n){if(1t||i=e.length?{done:!0}:{done:!1,value:e[i++]}},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(r.data.forEach(function(e){e.encoded_email===i[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===i[t].href||0!==i[t].href.indexOf("mailto:")&&0!==i[t].href.indexOf("tel:"))i[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i[t])},2e3);else{if(0===i[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==i[t].href.indexOf("tel:"))return 0;e="tel:"}var o=i[t].href.replace(e,""),a=i[t].innerHTML;i[t].innerHTML=a.replace(o,n.decoded_email),i[t].href=e+n.decoded_email,i[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}i[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];i.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i)},2e3),i.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'):(i.innerHTML="Loading...",t&&this.load(t)),i.setAttribute("id","cleantalk-modal-content"),n.append(i),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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(a.elements);try{for(r.s();!(c=r.n()).done;)i[(l=c.value).name]=l.value}catch(e){r.e(e)}finally{r.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",i="";if(+ctPublic.settings__data__bot_detector_enabled?(r=(new c).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+r+"&":"data%5Bct_bot_detector_event_token%5D="+r+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var r=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(r=n?n.extract(t.data):r))try{i="apbct_visible_fields="+encodeURIComponent(r)+"&"}catch(e){}}t.data=a+o+i+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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,i=t.querySelector('[name*="apbct_email_id__"]'),r=null,c=(null!==i&&null!==i.value&&(r=i.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===i&&null===l||(e.preventDefault(),n=function(){null!==i&&i.parentNode.removeChild(i),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==r&&(o.apbct_search_form__honeypot_value=r),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 i=o.value,r=this.findParentContainer(i);if(r){var c=this.getIdFromHTML(r);if(c===n){var l=r.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,i,r,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),(i=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),i.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(c),r.append(" "),r.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)),i.append(r,c),a.append(i),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 _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,i,r,c,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,i=n,u=o||[],d=!1,p={p:s=0,n:0,v:f,a:_,f:_.bind(f,4),d:function(e,t){return r=e,c=0,l=f,p.n=t,m}},function(e,t,n){if(1t||i=e.length?{done:!0}:{done:!1,value:e[i++]}},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(r.data.forEach(function(e){e.encoded_email===i[t].dataset.originalString&&(n=e)}),!1===n.is_allowed)return{v:void 0};if(void 0===i[t].href||0!==i[t].href.indexOf("mailto:")&&0!==i[t].href.indexOf("tel:"))i[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i[t])},2e3);else{if(0===i[t].href.indexOf("mailto:"))e="mailto:";else{if(0!==i[t].href.indexOf("tel:"))return 0;e="tel:"}var o=i[t].href.replace(e,""),a=i[t].innerHTML;i[t].innerHTML=a.replace(o,n.decoded_email),i[t].href=e+n.decoded_email,i[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var n="";r.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}i[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))&&e)return e.v}else{var n=r.data[0];i.classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(n,i)},2e3),i.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'):(i.innerHTML="Loading...",t&&this.load(t)),i.setAttribute("id","cleantalk-modal-content"),n.append(i),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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),i={action:"cleantalk_force_ajax_check"},r=_createForOfIteratorHelper(a.elements);try{for(r.s();!(c=r.n()).done;)i[(l=c.value).name]=l.value}catch(e){r.e(e)}finally{r.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(i,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit")&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=uael_register_user"))&&"none"===ctPublic.data__cookies_type&&(n.found="action=uael_register_user",n.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",i="";if(+ctPublic.settings__data__bot_detector_enabled?(r=(new c).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+r+"&":"data%5Bct_bot_detector_event_token%5D="+r+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var r=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(r=n?n.extract(t.data):r))try{i="apbct_visible_fields="+encodeURIComponent(r)+"&"}catch(e){}}t.data=a+o+i+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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,i=t.querySelector('[name*="apbct_email_id__"]'),r=null,c=(null!==i&&null!==i.value&&(r=i.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===c&&null===i&&null===l||(e.preventDefault(),n=function(){null!==i&&i.parentNode.removeChild(i),"function"==typeof t.apbctSearchPrevOnsubmit?t.apbctSearchPrevOnsubmit():HTMLFormElement.prototype.submit.call(t)},o=c,null!==r&&(o.apbct_search_form__honeypot_value=r),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 i=o.value,r=this.findParentContainer(i);if(r){var c=this.getIdFromHTML(r);if(c===n){var l=r.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,i,r,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),(i=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),i.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(c),r.append(" "),r.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)),i.append(r,c),a.append(i),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 b02b8f904..e3e836533 100644 --- a/js/apbct-public-bundle_int-protection_gathering.min.js +++ b/js/apbct-public-bundle_int-protection_gathering.min.js @@ -1 +1 @@ -function _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,u=o||[],d=!1,p={p:s=0,n:0,v:f,a:_,f:_.bind(f,4),d:function(e,t){return i=e,r=0,l=f,p.n=t,m}},function(e,t,n){if(1t||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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},i=_createForOfIteratorHelper(a.elements);try{for(i.s();!(r=i.n()).done;)c[(l=r.value).name]=l.value}catch(e){i.e(e)}finally{i.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit"))&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var i=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(i=n?n.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+o+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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 _regenerator(){var f,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var a,c,i,r,l,s,u,d,p,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(a=e,c=n,u=o||[],d=!1,p={p:s=0,n:0,v:f,a:_,f:_.bind(f,4),d:function(e,t){return i=e,r=0,l=f,p.n=t,m}},function(e,t,n){if(1t||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;nMath.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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=2,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=4):e.n=4;break;case 3:return e.p=3,e.a(2,defaultFetch.apply(window,n));case 4:Array.from(document.forms).some(function(e){return e.classList.contains("wprm-user-ratings-modal-stars-container")})&&"function"==typeof n[0].includes&&n[0].includes("/wp-json/wp-recipe-maker/")?(e.p=5,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=7):e.n=7;break;case 6:return e.p=6,e.a(2,defaultFetch.apply(window,n));case 7:"function"==typeof n[0].includes&&n[0].includes("/wc/store/v1/cart/add-item")?(e.p=8,+ctPublic.settings__forms__wc_add_to_cart&&(n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled))),e.n=10):e.n=10;break;case 9:return e.p=9,e.a(2,defaultFetch.apply(window,n));case 10:if(!(+ctPublic.settings__forms__check_external&&"function"==typeof n[0].includes&&n[0].includes("bitrix/services/main/ajax.php?action=crm.site.form.fill")&&n[1].body instanceof FormData)){e.n=11;break}a=document.querySelector(".b24-form form"),c={action:"cleantalk_force_ajax_check"},i=_createForOfIteratorHelper(a.elements);try{for(i.s();!(r=i.n()).done;)c[(l=r.value).name]=l.value}catch(e){i.e(e)}finally{i.f()}return e.n=11,new Promise(function(a,t){apbct_public_sendAJAX(c,{async:!0,callback:function(e,t,n,o){(void 0===e.apbct&&void 0===e.data||void 0!==e.apbct&&!+e.apbct.blocked)&&(p=!1),(void 0!==e.apbct&&+e.apbct.blocked||void 0!==e.data&&void 0!==e.data.message)&&(p=!0,(new ApbctShowForbidden).parseBlockMessage(e)),a(e)},onErrorCallback:function(e){console.log("AJAX error:",e),t(e)}})});case 11:if(p){e.n=12;break}return e.a(2,defaultFetch.apply(window,n));case 12:return e.a(2)}},e,null,[[8,9],[5,6],[2,3]])})))},1e3)}},{key:"catchJqueryAjax",value:function(){"undefined"!=typeof jQuery&&"function"==typeof jQuery.ajaxSetup&&jQuery.ajaxSetup({beforeSend:function(e,t){var n={found:!1,keepUnwrapped:!1,attachVisibleFieldsData:!1};if("string"==typeof t.data&&(-1!==t.data.indexOf("action=fl_builder_subscribe_form_submit")&&(n.found="fl_builder_subscribe_form_submit"),-1!==t.data.indexOf("twt_cc_signup")&&(n.found="twt_cc_signup"),-1!==t.data.indexOf("action=mailpoet")&&(n.found="action=mailpoet",n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=user_registration")&&-1!==t.data.indexOf("ur_frontend_form_nonce")&&(n.found="action=user_registration"),-1!==t.data.indexOf("action=happyforms_message")&&(n.found="action=happyforms_message"),-1!==t.data.indexOf("action=new_activity_comment")&&(n.found="action=new_activity_comment"),-1!==t.data.indexOf("action=wwlc_create_user")&&(n.found="action=wwlc_create_user"),-1!==t.data.indexOf("action=drplus_signup")&&(n.found="action=drplus_signup",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=bt_cc")&&(n.found="action=bt_cc",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=wpr_form_builder_email")&&(n.found="action=wpr_form_builder_email",n.keepUnwrapped=!0),-1!==t.data.indexOf("action=nf_ajax_submit")&&(n.found="action=nf_ajax_submit",n.keepUnwrapped=!0,n.attachVisibleFieldsData=!0),-1!==t.data.indexOf("action=uael_register_user"))&&"none"===ctPublic.data__cookies_type&&(n.found="action=uael_register_user",n.keepUnwrapped=!0),"string"==typeof t.url&&-1!==t.url.indexOf("wc-ajax=add_to_cart")&&(n.found="wc-ajax=add_to_cart"),!1!==n.found){var o="",a="",c="";if(+ctPublic.settings__data__bot_detector_enabled?(i=(new r).toolGetEventToken())&&(o=n.keepUnwrapped?"ct_bot_detector_event_token="+i+"&":"data%5Bct_bot_detector_event_token%5D="+i+"&"):(a=getNoCookieData(),a=n.keepUnwrapped?"ct_no_cookie_hidden_field="+a+"&":"data%5Bct_no_cookie_hidden_field%5D="+a+"&"),n.attachVisibleFieldsData){var i=!1,n=ApbctVisibleFieldsExtractor.createExtractor(n.found);if("string"==typeof(i=n?n.extract(t.data):i))try{c="apbct_visible_fields="+encodeURIComponent(i)+"&"}catch(e){}}t.data=a+o+c+t.data}}})}},{key:"catchWCRestRequestAsMiddleware",value:function(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){var n;return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&void 0!==e.data&&e.hasOwnProperty("path")&&void 0!==e.path&&(e.data.hasOwnProperty("requests")&&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/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 8eac996ce..adbdd32e4 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -2831,7 +2831,6 @@ class ApbctHandler { * @return {void} */ detectForcedAltCookiesForms() { - let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0; let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0; let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0; let userRegistrationProForm = document.querySelectorAll('div[id^="user-registration-form"]').length > 0; @@ -2843,7 +2842,6 @@ class ApbctHandler { let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || - elementorUltimateAddonsRegister || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || @@ -3269,6 +3267,13 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; sourceSign.attachVisibleFieldsData = true; } + if ( + settings.data.indexOf('action=uael_register_user') !== -1 && + ctPublic.data__cookies_type === 'none' + ) { + sourceSign.found = 'action=uael_register_user'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index 94430dbac..f156ffaf7 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -2831,7 +2831,6 @@ class ApbctHandler { * @return {void} */ detectForcedAltCookiesForms() { - let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0; let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0; let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0; let userRegistrationProForm = document.querySelectorAll('div[id^="user-registration-form"]').length > 0; @@ -2843,7 +2842,6 @@ class ApbctHandler { let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || - elementorUltimateAddonsRegister || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || @@ -3269,6 +3267,13 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; sourceSign.attachVisibleFieldsData = true; } + if ( + settings.data.indexOf('action=uael_register_user') !== -1 && + ctPublic.data__cookies_type === 'none' + ) { + sourceSign.found = 'action=uael_register_user'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index 7b83af140..9f3d2e684 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -2831,7 +2831,6 @@ class ApbctHandler { * @return {void} */ detectForcedAltCookiesForms() { - let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0; let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0; let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0; let userRegistrationProForm = document.querySelectorAll('div[id^="user-registration-form"]').length > 0; @@ -2843,7 +2842,6 @@ class ApbctHandler { let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || - elementorUltimateAddonsRegister || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || @@ -3269,6 +3267,13 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; sourceSign.attachVisibleFieldsData = true; } + if ( + settings.data.indexOf('action=uael_register_user') !== -1 && + ctPublic.data__cookies_type === 'none' + ) { + sourceSign.found = 'action=uael_register_user'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 031cad4c5..98c8e7aa7 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -2831,7 +2831,6 @@ class ApbctHandler { * @return {void} */ detectForcedAltCookiesForms() { - let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0; let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0; let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0; let userRegistrationProForm = document.querySelectorAll('div[id^="user-registration-form"]').length > 0; @@ -2843,7 +2842,6 @@ class ApbctHandler { let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || - elementorUltimateAddonsRegister || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || @@ -3269,6 +3267,13 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; sourceSign.attachVisibleFieldsData = true; } + if ( + settings.data.indexOf('action=uael_register_user') !== -1 && + ctPublic.data__cookies_type === 'none' + ) { + sourceSign.found = 'action=uael_register_user'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index d8e7f9cdc..b2275dac4 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -2831,7 +2831,6 @@ class ApbctHandler { * @return {void} */ detectForcedAltCookiesForms() { - let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0; let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0; let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0; let userRegistrationProForm = document.querySelectorAll('div[id^="user-registration-form"]').length > 0; @@ -2843,7 +2842,6 @@ class ApbctHandler { let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || - elementorUltimateAddonsRegister || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || @@ -3269,6 +3267,13 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; sourceSign.attachVisibleFieldsData = true; } + if ( + settings.data.indexOf('action=uael_register_user') !== -1 && + ctPublic.data__cookies_type === 'none' + ) { + sourceSign.found = 'action=uael_register_user'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index ab7344eec..c88ed83b9 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -2831,7 +2831,6 @@ class ApbctHandler { * @return {void} */ detectForcedAltCookiesForms() { - let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0; let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0; let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0; let userRegistrationProForm = document.querySelectorAll('div[id^="user-registration-form"]').length > 0; @@ -2843,7 +2842,6 @@ class ApbctHandler { let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || - elementorUltimateAddonsRegister || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || @@ -3269,6 +3267,13 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; sourceSign.attachVisibleFieldsData = true; } + if ( + settings.data.indexOf('action=uael_register_user') !== -1 && + ctPublic.data__cookies_type === 'none' + ) { + sourceSign.found = 'action=uael_register_user'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index 3e99dcbc9..59afe43c1 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -2831,7 +2831,6 @@ class ApbctHandler { * @return {void} */ detectForcedAltCookiesForms() { - let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0; let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0; let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0; let userRegistrationProForm = document.querySelectorAll('div[id^="user-registration-form"]').length > 0; @@ -2843,7 +2842,6 @@ class ApbctHandler { let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || - elementorUltimateAddonsRegister || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || @@ -3269,6 +3267,13 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; sourceSign.attachVisibleFieldsData = true; } + if ( + settings.data.indexOf('action=uael_register_user') !== -1 && + ctPublic.data__cookies_type === 'none' + ) { + sourceSign.found = 'action=uael_register_user'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index b8ff3ea65..7a7495483 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -2831,7 +2831,6 @@ class ApbctHandler { * @return {void} */ detectForcedAltCookiesForms() { - let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0; let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0; let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0; let userRegistrationProForm = document.querySelectorAll('div[id^="user-registration-form"]').length > 0; @@ -2843,7 +2842,6 @@ class ApbctHandler { let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || - elementorUltimateAddonsRegister || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || @@ -3269,6 +3267,13 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; sourceSign.attachVisibleFieldsData = true; } + if ( + settings.data.indexOf('action=uael_register_user') !== -1 && + ctPublic.data__cookies_type === 'none' + ) { + sourceSign.found = 'action=uael_register_user'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index 4ff80c9e4..9071f2bb6 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -489,7 +489,6 @@ class ApbctHandler { * @return {void} */ detectForcedAltCookiesForms() { - let elementorUltimateAddonsRegister = document.querySelectorAll('.uael-registration-form-wrapper').length > 0; let smartFormsSign = document.querySelectorAll('script[id*="smart-forms"]').length > 0; let jetpackCommentsForm = document.querySelectorAll('iframe[name="jetpack_remote_comment"]').length > 0; let userRegistrationProForm = document.querySelectorAll('div[id^="user-registration-form"]').length > 0; @@ -501,7 +500,6 @@ class ApbctHandler { let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || - elementorUltimateAddonsRegister || userRegistrationProForm || etPbDiviSubscriptionForm || fluentBookingApp || @@ -927,6 +925,13 @@ class ApbctHandler { sourceSign.keepUnwrapped = true; sourceSign.attachVisibleFieldsData = true; } + if ( + settings.data.indexOf('action=uael_register_user') !== -1 && + ctPublic.data__cookies_type === 'none' + ) { + sourceSign.found = 'action=uael_register_user'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { diff --git a/lib/Cleantalk/Antispam/Integrations/ElementorUltimateAddonsRegister.php b/lib/Cleantalk/Antispam/Integrations/ElementorUltimateAddonsRegister.php index 8aaa83ccd..feaa89b16 100644 --- a/lib/Cleantalk/Antispam/Integrations/ElementorUltimateAddonsRegister.php +++ b/lib/Cleantalk/Antispam/Integrations/ElementorUltimateAddonsRegister.php @@ -2,18 +2,14 @@ namespace Cleantalk\Antispam\Integrations; -use Cleantalk\ApbctWP\Variables\Cookie; - class ElementorUltimateAddonsRegister extends IntegrationBase { public function getDataForChecking($argument) { - Cookie::$force_alt_cookies_global = true; $input_array = apply_filters('apbct__filter_post', $_POST); - $data = ct_get_fields_any($input_array); + $data = ct_gfa_dto($input_array)->getArray(); - $data['event_token'] = Cookie::get('ct_bot_detector_event_token'); $data['register'] = true; return $data; From 0b944220e822214b0cb34dc6e82df82e4dbee4ed Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Mon, 9 Feb 2026 15:40:15 +0700 Subject: [PATCH 26/60] Fix. IntegMailChimp. Clearing all fields except for the field whose name contains message --- .../Antispam/Integrations/MailChimpShadowRoot.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Cleantalk/Antispam/Integrations/MailChimpShadowRoot.php b/lib/Cleantalk/Antispam/Integrations/MailChimpShadowRoot.php index 09f78f2f6..6d0bb6a82 100644 --- a/lib/Cleantalk/Antispam/Integrations/MailChimpShadowRoot.php +++ b/lib/Cleantalk/Antispam/Integrations/MailChimpShadowRoot.php @@ -22,6 +22,17 @@ public function getDataForChecking($argument) $data = ct_gfa_dto($input_array)->getArray(); + // Clean message field - keep only keys containing "message", remove everything else + if (isset($data['message']) && is_array($data['message'])) { + $filtered_message = array(); + foreach ($data['message'] as $key => $value) { + if (stripos($key, 'message') !== false) { + $filtered_message[$key] = $value; + } + } + $data['message'] = !empty($filtered_message) ? implode(' ', $filtered_message) : ''; + } + return $data; } From 9b2e12a0ce8f6c566541fa2018a686a9920ae59c Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 10 Feb 2026 15:49:51 +0700 Subject: [PATCH 27/60] Fix. Code. Edit Remote Calls --- cleantalk.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/cleantalk.php b/cleantalk.php index b28f45cc7..184d95463 100644 --- a/cleantalk.php +++ b/cleantalk.php @@ -2096,6 +2096,11 @@ function apbct_rc__install_plugin($_wp = null, $plugin = null) $plugin = Get::get('plugin') ? Get::get('plugin') : ''; } + $allowed_plugin = 'security-malware-firewall/security-malware-firewall.php'; + if ( !empty($plugin) && TT::toString($plugin) !== $allowed_plugin ) { + die('FAIL ' . json_encode(array('error' => 'PLUGIN_NOT_ALLOWED'))); + } + if ( !empty($plugin) ) { $plugin = TT::toString($plugin); if ( preg_match('/[a-zA-Z-\d]+[\/\\][a-zA-Z-\d]+\.php/', $plugin) ) { @@ -2159,6 +2164,12 @@ function apbct_rc__activate_plugin($plugin) $plugin = Get::get('plugin') ? TT::toString(Get::get('plugin')) : null; } + // Only allow activation of Security by CleanTalk plugin via remote call + $allowed_plugin = 'security-malware-firewall/security-malware-firewall.php'; + if ( $plugin && $plugin !== $allowed_plugin ) { + return array('error' => 'PLUGIN_NOT_ALLOWED'); + } + if ( $plugin ) { if ( preg_match('@[a-zA-Z-\d]+[\\\/][a-zA-Z-\d]+\.php@', $plugin) ) { require_once(ABSPATH . '/wp-admin/includes/plugin.php'); @@ -2199,6 +2210,15 @@ function apbct_rc__deactivate_plugin($plugin = null) $plugin = Get::get('plugin') ? TT::toString(Get::get('plugin')) : null; } + // Only allow deactivation of CleanTalk plugins via remote call + $allowed_plugins = array( + 'cleantalk-spam-protect/cleantalk.php', + 'security-malware-firewall/security-malware-firewall.php', + ); + if ( $plugin && !in_array($plugin, $allowed_plugins, true) ) { + die('FAIL ' . json_encode(array('error' => 'PLUGIN_NOT_ALLOWED'))); + } + if ( $plugin ) { // Switching complete deactivation for security if ( $plugin === 'security-malware-firewall/security-malware-firewall.php' && ! empty(Get::get('misc__complete_deactivation')) ) { @@ -2245,6 +2265,15 @@ function apbct_rc__uninstall_plugin($plugin = null) $plugin = Get::get('plugin') ? TT::toString(Get::get('plugin')) : null; } + // Only allow uninstallation of CleanTalk plugins via remote call + $allowed_plugins = array( + 'cleantalk-spam-protect/cleantalk.php', + 'security-malware-firewall/security-malware-firewall.php', + ); + if ( $plugin && !in_array($plugin, $allowed_plugins, true) ) { + die('FAIL ' . json_encode(array('error' => 'PLUGIN_NOT_ALLOWED'))); + } + if ( $plugin ) { // Switching complete deactivation for security if ( $plugin === 'security-malware-firewall/security-malware-firewall.php' && ! empty(Get::get('misc__complete_deactivation')) ) { From ac1c76e725fb8d4e66a9c7a14b918f8855d4681b Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 10 Feb 2026 16:49:28 +0700 Subject: [PATCH 28/60] Fix. AdminActions. Checking permissions for Actions --- inc/cleantalk-admin.php | 12 +++++++++ inc/cleantalk-settings.php | 35 +++++++++++++++++++++++++ js/src/cleantalk-admin-settings-page.js | 16 ++++++----- 3 files changed, 56 insertions(+), 7 deletions(-) diff --git a/inc/cleantalk-admin.php b/inc/cleantalk-admin.php index c19a2c08e..1a79caf65 100644 --- a/inc/cleantalk-admin.php +++ b/inc/cleantalk-admin.php @@ -1551,6 +1551,10 @@ function apbct_action_adjust_change() { AJAXService::checkAdminNonce(); + if(!current_user_can('activate_plugins')) { + wp_send_json_error('Permission denied'); + } + if (in_array(Post::get('adjust'), array_keys(AdjustToEnvironmentHandler::SET_OF_ADJUST))) { try { $adjust = Post::getString('adjust'); @@ -1570,6 +1574,10 @@ function apbct_action_adjust_reverse() { AJAXService::checkAdminNonce(); + if (!current_user_can('activate_plugins')) { + wp_send_json_error('Permission denied'); + } + if (in_array(Post::getString('adjust'), array_keys(AdjustToEnvironmentHandler::SET_OF_ADJUST))) { $adjust = Post::getString('adjust'); try { @@ -1586,6 +1594,10 @@ function apbct_action_adjust_reverse() function apbct_action__create_support_user() { + if (!current_user_can('activate_plugins')) { + wp_send_json_error('Permission denied'); + } + $support_user = new SupportUser(); $result = $support_user->ajaxProcess(); wp_send_json($result); diff --git a/inc/cleantalk-settings.php b/inc/cleantalk-settings.php index 654687a25..062d55c38 100644 --- a/inc/cleantalk-settings.php +++ b/inc/cleantalk-settings.php @@ -2592,6 +2592,15 @@ function apbct_settings__sync($direct_call = false) global $apbct; + if (!current_user_can('activate_plugins')) { + $out = array( + 'success' => false, + 'reload' => false, + 'message' => __('You do not have sufficient permissions to access this page.', 'cleantalk-spam-protect'), + ); + die(json_encode($out)); + } + //Clearing all errors $apbct->errorDeleteAll(true); @@ -2720,6 +2729,15 @@ function apbct_settings__get_key_auto($direct_call = false) global $apbct; + if(!current_user_can('activate_plugins')) { + $out = array( + 'success' => false, + 'message' => __('You do not have sufficient permissions to access this page.', 'cleantalk-spam-protect'), + + ); + die(json_encode($out)); + } + $website = parse_url(get_option('home'), PHP_URL_HOST) . parse_url(get_option('home'), PHP_URL_PATH); $platform = 'wordpress'; $user_ip = Helper::ipGet('real', false); @@ -2983,6 +3001,14 @@ function apbct_settings__get__long_description() global $apbct; AJAXService::checkAdminNonce(); + if(!current_user_can('activate_plugins')) { + $out = array( + 'success' => false, + 'message' => __('You do not have sufficient permissions to access this page.', 'cleantalk-spam-protect'), + ); + die(json_encode($out)); + } + $setting_id = TT::toString(Post::get('setting_id', null, 'word')); $link_exclusion_by_form_signs = LinkConstructor::buildCleanTalkLink( @@ -3150,6 +3176,15 @@ function apbct_settings__check_renew_banner() AJAXService::checkAdminNonce(); + if(!current_user_can('activate_plugins')) { + $out = array( + 'success' => false, + 'close_renew_banner' => false, + 'message' => __('You do not have sufficient permissions to access this page.', 'cleantalk-spam-protect'), + ); + die(json_encode($out)); + } + die( json_encode( array('close_renew_banner' => ($apbct->data['notice_trial'] == 0 && $apbct->data['notice_renew'] == 0) ? true : false) diff --git a/js/src/cleantalk-admin-settings-page.js b/js/src/cleantalk-admin-settings-page.js index 2b569b0ce..04636f30b 100644 --- a/js/src/cleantalk-admin-settings-page.js +++ b/js/src/cleantalk-admin-settings-page.js @@ -724,13 +724,15 @@ function apbctSettingsShowDescription(label, settingId) { { spinner: obj.children('img'), callback: function(result, data, params, obj) { - obj.empty() - .append('
') - .append('') - .append('

'+result.title+'

') - .append('

'+result.desc+'

'); - - jQuery(document).on('click', removeDescFunc); + if (result && result.title && result.desc) { + obj.empty() + .append('
') + .append('') + .append('

'+result.title+'

') + .append('

'+result.desc+'

'); + + jQuery(document).on('click', removeDescFunc); + } }, }, obj, From e8a2ec37034085642b3307d08e0bb40a5ff9adc6 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 10 Feb 2026 16:57:17 +0700 Subject: [PATCH 29/60] Rebuild js --- js/cleantalk-admin-settings-page.min.js | 2 +- js/cleantalk-admin-settings-page.min.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/cleantalk-admin-settings-page.min.js b/js/cleantalk-admin-settings-page.min.js index a21ac484c..c6f8fd3f7 100644 --- a/js/cleantalk-admin-settings-page.min.js +++ b/js/cleantalk-admin-settings-page.min.js @@ -1,2 +1,2 @@ -function handleAnchorDetection(t){"none"===document.querySelector("#apbct_settings__advanced_settings").style.display&&apbctExceptedShowHide("apbct_settings__advanced_settings"),scrollToAnchor("#"+t)}function scrollToAnchor(t){t=document.querySelector(t);t&&t.scrollIntoView({block:"end"})}function apbctManageEmailEncoderCustomTextField(){var t=document.querySelector("#apbct_setting_data__email_decoder_obfuscation_custom_text");let e;null!==t&&(e=void 0!==t.parentElement?t.parentElement:null),document.querySelectorAll(".apbct_setting---data__email_decoder_obfuscation_mode").forEach(t=>{e&&t.checked&&"replace"!==t.value&&e.classList.add("hidden"),t.addEventListener("click",t=>{void 0!==e&&("replace"===t.target.value?e.classList.remove("hidden"):e.classList.add("hidden"))})})}function apbctBannerCheck(){let c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbctGetElems(a){for(let t=0,e=(a=a.split(",")).length,n;t{document.getElementById(t)&&"none"!==document.getElementById(t).style.display&&apbctShowHideElem(t)})}function apbctShowRequiredGroups(t,e){var n=document.getElementById("apbct_settings__dwpms_settings");n&&"none"===n.style.display&&((n=t).preventDefault(),apbctShowHideElem("apbct_settings__dwpms_settings"),document.getElementById(e).dispatchEvent(new n.constructor(n.type,n)))}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbctGetElemsNative(t).forEach(function(t,e,n){var a;1===(c=null===c?null===t.getAttribute("disabled")?0:1:c)?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null!==t.getAttribute("apbct_children")&&null!==(a=apbctSettingsDependenciesGetState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependenciesGetState(t){let e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbctSettingsShowDescription(t,e){function c(t){var e=0!=jQuery(t.target).parent(".apbct_long_desc").length,t=jQuery(t.target).hasClass("apbct_long_desc__cancel");(0
");var n=jQuery("#apbct_long_desc__"+e);n.append("").append("
").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){a.empty().append("
").append("").append("

"+t.title+"

").append("

"+t.desc+"

"),jQuery(document).on("click",c)}},n)}function apbctNavigationMenuPosition(){var t,e,n=document.querySelector("#apbct_hidden_section_nav ul"),a=document.querySelector("#apbct_settings__button_section");n&&a&&(t=window.scrollY,e=window.innerWidth,1e3"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");let n={};if(e.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{if("new_template"===t.data("id")){var a=e.val();if(""===a)return void e.css("border-color","red");n={template_name:a}}else n={template_id:t.data("id")};let c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:n},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){let c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&(ctSettingsPage.key_changed?(jQuery(".key_changed_sync").hide(300),jQuery(".key_changed_success").show(300),setTimeout(function(){document.location.reload()},3e3)):document.location.reload())}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){apbctSettingsShowDescription(self=jQuery(this),self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbctBannerCheck(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()}),apbctSaveButtonPosition();let e;window.addEventListener("scroll",function(){clearTimeout(e),e=setTimeout(function(){apbctSaveButtonPosition()},50),apbctNavigationMenuPosition()}),jQuery("#ct_adv_showhide a").on("click",apbctSaveButtonPosition),jQuery("#apbct-change-account-email").on("click",function(t){t.preventDefault();var t=jQuery(this),e=jQuery("#apbct-account-email"),n=e.text();t.toggleClass("active"),t.hasClass("active")?(t.text(t.data("save-text")),e.attr("contenteditable","true"),e.on("keydown",function(t){"Enter"===t.code&&t.preventDefault()}),e.on("input",function(t){"insertParagraph"===t.inputType&&t.preventDefault()})):(apbct_admin_sendAJAX({action:"apbct_update_account_email",accountEmail:n},{timeout:5e3,callback:function(t,e,n,a){void 0!==t.success&&"ok"===t.success&&void 0!==t.manuallyLink&&jQuery("#apbct-key-manually-link").attr("href",t.manuallyLink),void 0!==t.error&&jQuery("#apbct-account-email").css("border-color","red")}}),e.attr("contenteditable","false"),t.text(t.data("default-text")))}),jQuery("#apbct_setting_apikey").on("input",function(){var t=jQuery(this).val(),e=(jQuery("#apbct_settings__key_line__save_settings").off("click"),""!==t&&null===t.match(/^[a-z\d]{8,30}\s*$/));jQuery("#apbct_settings__key_is_bad").hide(),jQuery("#apbct_showApiKey").hide(),jQuery("#apbct_settings__account_name_ob").hide(),jQuery("#apbct_settings__no_agreement_notice").hide(),""===t?(jQuery("#apbct_button__key_line__save_changes_wrapper").hide(),jQuery("#apbct_button__get_key_auto__wrapper").show(),jQuery("#apbct_button__get_key_manual_chunk").show()):(jQuery("#apbct_button__key_line__save_changes_wrapper").show(),jQuery("#apbct_button__get_key_auto__wrapper").hide(),jQuery("#apbct_button__get_key_manual_chunk").hide(),e&&jQuery("#apbct_settings__key_line__save_settings").on("click",function(t){t.preventDefault(),jQuery("#apbct_settings__key_is_bad").show(),apbctHighlightElement("apbct_setting_apikey",3)}))}),jQuery("#apbct_setting_apikey").val()&&ctSettingsPage.key_is_ok&&jQuery("#apbct_button__get_key_auto__wrapper").hide(),ctSettingsPage.key_is_ok||ctSettingsPage.ip_license||jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#sync_required_notice").length||jQuery("

Synchronization process failed. Please, check the acces key and restart the synch.

").insertAfter(jQuery("#apbct_button__sync")),apbctHighlightElement("apbct_setting_apikey",3),apbctHighlightElement("apbct_button__sync",3),jQuery("#apbct_button__get_key_auto__wrapper").show()}),jQuery("#apbct-custom-logo-open-gallery").click(function(t){t.preventDefault();let e=jQuery(this),n=wp.media({library:{type:"image"},multiple:!1});n.on("select",function(){var t=n.state().get("selection").first().toJSON();e.parent().prev().attr("src",t.url),jQuery("#cleantalk_custom_logo").val(t.id)}),n.open()}),jQuery("#apbct-custom-logo-remove-image").click(function(t){t.preventDefault(),!0===confirm("Sure?")&&(t=jQuery(this).parent().prev().data("src"),jQuery(this).parent().prev().attr("src",t),jQuery(this).prev().prev().val(""))}),jQuery('button[id*="apbct-action-adjust-change-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_change"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-change-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),jQuery('button[id*="apbct-action-adjust-reverse-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_reverse"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-reverse-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),document.querySelector(".apbct_hidden_section_nav_mob_btn").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="block",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="none"}),document.querySelector(".apbct_hidden_section_nav_mob_btn-close").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="none",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="block"}),apbctManageEmailEncoderCustomTextField(),window.location.hash&&handleAnchorDetection(window.location.hash.substring(1))}); +function handleAnchorDetection(t){"none"===document.querySelector("#apbct_settings__advanced_settings").style.display&&apbctExceptedShowHide("apbct_settings__advanced_settings"),scrollToAnchor("#"+t)}function scrollToAnchor(t){t=document.querySelector(t);t&&t.scrollIntoView({block:"end"})}function apbctManageEmailEncoderCustomTextField(){var t=document.querySelector("#apbct_setting_data__email_decoder_obfuscation_custom_text");let e;null!==t&&(e=void 0!==t.parentElement?t.parentElement:null),document.querySelectorAll(".apbct_setting---data__email_decoder_obfuscation_mode").forEach(t=>{e&&t.checked&&"replace"!==t.value&&e.classList.add("hidden"),t.addEventListener("click",t=>{void 0!==e&&("replace"===t.target.value?e.classList.remove("hidden"):e.classList.add("hidden"))})})}function apbctBannerCheck(){let c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbctGetElems(a){for(let t=0,e=(a=a.split(",")).length,n;t{document.getElementById(t)&&"none"!==document.getElementById(t).style.display&&apbctShowHideElem(t)})}function apbctShowRequiredGroups(t,e){var n=document.getElementById("apbct_settings__dwpms_settings");n&&"none"===n.style.display&&((n=t).preventDefault(),apbctShowHideElem("apbct_settings__dwpms_settings"),document.getElementById(e).dispatchEvent(new n.constructor(n.type,n)))}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbctGetElemsNative(t).forEach(function(t,e,n){var a;1===(c=null===c?null===t.getAttribute("disabled")?0:1:c)?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null!==t.getAttribute("apbct_children")&&null!==(a=apbctSettingsDependenciesGetState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependenciesGetState(t){let e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbctSettingsShowDescription(t,e){function c(t){var e=0!=jQuery(t.target).parent(".apbct_long_desc").length,t=jQuery(t.target).hasClass("apbct_long_desc__cancel");(0
");var n=jQuery("#apbct_long_desc__"+e);n.append("").append("
").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){t&&t.title&&t.desc&&(a.empty().append("
").append("").append("

"+t.title+"

").append("

"+t.desc+"

"),jQuery(document).on("click",c))}},n)}function apbctNavigationMenuPosition(){var t,e,n=document.querySelector("#apbct_hidden_section_nav ul"),a=document.querySelector("#apbct_settings__button_section");n&&a&&(t=window.scrollY,e=window.innerWidth,1e3"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");let n={};if(e.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{if("new_template"===t.data("id")){var a=e.val();if(""===a)return void e.css("border-color","red");n={template_name:a}}else n={template_id:t.data("id")};let c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:n},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){let c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&(ctSettingsPage.key_changed?(jQuery(".key_changed_sync").hide(300),jQuery(".key_changed_success").show(300),setTimeout(function(){document.location.reload()},3e3)):document.location.reload())}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){apbctSettingsShowDescription(self=jQuery(this),self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbctBannerCheck(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()}),apbctSaveButtonPosition();let e;window.addEventListener("scroll",function(){clearTimeout(e),e=setTimeout(function(){apbctSaveButtonPosition()},50),apbctNavigationMenuPosition()}),jQuery("#ct_adv_showhide a").on("click",apbctSaveButtonPosition),jQuery("#apbct-change-account-email").on("click",function(t){t.preventDefault();var t=jQuery(this),e=jQuery("#apbct-account-email"),n=e.text();t.toggleClass("active"),t.hasClass("active")?(t.text(t.data("save-text")),e.attr("contenteditable","true"),e.on("keydown",function(t){"Enter"===t.code&&t.preventDefault()}),e.on("input",function(t){"insertParagraph"===t.inputType&&t.preventDefault()})):(apbct_admin_sendAJAX({action:"apbct_update_account_email",accountEmail:n},{timeout:5e3,callback:function(t,e,n,a){void 0!==t.success&&"ok"===t.success&&void 0!==t.manuallyLink&&jQuery("#apbct-key-manually-link").attr("href",t.manuallyLink),void 0!==t.error&&jQuery("#apbct-account-email").css("border-color","red")}}),e.attr("contenteditable","false"),t.text(t.data("default-text")))}),jQuery("#apbct_setting_apikey").on("input",function(){var t=jQuery(this).val(),e=(jQuery("#apbct_settings__key_line__save_settings").off("click"),""!==t&&null===t.match(/^[a-z\d]{8,30}\s*$/));jQuery("#apbct_settings__key_is_bad").hide(),jQuery("#apbct_showApiKey").hide(),jQuery("#apbct_settings__account_name_ob").hide(),jQuery("#apbct_settings__no_agreement_notice").hide(),""===t?(jQuery("#apbct_button__key_line__save_changes_wrapper").hide(),jQuery("#apbct_button__get_key_auto__wrapper").show(),jQuery("#apbct_button__get_key_manual_chunk").show()):(jQuery("#apbct_button__key_line__save_changes_wrapper").show(),jQuery("#apbct_button__get_key_auto__wrapper").hide(),jQuery("#apbct_button__get_key_manual_chunk").hide(),e&&jQuery("#apbct_settings__key_line__save_settings").on("click",function(t){t.preventDefault(),jQuery("#apbct_settings__key_is_bad").show(),apbctHighlightElement("apbct_setting_apikey",3)}))}),jQuery("#apbct_setting_apikey").val()&&ctSettingsPage.key_is_ok&&jQuery("#apbct_button__get_key_auto__wrapper").hide(),ctSettingsPage.key_is_ok||ctSettingsPage.ip_license||jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#sync_required_notice").length||jQuery("

Synchronization process failed. Please, check the acces key and restart the synch.

").insertAfter(jQuery("#apbct_button__sync")),apbctHighlightElement("apbct_setting_apikey",3),apbctHighlightElement("apbct_button__sync",3),jQuery("#apbct_button__get_key_auto__wrapper").show()}),jQuery("#apbct-custom-logo-open-gallery").click(function(t){t.preventDefault();let e=jQuery(this),n=wp.media({library:{type:"image"},multiple:!1});n.on("select",function(){var t=n.state().get("selection").first().toJSON();e.parent().prev().attr("src",t.url),jQuery("#cleantalk_custom_logo").val(t.id)}),n.open()}),jQuery("#apbct-custom-logo-remove-image").click(function(t){t.preventDefault(),!0===confirm("Sure?")&&(t=jQuery(this).parent().prev().data("src"),jQuery(this).parent().prev().attr("src",t),jQuery(this).prev().prev().val(""))}),jQuery('button[id*="apbct-action-adjust-change-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_change"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-change-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),jQuery('button[id*="apbct-action-adjust-reverse-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_reverse"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-reverse-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),document.querySelector(".apbct_hidden_section_nav_mob_btn").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="block",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="none"}),document.querySelector(".apbct_hidden_section_nav_mob_btn-close").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="none",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="block"}),apbctManageEmailEncoderCustomTextField(),window.location.hash&&handleAnchorDetection(window.location.hash.substring(1))}); //# sourceMappingURL=cleantalk-admin-settings-page.min.js.map diff --git a/js/cleantalk-admin-settings-page.min.js.map b/js/cleantalk-admin-settings-page.min.js.map index eea0815e3..53d92b133 100644 --- a/js/cleantalk-admin-settings-page.min.js.map +++ b/js/cleantalk-admin-settings-page.min.js.map @@ -1 +1 @@ -{"version":3,"file":"cleantalk-admin-settings-page.min.js","sources":["cleantalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function() {\n // Crunch for Right to Left direction languages\n if (document.getElementsByClassName('apbct_settings-title')[0]) {\n if (getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl') {\n jQuery('.apbct_switchers').css('text-align', 'right');\n }\n }\n\n // Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function(e) {\n e.preventDefault();\n jQuery(this).hide();\n jQuery('.apbct_settings-field--api_key').val(jQuery('.apbct_settings-field--api_key').attr('key'));\n jQuery('.apbct_settings-field--api_key+div').css('display', 'inline');\n });\n\n let d = new Date();\n let timezone = d.getTimezoneOffset()/60*(-1);\n jQuery('#ct_admin_timezone').val(timezone);\n\n // Key KEY automatically\n jQuery('#apbct_button__get_key_auto').on('click', function() {\n if (!jQuery('#apbct_license_agreed').is(':checked')) {\n jQuery('#apbct_settings__no_agreement_notice').show();\n apbctHighlightElement('apbct_license_agreed', 3);\n return;\n }\n apbct_admin_sendAJAX(\n {action: 'apbct_get_key_auto', ct_admin_timezone: timezone},\n {\n timeout: 25000,\n button: document.getElementById('apbct_button__get_key_auto' ),\n spinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#apbct_button__get_key_auto .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);\n }, 2000);\n if (result.reload) {\n document.location.reload();\n }\n if (result.getTemplates) {\n cleantalkModal.loaded = result.getTemplates;\n cleantalkModal.open();\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n }\n },\n },\n );\n });\n\n // Import settings\n jQuery( document ).on('click', '#apbct_settings_templates_import_button', function() {\n jQuery('#apbct-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\n let templateNameInput = jQuery('#apbct_settings_templates_import_name');\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n let data = {\n 'template_id': optionSelected.data('id'),\n 'template_name': optionSelected.data('name'),\n 'settings': optionSelected.data('settings'),\n };\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_import', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Export settings\n jQuery( document ).on('click', '#apbct_settings_templates_export_button', function() {\n jQuery('#apbct-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\n let templateNameInput = jQuery('#apbct_settings_templates_export_name');\n let data = {};\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n if ( optionSelected.data('id') === 'new_template' ) {\n let templateName = templateNameInput.val();\n if ( templateName === '' ) {\n templateNameInput.css('border-color', 'red');\n return;\n }\n data = {\n 'template_name': templateName,\n };\n } else {\n data = {\n 'template_id': optionSelected.data('id'),\n };\n }\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_export', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Reset settings\n jQuery( document ).on('click', '#apbct_settings_templates_reset_button', function() {\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_reset'},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Sync button\n jQuery('#apbct_button__sync').on('click', function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_sync'},\n {\n timeout: 25000,\n button: document.getElementById('apbct_button__sync' ),\n spinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#apbct_button__sync .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_button__sync .apbct_success').hide(300);\n }, 2000);\n if (result.reload) {\n if ( ctSettingsPage.key_changed ) {\n jQuery('.key_changed_sync').hide(300);\n jQuery('.key_changed_success').show(300);\n setTimeout(function() {\n document.location.reload();\n }, 3000);\n } else {\n document.location.reload();\n }\n }\n },\n },\n );\n });\n\n if ( ctSettingsPage.key_changed ) {\n jQuery('#apbct_button__sync').click();\n }\n\n jQuery(document).on('click', '.apbct_settings-long_description---show', function() {\n self = jQuery(this);\n apbctSettingsShowDescription(self, self.attr('setting'));\n });\n\n if (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length) {\n apbctBannerCheck();\n }\n\n jQuery(document).on('change', '#apbct_settings_templates_export', function() {\n let optionSelected = jQuery('option:selected', this);\n if ( optionSelected.data('id') === 'new_template' ) {\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\n } else {\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\n }\n });\n\n apbctSaveButtonPosition();\n let debounceTimer;\n window.addEventListener('scroll', function() {\n clearTimeout(debounceTimer);\n debounceTimer = setTimeout(function() {\n apbctSaveButtonPosition();\n }, 50);\n apbctNavigationMenuPosition();\n });\n jQuery('#ct_adv_showhide a').on('click', apbctSaveButtonPosition);\n\n\n /**\n * Change cleantalk account email\n */\n jQuery('#apbct-change-account-email').on('click', function(e) {\n e.preventDefault();\n\n let $this = jQuery(this);\n let accountEmailField = jQuery('#apbct-account-email');\n let accountEmail = accountEmailField.text();\n\n $this.toggleClass('active');\n\n if ($this.hasClass('active')) {\n $this.text($this.data('save-text'));\n accountEmailField.attr('contenteditable', 'true');\n accountEmailField.on('keydown', function(e) {\n if (e.code === 'Enter') {\n e.preventDefault();\n }\n });\n accountEmailField.on('input', function(e) {\n if (e.inputType === 'insertParagraph') {\n e.preventDefault();\n }\n });\n } else {\n apbct_admin_sendAJAX(\n {\n action: 'apbct_update_account_email',\n accountEmail: accountEmail,\n },\n {\n timeout: 5000,\n callback: function(result, data, params, obj) {\n if (result.success !== undefined && result.success === 'ok') {\n if (result.manuallyLink !== undefined) {\n jQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);\n }\n }\n\n if (result.error !== undefined) {\n jQuery('#apbct-account-email').css('border-color', 'red');\n }\n },\n },\n );\n\n accountEmailField.attr('contenteditable', 'false');\n $this.text($this.data('default-text'));\n }\n });\n\n /**\n * Validate apkikey and hide get auto btn\n */\n jQuery('#apbct_setting_apikey').on('input', function() {\n let enteredValue = jQuery(this).val();\n jQuery('#apbct_settings__key_line__save_settings').off('click');\n let keyBad = enteredValue !== '' && enteredValue.match(/^[a-z\\d]{8,30}\\s*$/) === null;\n jQuery('#apbct_settings__key_is_bad').hide();\n jQuery('#apbct_showApiKey').hide();\n jQuery('#apbct_settings__account_name_ob').hide();\n jQuery('#apbct_settings__no_agreement_notice').hide();\n if (enteredValue === '') {\n jQuery('#apbct_button__key_line__save_changes_wrapper').hide();\n jQuery('#apbct_button__get_key_auto__wrapper').show();\n jQuery('#apbct_button__get_key_manual_chunk').show();\n } else {\n jQuery('#apbct_button__key_line__save_changes_wrapper').show();\n jQuery('#apbct_button__get_key_auto__wrapper').hide();\n jQuery('#apbct_button__get_key_manual_chunk').hide();\n if (keyBad) {\n jQuery('#apbct_settings__key_line__save_settings').on('click',\n function(e) {\n e.preventDefault();\n jQuery('#apbct_settings__key_is_bad').show();\n apbctHighlightElement('apbct_setting_apikey', 3);\n },\n );\n }\n }\n });\n\n if ( jQuery('#apbct_setting_apikey').val() && ctSettingsPage.key_is_ok) {\n jQuery('#apbct_button__get_key_auto__wrapper').hide();\n }\n\n /**\n * Handle synchronization errors when key is no ok to force user check the key and restart the sync\n */\n if ( !ctSettingsPage.key_is_ok && !ctSettingsPage.ip_license ) {\n jQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n function(e) {\n e.preventDefault();\n if (!jQuery('#sync_required_notice').length) {\n jQuery( '

' +\n 'Synchronization process failed. Please, check the acces key and restart the synch.' +\n '

' ).insertAfter( jQuery('#apbct_button__sync') );\n }\n apbctHighlightElement('apbct_setting_apikey', 3);\n apbctHighlightElement('apbct_button__sync', 3);\n jQuery('#apbct_button__get_key_auto__wrapper').show();\n },\n );\n }\n\n /**\n * Open WP gallery for adding custom logo\n */\n jQuery('#apbct-custom-logo-open-gallery').click(function(e) {\n e.preventDefault();\n\n const button = jQuery(this);\n\n const customUploader = wp.media({\n library: {\n type: 'image',\n },\n multiple: false,\n });\n\n customUploader.on('select', function() {\n const image = customUploader.state().get('selection').first().toJSON();\n\n button.parent().prev().attr( 'src', image.url );\n jQuery('#cleantalk_custom_logo').val( image.id );\n });\n\n customUploader.open();\n });\n\n /**\n * Remove selected logo\n */\n jQuery('#apbct-custom-logo-remove-image').click(function(e) {\n e.preventDefault();\n\n if ( true === confirm( 'Sure?' ) ) {\n const src = jQuery(this).parent().prev().data('src');\n jQuery(this).parent().prev().attr('src', src);\n jQuery(this).prev().prev().val('');\n }\n });\n\n jQuery('button[id*=\"apbct-action-adjust-change-\"]').click(function(e) {\n e.preventDefault();\n\n let data = {};\n data.action = 'apbct_action_adjust_change';\n data.adjust = jQuery(this).data('adjust');\n\n let params = {};\n params.button = document.getElementById('apbct-action-adjust-change-' + data.adjust);\n params.notJson = true;\n\n params.callback = function() {\n document.location.reload();\n };\n\n apbct_admin_sendAJAX(data, params);\n });\n\n jQuery('button[id*=\"apbct-action-adjust-reverse-\"]').click(function(e) {\n e.preventDefault();\n\n let data = {};\n data.action = 'apbct_action_adjust_reverse';\n data.adjust = jQuery(this).data('adjust');\n\n let params = {};\n params.button = document.getElementById('apbct-action-adjust-reverse-' + data.adjust);\n params.notJson = true;\n\n params.callback = function() {\n document.location.reload();\n };\n\n apbct_admin_sendAJAX(data, params);\n });\n\n document.querySelector('.apbct_hidden_section_nav_mob_btn').addEventListener('click', () => {\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'block';\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'none';\n });\n\n document.querySelector('.apbct_hidden_section_nav_mob_btn-close').addEventListener('click', () => {\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'none';\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'block';\n });\n\n // Hide/show EmailEncoder replacing text textarea\n apbctManageEmailEncoderCustomTextField();\n\n if (window.location.hash) {\n const anchor = window.location.hash.substring(1);\n handleAnchorDetection(anchor);\n }\n});\n\n/**\n * Detect ancors and open advanced settings before scroll\n * @param {string} anchor\n */\nfunction handleAnchorDetection(anchor) {\n let advSettings = document.querySelector('#apbct_settings__advanced_settings');\n if ( 'none' === advSettings.style.display ) {\n apbctExceptedShowHide('apbct_settings__advanced_settings');\n }\n scrollToAnchor('#' + anchor);\n}\n\n/**\n * Scroll to the target element ID\n * @param {string} anchorId Anchor target element ID\n */\nfunction scrollToAnchor(anchorId) {\n const targetElement = document.querySelector(anchorId);\n if (targetElement) {\n targetElement.scrollIntoView({\n block: 'end',\n });\n }\n}\n\n/**\n * Hide/show EmailEncoder replacing text textarea\n */\nfunction apbctManageEmailEncoderCustomTextField() {\n const replacingText = document\n .querySelector('#apbct_setting_data__email_decoder_obfuscation_custom_text');\n let replacingTextWrapperSub;\n if (replacingText !== null) {\n replacingTextWrapperSub = typeof replacingText.parentElement !== 'undefined' ?\n replacingText.parentElement :\n null;\n }\n document.querySelectorAll('.apbct_setting---data__email_decoder_obfuscation_mode').forEach((elem) => {\n // visibility set on saved settings\n if (replacingTextWrapperSub && elem.checked && elem.value !== 'replace') {\n replacingTextWrapperSub.classList.add('hidden');\n }\n // visibility set on change\n elem.addEventListener('click', (event) => {\n if (typeof replacingTextWrapperSub !== 'undefined') {\n if (event.target.value === 'replace') {\n replacingTextWrapperSub.classList.remove('hidden');\n } else {\n replacingTextWrapperSub.classList.add('hidden');\n }\n }\n });\n });\n}\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbctBannerCheck() {\n let bannerChecker = setInterval( function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_settings__check_renew_banner'},\n {\n callback: function(result, data, params, obj) {\n if (result.close_renew_banner) {\n if (jQuery('#cleantalk_notice_renew').length) {\n jQuery('#cleantalk_notice_renew').hide('slow');\n }\n if (jQuery('#cleantalk_notice_trial').length) {\n jQuery('#cleantalk_notice_trial').hide('slow');\n }\n clearInterval(bannerChecker);\n }\n },\n },\n );\n }, 900000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param {string|array} elems\n * @return {*}\n */\nfunction apbctGetElems(elems) {\n elems = elems.split(',');\n for ( let i=0, len = elems.length, tmp; i < len; i++) {\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param {string|array} elems\n * @return {array}\n */\nfunction apbctGetElemsNative(elems) {\n // Make array from a string\n if (typeof elems === 'string') {\n elems = elems.split(',');\n }\n\n let out = [];\n\n elems.forEach(function(elem, i, arr) {\n // try to get elements with such IDs\n let tmp = document.getElementById(elem);\n if (tmp !== null) {\n out.push( tmp[key] );\n return;\n }\n\n // try to get elements with such class name\n // write each elem from collection to new element of output array\n tmp = document.getElementsByClassName(elem);\n if (tmp !== null && tmp.length !==0 ) {\n for (key in tmp) {\n if ( +key >= 0 ) {\n out.push( tmp[key] );\n }\n }\n }\n });\n\n return out;\n}\n\n/**\n * @param {string|array} elems\n */\nfunction apbctShowHideElem(elems) {\n elems = apbctGetElems(elems);\n for ( let i=0, len = elems.length; i < len; i++) {\n elems[i].each(function(i, elem) {\n elem = jQuery(elem);\n let label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(':visible')) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * @param {string|array} element\n */\nfunction apbctExceptedShowHide(element) { // eslint-disable-line no-unused-vars\n let toHide = [\n 'apbct_settings__dwpms_settings',\n 'apbct_settings__advanced_settings',\n 'trusted_and_affiliate__special_span',\n ];\n let index = toHide.indexOf(element);\n if (index !== -1) {\n toHide.splice(index, 1);\n }\n apbctShowHideElem(element);\n toHide.forEach((toHideElem) => {\n if (document.getElementById(toHideElem) && document.getElementById(toHideElem).style.display !== 'none') {\n apbctShowHideElem(toHideElem);\n }\n });\n}\n\n/**\n * @param {mixed} event\n * @param {string} id\n */\nfunction apbctShowRequiredGroups(event, id) { // eslint-disable-line no-unused-vars\n let required = document.getElementById('apbct_settings__dwpms_settings');\n if (required && required.style.display === 'none') {\n let originEvent = event;\n event.preventDefault();\n apbctShowHideElem('apbct_settings__dwpms_settings');\n document.getElementById(id).dispatchEvent(new originEvent.constructor(originEvent.type, originEvent));\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param {string|array} ids\n * @param {int} enable\n */\nfunction apbctSettingsDependencies(ids, enable) { // eslint-disable-line no-unused-vars\n enable = ! isNaN(enable) ? enable : null;\n\n // Get elements\n let elems = apbctGetElemsNative( ids );\n\n elems.forEach(function(elem, i, arr) {\n let doDisable = function() {\n elem.setAttribute('disabled', 'disabled');\n };\n let doEnable = function() {\n elem.removeAttribute('disabled');\n };\n\n // Set defined state\n if (enable === null) {\n enable = elem.getAttribute('disabled') === null ? 0 : 1;\n }\n\n enable === 1 ? doEnable() : doDisable();\n\n if ( elem.getAttribute('apbct_children') !== null) {\n let state = apbctSettingsDependenciesGetState( elem ) && enable;\n if ( state !== null ) {\n apbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\n }\n }\n });\n}\n\n/**\n * @param {HTMLElement} elem\n * @return {int|null}\n */\nfunction apbctSettingsDependenciesGetState(elem) {\n let state;\n\n switch ( elem.getAttribute( 'type' ) ) {\n case 'checkbox':\n state = +elem.checked;\n break;\n case 'radio':\n state = +(+elem.getAttribute('value') === 1);\n break;\n default:\n state = null;\n }\n\n return state;\n}\n\n/**\n * @param {HTMLElement} label\n * @param {string} settingId\n */\nfunction apbctSettingsShowDescription(label, settingId) {\n let removeDescFunc = function(e) {\n const callerIsPopup = jQuery(e.target).parent('.apbct_long_desc').length != 0;\n const callerIsHideCross = jQuery(e.target).hasClass('apbct_long_desc__cancel');\n const descIsShown = jQuery('.apbct_long_desc__title').length > 0;\n if (descIsShown && !callerIsPopup || callerIsHideCross) {\n jQuery('.apbct_long_desc').remove();\n jQuery(document).off('click', removeDescFunc);\n }\n };\n\n label.after('
');\n let obj = jQuery('#apbct_long_desc__'+settingId);\n obj.append('')\n .append('
')\n .css({\n top: label.position().top - 5,\n left: label.position().left + 25,\n });\n\n\n apbct_admin_sendAJAX(\n {action: 'apbct_settings__get__long_description', setting_id: settingId},\n {\n spinner: obj.children('img'),\n callback: function(result, data, params, obj) {\n obj.empty()\n .append('
')\n .append('')\n .append('

'+result.title+'

')\n .append('

'+result.desc+'

');\n\n jQuery(document).on('click', removeDescFunc);\n },\n },\n obj,\n );\n}\n\n/**\n * Set position for navigation menu\n * @return {void}\n */\nfunction apbctNavigationMenuPosition() {\n const navBlock = document.querySelector('#apbct_hidden_section_nav ul');\n const rightBtnSave = document.querySelector('#apbct_settings__button_section');\n if (!navBlock || !rightBtnSave) {\n return;\n }\n const scrollPosition = window.scrollY;\n const windowWidth = window.innerWidth;\n if (scrollPosition > 1000) {\n navBlock.style.position = 'fixed';\n rightBtnSave.style.position = 'fixed';\n } else {\n navBlock.style.position = 'static';\n rightBtnSave.style.position = 'static';\n }\n\n if (windowWidth < 768) {\n rightBtnSave.style.position = 'fixed';\n }\n}\n\n/**\n * Set position for save button, hide it if scrolled to the bottom\n * @return {void}\n */\nfunction apbctSaveButtonPosition() {\n if (\n document.getElementById('apbct_settings__before_advanced_settings') === null ||\n document.getElementById('apbct_settings__after_advanced_settings') === null ||\n document.getElementById('apbct_settings__button_section') === null ||\n document.getElementById('apbct_settings__advanced_settings') === null ||\n document.getElementById('apbct_hidden_section_nav') === null\n ) {\n return;\n }\n\n if (!ctSettingsPage.key_is_ok && !ctSettingsPage.ip_license) {\n jQuery('#apbct_settings__main_save_button').hide();\n return;\n }\n\n const additionalSaveButton =\n document.querySelector('#apbct_settings__button_section, cleantalk_link[value=\"save_changes\"]');\n if (!additionalSaveButton) {\n return;\n }\n\n const scrollPosition = window.scrollY;\n const documentHeight = document.documentElement.scrollHeight;\n const windowHeight = window.innerHeight;\n const threshold = 800;\n if (scrollPosition + windowHeight >= documentHeight - threshold) {\n additionalSaveButton.style.display = 'none';\n } else {\n additionalSaveButton.style.display = 'block';\n }\n\n const advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');\n const mainSaveButton = document.getElementById('apbct_settings__block_main_save_button');\n if (!advSettingsBlock || !mainSaveButton) {\n return;\n }\n\n if (advSettingsBlock.style.display == 'none') {\n mainSaveButton.classList.remove('apbct_settings__position_main_save_button');\n } else {\n mainSaveButton.classList.add('apbct_settings__position_main_save_button');\n }\n}\n\n/**\n * Hightlights element\n *\n * @param {string} id\n * @param {int} times\n */\nfunction apbctHighlightElement(id, times) {\n times = times-1 || 0;\n let keyField = jQuery('#'+id);\n jQuery('html, body').animate({scrollTop: keyField.offset().top - 100}, 'slow');\n keyField.addClass('apbct_highlighted');\n keyField.animate({opacity: 0}, 400, 'linear', function() {\n keyField.animate({opacity: 1}, 400, 'linear', function() {\n if (times>0) {\n apbctHighlightElement(id, times);\n } else {\n keyField.removeClass('apbct_highlighted');\n }\n });\n });\n}\n\n/**\n * Open modal to create support user\n */\nfunction apbctCreateSupportUser() { // eslint-disable-line no-unused-vars\n const localTextArray = ctSettingsPage.support_user_creation_msg_array;\n cleantalkModal.loaded = false;\n cleantalkModal.open(false);\n cleantalkModal.confirm(\n localTextArray.confirm_header,\n localTextArray.confirm_text,\n '',\n apbctCreateSupportUserCallback,\n );\n}\n\n/**\n * Create support user\n */\nfunction apbctCreateSupportUserCallback() {\n const preloader = jQuery('#apbct_summary_and_support-create_user_button_preloader');\n preloader.css('display', 'block');\n apbct_admin_sendAJAX(\n {\n action: 'apbct_action__create_support_user',\n },\n {\n timeout: 10000,\n notJson: 1,\n callback: function(result, data, params, obj) {\n let localTextArray = ctSettingsPage.support_user_creation_msg_array;\n let popupMsg = localTextArray.default_error;\n const responseValid = (\n typeof result === 'object' &&\n result.hasOwnProperty('success') &&\n result.hasOwnProperty('user_created') &&\n result.hasOwnProperty('mail_sent') &&\n result.hasOwnProperty('cron_updated') &&\n result.hasOwnProperty('user_data') &&\n result.hasOwnProperty('result_code') &&\n typeof result.user_data === 'object' &&\n result.user_data.hasOwnProperty('username') &&\n result.user_data.hasOwnProperty('email') &&\n result.user_data.hasOwnProperty('password')\n );\n if (responseValid && result.success) {\n if (result.user_created) {\n let mailSentMsg = '';\n let successCreationMsg = '';\n let cronUpdatedMsg = localTextArray.cron_updated;\n\n if (result.mail_sent) {\n mailSentMsg = localTextArray.mail_sent_success;\n } else {\n mailSentMsg = localTextArray.mail_sent_error;\n }\n\n if (result.result_code === 0) {\n successCreationMsg = localTextArray.user_updated;\n } else {\n successCreationMsg = localTextArray.user_created;\n }\n\n jQuery('#apbct_summary_and_support-user_creation_username').text(result.user_data.username);\n jQuery('#apbct_summary_and_support-user_creation_email').text(result.user_data.email);\n jQuery('#apbct_summary_and_support-user_creation_password').text(result.user_data.password);\n jQuery('#apbct_summary_and_support-user_creation_mail_sent').text(mailSentMsg);\n jQuery('#apbct_summary_and_support-user_creation_title').text(successCreationMsg);\n jQuery('#apbct_summary_and_support-user_creation_cron_updated').text(cronUpdatedMsg);\n jQuery('.apbct_summary_and_support-user_creation_result').css('display', 'block');\n const createUserButton = jQuery('#apbct_summary_and_support-create_user_button');\n createUserButton.attr('disabled', true);\n createUserButton.css('color', 'rgba(93,89,86,0.55)');\n createUserButton.css('background', '#cccccc');\n preloader.css('display', 'none');\n return;\n } else {\n if (result.result_code === -2) {\n popupMsg = localTextArray.invalid_permission;\n } else if (result.result_code === -1) {\n popupMsg = localTextArray.unknown_creation_error;\n } else if (result.result_code === -4) {\n popupMsg = localTextArray.on_cooldown;\n } else if (result.result_code === -5) {\n popupMsg = localTextArray.email_is_busy;\n }\n }\n }\n preloader.css('display', 'none');\n cleantalkModal.loaded = popupMsg;\n cleantalkModal.open();\n },\n errorOutput: function(msg) {\n preloader.css('display', 'none');\n cleantalkModal.loaded = msg;\n cleantalkModal.open();\n },\n },\n );\n}\n"],"names":["handleAnchorDetection","anchor","document","querySelector","style","display","apbctExceptedShowHide","scrollToAnchor","anchorId","targetElement","scrollIntoView","block","apbctManageEmailEncoderCustomTextField","replacingText","let","replacingTextWrapperSub","parentElement","querySelectorAll","forEach","elem","checked","value","classList","add","addEventListener","event","target","remove","apbctBannerCheck","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbctGetElems","elems","i","len","split","tmp","apbctGetElemsNative","out","arr","getElementById","push","key","getElementsByClassName","apbctShowHideElem","each","label","next","prev","is","show","element","toHide","index","indexOf","splice","toHideElem","apbctShowRequiredGroups","id","required","originEvent","preventDefault","dispatchEvent","constructor","type","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependenciesGetState","apbctSettingsShowDescription","settingId","removeDescFunc","e","callerIsPopup","parent","callerIsHideCross","hasClass","off","after","append","css","top","position","left","setting_id","spinner","children","empty","title","desc","on","apbctNavigationMenuPosition","scrollPosition","windowWidth","navBlock","rightBtnSave","window","scrollY","innerWidth","apbctSaveButtonPosition","advSettingsBlock","mainSaveButton","ctSettingsPage","key_is_ok","ip_license","additionalSaveButton","documentHeight","documentElement","scrollHeight","innerHeight","apbctHighlightElement","times","keyField","animate","scrollTop","offset","addClass","opacity","removeClass","apbctCreateSupportUser","localTextArray","support_user_creation_msg_array","cleantalkModal","loaded","open","confirm","confirm_header","confirm_text","apbctCreateSupportUserCallback","preloader","timeout","notJson","popupMsg","default_error","hasOwnProperty","user_data","success","user_created","mailSentMsg","successCreationMsg","cronUpdatedMsg","cron_updated","createUserButton","mail_sent","mail_sent_success","mail_sent_error","result_code","user_updated","text","username","email","password","attr","invalid_permission","unknown_creation_error","on_cooldown","email_is_busy","errorOutput","msg","ready","getComputedStyle","direction","this","val","timezone","Date","getTimezoneOffset","ct_admin_timezone","button","setTimeout","reload","location","getTemplates","optionSelected","console","log","template_id","template_name","settings","insertAfter","close","templateNameInput","templateName","key_changed","click","self","find","debounceTimer","clearTimeout","$this","accountEmailField","accountEmail","toggleClass","code","inputType","undefined","manuallyLink","error","enteredValue","keyBad","match","customUploader","wp","media","library","multiple","image","get","first","toJSON","url","src","adjust","hash","substring"],"mappings":"AAscA,SAASA,sBAAsBC,GAEtB,SADaC,SAASC,cAAc,oCAAoC,EACjDC,MAAMC,SAC9BC,sBAAsB,mCAAmC,EAE7DC,eAAe,IAAMN,CAAM,CAC/B,CAMA,SAASM,eAAeC,GACdC,EAAgBP,SAASC,cAAcK,CAAQ,EACjDC,GACAA,EAAcC,eAAe,CACzBC,MAAO,KACX,CAAC,CAET,CAKA,SAASC,yCACL,IAAMC,EAAgBX,SACjBC,cAAc,4DAA4D,EAC/EW,IAAIC,EACkB,OAAlBF,IACAE,EAAiE,KAAA,IAAhCF,EAAcG,cAC3CH,EAAcG,cACd,MAERd,SAASe,iBAAiB,uDAAuD,EAAEC,QAAQ,IAEnFH,GAA2BI,EAAKC,SAA0B,YAAfD,EAAKE,OAChDN,EAAwBO,UAAUC,IAAI,QAAQ,EAGlDJ,EAAKK,iBAAiB,QAAS,IACY,KAAA,IAA5BT,IACoB,YAAvBU,EAAMC,OAAOL,MACbN,EAAwBO,UAAUK,OAAO,QAAQ,EAEjDZ,EAAwBO,UAAUC,IAAI,QAAQ,EAG1D,CAAC,CACL,CAAC,CACL,CAKA,SAASK,mBACLd,IAAIe,EAAgBC,YAAa,WAC7BC,qBACI,CAACC,OAAQ,oCAAoC,EAC7C,CACIC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOI,qBACHC,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAE7CF,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAEjDC,cAAcb,CAAa,EAEnC,CACJ,CACJ,CACJ,EAAG,GAAM,CACb,CASA,SAASc,cAAcC,GAEnB,IAAM9B,IAAI+B,EAAE,EAAGC,GADfF,EAAQA,EAAMG,MAAM,GAAG,GACIP,OAAQQ,EAAKH,EAAIC,EAAKD,CAAC,GAC9CG,EAAMT,OAAO,IAAIK,EAAMC,EAAE,EACzBD,EAAMC,GAAoB,IAAfG,EAAIR,OAAeD,OAAO,IAAIK,EAAMC,EAAE,EAAIG,EAEzD,OAAOJ,CACX,CASA,SAASK,oBAAoBL,GAEJ,UAAjB,OAAOA,IACPA,EAAQA,EAAMG,MAAM,GAAG,GAG3BjC,IAAIoC,EAAM,GAsBV,OApBAN,EAAM1B,QAAQ,SAASC,EAAM0B,EAAGM,GAE5BrC,IAAIkC,EAAM9C,SAASkD,eAAejC,CAAI,EACtC,GAAY,OAAR6B,EACAE,EAAIG,KAAML,EAAIM,IAAK,OAOvB,GAAY,QADZN,EAAM9C,SAASqD,uBAAuBpC,CAAI,IACR,IAAd6B,EAAIR,OACpB,IAAKc,OAAON,EACK,GAAR,CAACM,KACFJ,EAAIG,KAAML,EAAIM,IAAK,CAInC,CAAC,EAEMJ,CACX,CAKA,SAASM,kBAAkBZ,GAEvB,IAAM9B,IAAI+B,EAAE,EAAGC,GADfF,EAAQD,cAAcC,CAAK,GACAJ,OAAQK,EAAIC,EAAKD,CAAC,GACzCD,EAAMC,GAAGY,KAAK,SAASZ,EAAG1B,GAEtBL,IAAI4C,GADJvC,EAAOoB,OAAOpB,CAAI,GACDwC,KAAK,OAAO,GAAKxC,EAAKyC,KAAK,OAAO,GAAK,KACpDzC,EAAK0C,GAAG,UAAU,GAClB1C,EAAKsB,KAAK,EACNiB,GAAOA,EAAMjB,KAAK,IAEtBtB,EAAK2C,KAAK,EACNJ,GAAOA,EAAMI,KAAK,EAE9B,CAAC,CAET,CAKA,SAASxD,sBAAsByD,GAC3BjD,IAAIkD,EAAS,CACT,iCACA,oCACA,uCAEAC,EAAQD,EAAOE,QAAQH,CAAO,EACpB,CAAC,IAAXE,GACAD,EAAOG,OAAOF,EAAO,CAAC,EAE1BT,kBAAkBO,CAAO,EACzBC,EAAO9C,QAAQ,IACPhB,SAASkD,eAAegB,CAAU,GAA2D,SAAtDlE,SAASkD,eAAegB,CAAU,EAAEhE,MAAMC,SACjFmD,kBAAkBY,CAAU,CAEpC,CAAC,CACL,CAMA,SAASC,wBAAwB5C,EAAO6C,GACpCxD,IAAIyD,EAAWrE,SAASkD,eAAe,gCAAgC,EACnEmB,GAAuC,SAA3BA,EAASnE,MAAMC,WACvBmE,EAAc/C,GACZgD,eAAe,EACrBjB,kBAAkB,gCAAgC,EAClDtD,SAASkD,eAAekB,CAAE,EAAEI,cAAc,IAAIF,EAAYG,YAAYH,EAAYI,KAAMJ,CAAW,CAAC,EAE5G,CASA,SAASK,0BAA0BC,EAAKC,GACpCA,EAAWC,MAAMD,CAAM,EAAa,KAATA,EAGf9B,oBAAqB6B,CAAI,EAE/B5D,QAAQ,SAASC,EAAM0B,EAAGM,GAC5BrC,IAeQmE,EAHG,KAHPF,EADW,OAAXA,EAC2C,OAAlC5D,EAAK+D,aAAa,UAAU,EAAa,EAAI,EAG1DH,GARI5D,EAAKgE,gBAAgB,UAAU,EAH/BhE,EAAKiE,aAAa,WAAY,UAAU,EAaC,OAAxCjE,EAAK+D,aAAa,gBAAgB,GAEpB,QADXD,EAAQI,kCAAmClE,CAAK,GAAK4D,IAErDF,0BAA2B1D,EAAK+D,aAAa,gBAAgB,EAAGD,CAAM,CAGlF,CAAC,CACL,CAMA,SAASI,kCAAkClE,GACvCL,IAAImE,EAEJ,OAAS9D,EAAK+D,aAAc,MAAO,GACnC,IAAK,WACDD,EAAQ,CAAC9D,EAAKC,QACd,MACJ,IAAK,QACD6D,EAAQ,EAAkC,GAAhC,CAAC9D,EAAK+D,aAAa,OAAO,GACpC,MACJ,QACID,EAAQ,IACZ,CAEA,OAAOA,CACX,CAMA,SAASK,6BAA6B5B,EAAO6B,GACpB,SAAjBC,EAA0BC,GAC1B,IAAMC,EAAsE,GAAtDnD,OAAOkD,EAAE/D,MAAM,EAAEiE,OAAO,kBAAkB,EAAEnD,OAC5DoD,EAAoBrD,OAAOkD,EAAE/D,MAAM,EAAEmE,SAAS,yBAAyB,GACd,EAA3CtD,OAAO,yBAAyB,EAAEC,QACnC,CAACkD,GAAiBE,KACjCrD,OAAO,kBAAkB,EAAEZ,OAAO,EAClCY,OAAOrC,QAAQ,EAAE4F,IAAI,QAASN,CAAc,EAEpD,CAEA9B,EAAMqC,MAAM,6BAA8BR,EAAU,kCAAqC,EACzFzE,IAAIuB,EAAME,OAAO,qBAAqBgD,CAAS,EAC/ClD,EAAI2D,OAAO,gDAAkD,EACxDA,OAAO,4CAA8C,EACrDC,IAAI,CACDC,IAAKxC,EAAMyC,SAAS,EAAED,IAAM,EAC5BE,KAAM1C,EAAMyC,SAAS,EAAEC,KAAO,EAClC,CAAC,EAGLrE,qBACI,CAACC,OAAQ,wCAAyCqE,WAAYd,CAAS,EACvE,CACIe,QAASjE,EAAIkE,SAAS,KAAK,EAC3BtE,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACrCA,EAAImE,MAAM,EACLR,OAAO,4CAA8C,EACrDA,OAAO,2DAA6D,EACpEA,OAAO,sCAAwC9D,EAAOuE,MAAM,OAAO,EACnET,OAAO,MAAM9D,EAAOwE,KAAK,MAAM,EAEpCnE,OAAOrC,QAAQ,EAAEyG,GAAG,QAASnB,CAAc,CAC/C,CACJ,EACAnD,CACJ,CACJ,CAMA,SAASuE,8BACL,IAKMC,EACAC,EANAC,EAAW7G,SAASC,cAAc,8BAA8B,EAChE6G,EAAe9G,SAASC,cAAc,iCAAiC,EACxE4G,GAAaC,IAGZH,EAAiBI,OAAOC,QACxBJ,EAAcG,OAAOE,WACN,IAAjBN,GACAE,EAAS3G,MAAM+F,SAAW,QAC1Ba,EAAa5G,MAAM+F,SAAW,UAE9BY,EAAS3G,MAAM+F,SAAW,SAC1Ba,EAAa5G,MAAM+F,SAAW,UAG9BW,EAAc,OACdE,EAAa5G,MAAM+F,SAAW,QAEtC,CAMA,SAASiB,0BACL,IAqBMP,EAUAQ,EACAC,EA/BsE,OAAxEpH,SAASkD,eAAe,0CAA0C,GACK,OAAvElD,SAASkD,eAAe,yCAAyC,GACH,OAA9DlD,SAASkD,eAAe,gCAAgC,GACS,OAAjElD,SAASkD,eAAe,mCAAmC,GACH,OAAxDlD,SAASkD,eAAe,0BAA0B,IAKjDmE,eAAeC,WAAcD,eAAeE,YAK3CC,EACFxH,SAASC,cAAc,uEAAuE,KAK5F0G,EAAiBI,OAAOC,QACxBS,EAAiBzH,SAAS0H,gBAAgBC,aAI5CH,EAAqBtH,MAAMC,QADMsH,EADnB,KACdd,EAFiBI,OAAOa,YAGa,OAEA,QAGnCT,EAAmBnH,SAASkD,eAAe,mCAAmC,EAC9EkE,EAAiBpH,SAASkD,eAAe,wCAAwC,EAClFiE,IAAqBC,IAIY,QAAlCD,EAAiBjH,MAAMC,QACvBiH,EAAehG,UAAUK,OAAO,2CAA2C,EAE3E2F,EAAehG,UAAUC,IAAI,2CAA2C,GA7BxEgB,OAAO,mCAAmC,EAAEE,KAAK,EA+BzD,CAQA,SAASsF,sBAAsBzD,EAAI0D,GAC/BA,EAAQA,EAAM,GAAK,EACnBlH,IAAImH,EAAW1F,OAAO,IAAI+B,CAAE,EAC5B/B,OAAO,YAAY,EAAE2F,QAAQ,CAACC,UAAWF,EAASG,OAAO,EAAElC,IAAM,GAAG,EAAG,MAAM,EAC7E+B,EAASI,SAAS,mBAAmB,EACrCJ,EAASC,QAAQ,CAACI,QAAS,CAAC,EAAG,IAAK,SAAU,WAC1CL,EAASC,QAAQ,CAACI,QAAS,CAAC,EAAG,IAAK,SAAU,WAChC,EAANN,EACAD,sBAAsBzD,EAAI0D,CAAK,EAE/BC,EAASM,YAAY,mBAAmB,CAEhD,CAAC,CACL,CAAC,CACL,CAKA,SAASC,yBACL,IAAMC,EAAiBlB,eAAemB,gCACtCC,eAAeC,OAAS,CAAA,EACxBD,eAAeE,KAAK,CAAA,CAAK,EACzBF,eAAeG,QACXL,EAAeM,eACfN,EAAeO,aACf,GACAC,8BACJ,CACJ,CAKA,SAASA,iCACL,IAAMC,EAAY3G,OAAO,yDAAyD,EAClF2G,EAAUjD,IAAI,UAAW,OAAO,EAChClE,qBACI,CACIC,OAAQ,mCACZ,EACA,CACImH,QAAS,IACTC,QAAS,EACTnH,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACrCvB,IAAI2H,EAAiBlB,eAAemB,gCACpC5H,IAAIuI,EAAWZ,EAAea,cAc9B,GAZsB,UAAlB,OAAOpH,GACPA,EAAOqH,eAAe,SAAS,GAC/BrH,EAAOqH,eAAe,cAAc,GACpCrH,EAAOqH,eAAe,WAAW,GACjCrH,EAAOqH,eAAe,cAAc,GACpCrH,EAAOqH,eAAe,WAAW,GACjCrH,EAAOqH,eAAe,aAAa,GACP,UAA5B,OAAOrH,EAAOsH,WACdtH,EAAOsH,UAAUD,eAAe,UAAU,GAC1CrH,EAAOsH,UAAUD,eAAe,OAAO,GACvCrH,EAAOsH,UAAUD,eAAe,UAAU,GAEzBrH,EAAOuH,QAAS,CACjC,GAAIvH,EAAOwH,aAAc,CACrB5I,IAAI6I,EAAc,GACdC,EAAqB,GACzB9I,IAAI+I,EAAiBpB,EAAeqB,aAqB9BC,GAlBFJ,EADAzH,EAAO8H,UACOvB,EAAewB,kBAEfxB,EAAeyB,gBAI7BN,EADuB,IAAvB1H,EAAOiI,YACc1B,EAAe2B,aAEf3B,EAAeiB,aAGxCnH,OAAO,mDAAmD,EAAE8H,KAAKnI,EAAOsH,UAAUc,QAAQ,EAC1F/H,OAAO,gDAAgD,EAAE8H,KAAKnI,EAAOsH,UAAUe,KAAK,EACpFhI,OAAO,mDAAmD,EAAE8H,KAAKnI,EAAOsH,UAAUgB,QAAQ,EAC1FjI,OAAO,oDAAoD,EAAE8H,KAAKV,CAAW,EAC7EpH,OAAO,gDAAgD,EAAE8H,KAAKT,CAAkB,EAChFrH,OAAO,uDAAuD,EAAE8H,KAAKR,CAAc,EACnFtH,OAAO,iDAAiD,EAAE0D,IAAI,UAAW,OAAO,EACvD1D,OAAO,+CAA+C,GAK/E,OAJAwH,EAAiBU,KAAK,WAAY,CAAA,CAAI,EACtCV,EAAiB9D,IAAI,QAAS,qBAAqB,EACnD8D,EAAiB9D,IAAI,aAAc,SAAS,EAF5C8D,KAGAb,EAAUjD,IAAI,UAAW,MAAM,CAEnC,CAC+B,CAAC,IAAxB/D,EAAOiI,YACPd,EAAWZ,EAAeiC,mBACI,CAAC,IAAxBxI,EAAOiI,YACdd,EAAWZ,EAAekC,uBACI,CAAC,IAAxBzI,EAAOiI,YACdd,EAAWZ,EAAemC,YACI,CAAC,IAAxB1I,EAAOiI,cACdd,EAAWZ,EAAeoC,cAGtC,CACA3B,EAAUjD,IAAI,UAAW,MAAM,EAC/B0C,eAAeC,OAASS,EACxBV,eAAeE,KAAK,CACxB,EACAiC,YAAa,SAASC,GAClB7B,EAAUjD,IAAI,UAAW,MAAM,EAC/B0C,eAAeC,OAASmC,EACxBpC,eAAeE,KAAK,CACxB,CACJ,CACJ,CACJ,CAr6BAtG,OAAOrC,QAAQ,EAAE8K,MAAM,WAEf9K,SAASqD,uBAAuB,sBAAsB,EAAE,IACuC,QAA3F0H,iBAAiB/K,SAASqD,uBAAuB,sBAAsB,EAAE,EAAE,EAAE2H,WAC7E3I,OAAO,kBAAkB,EAAE0D,IAAI,aAAc,OAAO,EAK5D1D,OAAO,mBAAmB,EAAEoE,GAAG,QAAS,SAASlB,GAC7CA,EAAEhB,eAAe,EACjBlC,OAAO4I,IAAI,EAAE1I,KAAK,EAClBF,OAAO,gCAAgC,EAAE6I,IAAI7I,OAAO,gCAAgC,EAAEkI,KAAK,KAAK,CAAC,EACjGlI,OAAO,oCAAoC,EAAE0D,IAAI,UAAW,QAAQ,CACxE,CAAC,EAGDnF,IAAIuK,GADI,IAAIC,MACKC,kBAAkB,EAAE,GAAG,CAAE,EAC1ChJ,OAAO,oBAAoB,EAAE6I,IAAIC,CAAQ,EAGzC9I,OAAO,6BAA6B,EAAEoE,GAAG,QAAS,WACzCpE,OAAO,uBAAuB,EAAEsB,GAAG,UAAU,EAKlD9B,qBACI,CAACC,OAAQ,qBAAsBwJ,kBAAmBH,CAAQ,EAC1D,CACIlC,QAAS,KACTsC,OAAQvL,SAASkD,eAAe,4BAA6B,EAC7DkD,QAAS/D,OAAO,qDAAsD,EACtEN,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACrCE,OAAO,4CAA4C,EAAEuB,KAAK,GAAG,EAC7D4H,WAAW,WACPnJ,OAAO,4CAA4C,EAAEE,KAAK,GAAG,CACjE,EAAG,GAAI,EACHP,EAAOyJ,QACPzL,SAAS0L,SAASD,OAAO,EAEzBzJ,EAAO2J,eACPlD,eAAeC,OAAS1G,EAAO2J,aAC/BlD,eAAeE,KAAK,EACpB3I,SAASsB,iBAAiB,uBAAwB,SAAUiE,GACxDvF,SAAS0L,SAASD,OAAO,CAC7B,CAAC,EAET,CACJ,CACJ,GA3BIpJ,OAAO,sCAAsC,EAAEuB,KAAK,EACpDiE,sBAAsB,uBAAwB,CAAC,EA2BvD,CAAC,EAGDxF,OAAQrC,QAAS,EAAEyG,GAAG,QAAS,0CAA2C,WACtEpE,OAAO,oBAAoB,EAAEZ,OAAO,EACpCb,IAAIgL,EAAiBvJ,OAAO,kBAAmBA,OAAO,kCAAkC,CAAC,EAGzF,GAFwBA,OAAO,uCAAuC,EACpD0D,IAAI,eAAgB,SAAS,EACL,KAAA,IAA9B6F,EAAe3J,KAAK,IAAI,EAChC4J,QAAQC,IAAK,6CAA8C,MAD/D,CAII7J,EAAO,CACP8J,YAAeH,EAAe3J,KAAK,IAAI,EACvC+J,cAAiBJ,EAAe3J,KAAK,MAAM,EAC3CgK,SAAYL,EAAe3J,KAAK,UAAU,CAC9C,EACArB,IAAI2K,EAASN,KACbpJ,qBACI,CAACC,OAAQ,4BAA6BG,KAAMA,CAAI,EAChD,CACIgH,QAAS,KACTsC,OAAQA,EACRnF,QAAS/D,OAAO,iEAAkE,EAClF6G,QAAS,CAAA,EACTnH,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOuH,SACPlH,OAAQ,6CAAmDL,EAAOC,KAAO,MAAO,EAC3EiK,YAAa7J,OAAOkJ,CAAM,CAAE,EACjClJ,OAAO,wDAAwD,EAAEuB,KAAK,GAAG,EACzE4H,WAAW,WACPnJ,OAAO,wDAAwD,EAAEE,KAAK,GAAG,CAC7E,EAAG,GAAI,EACPvC,SAASsB,iBAAiB,uBAAwB,SAAUiE,GACxDvF,SAAS0L,SAASD,OAAO,CAC7B,CAAC,EACDD,WAAW,WACP/C,eAAe0D,MAAM,CACzB,EAAG,GAAI,GAEP9J,OAAQ,2CAAiDL,EAAOC,KAAO,MAAO,EACzEiK,YAAa7J,OAAOkJ,CAAM,CAAE,CAEzC,CACJ,CACJ,CAlCA,CAmCJ,CAAC,EAGDlJ,OAAQrC,QAAS,EAAEyG,GAAG,QAAS,0CAA2C,WACtEpE,OAAO,oBAAoB,EAAEZ,OAAO,EACpCb,IAAIgL,EAAiBvJ,OAAO,kBAAmBA,OAAO,kCAAkC,CAAC,EACrF+J,EAAoB/J,OAAO,uCAAuC,EACtEzB,IAAIqB,EAAO,GAEX,GADAmK,EAAkBrG,IAAI,eAAgB,SAAS,EACL,KAAA,IAA9B6F,EAAe3J,KAAK,IAAI,EAChC4J,QAAQC,IAAK,6CAA8C,MAD/D,CAIA,GAAmC,iBAA9BF,EAAe3J,KAAK,IAAI,EAAuB,CAChDrB,IAAIyL,EAAeD,EAAkBlB,IAAI,EACzC,GAAsB,KAAjBmB,EAED,OADAD,KAAAA,EAAkBrG,IAAI,eAAgB,KAAK,EAG/C9D,EAAO,CACH+J,cAAiBK,CACrB,CACJ,MACIpK,EAAO,CACH8J,YAAeH,EAAe3J,KAAK,IAAI,CAC3C,EAEJrB,IAAI2K,EAASN,KACbpJ,qBACI,CAACC,OAAQ,4BAA6BG,KAAMA,CAAI,EAChD,CACIgH,QAAS,KACTsC,OAAQA,EACRnF,QAAS/D,OAAO,iEAAkE,EAClF6G,QAAS,CAAA,EACTnH,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOuH,SACPlH,OAAQ,6CAAmDL,EAAOC,KAAO,MAAO,EAC3EiK,YAAa7J,OAAOkJ,CAAM,CAAE,EACjClJ,OAAO,wDAAwD,EAAEuB,KAAK,GAAG,EACzE4H,WAAW,WACPnJ,OAAO,wDAAwD,EAAEE,KAAK,GAAG,CAC7E,EAAG,GAAI,EACPvC,SAASsB,iBAAiB,uBAAwB,SAAUiE,GACxDvF,SAAS0L,SAASD,OAAO,CAC7B,CAAC,EACDD,WAAW,WACP/C,eAAe0D,MAAM,CACzB,EAAG,GAAI,GAEP9J,OAAQ,2CAAiDL,EAAOC,KAAO,MAAO,EACzEiK,YAAa7J,OAAOkJ,CAAM,CAAE,CAEzC,CACJ,CACJ,CA3CA,CA4CJ,CAAC,EAGDlJ,OAAQrC,QAAS,EAAEyG,GAAG,QAAS,yCAA0C,WACrE7F,IAAI2K,EAASN,KACbpJ,qBACI,CAACC,OAAQ,0BAA0B,EACnC,CACImH,QAAS,KACTsC,OAAQA,EACRnF,QAAS/D,OAAO,gEAAiE,EACjF6G,QAAS,CAAA,EACTnH,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOuH,SACPlH,OAAQ,6CAAmDL,EAAOC,KAAO,MAAO,EAC3EiK,YAAa7J,OAAOkJ,CAAM,CAAE,EACjClJ,OAAO,uDAAuD,EAAEuB,KAAK,GAAG,EACxE4H,WAAW,WACPnJ,OAAO,uDAAuD,EAAEE,KAAK,GAAG,CAC5E,EAAG,GAAI,EACPvC,SAASsB,iBAAiB,uBAAwB,SAAUiE,GACxDvF,SAAS0L,SAASD,OAAO,CAC7B,CAAC,EACDD,WAAW,WACP/C,eAAe0D,MAAM,CACzB,EAAG,GAAI,GAEP9J,OAAQ,2CAAiDL,EAAOC,KAAO,MAAO,EACzEiK,YAAa7J,OAAOkJ,CAAM,CAAE,CAEzC,CACJ,CACJ,CACJ,CAAC,EAGDlJ,OAAO,qBAAqB,EAAEoE,GAAG,QAAS,WACtC5E,qBACI,CAACC,OAAQ,YAAY,EACrB,CACImH,QAAS,KACTsC,OAAQvL,SAASkD,eAAe,oBAAqB,EACrDkD,QAAS/D,OAAO,6CAA8C,EAC9DN,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACrCE,OAAO,oCAAoC,EAAEuB,KAAK,GAAG,EACrD4H,WAAW,WACPnJ,OAAO,oCAAoC,EAAEE,KAAK,GAAG,CACzD,EAAG,GAAI,EACHP,EAAOyJ,SACFpE,eAAeiF,aAChBjK,OAAO,mBAAmB,EAAEE,KAAK,GAAG,EACpCF,OAAO,sBAAsB,EAAEuB,KAAK,GAAG,EACvC4H,WAAW,WACPxL,SAAS0L,SAASD,OAAO,CAC7B,EAAG,GAAI,GAEPzL,SAAS0L,SAASD,OAAO,EAGrC,CACJ,CACJ,CACJ,CAAC,EAEIpE,eAAeiF,aAChBjK,OAAO,qBAAqB,EAAEkK,MAAM,EAGxClK,OAAOrC,QAAQ,EAAEyG,GAAG,QAAS,0CAA2C,WAEpErB,6BADAoH,KAAOnK,OAAO4I,IAAI,EACiBuB,KAAKjC,KAAK,SAAS,CAAC,CAC3D,CAAC,GAEGlI,OAAO,yBAAyB,EAAEC,QAAUD,OAAO,yBAAyB,EAAEC,SAC9EZ,iBAAiB,EAGrBW,OAAOrC,QAAQ,EAAEyG,GAAG,SAAU,mCAAoC,WAE3B,iBADdpE,OAAO,kBAAmB4I,IAAI,EAC/BhJ,KAAK,IAAI,EACzBI,OAAO4I,IAAI,EAAExF,OAAO,EAAEA,OAAO,EAAEgH,KAAK,uCAAuC,EAAE7I,KAAK,EAElFvB,OAAO4I,IAAI,EAAExF,OAAO,EAAEA,OAAO,EAAEgH,KAAK,uCAAuC,EAAElK,KAAK,CAE1F,CAAC,EAED2E,wBAAwB,EACxBtG,IAAI8L,EACJ3F,OAAOzF,iBAAiB,SAAU,WAC9BqL,aAAaD,CAAa,EAC1BA,EAAgBlB,WAAW,WACvBtE,wBAAwB,CAC5B,EAAG,EAAE,EACLR,4BAA4B,CAChC,CAAC,EACDrE,OAAO,oBAAoB,EAAEoE,GAAG,QAASS,uBAAuB,EAMhE7E,OAAO,6BAA6B,EAAEoE,GAAG,QAAS,SAASlB,GACvDA,EAAEhB,eAAe,EAEjB3D,IAAIgM,EAAQvK,OAAO4I,IAAI,EACnB4B,EAAoBxK,OAAO,sBAAsB,EACjDyK,EAAeD,EAAkB1C,KAAK,EAE1CyC,EAAMG,YAAY,QAAQ,EAEtBH,EAAMjH,SAAS,QAAQ,GACvBiH,EAAMzC,KAAKyC,EAAM3K,KAAK,WAAW,CAAC,EAClC4K,EAAkBtC,KAAK,kBAAmB,MAAM,EAChDsC,EAAkBpG,GAAG,UAAW,SAASlB,GACtB,UAAXA,EAAEyH,MACFzH,EAAEhB,eAAe,CAEzB,CAAC,EACDsI,EAAkBpG,GAAG,QAAS,SAASlB,GACf,oBAAhBA,EAAE0H,WACF1H,EAAEhB,eAAe,CAEzB,CAAC,IAED1C,qBACI,CACIC,OAAQ,6BACRgL,aAAcA,CAClB,EACA,CACI7D,QAAS,IACTlH,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACd+K,KAAAA,IAAnBlL,EAAOuH,SAA4C,OAAnBvH,EAAOuH,SACX2D,KAAAA,IAAxBlL,EAAOmL,cACP9K,OAAO,0BAA0B,EAAEkI,KAAK,OAAQvI,EAAOmL,YAAY,EAItDD,KAAAA,IAAjBlL,EAAOoL,OACP/K,OAAO,sBAAsB,EAAE0D,IAAI,eAAgB,KAAK,CAEhE,CACJ,CACJ,EAEA8G,EAAkBtC,KAAK,kBAAmB,OAAO,EACjDqC,EAAMzC,KAAKyC,EAAM3K,KAAK,cAAc,CAAC,EAE7C,CAAC,EAKDI,OAAO,uBAAuB,EAAEoE,GAAG,QAAS,WACxC7F,IAAIyM,EAAehL,OAAO4I,IAAI,EAAEC,IAAI,EAEhCoC,GADJjL,OAAO,0CAA0C,EAAEuD,IAAI,OAAO,EAChC,KAAjByH,GAAoE,OAA7CA,EAAaE,MAAM,oBAAoB,GAC3ElL,OAAO,6BAA6B,EAAEE,KAAK,EAC3CF,OAAO,mBAAmB,EAAEE,KAAK,EACjCF,OAAO,kCAAkC,EAAEE,KAAK,EAChDF,OAAO,sCAAsC,EAAEE,KAAK,EAC/B,KAAjB8K,GACAhL,OAAO,+CAA+C,EAAEE,KAAK,EAC7DF,OAAO,sCAAsC,EAAEuB,KAAK,EACpDvB,OAAO,qCAAqC,EAAEuB,KAAK,IAEnDvB,OAAO,+CAA+C,EAAEuB,KAAK,EAC7DvB,OAAO,sCAAsC,EAAEE,KAAK,EACpDF,OAAO,qCAAqC,EAAEE,KAAK,EAC/C+K,GACAjL,OAAO,0CAA0C,EAAEoE,GAAG,QAClD,SAASlB,GACLA,EAAEhB,eAAe,EACjBlC,OAAO,6BAA6B,EAAEuB,KAAK,EAC3CiE,sBAAsB,uBAAwB,CAAC,CACnD,CACJ,EAGZ,CAAC,EAEIxF,OAAO,uBAAuB,EAAE6I,IAAI,GAAK7D,eAAeC,WACzDjF,OAAO,sCAAsC,EAAEE,KAAK,EAMlD8E,eAAeC,WAAcD,eAAeE,YAC9ClF,OAAO,6CAA6C,EAAEoE,GAAG,QACrD,SAASlB,GACLA,EAAEhB,eAAe,EACZlC,OAAO,uBAAuB,EAAEC,QACjCD,OAAQ,kKAES,EAAE6J,YAAa7J,OAAO,qBAAqB,CAAE,EAElEwF,sBAAsB,uBAAwB,CAAC,EAC/CA,sBAAsB,qBAAsB,CAAC,EAC7CxF,OAAO,sCAAsC,EAAEuB,KAAK,CACxD,CACJ,EAMJvB,OAAO,iCAAiC,EAAEkK,MAAM,SAAShH,GACrDA,EAAEhB,eAAe,EAEjB,IAAMgH,EAASlJ,OAAO4I,IAAI,EAEpBuC,EAAiBC,GAAGC,MAAM,CAC5BC,QAAS,CACLjJ,KAAM,OACV,EACAkJ,SAAU,CAAA,CACd,CAAC,EAEDJ,EAAe/G,GAAG,SAAU,WACxB,IAAMoH,EAAQL,EAAezI,MAAM,EAAE+I,IAAI,WAAW,EAAEC,MAAM,EAAEC,OAAO,EAErEzC,EAAO9F,OAAO,EAAE/B,KAAK,EAAE6G,KAAM,MAAOsD,EAAMI,GAAI,EAC9C5L,OAAO,wBAAwB,EAAE6I,IAAK2C,EAAMzJ,EAAG,CACnD,CAAC,EAEDoJ,EAAe7E,KAAK,CACxB,CAAC,EAKDtG,OAAO,iCAAiC,EAAEkK,MAAM,SAAShH,GACrDA,EAAEhB,eAAe,EAEZ,CAAA,IAASqE,QAAS,OAAQ,IACrBsF,EAAM7L,OAAO4I,IAAI,EAAExF,OAAO,EAAE/B,KAAK,EAAEzB,KAAK,KAAK,EACnDI,OAAO4I,IAAI,EAAExF,OAAO,EAAE/B,KAAK,EAAE6G,KAAK,MAAO2D,CAAG,EAC5C7L,OAAO4I,IAAI,EAAEvH,KAAK,EAAEA,KAAK,EAAEwH,IAAI,EAAE,EAEzC,CAAC,EAED7I,OAAO,2CAA2C,EAAEkK,MAAM,SAAShH,GAC/DA,EAAEhB,eAAe,EAEjB3D,IAAIqB,EAAO,CACXH,OAAc,4BADF,EAIRI,GAFJD,EAAKkM,OAAS9L,OAAO4I,IAAI,EAAEhJ,KAAK,QAAQ,EAE3B,IACbC,EAAOqJ,OAASvL,SAASkD,eAAe,8BAAgCjB,EAAKkM,MAAM,EACnFjM,EAAOgH,QAAU,CAAA,EAEjBhH,EAAOH,SAAW,WACd/B,SAAS0L,SAASD,OAAO,CAC7B,EAEA5J,qBAAqBI,EAAMC,CAAM,CACrC,CAAC,EAEDG,OAAO,4CAA4C,EAAEkK,MAAM,SAAShH,GAChEA,EAAEhB,eAAe,EAEjB3D,IAAIqB,EAAO,CACXH,OAAc,6BADF,EAIRI,GAFJD,EAAKkM,OAAS9L,OAAO4I,IAAI,EAAEhJ,KAAK,QAAQ,EAE3B,IACbC,EAAOqJ,OAASvL,SAASkD,eAAe,+BAAiCjB,EAAKkM,MAAM,EACpFjM,EAAOgH,QAAU,CAAA,EAEjBhH,EAAOH,SAAW,WACd/B,SAAS0L,SAASD,OAAO,CAC7B,EAEA5J,qBAAqBI,EAAMC,CAAM,CACrC,CAAC,EAEDlC,SAASC,cAAc,mCAAmC,EAAEqB,iBAAiB,QAAS,KAClFtB,SAASC,cAAc,8BAA8B,EAAEC,MAAMC,QAAU,QACvEH,SAASC,cAAc,mCAAmC,EAAEC,MAAMC,QAAU,MAChF,CAAC,EAEDH,SAASC,cAAc,yCAAyC,EAAEqB,iBAAiB,QAAS,KACxFtB,SAASC,cAAc,8BAA8B,EAAEC,MAAMC,QAAU,OACvEH,SAASC,cAAc,mCAAmC,EAAEC,MAAMC,QAAU,OAChF,CAAC,EAGDO,uCAAuC,EAEnCqG,OAAO2E,SAAS0C,MAEhBtO,sBADeiH,OAAO2E,SAAS0C,KAAKC,UAAU,CAAC,CACnB,CAEpC,CAAC"} \ No newline at end of file +{"version":3,"file":"cleantalk-admin-settings-page.min.js","sources":["cleantalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function() {\n // Crunch for Right to Left direction languages\n if (document.getElementsByClassName('apbct_settings-title')[0]) {\n if (getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl') {\n jQuery('.apbct_switchers').css('text-align', 'right');\n }\n }\n\n // Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function(e) {\n e.preventDefault();\n jQuery(this).hide();\n jQuery('.apbct_settings-field--api_key').val(jQuery('.apbct_settings-field--api_key').attr('key'));\n jQuery('.apbct_settings-field--api_key+div').css('display', 'inline');\n });\n\n let d = new Date();\n let timezone = d.getTimezoneOffset()/60*(-1);\n jQuery('#ct_admin_timezone').val(timezone);\n\n // Key KEY automatically\n jQuery('#apbct_button__get_key_auto').on('click', function() {\n if (!jQuery('#apbct_license_agreed').is(':checked')) {\n jQuery('#apbct_settings__no_agreement_notice').show();\n apbctHighlightElement('apbct_license_agreed', 3);\n return;\n }\n apbct_admin_sendAJAX(\n {action: 'apbct_get_key_auto', ct_admin_timezone: timezone},\n {\n timeout: 25000,\n button: document.getElementById('apbct_button__get_key_auto' ),\n spinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#apbct_button__get_key_auto .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);\n }, 2000);\n if (result.reload) {\n document.location.reload();\n }\n if (result.getTemplates) {\n cleantalkModal.loaded = result.getTemplates;\n cleantalkModal.open();\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n }\n },\n },\n );\n });\n\n // Import settings\n jQuery( document ).on('click', '#apbct_settings_templates_import_button', function() {\n jQuery('#apbct-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\n let templateNameInput = jQuery('#apbct_settings_templates_import_name');\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n let data = {\n 'template_id': optionSelected.data('id'),\n 'template_name': optionSelected.data('name'),\n 'settings': optionSelected.data('settings'),\n };\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_import', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Export settings\n jQuery( document ).on('click', '#apbct_settings_templates_export_button', function() {\n jQuery('#apbct-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\n let templateNameInput = jQuery('#apbct_settings_templates_export_name');\n let data = {};\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n if ( optionSelected.data('id') === 'new_template' ) {\n let templateName = templateNameInput.val();\n if ( templateName === '' ) {\n templateNameInput.css('border-color', 'red');\n return;\n }\n data = {\n 'template_name': templateName,\n };\n } else {\n data = {\n 'template_id': optionSelected.data('id'),\n };\n }\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_export', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Reset settings\n jQuery( document ).on('click', '#apbct_settings_templates_reset_button', function() {\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_reset'},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Sync button\n jQuery('#apbct_button__sync').on('click', function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_sync'},\n {\n timeout: 25000,\n button: document.getElementById('apbct_button__sync' ),\n spinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#apbct_button__sync .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_button__sync .apbct_success').hide(300);\n }, 2000);\n if (result.reload) {\n if ( ctSettingsPage.key_changed ) {\n jQuery('.key_changed_sync').hide(300);\n jQuery('.key_changed_success').show(300);\n setTimeout(function() {\n document.location.reload();\n }, 3000);\n } else {\n document.location.reload();\n }\n }\n },\n },\n );\n });\n\n if ( ctSettingsPage.key_changed ) {\n jQuery('#apbct_button__sync').click();\n }\n\n jQuery(document).on('click', '.apbct_settings-long_description---show', function() {\n self = jQuery(this);\n apbctSettingsShowDescription(self, self.attr('setting'));\n });\n\n if (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length) {\n apbctBannerCheck();\n }\n\n jQuery(document).on('change', '#apbct_settings_templates_export', function() {\n let optionSelected = jQuery('option:selected', this);\n if ( optionSelected.data('id') === 'new_template' ) {\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\n } else {\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\n }\n });\n\n apbctSaveButtonPosition();\n let debounceTimer;\n window.addEventListener('scroll', function() {\n clearTimeout(debounceTimer);\n debounceTimer = setTimeout(function() {\n apbctSaveButtonPosition();\n }, 50);\n apbctNavigationMenuPosition();\n });\n jQuery('#ct_adv_showhide a').on('click', apbctSaveButtonPosition);\n\n\n /**\n * Change cleantalk account email\n */\n jQuery('#apbct-change-account-email').on('click', function(e) {\n e.preventDefault();\n\n let $this = jQuery(this);\n let accountEmailField = jQuery('#apbct-account-email');\n let accountEmail = accountEmailField.text();\n\n $this.toggleClass('active');\n\n if ($this.hasClass('active')) {\n $this.text($this.data('save-text'));\n accountEmailField.attr('contenteditable', 'true');\n accountEmailField.on('keydown', function(e) {\n if (e.code === 'Enter') {\n e.preventDefault();\n }\n });\n accountEmailField.on('input', function(e) {\n if (e.inputType === 'insertParagraph') {\n e.preventDefault();\n }\n });\n } else {\n apbct_admin_sendAJAX(\n {\n action: 'apbct_update_account_email',\n accountEmail: accountEmail,\n },\n {\n timeout: 5000,\n callback: function(result, data, params, obj) {\n if (result.success !== undefined && result.success === 'ok') {\n if (result.manuallyLink !== undefined) {\n jQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);\n }\n }\n\n if (result.error !== undefined) {\n jQuery('#apbct-account-email').css('border-color', 'red');\n }\n },\n },\n );\n\n accountEmailField.attr('contenteditable', 'false');\n $this.text($this.data('default-text'));\n }\n });\n\n /**\n * Validate apkikey and hide get auto btn\n */\n jQuery('#apbct_setting_apikey').on('input', function() {\n let enteredValue = jQuery(this).val();\n jQuery('#apbct_settings__key_line__save_settings').off('click');\n let keyBad = enteredValue !== '' && enteredValue.match(/^[a-z\\d]{8,30}\\s*$/) === null;\n jQuery('#apbct_settings__key_is_bad').hide();\n jQuery('#apbct_showApiKey').hide();\n jQuery('#apbct_settings__account_name_ob').hide();\n jQuery('#apbct_settings__no_agreement_notice').hide();\n if (enteredValue === '') {\n jQuery('#apbct_button__key_line__save_changes_wrapper').hide();\n jQuery('#apbct_button__get_key_auto__wrapper').show();\n jQuery('#apbct_button__get_key_manual_chunk').show();\n } else {\n jQuery('#apbct_button__key_line__save_changes_wrapper').show();\n jQuery('#apbct_button__get_key_auto__wrapper').hide();\n jQuery('#apbct_button__get_key_manual_chunk').hide();\n if (keyBad) {\n jQuery('#apbct_settings__key_line__save_settings').on('click',\n function(e) {\n e.preventDefault();\n jQuery('#apbct_settings__key_is_bad').show();\n apbctHighlightElement('apbct_setting_apikey', 3);\n },\n );\n }\n }\n });\n\n if ( jQuery('#apbct_setting_apikey').val() && ctSettingsPage.key_is_ok) {\n jQuery('#apbct_button__get_key_auto__wrapper').hide();\n }\n\n /**\n * Handle synchronization errors when key is no ok to force user check the key and restart the sync\n */\n if ( !ctSettingsPage.key_is_ok && !ctSettingsPage.ip_license ) {\n jQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n function(e) {\n e.preventDefault();\n if (!jQuery('#sync_required_notice').length) {\n jQuery( '

' +\n 'Synchronization process failed. Please, check the acces key and restart the synch.' +\n '

' ).insertAfter( jQuery('#apbct_button__sync') );\n }\n apbctHighlightElement('apbct_setting_apikey', 3);\n apbctHighlightElement('apbct_button__sync', 3);\n jQuery('#apbct_button__get_key_auto__wrapper').show();\n },\n );\n }\n\n /**\n * Open WP gallery for adding custom logo\n */\n jQuery('#apbct-custom-logo-open-gallery').click(function(e) {\n e.preventDefault();\n\n const button = jQuery(this);\n\n const customUploader = wp.media({\n library: {\n type: 'image',\n },\n multiple: false,\n });\n\n customUploader.on('select', function() {\n const image = customUploader.state().get('selection').first().toJSON();\n\n button.parent().prev().attr( 'src', image.url );\n jQuery('#cleantalk_custom_logo').val( image.id );\n });\n\n customUploader.open();\n });\n\n /**\n * Remove selected logo\n */\n jQuery('#apbct-custom-logo-remove-image').click(function(e) {\n e.preventDefault();\n\n if ( true === confirm( 'Sure?' ) ) {\n const src = jQuery(this).parent().prev().data('src');\n jQuery(this).parent().prev().attr('src', src);\n jQuery(this).prev().prev().val('');\n }\n });\n\n jQuery('button[id*=\"apbct-action-adjust-change-\"]').click(function(e) {\n e.preventDefault();\n\n let data = {};\n data.action = 'apbct_action_adjust_change';\n data.adjust = jQuery(this).data('adjust');\n\n let params = {};\n params.button = document.getElementById('apbct-action-adjust-change-' + data.adjust);\n params.notJson = true;\n\n params.callback = function() {\n document.location.reload();\n };\n\n apbct_admin_sendAJAX(data, params);\n });\n\n jQuery('button[id*=\"apbct-action-adjust-reverse-\"]').click(function(e) {\n e.preventDefault();\n\n let data = {};\n data.action = 'apbct_action_adjust_reverse';\n data.adjust = jQuery(this).data('adjust');\n\n let params = {};\n params.button = document.getElementById('apbct-action-adjust-reverse-' + data.adjust);\n params.notJson = true;\n\n params.callback = function() {\n document.location.reload();\n };\n\n apbct_admin_sendAJAX(data, params);\n });\n\n document.querySelector('.apbct_hidden_section_nav_mob_btn').addEventListener('click', () => {\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'block';\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'none';\n });\n\n document.querySelector('.apbct_hidden_section_nav_mob_btn-close').addEventListener('click', () => {\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'none';\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'block';\n });\n\n // Hide/show EmailEncoder replacing text textarea\n apbctManageEmailEncoderCustomTextField();\n\n if (window.location.hash) {\n const anchor = window.location.hash.substring(1);\n handleAnchorDetection(anchor);\n }\n});\n\n/**\n * Detect ancors and open advanced settings before scroll\n * @param {string} anchor\n */\nfunction handleAnchorDetection(anchor) {\n let advSettings = document.querySelector('#apbct_settings__advanced_settings');\n if ( 'none' === advSettings.style.display ) {\n apbctExceptedShowHide('apbct_settings__advanced_settings');\n }\n scrollToAnchor('#' + anchor);\n}\n\n/**\n * Scroll to the target element ID\n * @param {string} anchorId Anchor target element ID\n */\nfunction scrollToAnchor(anchorId) {\n const targetElement = document.querySelector(anchorId);\n if (targetElement) {\n targetElement.scrollIntoView({\n block: 'end',\n });\n }\n}\n\n/**\n * Hide/show EmailEncoder replacing text textarea\n */\nfunction apbctManageEmailEncoderCustomTextField() {\n const replacingText = document\n .querySelector('#apbct_setting_data__email_decoder_obfuscation_custom_text');\n let replacingTextWrapperSub;\n if (replacingText !== null) {\n replacingTextWrapperSub = typeof replacingText.parentElement !== 'undefined' ?\n replacingText.parentElement :\n null;\n }\n document.querySelectorAll('.apbct_setting---data__email_decoder_obfuscation_mode').forEach((elem) => {\n // visibility set on saved settings\n if (replacingTextWrapperSub && elem.checked && elem.value !== 'replace') {\n replacingTextWrapperSub.classList.add('hidden');\n }\n // visibility set on change\n elem.addEventListener('click', (event) => {\n if (typeof replacingTextWrapperSub !== 'undefined') {\n if (event.target.value === 'replace') {\n replacingTextWrapperSub.classList.remove('hidden');\n } else {\n replacingTextWrapperSub.classList.add('hidden');\n }\n }\n });\n });\n}\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbctBannerCheck() {\n let bannerChecker = setInterval( function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_settings__check_renew_banner'},\n {\n callback: function(result, data, params, obj) {\n if (result.close_renew_banner) {\n if (jQuery('#cleantalk_notice_renew').length) {\n jQuery('#cleantalk_notice_renew').hide('slow');\n }\n if (jQuery('#cleantalk_notice_trial').length) {\n jQuery('#cleantalk_notice_trial').hide('slow');\n }\n clearInterval(bannerChecker);\n }\n },\n },\n );\n }, 900000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param {string|array} elems\n * @return {*}\n */\nfunction apbctGetElems(elems) {\n elems = elems.split(',');\n for ( let i=0, len = elems.length, tmp; i < len; i++) {\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param {string|array} elems\n * @return {array}\n */\nfunction apbctGetElemsNative(elems) {\n // Make array from a string\n if (typeof elems === 'string') {\n elems = elems.split(',');\n }\n\n let out = [];\n\n elems.forEach(function(elem, i, arr) {\n // try to get elements with such IDs\n let tmp = document.getElementById(elem);\n if (tmp !== null) {\n out.push( tmp[key] );\n return;\n }\n\n // try to get elements with such class name\n // write each elem from collection to new element of output array\n tmp = document.getElementsByClassName(elem);\n if (tmp !== null && tmp.length !==0 ) {\n for (key in tmp) {\n if ( +key >= 0 ) {\n out.push( tmp[key] );\n }\n }\n }\n });\n\n return out;\n}\n\n/**\n * @param {string|array} elems\n */\nfunction apbctShowHideElem(elems) {\n elems = apbctGetElems(elems);\n for ( let i=0, len = elems.length; i < len; i++) {\n elems[i].each(function(i, elem) {\n elem = jQuery(elem);\n let label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(':visible')) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * @param {string|array} element\n */\nfunction apbctExceptedShowHide(element) { // eslint-disable-line no-unused-vars\n let toHide = [\n 'apbct_settings__dwpms_settings',\n 'apbct_settings__advanced_settings',\n 'trusted_and_affiliate__special_span',\n ];\n let index = toHide.indexOf(element);\n if (index !== -1) {\n toHide.splice(index, 1);\n }\n apbctShowHideElem(element);\n toHide.forEach((toHideElem) => {\n if (document.getElementById(toHideElem) && document.getElementById(toHideElem).style.display !== 'none') {\n apbctShowHideElem(toHideElem);\n }\n });\n}\n\n/**\n * @param {mixed} event\n * @param {string} id\n */\nfunction apbctShowRequiredGroups(event, id) { // eslint-disable-line no-unused-vars\n let required = document.getElementById('apbct_settings__dwpms_settings');\n if (required && required.style.display === 'none') {\n let originEvent = event;\n event.preventDefault();\n apbctShowHideElem('apbct_settings__dwpms_settings');\n document.getElementById(id).dispatchEvent(new originEvent.constructor(originEvent.type, originEvent));\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param {string|array} ids\n * @param {int} enable\n */\nfunction apbctSettingsDependencies(ids, enable) { // eslint-disable-line no-unused-vars\n enable = ! isNaN(enable) ? enable : null;\n\n // Get elements\n let elems = apbctGetElemsNative( ids );\n\n elems.forEach(function(elem, i, arr) {\n let doDisable = function() {\n elem.setAttribute('disabled', 'disabled');\n };\n let doEnable = function() {\n elem.removeAttribute('disabled');\n };\n\n // Set defined state\n if (enable === null) {\n enable = elem.getAttribute('disabled') === null ? 0 : 1;\n }\n\n enable === 1 ? doEnable() : doDisable();\n\n if ( elem.getAttribute('apbct_children') !== null) {\n let state = apbctSettingsDependenciesGetState( elem ) && enable;\n if ( state !== null ) {\n apbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\n }\n }\n });\n}\n\n/**\n * @param {HTMLElement} elem\n * @return {int|null}\n */\nfunction apbctSettingsDependenciesGetState(elem) {\n let state;\n\n switch ( elem.getAttribute( 'type' ) ) {\n case 'checkbox':\n state = +elem.checked;\n break;\n case 'radio':\n state = +(+elem.getAttribute('value') === 1);\n break;\n default:\n state = null;\n }\n\n return state;\n}\n\n/**\n * @param {HTMLElement} label\n * @param {string} settingId\n */\nfunction apbctSettingsShowDescription(label, settingId) {\n let removeDescFunc = function(e) {\n const callerIsPopup = jQuery(e.target).parent('.apbct_long_desc').length != 0;\n const callerIsHideCross = jQuery(e.target).hasClass('apbct_long_desc__cancel');\n const descIsShown = jQuery('.apbct_long_desc__title').length > 0;\n if (descIsShown && !callerIsPopup || callerIsHideCross) {\n jQuery('.apbct_long_desc').remove();\n jQuery(document).off('click', removeDescFunc);\n }\n };\n\n label.after('
');\n let obj = jQuery('#apbct_long_desc__'+settingId);\n obj.append('')\n .append('
')\n .css({\n top: label.position().top - 5,\n left: label.position().left + 25,\n });\n\n\n apbct_admin_sendAJAX(\n {action: 'apbct_settings__get__long_description', setting_id: settingId},\n {\n spinner: obj.children('img'),\n callback: function(result, data, params, obj) {\n if (result && result.title && result.desc) {\n obj.empty()\n .append('
')\n .append('')\n .append('

'+result.title+'

')\n .append('

'+result.desc+'

');\n\n jQuery(document).on('click', removeDescFunc);\n }\n },\n },\n obj,\n );\n}\n\n/**\n * Set position for navigation menu\n * @return {void}\n */\nfunction apbctNavigationMenuPosition() {\n const navBlock = document.querySelector('#apbct_hidden_section_nav ul');\n const rightBtnSave = document.querySelector('#apbct_settings__button_section');\n if (!navBlock || !rightBtnSave) {\n return;\n }\n const scrollPosition = window.scrollY;\n const windowWidth = window.innerWidth;\n if (scrollPosition > 1000) {\n navBlock.style.position = 'fixed';\n rightBtnSave.style.position = 'fixed';\n } else {\n navBlock.style.position = 'static';\n rightBtnSave.style.position = 'static';\n }\n\n if (windowWidth < 768) {\n rightBtnSave.style.position = 'fixed';\n }\n}\n\n/**\n * Set position for save button, hide it if scrolled to the bottom\n * @return {void}\n */\nfunction apbctSaveButtonPosition() {\n if (\n document.getElementById('apbct_settings__before_advanced_settings') === null ||\n document.getElementById('apbct_settings__after_advanced_settings') === null ||\n document.getElementById('apbct_settings__button_section') === null ||\n document.getElementById('apbct_settings__advanced_settings') === null ||\n document.getElementById('apbct_hidden_section_nav') === null\n ) {\n return;\n }\n\n if (!ctSettingsPage.key_is_ok && !ctSettingsPage.ip_license) {\n jQuery('#apbct_settings__main_save_button').hide();\n return;\n }\n\n const additionalSaveButton =\n document.querySelector('#apbct_settings__button_section, cleantalk_link[value=\"save_changes\"]');\n if (!additionalSaveButton) {\n return;\n }\n\n const scrollPosition = window.scrollY;\n const documentHeight = document.documentElement.scrollHeight;\n const windowHeight = window.innerHeight;\n const threshold = 800;\n if (scrollPosition + windowHeight >= documentHeight - threshold) {\n additionalSaveButton.style.display = 'none';\n } else {\n additionalSaveButton.style.display = 'block';\n }\n\n const advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');\n const mainSaveButton = document.getElementById('apbct_settings__block_main_save_button');\n if (!advSettingsBlock || !mainSaveButton) {\n return;\n }\n\n if (advSettingsBlock.style.display == 'none') {\n mainSaveButton.classList.remove('apbct_settings__position_main_save_button');\n } else {\n mainSaveButton.classList.add('apbct_settings__position_main_save_button');\n }\n}\n\n/**\n * Hightlights element\n *\n * @param {string} id\n * @param {int} times\n */\nfunction apbctHighlightElement(id, times) {\n times = times-1 || 0;\n let keyField = jQuery('#'+id);\n jQuery('html, body').animate({scrollTop: keyField.offset().top - 100}, 'slow');\n keyField.addClass('apbct_highlighted');\n keyField.animate({opacity: 0}, 400, 'linear', function() {\n keyField.animate({opacity: 1}, 400, 'linear', function() {\n if (times>0) {\n apbctHighlightElement(id, times);\n } else {\n keyField.removeClass('apbct_highlighted');\n }\n });\n });\n}\n\n/**\n * Open modal to create support user\n */\nfunction apbctCreateSupportUser() { // eslint-disable-line no-unused-vars\n const localTextArray = ctSettingsPage.support_user_creation_msg_array;\n cleantalkModal.loaded = false;\n cleantalkModal.open(false);\n cleantalkModal.confirm(\n localTextArray.confirm_header,\n localTextArray.confirm_text,\n '',\n apbctCreateSupportUserCallback,\n );\n}\n\n/**\n * Create support user\n */\nfunction apbctCreateSupportUserCallback() {\n const preloader = jQuery('#apbct_summary_and_support-create_user_button_preloader');\n preloader.css('display', 'block');\n apbct_admin_sendAJAX(\n {\n action: 'apbct_action__create_support_user',\n },\n {\n timeout: 10000,\n notJson: 1,\n callback: function(result, data, params, obj) {\n let localTextArray = ctSettingsPage.support_user_creation_msg_array;\n let popupMsg = localTextArray.default_error;\n const responseValid = (\n typeof result === 'object' &&\n result.hasOwnProperty('success') &&\n result.hasOwnProperty('user_created') &&\n result.hasOwnProperty('mail_sent') &&\n result.hasOwnProperty('cron_updated') &&\n result.hasOwnProperty('user_data') &&\n result.hasOwnProperty('result_code') &&\n typeof result.user_data === 'object' &&\n result.user_data.hasOwnProperty('username') &&\n result.user_data.hasOwnProperty('email') &&\n result.user_data.hasOwnProperty('password')\n );\n if (responseValid && result.success) {\n if (result.user_created) {\n let mailSentMsg = '';\n let successCreationMsg = '';\n let cronUpdatedMsg = localTextArray.cron_updated;\n\n if (result.mail_sent) {\n mailSentMsg = localTextArray.mail_sent_success;\n } else {\n mailSentMsg = localTextArray.mail_sent_error;\n }\n\n if (result.result_code === 0) {\n successCreationMsg = localTextArray.user_updated;\n } else {\n successCreationMsg = localTextArray.user_created;\n }\n\n jQuery('#apbct_summary_and_support-user_creation_username').text(result.user_data.username);\n jQuery('#apbct_summary_and_support-user_creation_email').text(result.user_data.email);\n jQuery('#apbct_summary_and_support-user_creation_password').text(result.user_data.password);\n jQuery('#apbct_summary_and_support-user_creation_mail_sent').text(mailSentMsg);\n jQuery('#apbct_summary_and_support-user_creation_title').text(successCreationMsg);\n jQuery('#apbct_summary_and_support-user_creation_cron_updated').text(cronUpdatedMsg);\n jQuery('.apbct_summary_and_support-user_creation_result').css('display', 'block');\n const createUserButton = jQuery('#apbct_summary_and_support-create_user_button');\n createUserButton.attr('disabled', true);\n createUserButton.css('color', 'rgba(93,89,86,0.55)');\n createUserButton.css('background', '#cccccc');\n preloader.css('display', 'none');\n return;\n } else {\n if (result.result_code === -2) {\n popupMsg = localTextArray.invalid_permission;\n } else if (result.result_code === -1) {\n popupMsg = localTextArray.unknown_creation_error;\n } else if (result.result_code === -4) {\n popupMsg = localTextArray.on_cooldown;\n } else if (result.result_code === -5) {\n popupMsg = localTextArray.email_is_busy;\n }\n }\n }\n preloader.css('display', 'none');\n cleantalkModal.loaded = popupMsg;\n cleantalkModal.open();\n },\n errorOutput: function(msg) {\n preloader.css('display', 'none');\n cleantalkModal.loaded = msg;\n cleantalkModal.open();\n },\n },\n );\n}\n"],"names":["handleAnchorDetection","anchor","document","querySelector","style","display","apbctExceptedShowHide","scrollToAnchor","anchorId","targetElement","scrollIntoView","block","apbctManageEmailEncoderCustomTextField","replacingText","let","replacingTextWrapperSub","parentElement","querySelectorAll","forEach","elem","checked","value","classList","add","addEventListener","event","target","remove","apbctBannerCheck","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbctGetElems","elems","i","len","split","tmp","apbctGetElemsNative","out","arr","getElementById","push","key","getElementsByClassName","apbctShowHideElem","each","label","next","prev","is","show","element","toHide","index","indexOf","splice","toHideElem","apbctShowRequiredGroups","id","required","originEvent","preventDefault","dispatchEvent","constructor","type","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependenciesGetState","apbctSettingsShowDescription","settingId","removeDescFunc","e","callerIsPopup","parent","callerIsHideCross","hasClass","off","after","append","css","top","position","left","setting_id","spinner","children","title","desc","empty","on","apbctNavigationMenuPosition","scrollPosition","windowWidth","navBlock","rightBtnSave","window","scrollY","innerWidth","apbctSaveButtonPosition","advSettingsBlock","mainSaveButton","ctSettingsPage","key_is_ok","ip_license","additionalSaveButton","documentHeight","documentElement","scrollHeight","innerHeight","apbctHighlightElement","times","keyField","animate","scrollTop","offset","addClass","opacity","removeClass","apbctCreateSupportUser","localTextArray","support_user_creation_msg_array","cleantalkModal","loaded","open","confirm","confirm_header","confirm_text","apbctCreateSupportUserCallback","preloader","timeout","notJson","popupMsg","default_error","hasOwnProperty","user_data","success","user_created","mailSentMsg","successCreationMsg","cronUpdatedMsg","cron_updated","createUserButton","mail_sent","mail_sent_success","mail_sent_error","result_code","user_updated","text","username","email","password","attr","invalid_permission","unknown_creation_error","on_cooldown","email_is_busy","errorOutput","msg","ready","getComputedStyle","direction","this","val","timezone","Date","getTimezoneOffset","ct_admin_timezone","button","setTimeout","reload","location","getTemplates","optionSelected","console","log","template_id","template_name","settings","insertAfter","close","templateNameInput","templateName","key_changed","click","self","find","debounceTimer","clearTimeout","$this","accountEmailField","accountEmail","toggleClass","code","inputType","undefined","manuallyLink","error","enteredValue","keyBad","match","customUploader","wp","media","library","multiple","image","get","first","toJSON","url","src","adjust","hash","substring"],"mappings":"AAscA,SAASA,sBAAsBC,GAEtB,SADaC,SAASC,cAAc,oCAAoC,EACjDC,MAAMC,SAC9BC,sBAAsB,mCAAmC,EAE7DC,eAAe,IAAMN,CAAM,CAC/B,CAMA,SAASM,eAAeC,GACdC,EAAgBP,SAASC,cAAcK,CAAQ,EACjDC,GACAA,EAAcC,eAAe,CACzBC,MAAO,KACX,CAAC,CAET,CAKA,SAASC,yCACL,IAAMC,EAAgBX,SACjBC,cAAc,4DAA4D,EAC/EW,IAAIC,EACkB,OAAlBF,IACAE,EAAiE,KAAA,IAAhCF,EAAcG,cAC3CH,EAAcG,cACd,MAERd,SAASe,iBAAiB,uDAAuD,EAAEC,QAAQ,IAEnFH,GAA2BI,EAAKC,SAA0B,YAAfD,EAAKE,OAChDN,EAAwBO,UAAUC,IAAI,QAAQ,EAGlDJ,EAAKK,iBAAiB,QAAS,IACY,KAAA,IAA5BT,IACoB,YAAvBU,EAAMC,OAAOL,MACbN,EAAwBO,UAAUK,OAAO,QAAQ,EAEjDZ,EAAwBO,UAAUC,IAAI,QAAQ,EAG1D,CAAC,CACL,CAAC,CACL,CAKA,SAASK,mBACLd,IAAIe,EAAgBC,YAAa,WAC7BC,qBACI,CAACC,OAAQ,oCAAoC,EAC7C,CACIC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOI,qBACHC,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAE7CF,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAEjDC,cAAcb,CAAa,EAEnC,CACJ,CACJ,CACJ,EAAG,GAAM,CACb,CASA,SAASc,cAAcC,GAEnB,IAAM9B,IAAI+B,EAAE,EAAGC,GADfF,EAAQA,EAAMG,MAAM,GAAG,GACIP,OAAQQ,EAAKH,EAAIC,EAAKD,CAAC,GAC9CG,EAAMT,OAAO,IAAIK,EAAMC,EAAE,EACzBD,EAAMC,GAAoB,IAAfG,EAAIR,OAAeD,OAAO,IAAIK,EAAMC,EAAE,EAAIG,EAEzD,OAAOJ,CACX,CASA,SAASK,oBAAoBL,GAEJ,UAAjB,OAAOA,IACPA,EAAQA,EAAMG,MAAM,GAAG,GAG3BjC,IAAIoC,EAAM,GAsBV,OApBAN,EAAM1B,QAAQ,SAASC,EAAM0B,EAAGM,GAE5BrC,IAAIkC,EAAM9C,SAASkD,eAAejC,CAAI,EACtC,GAAY,OAAR6B,EACAE,EAAIG,KAAML,EAAIM,IAAK,OAOvB,GAAY,QADZN,EAAM9C,SAASqD,uBAAuBpC,CAAI,IACR,IAAd6B,EAAIR,OACpB,IAAKc,OAAON,EACK,GAAR,CAACM,KACFJ,EAAIG,KAAML,EAAIM,IAAK,CAInC,CAAC,EAEMJ,CACX,CAKA,SAASM,kBAAkBZ,GAEvB,IAAM9B,IAAI+B,EAAE,EAAGC,GADfF,EAAQD,cAAcC,CAAK,GACAJ,OAAQK,EAAIC,EAAKD,CAAC,GACzCD,EAAMC,GAAGY,KAAK,SAASZ,EAAG1B,GAEtBL,IAAI4C,GADJvC,EAAOoB,OAAOpB,CAAI,GACDwC,KAAK,OAAO,GAAKxC,EAAKyC,KAAK,OAAO,GAAK,KACpDzC,EAAK0C,GAAG,UAAU,GAClB1C,EAAKsB,KAAK,EACNiB,GAAOA,EAAMjB,KAAK,IAEtBtB,EAAK2C,KAAK,EACNJ,GAAOA,EAAMI,KAAK,EAE9B,CAAC,CAET,CAKA,SAASxD,sBAAsByD,GAC3BjD,IAAIkD,EAAS,CACT,iCACA,oCACA,uCAEAC,EAAQD,EAAOE,QAAQH,CAAO,EACpB,CAAC,IAAXE,GACAD,EAAOG,OAAOF,EAAO,CAAC,EAE1BT,kBAAkBO,CAAO,EACzBC,EAAO9C,QAAQ,IACPhB,SAASkD,eAAegB,CAAU,GAA2D,SAAtDlE,SAASkD,eAAegB,CAAU,EAAEhE,MAAMC,SACjFmD,kBAAkBY,CAAU,CAEpC,CAAC,CACL,CAMA,SAASC,wBAAwB5C,EAAO6C,GACpCxD,IAAIyD,EAAWrE,SAASkD,eAAe,gCAAgC,EACnEmB,GAAuC,SAA3BA,EAASnE,MAAMC,WACvBmE,EAAc/C,GACZgD,eAAe,EACrBjB,kBAAkB,gCAAgC,EAClDtD,SAASkD,eAAekB,CAAE,EAAEI,cAAc,IAAIF,EAAYG,YAAYH,EAAYI,KAAMJ,CAAW,CAAC,EAE5G,CASA,SAASK,0BAA0BC,EAAKC,GACpCA,EAAWC,MAAMD,CAAM,EAAa,KAATA,EAGf9B,oBAAqB6B,CAAI,EAE/B5D,QAAQ,SAASC,EAAM0B,EAAGM,GAC5BrC,IAeQmE,EAHG,KAHPF,EADW,OAAXA,EAC2C,OAAlC5D,EAAK+D,aAAa,UAAU,EAAa,EAAI,EAG1DH,GARI5D,EAAKgE,gBAAgB,UAAU,EAH/BhE,EAAKiE,aAAa,WAAY,UAAU,EAaC,OAAxCjE,EAAK+D,aAAa,gBAAgB,GAEpB,QADXD,EAAQI,kCAAmClE,CAAK,GAAK4D,IAErDF,0BAA2B1D,EAAK+D,aAAa,gBAAgB,EAAGD,CAAM,CAGlF,CAAC,CACL,CAMA,SAASI,kCAAkClE,GACvCL,IAAImE,EAEJ,OAAS9D,EAAK+D,aAAc,MAAO,GACnC,IAAK,WACDD,EAAQ,CAAC9D,EAAKC,QACd,MACJ,IAAK,QACD6D,EAAQ,EAAkC,GAAhC,CAAC9D,EAAK+D,aAAa,OAAO,GACpC,MACJ,QACID,EAAQ,IACZ,CAEA,OAAOA,CACX,CAMA,SAASK,6BAA6B5B,EAAO6B,GACpB,SAAjBC,EAA0BC,GAC1B,IAAMC,EAAsE,GAAtDnD,OAAOkD,EAAE/D,MAAM,EAAEiE,OAAO,kBAAkB,EAAEnD,OAC5DoD,EAAoBrD,OAAOkD,EAAE/D,MAAM,EAAEmE,SAAS,yBAAyB,GACd,EAA3CtD,OAAO,yBAAyB,EAAEC,QACnC,CAACkD,GAAiBE,KACjCrD,OAAO,kBAAkB,EAAEZ,OAAO,EAClCY,OAAOrC,QAAQ,EAAE4F,IAAI,QAASN,CAAc,EAEpD,CAEA9B,EAAMqC,MAAM,6BAA8BR,EAAU,kCAAqC,EACzFzE,IAAIuB,EAAME,OAAO,qBAAqBgD,CAAS,EAC/ClD,EAAI2D,OAAO,gDAAkD,EACxDA,OAAO,4CAA8C,EACrDC,IAAI,CACDC,IAAKxC,EAAMyC,SAAS,EAAED,IAAM,EAC5BE,KAAM1C,EAAMyC,SAAS,EAAEC,KAAO,EAClC,CAAC,EAGLrE,qBACI,CAACC,OAAQ,wCAAyCqE,WAAYd,CAAS,EACvE,CACIe,QAASjE,EAAIkE,SAAS,KAAK,EAC3BtE,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,GAAUA,EAAOsE,OAAStE,EAAOuE,OACjCpE,EAAIqE,MAAM,EACLV,OAAO,4CAA8C,EACrDA,OAAO,2DAA6D,EACpEA,OAAO,sCAAwC9D,EAAOsE,MAAM,OAAO,EACnER,OAAO,MAAM9D,EAAOuE,KAAK,MAAM,EAEpClE,OAAOrC,QAAQ,EAAEyG,GAAG,QAASnB,CAAc,EAEnD,CACJ,EACAnD,CACJ,CACJ,CAMA,SAASuE,8BACL,IAKMC,EACAC,EANAC,EAAW7G,SAASC,cAAc,8BAA8B,EAChE6G,EAAe9G,SAASC,cAAc,iCAAiC,EACxE4G,GAAaC,IAGZH,EAAiBI,OAAOC,QACxBJ,EAAcG,OAAOE,WACN,IAAjBN,GACAE,EAAS3G,MAAM+F,SAAW,QAC1Ba,EAAa5G,MAAM+F,SAAW,UAE9BY,EAAS3G,MAAM+F,SAAW,SAC1Ba,EAAa5G,MAAM+F,SAAW,UAG9BW,EAAc,OACdE,EAAa5G,MAAM+F,SAAW,QAEtC,CAMA,SAASiB,0BACL,IAqBMP,EAUAQ,EACAC,EA/BsE,OAAxEpH,SAASkD,eAAe,0CAA0C,GACK,OAAvElD,SAASkD,eAAe,yCAAyC,GACH,OAA9DlD,SAASkD,eAAe,gCAAgC,GACS,OAAjElD,SAASkD,eAAe,mCAAmC,GACH,OAAxDlD,SAASkD,eAAe,0BAA0B,IAKjDmE,eAAeC,WAAcD,eAAeE,YAK3CC,EACFxH,SAASC,cAAc,uEAAuE,KAK5F0G,EAAiBI,OAAOC,QACxBS,EAAiBzH,SAAS0H,gBAAgBC,aAI5CH,EAAqBtH,MAAMC,QADMsH,EADnB,KACdd,EAFiBI,OAAOa,YAGa,OAEA,QAGnCT,EAAmBnH,SAASkD,eAAe,mCAAmC,EAC9EkE,EAAiBpH,SAASkD,eAAe,wCAAwC,EAClFiE,IAAqBC,IAIY,QAAlCD,EAAiBjH,MAAMC,QACvBiH,EAAehG,UAAUK,OAAO,2CAA2C,EAE3E2F,EAAehG,UAAUC,IAAI,2CAA2C,GA7BxEgB,OAAO,mCAAmC,EAAEE,KAAK,EA+BzD,CAQA,SAASsF,sBAAsBzD,EAAI0D,GAC/BA,EAAQA,EAAM,GAAK,EACnBlH,IAAImH,EAAW1F,OAAO,IAAI+B,CAAE,EAC5B/B,OAAO,YAAY,EAAE2F,QAAQ,CAACC,UAAWF,EAASG,OAAO,EAAElC,IAAM,GAAG,EAAG,MAAM,EAC7E+B,EAASI,SAAS,mBAAmB,EACrCJ,EAASC,QAAQ,CAACI,QAAS,CAAC,EAAG,IAAK,SAAU,WAC1CL,EAASC,QAAQ,CAACI,QAAS,CAAC,EAAG,IAAK,SAAU,WAChC,EAANN,EACAD,sBAAsBzD,EAAI0D,CAAK,EAE/BC,EAASM,YAAY,mBAAmB,CAEhD,CAAC,CACL,CAAC,CACL,CAKA,SAASC,yBACL,IAAMC,EAAiBlB,eAAemB,gCACtCC,eAAeC,OAAS,CAAA,EACxBD,eAAeE,KAAK,CAAA,CAAK,EACzBF,eAAeG,QACXL,EAAeM,eACfN,EAAeO,aACf,GACAC,8BACJ,CACJ,CAKA,SAASA,iCACL,IAAMC,EAAY3G,OAAO,yDAAyD,EAClF2G,EAAUjD,IAAI,UAAW,OAAO,EAChClE,qBACI,CACIC,OAAQ,mCACZ,EACA,CACImH,QAAS,IACTC,QAAS,EACTnH,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACrCvB,IAAI2H,EAAiBlB,eAAemB,gCACpC5H,IAAIuI,EAAWZ,EAAea,cAc9B,GAZsB,UAAlB,OAAOpH,GACPA,EAAOqH,eAAe,SAAS,GAC/BrH,EAAOqH,eAAe,cAAc,GACpCrH,EAAOqH,eAAe,WAAW,GACjCrH,EAAOqH,eAAe,cAAc,GACpCrH,EAAOqH,eAAe,WAAW,GACjCrH,EAAOqH,eAAe,aAAa,GACP,UAA5B,OAAOrH,EAAOsH,WACdtH,EAAOsH,UAAUD,eAAe,UAAU,GAC1CrH,EAAOsH,UAAUD,eAAe,OAAO,GACvCrH,EAAOsH,UAAUD,eAAe,UAAU,GAEzBrH,EAAOuH,QAAS,CACjC,GAAIvH,EAAOwH,aAAc,CACrB5I,IAAI6I,EAAc,GACdC,EAAqB,GACzB9I,IAAI+I,EAAiBpB,EAAeqB,aAqB9BC,GAlBFJ,EADAzH,EAAO8H,UACOvB,EAAewB,kBAEfxB,EAAeyB,gBAI7BN,EADuB,IAAvB1H,EAAOiI,YACc1B,EAAe2B,aAEf3B,EAAeiB,aAGxCnH,OAAO,mDAAmD,EAAE8H,KAAKnI,EAAOsH,UAAUc,QAAQ,EAC1F/H,OAAO,gDAAgD,EAAE8H,KAAKnI,EAAOsH,UAAUe,KAAK,EACpFhI,OAAO,mDAAmD,EAAE8H,KAAKnI,EAAOsH,UAAUgB,QAAQ,EAC1FjI,OAAO,oDAAoD,EAAE8H,KAAKV,CAAW,EAC7EpH,OAAO,gDAAgD,EAAE8H,KAAKT,CAAkB,EAChFrH,OAAO,uDAAuD,EAAE8H,KAAKR,CAAc,EACnFtH,OAAO,iDAAiD,EAAE0D,IAAI,UAAW,OAAO,EACvD1D,OAAO,+CAA+C,GAK/E,OAJAwH,EAAiBU,KAAK,WAAY,CAAA,CAAI,EACtCV,EAAiB9D,IAAI,QAAS,qBAAqB,EACnD8D,EAAiB9D,IAAI,aAAc,SAAS,EAF5C8D,KAGAb,EAAUjD,IAAI,UAAW,MAAM,CAEnC,CAC+B,CAAC,IAAxB/D,EAAOiI,YACPd,EAAWZ,EAAeiC,mBACI,CAAC,IAAxBxI,EAAOiI,YACdd,EAAWZ,EAAekC,uBACI,CAAC,IAAxBzI,EAAOiI,YACdd,EAAWZ,EAAemC,YACI,CAAC,IAAxB1I,EAAOiI,cACdd,EAAWZ,EAAeoC,cAGtC,CACA3B,EAAUjD,IAAI,UAAW,MAAM,EAC/B0C,eAAeC,OAASS,EACxBV,eAAeE,KAAK,CACxB,EACAiC,YAAa,SAASC,GAClB7B,EAAUjD,IAAI,UAAW,MAAM,EAC/B0C,eAAeC,OAASmC,EACxBpC,eAAeE,KAAK,CACxB,CACJ,CACJ,CACJ,CAv6BAtG,OAAOrC,QAAQ,EAAE8K,MAAM,WAEf9K,SAASqD,uBAAuB,sBAAsB,EAAE,IACuC,QAA3F0H,iBAAiB/K,SAASqD,uBAAuB,sBAAsB,EAAE,EAAE,EAAE2H,WAC7E3I,OAAO,kBAAkB,EAAE0D,IAAI,aAAc,OAAO,EAK5D1D,OAAO,mBAAmB,EAAEoE,GAAG,QAAS,SAASlB,GAC7CA,EAAEhB,eAAe,EACjBlC,OAAO4I,IAAI,EAAE1I,KAAK,EAClBF,OAAO,gCAAgC,EAAE6I,IAAI7I,OAAO,gCAAgC,EAAEkI,KAAK,KAAK,CAAC,EACjGlI,OAAO,oCAAoC,EAAE0D,IAAI,UAAW,QAAQ,CACxE,CAAC,EAGDnF,IAAIuK,GADI,IAAIC,MACKC,kBAAkB,EAAE,GAAG,CAAE,EAC1ChJ,OAAO,oBAAoB,EAAE6I,IAAIC,CAAQ,EAGzC9I,OAAO,6BAA6B,EAAEoE,GAAG,QAAS,WACzCpE,OAAO,uBAAuB,EAAEsB,GAAG,UAAU,EAKlD9B,qBACI,CAACC,OAAQ,qBAAsBwJ,kBAAmBH,CAAQ,EAC1D,CACIlC,QAAS,KACTsC,OAAQvL,SAASkD,eAAe,4BAA6B,EAC7DkD,QAAS/D,OAAO,qDAAsD,EACtEN,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACrCE,OAAO,4CAA4C,EAAEuB,KAAK,GAAG,EAC7D4H,WAAW,WACPnJ,OAAO,4CAA4C,EAAEE,KAAK,GAAG,CACjE,EAAG,GAAI,EACHP,EAAOyJ,QACPzL,SAAS0L,SAASD,OAAO,EAEzBzJ,EAAO2J,eACPlD,eAAeC,OAAS1G,EAAO2J,aAC/BlD,eAAeE,KAAK,EACpB3I,SAASsB,iBAAiB,uBAAwB,SAAUiE,GACxDvF,SAAS0L,SAASD,OAAO,CAC7B,CAAC,EAET,CACJ,CACJ,GA3BIpJ,OAAO,sCAAsC,EAAEuB,KAAK,EACpDiE,sBAAsB,uBAAwB,CAAC,EA2BvD,CAAC,EAGDxF,OAAQrC,QAAS,EAAEyG,GAAG,QAAS,0CAA2C,WACtEpE,OAAO,oBAAoB,EAAEZ,OAAO,EACpCb,IAAIgL,EAAiBvJ,OAAO,kBAAmBA,OAAO,kCAAkC,CAAC,EAGzF,GAFwBA,OAAO,uCAAuC,EACpD0D,IAAI,eAAgB,SAAS,EACL,KAAA,IAA9B6F,EAAe3J,KAAK,IAAI,EAChC4J,QAAQC,IAAK,6CAA8C,MAD/D,CAII7J,EAAO,CACP8J,YAAeH,EAAe3J,KAAK,IAAI,EACvC+J,cAAiBJ,EAAe3J,KAAK,MAAM,EAC3CgK,SAAYL,EAAe3J,KAAK,UAAU,CAC9C,EACArB,IAAI2K,EAASN,KACbpJ,qBACI,CAACC,OAAQ,4BAA6BG,KAAMA,CAAI,EAChD,CACIgH,QAAS,KACTsC,OAAQA,EACRnF,QAAS/D,OAAO,iEAAkE,EAClF6G,QAAS,CAAA,EACTnH,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOuH,SACPlH,OAAQ,6CAAmDL,EAAOC,KAAO,MAAO,EAC3EiK,YAAa7J,OAAOkJ,CAAM,CAAE,EACjClJ,OAAO,wDAAwD,EAAEuB,KAAK,GAAG,EACzE4H,WAAW,WACPnJ,OAAO,wDAAwD,EAAEE,KAAK,GAAG,CAC7E,EAAG,GAAI,EACPvC,SAASsB,iBAAiB,uBAAwB,SAAUiE,GACxDvF,SAAS0L,SAASD,OAAO,CAC7B,CAAC,EACDD,WAAW,WACP/C,eAAe0D,MAAM,CACzB,EAAG,GAAI,GAEP9J,OAAQ,2CAAiDL,EAAOC,KAAO,MAAO,EACzEiK,YAAa7J,OAAOkJ,CAAM,CAAE,CAEzC,CACJ,CACJ,CAlCA,CAmCJ,CAAC,EAGDlJ,OAAQrC,QAAS,EAAEyG,GAAG,QAAS,0CAA2C,WACtEpE,OAAO,oBAAoB,EAAEZ,OAAO,EACpCb,IAAIgL,EAAiBvJ,OAAO,kBAAmBA,OAAO,kCAAkC,CAAC,EACrF+J,EAAoB/J,OAAO,uCAAuC,EACtEzB,IAAIqB,EAAO,GAEX,GADAmK,EAAkBrG,IAAI,eAAgB,SAAS,EACL,KAAA,IAA9B6F,EAAe3J,KAAK,IAAI,EAChC4J,QAAQC,IAAK,6CAA8C,MAD/D,CAIA,GAAmC,iBAA9BF,EAAe3J,KAAK,IAAI,EAAuB,CAChDrB,IAAIyL,EAAeD,EAAkBlB,IAAI,EACzC,GAAsB,KAAjBmB,EAED,OADAD,KAAAA,EAAkBrG,IAAI,eAAgB,KAAK,EAG/C9D,EAAO,CACH+J,cAAiBK,CACrB,CACJ,MACIpK,EAAO,CACH8J,YAAeH,EAAe3J,KAAK,IAAI,CAC3C,EAEJrB,IAAI2K,EAASN,KACbpJ,qBACI,CAACC,OAAQ,4BAA6BG,KAAMA,CAAI,EAChD,CACIgH,QAAS,KACTsC,OAAQA,EACRnF,QAAS/D,OAAO,iEAAkE,EAClF6G,QAAS,CAAA,EACTnH,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOuH,SACPlH,OAAQ,6CAAmDL,EAAOC,KAAO,MAAO,EAC3EiK,YAAa7J,OAAOkJ,CAAM,CAAE,EACjClJ,OAAO,wDAAwD,EAAEuB,KAAK,GAAG,EACzE4H,WAAW,WACPnJ,OAAO,wDAAwD,EAAEE,KAAK,GAAG,CAC7E,EAAG,GAAI,EACPvC,SAASsB,iBAAiB,uBAAwB,SAAUiE,GACxDvF,SAAS0L,SAASD,OAAO,CAC7B,CAAC,EACDD,WAAW,WACP/C,eAAe0D,MAAM,CACzB,EAAG,GAAI,GAEP9J,OAAQ,2CAAiDL,EAAOC,KAAO,MAAO,EACzEiK,YAAa7J,OAAOkJ,CAAM,CAAE,CAEzC,CACJ,CACJ,CA3CA,CA4CJ,CAAC,EAGDlJ,OAAQrC,QAAS,EAAEyG,GAAG,QAAS,yCAA0C,WACrE7F,IAAI2K,EAASN,KACbpJ,qBACI,CAACC,OAAQ,0BAA0B,EACnC,CACImH,QAAS,KACTsC,OAAQA,EACRnF,QAAS/D,OAAO,gEAAiE,EACjF6G,QAAS,CAAA,EACTnH,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOuH,SACPlH,OAAQ,6CAAmDL,EAAOC,KAAO,MAAO,EAC3EiK,YAAa7J,OAAOkJ,CAAM,CAAE,EACjClJ,OAAO,uDAAuD,EAAEuB,KAAK,GAAG,EACxE4H,WAAW,WACPnJ,OAAO,uDAAuD,EAAEE,KAAK,GAAG,CAC5E,EAAG,GAAI,EACPvC,SAASsB,iBAAiB,uBAAwB,SAAUiE,GACxDvF,SAAS0L,SAASD,OAAO,CAC7B,CAAC,EACDD,WAAW,WACP/C,eAAe0D,MAAM,CACzB,EAAG,GAAI,GAEP9J,OAAQ,2CAAiDL,EAAOC,KAAO,MAAO,EACzEiK,YAAa7J,OAAOkJ,CAAM,CAAE,CAEzC,CACJ,CACJ,CACJ,CAAC,EAGDlJ,OAAO,qBAAqB,EAAEoE,GAAG,QAAS,WACtC5E,qBACI,CAACC,OAAQ,YAAY,EACrB,CACImH,QAAS,KACTsC,OAAQvL,SAASkD,eAAe,oBAAqB,EACrDkD,QAAS/D,OAAO,6CAA8C,EAC9DN,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACrCE,OAAO,oCAAoC,EAAEuB,KAAK,GAAG,EACrD4H,WAAW,WACPnJ,OAAO,oCAAoC,EAAEE,KAAK,GAAG,CACzD,EAAG,GAAI,EACHP,EAAOyJ,SACFpE,eAAeiF,aAChBjK,OAAO,mBAAmB,EAAEE,KAAK,GAAG,EACpCF,OAAO,sBAAsB,EAAEuB,KAAK,GAAG,EACvC4H,WAAW,WACPxL,SAAS0L,SAASD,OAAO,CAC7B,EAAG,GAAI,GAEPzL,SAAS0L,SAASD,OAAO,EAGrC,CACJ,CACJ,CACJ,CAAC,EAEIpE,eAAeiF,aAChBjK,OAAO,qBAAqB,EAAEkK,MAAM,EAGxClK,OAAOrC,QAAQ,EAAEyG,GAAG,QAAS,0CAA2C,WAEpErB,6BADAoH,KAAOnK,OAAO4I,IAAI,EACiBuB,KAAKjC,KAAK,SAAS,CAAC,CAC3D,CAAC,GAEGlI,OAAO,yBAAyB,EAAEC,QAAUD,OAAO,yBAAyB,EAAEC,SAC9EZ,iBAAiB,EAGrBW,OAAOrC,QAAQ,EAAEyG,GAAG,SAAU,mCAAoC,WAE3B,iBADdpE,OAAO,kBAAmB4I,IAAI,EAC/BhJ,KAAK,IAAI,EACzBI,OAAO4I,IAAI,EAAExF,OAAO,EAAEA,OAAO,EAAEgH,KAAK,uCAAuC,EAAE7I,KAAK,EAElFvB,OAAO4I,IAAI,EAAExF,OAAO,EAAEA,OAAO,EAAEgH,KAAK,uCAAuC,EAAElK,KAAK,CAE1F,CAAC,EAED2E,wBAAwB,EACxBtG,IAAI8L,EACJ3F,OAAOzF,iBAAiB,SAAU,WAC9BqL,aAAaD,CAAa,EAC1BA,EAAgBlB,WAAW,WACvBtE,wBAAwB,CAC5B,EAAG,EAAE,EACLR,4BAA4B,CAChC,CAAC,EACDrE,OAAO,oBAAoB,EAAEoE,GAAG,QAASS,uBAAuB,EAMhE7E,OAAO,6BAA6B,EAAEoE,GAAG,QAAS,SAASlB,GACvDA,EAAEhB,eAAe,EAEjB3D,IAAIgM,EAAQvK,OAAO4I,IAAI,EACnB4B,EAAoBxK,OAAO,sBAAsB,EACjDyK,EAAeD,EAAkB1C,KAAK,EAE1CyC,EAAMG,YAAY,QAAQ,EAEtBH,EAAMjH,SAAS,QAAQ,GACvBiH,EAAMzC,KAAKyC,EAAM3K,KAAK,WAAW,CAAC,EAClC4K,EAAkBtC,KAAK,kBAAmB,MAAM,EAChDsC,EAAkBpG,GAAG,UAAW,SAASlB,GACtB,UAAXA,EAAEyH,MACFzH,EAAEhB,eAAe,CAEzB,CAAC,EACDsI,EAAkBpG,GAAG,QAAS,SAASlB,GACf,oBAAhBA,EAAE0H,WACF1H,EAAEhB,eAAe,CAEzB,CAAC,IAED1C,qBACI,CACIC,OAAQ,6BACRgL,aAAcA,CAClB,EACA,CACI7D,QAAS,IACTlH,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACd+K,KAAAA,IAAnBlL,EAAOuH,SAA4C,OAAnBvH,EAAOuH,SACX2D,KAAAA,IAAxBlL,EAAOmL,cACP9K,OAAO,0BAA0B,EAAEkI,KAAK,OAAQvI,EAAOmL,YAAY,EAItDD,KAAAA,IAAjBlL,EAAOoL,OACP/K,OAAO,sBAAsB,EAAE0D,IAAI,eAAgB,KAAK,CAEhE,CACJ,CACJ,EAEA8G,EAAkBtC,KAAK,kBAAmB,OAAO,EACjDqC,EAAMzC,KAAKyC,EAAM3K,KAAK,cAAc,CAAC,EAE7C,CAAC,EAKDI,OAAO,uBAAuB,EAAEoE,GAAG,QAAS,WACxC7F,IAAIyM,EAAehL,OAAO4I,IAAI,EAAEC,IAAI,EAEhCoC,GADJjL,OAAO,0CAA0C,EAAEuD,IAAI,OAAO,EAChC,KAAjByH,GAAoE,OAA7CA,EAAaE,MAAM,oBAAoB,GAC3ElL,OAAO,6BAA6B,EAAEE,KAAK,EAC3CF,OAAO,mBAAmB,EAAEE,KAAK,EACjCF,OAAO,kCAAkC,EAAEE,KAAK,EAChDF,OAAO,sCAAsC,EAAEE,KAAK,EAC/B,KAAjB8K,GACAhL,OAAO,+CAA+C,EAAEE,KAAK,EAC7DF,OAAO,sCAAsC,EAAEuB,KAAK,EACpDvB,OAAO,qCAAqC,EAAEuB,KAAK,IAEnDvB,OAAO,+CAA+C,EAAEuB,KAAK,EAC7DvB,OAAO,sCAAsC,EAAEE,KAAK,EACpDF,OAAO,qCAAqC,EAAEE,KAAK,EAC/C+K,GACAjL,OAAO,0CAA0C,EAAEoE,GAAG,QAClD,SAASlB,GACLA,EAAEhB,eAAe,EACjBlC,OAAO,6BAA6B,EAAEuB,KAAK,EAC3CiE,sBAAsB,uBAAwB,CAAC,CACnD,CACJ,EAGZ,CAAC,EAEIxF,OAAO,uBAAuB,EAAE6I,IAAI,GAAK7D,eAAeC,WACzDjF,OAAO,sCAAsC,EAAEE,KAAK,EAMlD8E,eAAeC,WAAcD,eAAeE,YAC9ClF,OAAO,6CAA6C,EAAEoE,GAAG,QACrD,SAASlB,GACLA,EAAEhB,eAAe,EACZlC,OAAO,uBAAuB,EAAEC,QACjCD,OAAQ,kKAES,EAAE6J,YAAa7J,OAAO,qBAAqB,CAAE,EAElEwF,sBAAsB,uBAAwB,CAAC,EAC/CA,sBAAsB,qBAAsB,CAAC,EAC7CxF,OAAO,sCAAsC,EAAEuB,KAAK,CACxD,CACJ,EAMJvB,OAAO,iCAAiC,EAAEkK,MAAM,SAAShH,GACrDA,EAAEhB,eAAe,EAEjB,IAAMgH,EAASlJ,OAAO4I,IAAI,EAEpBuC,EAAiBC,GAAGC,MAAM,CAC5BC,QAAS,CACLjJ,KAAM,OACV,EACAkJ,SAAU,CAAA,CACd,CAAC,EAEDJ,EAAe/G,GAAG,SAAU,WACxB,IAAMoH,EAAQL,EAAezI,MAAM,EAAE+I,IAAI,WAAW,EAAEC,MAAM,EAAEC,OAAO,EAErEzC,EAAO9F,OAAO,EAAE/B,KAAK,EAAE6G,KAAM,MAAOsD,EAAMI,GAAI,EAC9C5L,OAAO,wBAAwB,EAAE6I,IAAK2C,EAAMzJ,EAAG,CACnD,CAAC,EAEDoJ,EAAe7E,KAAK,CACxB,CAAC,EAKDtG,OAAO,iCAAiC,EAAEkK,MAAM,SAAShH,GACrDA,EAAEhB,eAAe,EAEZ,CAAA,IAASqE,QAAS,OAAQ,IACrBsF,EAAM7L,OAAO4I,IAAI,EAAExF,OAAO,EAAE/B,KAAK,EAAEzB,KAAK,KAAK,EACnDI,OAAO4I,IAAI,EAAExF,OAAO,EAAE/B,KAAK,EAAE6G,KAAK,MAAO2D,CAAG,EAC5C7L,OAAO4I,IAAI,EAAEvH,KAAK,EAAEA,KAAK,EAAEwH,IAAI,EAAE,EAEzC,CAAC,EAED7I,OAAO,2CAA2C,EAAEkK,MAAM,SAAShH,GAC/DA,EAAEhB,eAAe,EAEjB3D,IAAIqB,EAAO,CACXH,OAAc,4BADF,EAIRI,GAFJD,EAAKkM,OAAS9L,OAAO4I,IAAI,EAAEhJ,KAAK,QAAQ,EAE3B,IACbC,EAAOqJ,OAASvL,SAASkD,eAAe,8BAAgCjB,EAAKkM,MAAM,EACnFjM,EAAOgH,QAAU,CAAA,EAEjBhH,EAAOH,SAAW,WACd/B,SAAS0L,SAASD,OAAO,CAC7B,EAEA5J,qBAAqBI,EAAMC,CAAM,CACrC,CAAC,EAEDG,OAAO,4CAA4C,EAAEkK,MAAM,SAAShH,GAChEA,EAAEhB,eAAe,EAEjB3D,IAAIqB,EAAO,CACXH,OAAc,6BADF,EAIRI,GAFJD,EAAKkM,OAAS9L,OAAO4I,IAAI,EAAEhJ,KAAK,QAAQ,EAE3B,IACbC,EAAOqJ,OAASvL,SAASkD,eAAe,+BAAiCjB,EAAKkM,MAAM,EACpFjM,EAAOgH,QAAU,CAAA,EAEjBhH,EAAOH,SAAW,WACd/B,SAAS0L,SAASD,OAAO,CAC7B,EAEA5J,qBAAqBI,EAAMC,CAAM,CACrC,CAAC,EAEDlC,SAASC,cAAc,mCAAmC,EAAEqB,iBAAiB,QAAS,KAClFtB,SAASC,cAAc,8BAA8B,EAAEC,MAAMC,QAAU,QACvEH,SAASC,cAAc,mCAAmC,EAAEC,MAAMC,QAAU,MAChF,CAAC,EAEDH,SAASC,cAAc,yCAAyC,EAAEqB,iBAAiB,QAAS,KACxFtB,SAASC,cAAc,8BAA8B,EAAEC,MAAMC,QAAU,OACvEH,SAASC,cAAc,mCAAmC,EAAEC,MAAMC,QAAU,OAChF,CAAC,EAGDO,uCAAuC,EAEnCqG,OAAO2E,SAAS0C,MAEhBtO,sBADeiH,OAAO2E,SAAS0C,KAAKC,UAAU,CAAC,CACnB,CAEpC,CAAC"} \ No newline at end of file From 8767989dbf3addb83974219d9e98ed37aa2e63f3 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 10 Feb 2026 17:01:42 +0700 Subject: [PATCH 30/60] Fix phpunits errors --- inc/cleantalk-admin.php | 2 +- inc/cleantalk-settings.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/cleantalk-admin.php b/inc/cleantalk-admin.php index 1a79caf65..8ac6e95f4 100644 --- a/inc/cleantalk-admin.php +++ b/inc/cleantalk-admin.php @@ -1551,7 +1551,7 @@ function apbct_action_adjust_change() { AJAXService::checkAdminNonce(); - if(!current_user_can('activate_plugins')) { + if (!current_user_can('activate_plugins')) { wp_send_json_error('Permission denied'); } diff --git a/inc/cleantalk-settings.php b/inc/cleantalk-settings.php index 062d55c38..ed0a9cd91 100644 --- a/inc/cleantalk-settings.php +++ b/inc/cleantalk-settings.php @@ -2729,7 +2729,7 @@ function apbct_settings__get_key_auto($direct_call = false) global $apbct; - if(!current_user_can('activate_plugins')) { + if (!current_user_can('activate_plugins')) { $out = array( 'success' => false, 'message' => __('You do not have sufficient permissions to access this page.', 'cleantalk-spam-protect'), @@ -3001,7 +3001,7 @@ function apbct_settings__get__long_description() global $apbct; AJAXService::checkAdminNonce(); - if(!current_user_can('activate_plugins')) { + if (!current_user_can('activate_plugins')) { $out = array( 'success' => false, 'message' => __('You do not have sufficient permissions to access this page.', 'cleantalk-spam-protect'), @@ -3176,7 +3176,7 @@ function apbct_settings__check_renew_banner() AJAXService::checkAdminNonce(); - if(!current_user_can('activate_plugins')) { + if (!current_user_can('activate_plugins')) { $out = array( 'success' => false, 'close_renew_banner' => false, From 272f0e0108c8a626cee8efaf127ecaf4bc7f03cd Mon Sep 17 00:00:00 2001 From: alexandergull Date: Wed, 11 Feb 2026 13:45:48 +0500 Subject: [PATCH 31/60] Upd. Exclusions. Ajax. Plugin "wp-multi-step-checkout". --- inc/cleantalk-pluggable.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/inc/cleantalk-pluggable.php b/inc/cleantalk-pluggable.php index 2e4311fb8..1213d0649 100644 --- a/inc/cleantalk-pluggable.php +++ b/inc/cleantalk-pluggable.php @@ -1676,7 +1676,7 @@ class_exists('Cleantalk\Antispam\Integrations\CleantalkInternalForms') return 'spoki_abandoned_card_for_woocommerce'; } - //https://wordpress.org/plugins/woocommerce-abandoned-cart/ + //UNIT OK https://wordpress.org/plugins/woocommerce-abandoned-cart/ if ( apbct_is_plugin_active('woocommerce-abandoned-cart\woocommerce-ac.php') && Post::equal('action', 'save_data') @@ -1684,7 +1684,7 @@ class_exists('Cleantalk\Antispam\Integrations\CleantalkInternalForms') return 'woocommerce-abandoned-cart'; } - //https://wordpress.org/plugins/woo-abandoned-cart-recovery/ + //UNIT OK https://wordpress.org/plugins/woo-abandoned-cart-recovery/ if ( apbct_is_plugin_active('woo-abandoned-cart-recovery/woo-abandoned-cart-recovery.php') && Post::equal('action', 'wacv_get_info ') @@ -1692,13 +1692,21 @@ class_exists('Cleantalk\Antispam\Integrations\CleantalkInternalForms') return 'woo-abandoned-cart-recovery'; } - //unknown wc plugin from https://app.doboard.com/1/task/41205 + //UNIT OK unknown wc plugin from https://app.doboard.com/1/task/41205 if ( apbct_is_plugin_active('abandoned-cart-capture/abandoned-cart-capture.php') && Post::equal('action', 'acc_save_data') ) { return 'abandoned-cart-capture'; } + + //UNIT OK https://wordpress.org/plugins/wp-multi-step-checkout/ multipage request + if ( + apbct_is_plugin_active('wp-multi-step-checkout/wp-multi-step-checkout.php') && + Post::equal('action', 'wpms_checkout_errors') + ) { + return 'wp-multi-step-checkout'; + } } else { /*****************************************/ /* Here is non-ajax requests skipping */ From 759b262add5e79f698398cf345d0d1e4b55e4ce2 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Wed, 11 Feb 2026 13:46:14 +0500 Subject: [PATCH 32/60] Fix. Exclusions. Ajax. Plugin "woo-abandoned-cart-recovery". Fixed condition. --- inc/cleantalk-pluggable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/cleantalk-pluggable.php b/inc/cleantalk-pluggable.php index 1213d0649..19fe6ed7f 100644 --- a/inc/cleantalk-pluggable.php +++ b/inc/cleantalk-pluggable.php @@ -1687,7 +1687,7 @@ class_exists('Cleantalk\Antispam\Integrations\CleantalkInternalForms') //UNIT OK https://wordpress.org/plugins/woo-abandoned-cart-recovery/ if ( apbct_is_plugin_active('woo-abandoned-cart-recovery/woo-abandoned-cart-recovery.php') && - Post::equal('action', 'wacv_get_info ') + Post::equal('action', 'wacv_get_info') ) { return 'woo-abandoned-cart-recovery'; } From 99626d3b7921a9c4e647ef3854bd7ad18701e66c Mon Sep 17 00:00:00 2001 From: alexandergull Date: Wed, 11 Feb 2026 13:46:43 +0500 Subject: [PATCH 33/60] Code. Unit tests for apbct_is_skip_request() refactored. --- tests/Inc/TestContactIsSkipRequest.php | 197 +++++++++++++++++-------- 1 file changed, 139 insertions(+), 58 deletions(-) diff --git a/tests/Inc/TestContactIsSkipRequest.php b/tests/Inc/TestContactIsSkipRequest.php index 4a24899b3..441d91943 100644 --- a/tests/Inc/TestContactIsSkipRequest.php +++ b/tests/Inc/TestContactIsSkipRequest.php @@ -23,7 +23,6 @@ protected function tearDown(): void { global $apbct; $apbct = $this->apbctBackup; - $GLOBALS['current_screen'] = null; } public static function tearDownAfterClass(): void @@ -34,89 +33,171 @@ public static function tearDownAfterClass(): void $_POST = []; $_GET = []; $_REQUEST = []; + $GLOBALS['current_screen'] = null; } public function testElementorBuilderSkipIsAdmin() { - update_option( 'active_plugins', array('elementor/elementor.php'), false ); - - $_POST = array ( - 'actions_save_builder_action' => 'save_builder', - ); - $GLOBALS['current_screen'] = new Mock_WP_Screen(); - - Post::getInstance()->variables = $_POST; - - $result = apbct_is_skip_request(true); - $this->assertEquals('elementor_skip', $result); - - update_option( 'active_plugins', array(), false ); + $this->assertTrue(self::skipped( + 'actions_save_builder_action', + 'save_builder', + 'elementor/elementor.php', + function() { + $GLOBALS['current_screen'] = new Mock_WP_Screen(); //is admin page + }, + 'elementor_skip' + )); } - public function testElementorBuilderSkipIsAdminNoActivePlugin() + public function testElementorBuilderSkipNotAdmin() { - update_option( 'active_plugins', [], false ); - - $_POST = array ( - 'actions_save_builder_action' => 'save_builder', - ); - $GLOBALS['current_screen'] = new Mock_WP_Screen(); - - Post::getInstance()->variables = $_POST; - - $result = apbct_is_skip_request(true); - $this->assertFalse($result); - - update_option( 'active_plugins', array(), false ); + $this->assertFalse(self::skipped( + 'actions_save_builder_action', + 'save_builder', + 'elementor/elementor.php', + function() { + $GLOBALS['current_screen'] = null; //is not admin page + }, + 'elementor_skip' + )); } - public function testElementorBuilderSkipNotAdmin() + public function testSkip__woocommerceAbandonedCart() { - update_option( 'active_plugins', array('elementor/elementor.php'), false ); - - $_POST = array ( - 'actions_save_builder_action' => 'save_builder', - ); - $GLOBALS['current_screen'] = null; - - Post::getInstance()->variables = $_POST; - - $result = apbct_is_skip_request(true); - $this->assertFalse($result); - - update_option( 'active_plugins', array(), false ); + $this->assertTrue(self::checkSkipMutations( + 'action', + 'save_data', + 'woocommerce-abandoned-cart\woocommerce-ac.php', + 'woocommerce-abandoned-cart' + )); } - - public function testElementorLoginWidgetSkip() + public function testSkip__wooAbandonedCartRecovery() + { + $this->assertTrue(self::checkSkipMutations( + 'action', + 'wacv_get_info', + 'woo-abandoned-cart-recovery/woo-abandoned-cart-recovery.php', + 'woo-abandoned-cart-recovery' + )); + } + public function testSkip__ElementorLoginWidget() + { + $this->assertTrue(self::checkSkipMutations( + 'action', + 'elementor_woocommerce_checkout_login_user', + 'elementor/elementor.php', + 'elementor_skip' + )); + } + public function testSkip__abandonedCartCapture() { - update_option( 'active_plugins', array('elementor/elementor.php'), false ); + $this->assertTrue(self::checkSkipMutations( + 'action', + 'acc_save_data', + 'abandoned-cart-capture/abandoned-cart-capture.php', + 'abandoned-cart-capture' + )); + } + public function testSkip__WpMultiStepCheckout() + { + $this->assertTrue(self::checkSkipMutations( + 'action', + 'wpms_checkout_errors', + 'wp-multi-step-checkout/wp-multi-step-checkout.php', + 'wp-multi-step-checkout' + )); + } - $_POST = array ( - 'action' => 'elementor_woocommerce_checkout_login_user', + /** + * Check if skipped on all data complied, and every case if not. + * @param string $expected_key expected POST key + * @param string $expected_action expected POST value + * @param string $plugin_slug plugin slug string + * @param string $expected_reason expected string from apbct_is_skip_request + * @return true + */ + private static function checkSkipMutations(string $expected_key, string $expected_action, string $plugin_slug, string $expected_reason): bool + { + //anything is OK - should be skipped + self::assertTrue( + self::skipped( + $expected_key, + $expected_action, + $plugin_slug, + function () {}, + $expected_reason + ) ); - - Post::getInstance()->variables = $_POST; - - $result = apbct_is_skip_request(true); - $this->assertEquals('elementor_skip', $result); - - update_option( 'active_plugins', array(), false ); + //wrong post key + self::assertFalse( + self::skipped( + 'not_valid_key', + $expected_action, + $plugin_slug, + function () {}, + $expected_reason + ) + ); + //wrong post value + self::assertFalse( + self::skipped( + $expected_key, + 'not_valid_action', + $plugin_slug, + function () {}, + $expected_reason + ) + ); + //wrong slug + self::assertFalse( + self::skipped( + $expected_key, + $expected_action, + 'invalid_plugin/plugin.php', + function () {}, + $expected_reason + ) + ); + //wrong reason + self::assertFalse( + self::skipped( + $expected_key, + $expected_action, + $plugin_slug, + function () {}, + 'not_valid_reason' + ) + ); + //success + return true; } - public function testElementorLoginWidgetSkipNoActivePlugin() + /** + * Returns true if apbct_is_skip_request returns the expected string, false otherwise + * @param string $expected_key expected POST key + * @param string $expected_action expected POST value + * @param string $plugin_slug plugin slug string + * @param mixed $prepare_function logic run before check + * @param string $expected_reason expected string from apbct_is_skip_request + * @return bool + */ + private static function skipped(string $expected_key, string $expected_action, string $plugin_slug, $prepare_function, string $expected_reason): bool { - update_option( 'active_plugins', [], false ); + $prepare_function(); + + update_option( 'active_plugins', [$plugin_slug], false ); $_POST = array ( - 'action' => 'elementor_woocommerce_checkout_login_user', + $expected_key => $expected_action, ); Post::getInstance()->variables = $_POST; $result = apbct_is_skip_request(true); - $this->assertFalse($result); update_option( 'active_plugins', array(), false ); + + return $result === $expected_reason; } } From b2cdc5c4765920e3721a84925f7dc1b55447e21f Mon Sep 17 00:00:00 2001 From: alexandergull Date: Wed, 11 Feb 2026 14:29:01 +0500 Subject: [PATCH 34/60] Upd. Unit tests for apbct_is_skip_request(). --- tests/Inc/TestContactIsSkipRequest.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/Inc/TestContactIsSkipRequest.php b/tests/Inc/TestContactIsSkipRequest.php index 441d91943..40169c8c6 100644 --- a/tests/Inc/TestContactIsSkipRequest.php +++ b/tests/Inc/TestContactIsSkipRequest.php @@ -158,16 +158,6 @@ function () {}, $expected_reason ) ); - //wrong reason - self::assertFalse( - self::skipped( - $expected_key, - $expected_action, - $plugin_slug, - function () {}, - 'not_valid_reason' - ) - ); //success return true; } @@ -195,6 +185,12 @@ private static function skipped(string $expected_key, string $expected_action, s $result = apbct_is_skip_request(true); + if (is_string($result)) { + self::assertEquals($expected_reason, $result); + } else { + self::assertFalse($result); + } + update_option( 'active_plugins', array(), false ); return $result === $expected_reason; From ccace562bd0b10cf7c95bc2fe0009d14a10e8cde Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 11 Feb 2026 17:35:45 +0700 Subject: [PATCH 35/60] Fix. Code. Escaping woocommerce order data --- .../ApbctWP/WcSpamOrdersListTable.php | 10 +- tests/ApbctWP/TestWcSpamOrdersListTable.php | 185 ++++++++++++++++++ 2 files changed, 190 insertions(+), 5 deletions(-) create mode 100644 tests/ApbctWP/TestWcSpamOrdersListTable.php diff --git a/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php b/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php index 1ab6b6388..ed284cbf9 100644 --- a/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php +++ b/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php @@ -219,9 +219,9 @@ private function renderOrderDetailsColumn($order_details) $wc_product_class = '\WC_Product'; $product_title = $wc_product instanceof $wc_product_class ? $wc_product->get_title() : ''; } - $result .= "" . $product_title . ""; + $result .= "" . esc_html($product_title) . ""; $result .= " - "; - $result .= $order_detail['quantity']; + $result .= esc_html($order_detail['quantity']); $result .= "
"; } @@ -242,11 +242,11 @@ private function renderCustomerDetailsColumn($customer_details) $result = ''; - $result .= "" . ($customer_details["billing_first_name"] ?? '') . ""; + $result .= "" . esc_html($customer_details["billing_first_name"] ?? '') . ""; $result .= "
"; - $result .= "" . ($customer_details["billing_last_name"] ?? '') . ""; + $result .= "" . esc_html($customer_details["billing_last_name"] ?? '') . ""; $result .= "
"; - $result .= "" . ($customer_details["billing_email"] ?? '') . ""; + $result .= "" . esc_html($customer_details["billing_email"] ?? '') . ""; return $result; } diff --git a/tests/ApbctWP/TestWcSpamOrdersListTable.php b/tests/ApbctWP/TestWcSpamOrdersListTable.php new file mode 100644 index 000000000..3c366c2d8 --- /dev/null +++ b/tests/ApbctWP/TestWcSpamOrdersListTable.php @@ -0,0 +1,185 @@ +instance = $reflection->newInstanceWithoutConstructor(); + + // Make private methods accessible + $this->renderOrderDetailsColumn = $reflection->getMethod('renderOrderDetailsColumn'); + $this->renderOrderDetailsColumn->setAccessible(true); + + $this->renderCustomerDetailsColumn = $reflection->getMethod('renderCustomerDetailsColumn'); + $this->renderCustomerDetailsColumn->setAccessible(true); + } + + /** + * Test renderOrderDetailsColumn returns error on invalid JSON + */ + public function testRenderOrderDetailsColumnInvalidJson() + { + $result = $this->renderOrderDetailsColumn->invoke($this->instance, 'invalid json'); + + $this->assertEquals('Product details decoding error.
', $result); + } + + /** + * Test renderOrderDetailsColumn returns error on non-array JSON + */ + public function testRenderOrderDetailsColumnNonArrayJson() + { + $result = $this->renderOrderDetailsColumn->invoke($this->instance, '"just a string"'); + + $this->assertEquals('Product details decoding error.
', $result); + } + + /** + * Test renderOrderDetailsColumn with valid order details (no WooCommerce) + */ + public function testRenderOrderDetailsColumnValidDataWithoutWooCommerce() + { + $orderDetails = json_encode([ + ['product_id' => 1, 'quantity' => 2], + ['product_id' => 2, 'quantity' => 5], + ]); + + $result = $this->renderOrderDetailsColumn->invoke($this->instance, $orderDetails); + + // Without WooCommerce, product title should be 'Unavailable product' + $this->assertStringContainsString('Unavailable product', $result); + $this->assertStringContainsString(' - 2
', $result); + $this->assertStringContainsString(' - 5
', $result); + } + + /** + * Test renderOrderDetailsColumn escapes HTML to prevent XSS + */ + public function testRenderOrderDetailsColumnEscapesHtmlInQuantity() + { + $orderDetails = json_encode([ + ['product_id' => 1, 'quantity' => ''], + ]); + + $result = $this->renderOrderDetailsColumn->invoke($this->instance, $orderDetails); + + // Verify that script tags are escaped + $this->assertStringNotContainsString('', + 'billing_last_name' => '', + 'billing_email' => '">', + ]); + + $result = $this->renderCustomerDetailsColumn->invoke($this->instance, $customerDetails); + + // Verify that malicious HTML is escaped + $this->assertStringNotContainsString(''], + ['product_id' => 1, 'quantity' => ''], ]); $result = $this->renderOrderDetailsColumn->invoke($this->instance, $orderDetails); @@ -134,7 +134,7 @@ public function testRenderCustomerDetailsColumnValidData() public function testRenderCustomerDetailsColumnEscapesHtml() { $customerDetails = json_encode([ - 'billing_first_name' => '', + 'billing_first_name' => '', 'billing_last_name' => '', 'billing_email' => '">', ]); From 355051d7f0963e5aed23f92309e83ceebb0733a6 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Thu, 12 Feb 2026 14:34:28 +0700 Subject: [PATCH 42/60] Fix. Code. Edits ip resolving --- lib/Cleantalk/Common/Helper.php | 35 +++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/lib/Cleantalk/Common/Helper.php b/lib/Cleantalk/Common/Helper.php index 141ccbd11..e6d388c08 100644 --- a/lib/Cleantalk/Common/Helper.php +++ b/lib/Cleantalk/Common/Helper.php @@ -538,7 +538,8 @@ public static function ipV6Reduce($ip) public static function ipResolve($ip) { // Validate IP first - if (!self::ipValidate($ip)) { + $ip_version = self::ipValidate($ip); + if (!$ip_version) { return false; } @@ -550,20 +551,42 @@ public static function ipResolve($ip) return false; } - // Forward DNS lookup (A/AAAA records) - verify the hostname points back to the IP - $forward_ips = gethostbynamel($hostname); + // Forward DNS lookup - use dns_get_record() to support both IPv4 (A) and IPv6 (AAAA) records + $record_type = ($ip_version === 'v6') ? DNS_AAAA : DNS_A; + $ip_field = ($ip_version === 'v6') ? 'ipv6' : 'ip'; + + $records = @dns_get_record($hostname, $record_type); // If forward lookup fails, we can't verify - if (!$forward_ips) { + if (!$records || !is_array($records)) { + return false; + } + + // Extract IPs from DNS records + $forward_ips = array(); + foreach ($records as $record) { + if (isset($record[$ip_field])) { + $forward_ips[] = $record[$ip_field]; + } + } + + if (empty($forward_ips)) { return false; } // Check if the original IP is in the list of IPs the hostname resolves to - if (in_array($ip, $forward_ips, true)) { + // For IPv6, normalize both for comparison + if ($ip_version === 'v6') { + $normalized_ip = self::ipV6Normalize($ip); + foreach ($forward_ips as $forward_ip) { + if (self::ipV6Normalize($forward_ip) === $normalized_ip) { + return $hostname; + } + } + } elseif (in_array($ip, $forward_ips, true)) { return $hostname; } - // FCrDNS verification failed - possible PTR spoofing attempt return false; } From 2c600a24cbc9d57f2597f2b1e10529b113527ec3 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Thu, 12 Feb 2026 14:40:15 +0700 Subject: [PATCH 43/60] Fix phpuints error --- lib/Cleantalk/Common/Helper.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Cleantalk/Common/Helper.php b/lib/Cleantalk/Common/Helper.php index e6d388c08..79e07925d 100644 --- a/lib/Cleantalk/Common/Helper.php +++ b/lib/Cleantalk/Common/Helper.php @@ -558,7 +558,7 @@ public static function ipResolve($ip) $records = @dns_get_record($hostname, $record_type); // If forward lookup fails, we can't verify - if (!$records || !is_array($records)) { + if (empty($records)) { return false; } @@ -575,7 +575,6 @@ public static function ipResolve($ip) } // Check if the original IP is in the list of IPs the hostname resolves to - // For IPv6, normalize both for comparison if ($ip_version === 'v6') { $normalized_ip = self::ipV6Normalize($ip); foreach ($forward_ips as $forward_ip) { From 4dbf269cf81e4c8915a60c8b671fbe370bcf4e9c Mon Sep 17 00:00:00 2001 From: alexandergull Date: Thu, 12 Feb 2026 12:49:51 +0500 Subject: [PATCH 44/60] Upd. Exclusions. Ajax. Plugin "woocommerce-sendinblue-newsletter-subscription". --- inc/cleantalk-pluggable.php | 8 ++++++++ tests/Inc/TestContactIsSkipRequest.php | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/inc/cleantalk-pluggable.php b/inc/cleantalk-pluggable.php index 19fe6ed7f..4ca90815e 100644 --- a/inc/cleantalk-pluggable.php +++ b/inc/cleantalk-pluggable.php @@ -783,6 +783,14 @@ function apbct_is_skip_request($ajax = false, $ajax_message_obj = array()) return 'WS Form submit service request'; } + // UNIT OK https://wordpress.org/plugins/woocommerce-sendinblue-newsletter-subscription/ + if ( + apbct_is_plugin_active('woocommerce-sendinblue-newsletter-subscription/woocommerce-sendinblue.php') && + Post::getString('action') === 'the_ajax_hook' + ) { + return 'woocommerce-sendinblue-newsletter-subscription'; + } + // Paid Memberships Pro - Login Form if ( apbct_is_plugin_active('paid-memberships-pro/paid-memberships-pro.php') && diff --git a/tests/Inc/TestContactIsSkipRequest.php b/tests/Inc/TestContactIsSkipRequest.php index 40169c8c6..5799ebf9f 100644 --- a/tests/Inc/TestContactIsSkipRequest.php +++ b/tests/Inc/TestContactIsSkipRequest.php @@ -107,6 +107,15 @@ public function testSkip__WpMultiStepCheckout() 'wp-multi-step-checkout' )); } + public function testSkip__woocommerceSendinblueNewsletterSubscription() + { + $this->assertTrue(self::checkSkipMutations( + 'action', + 'the_ajax_hook', + 'woocommerce-sendinblue-newsletter-subscription/woocommerce-sendinblue.php', + 'woocommerce-sendinblue-newsletter-subscription' + )); + } /** * Check if skipped on all data complied, and every case if not. From 54419d5864fefcfab9de82eee240bed7ef56ab1f Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Thu, 12 Feb 2026 14:52:00 +0700 Subject: [PATCH 45/60] Phpunit tests --- tests/Common/HelperTest.php | 115 ++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/tests/Common/HelperTest.php b/tests/Common/HelperTest.php index 1c17a1efc..b240d0a97 100644 --- a/tests/Common/HelperTest.php +++ b/tests/Common/HelperTest.php @@ -17,4 +17,119 @@ public function test_http__multi_request_success() { $this->assertIsArray( $res ); $this->assertContainsOnly( 'string', $res ); } + + /** + * Test ipResolve returns false for invalid IP + */ + public function test_ipResolve_invalid_ip() + { + $this->assertFalse(Helper::ipResolve('invalid')); + $this->assertFalse(Helper::ipResolve('999.999.999.999')); + $this->assertFalse(Helper::ipResolve('')); + $this->assertFalse(Helper::ipResolve('abc.def.ghi.jkl')); + } + + /** + * Test ipResolve returns false for null/empty values + */ + public function test_ipResolve_null_empty() + { + $this->assertFalse(Helper::ipResolve(null)); + $this->assertFalse(Helper::ipResolve(false)); + } + + /** + * Test ipResolve returns false for reserved/special IPs (0.0.0.0) + */ + public function test_ipResolve_reserved_ip() + { + $this->assertFalse(Helper::ipResolve('0.0.0.0')); + } + + /** + * Test ipResolve with Google DNS (8.8.8.8) - should return hostname + * This is an integration test that requires network access + * + * @group integration + */ + public function test_ipResolve_google_dns_ipv4() + { + $result = Helper::ipResolve('8.8.8.8'); + + // Google DNS should resolve to dns.google + if ($result !== false) { + $this->assertStringContainsString('dns.google', $result); + } else { + // DNS resolution might fail in some environments + $this->markTestSkipped('DNS resolution not available in this environment'); + } + } + + /** + * Test ipResolve with private IP - should return false (no PTR record) + */ + public function test_ipResolve_private_ip() + { + // Private IPs typically don't have public PTR records + $result = Helper::ipResolve('192.168.1.1'); + + // Either false or the IP itself (no PTR) - both are acceptable + $this->assertTrue($result === false || is_string($result)); + } + + /** + * Test ipResolve with localhost IPv4 + */ + public function test_ipResolve_localhost_ipv4() + { + $result = Helper::ipResolve('127.0.0.1'); + + // Localhost might resolve to 'localhost' or return false depending on system config + $this->assertTrue($result === false || is_string($result)); + } + + /** + * Test ipResolve with IPv6 localhost (::1) + */ + public function test_ipResolve_localhost_ipv6() + { + // IPv6 localhost is considered invalid (0::0) by ipValidate + $result = Helper::ipResolve('::1'); + + $this->assertTrue($result === false || is_string($result)); + } + + /** + * Test ipResolve with Google DNS IPv6 (2001:4860:4860::8888) + * + * @group integration + */ + public function test_ipResolve_google_dns_ipv6() + { + $result = Helper::ipResolve('2001:4860:4860::8888'); + + // Google DNS IPv6 should resolve to dns.google + if ($result !== false) { + $this->assertStringContainsString('dns.google', $result); + } else { + // IPv6 DNS resolution might not work in all environments + $this->markTestSkipped('IPv6 DNS resolution not available in this environment'); + } + } + + /** + * Test ipResolve returns string hostname on success + * + * @group integration + */ + public function test_ipResolve_return_type() + { + $result = Helper::ipResolve('8.8.8.8'); + + // Result should be either false or a non-empty string + $this->assertTrue( + $result === false || (is_string($result) && strlen($result) > 0), + 'ipResolve should return false or a non-empty string hostname' + ); + } } From bc59b613353e04ac80b8955e28082e6fd24aa963 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Thu, 12 Feb 2026 15:20:22 +0500 Subject: [PATCH 46/60] Fix. Remote Calls. Skip check if no sign of RC action provided in Request. --- lib/Cleantalk/ApbctWP/RemoteCalls.php | 12 +- tests/ApbctWP/TestRemoteCalls.php | 271 ++++++++++++++++++++++++++ 2 files changed, 279 insertions(+), 4 deletions(-) create mode 100644 tests/ApbctWP/TestRemoteCalls.php diff --git a/lib/Cleantalk/ApbctWP/RemoteCalls.php b/lib/Cleantalk/ApbctWP/RemoteCalls.php index 5c1a4c2cd..b04402ddc 100644 --- a/lib/Cleantalk/ApbctWP/RemoteCalls.php +++ b/lib/Cleantalk/ApbctWP/RemoteCalls.php @@ -31,9 +31,13 @@ class RemoteCalls */ public static function check() { - return Request::get('spbc_remote_call_token') - ? self::checkWithToken() - : self::checkWithoutToken(); + //do not check token logic if no RC action sign found + if ( Request::getString('spbc_remote_call_action') ) { + return Request::getString('spbc_remote_call_token') + ? self::checkWithToken() + : self::checkWithoutToken(); + } + return false; } public static function checkWithToken() @@ -107,7 +111,7 @@ public static function perform() // Check Access key if ( (self::checkToken($token)) || - (self::checkWithoutToken() && self::isAllowedWithoutToken($action)) + (self::isAllowedWithoutToken($action) && self::checkWithoutToken()) ) { // Flag to let plugin know that Remote Call is running. $apbct->rc_running = true; diff --git a/tests/ApbctWP/TestRemoteCalls.php b/tests/ApbctWP/TestRemoteCalls.php new file mode 100644 index 000000000..48a2c1551 --- /dev/null +++ b/tests/ApbctWP/TestRemoteCalls.php @@ -0,0 +1,271 @@ +apbct_backup = $apbct; + $apbct = null; + } + + protected function tearDown(): void + { + // Reset global after each test + global $apbct; + $apbct = $this->apbct_backup; + } + + /** @test */ + public function checkReturnsFalseWhenNoActionProvided() + { + $_REQUEST = []; + \Cleantalk\ApbctWP\Variables\Request::getInstance()->variables = $_REQUEST; + $this->assertFalse(RemoteCalls::check()); + } + + /** @test */ + public function checkCallsCheckWithTokenWhenTokenProvided() + { + $_REQUEST = [ + 'spbc_remote_call_action' => 'antispam', + 'spbc_remote_call_token' => 'token', + //any token is allowed on check() stage, containment will be checked on perform() + 'plugin_name' => 'antispam', + ]; + + \Cleantalk\ApbctWP\Variables\Request::getInstance()->variables = $_REQUEST; + + // checkWithToken returns true + $this->assertTrue(RemoteCalls::check()); + } + + /** @test */ + public function checkCallsCheckWithoutTokenWhenNoTokenProvided() + { + global $apbct; + + $_REQUEST = [ + 'spbc_remote_call_action' => 'get_fresh_wpnonce', //allowed action + 'plugin_name' => 'antispam', + ]; + + \Cleantalk\ApbctWP\Variables\Request::getInstance()->variables = $_REQUEST; + + $apbct = new stdClass(); + $apbct->key_is_ok = true; + $apbct->api_key = null; + $apbct->data = []; + $apbct->data['moderate_ip'] = null; + + // checkWithoutToken returns true + $this->assertTrue(RemoteCalls::check()); + } + + public function checkCallsCheckWithTokenWhenEmptyTokenProvided() + { + $_REQUEST = [ + 'spbc_remote_call_action' => 'antispam', + //any token is allowed on check() stage, containment will be checked on perform() + 'plugin_name' => 'antispam', + ]; + + \Cleantalk\ApbctWP\Variables\Request::getInstance()->variables = $_REQUEST; + + // checkWithToken returns true + $this->assertFalse(RemoteCalls::check()); + } + + /** @test */ + public function checkCallsCheckWithoutTokenWhenActioNIsNotAllowed() + { + global $apbct; + + $_REQUEST = [ + 'spbc_remote_call_action' => 'debug', //rejected action + 'plugin_name' => 'antispam', + ]; + + \Cleantalk\ApbctWP\Variables\Request::getInstance()->variables = $_REQUEST; + + $apbct = new stdClass(); + $apbct->key_is_ok = true; + $apbct->api_key = null; + $apbct->data = []; + $apbct->data['moderate_ip'] = null; + + // checkWithoutToken returns true + $this->assertFalse(RemoteCalls::check()); + } + + /** @test */ + public function itHidesSensitiveDataInFlatArray() + { + $input = [ + 'apikey' => '1234567890', + 'user_token' => 'abcdef', + 'salt' => 'qwerty12345', + 'normal_key' => 'visible' + ]; + + $method = new ReflectionMethod(RemoteCalls::class, 'hideSensitiveData'); + $method->setAccessible(true); + + $result = $method->invoke(null, $input); + + $this->assertEquals('12******90', $result['apikey']); + $this->assertEquals('ab**ef', $result['user_token']); + $this->assertEquals('qw*******45', $result['salt']); + $this->assertEquals('visible', $result['normal_key']); + } + + /** @test */ + public function itHidesSensitiveDataInNestedArray() + { + $input = [ + 'level1' => [ + 'level2' => [ + 'apikey' => 'abcdefghij' + ] + ] + ]; + + $method = new ReflectionMethod(RemoteCalls::class, 'hideSensitiveData'); + $method->setAccessible(true); + + $result = $method->invoke(null, $input); + + $this->assertEquals( + 'ab******ij', + $result['level1']['level2']['apikey'] + ); + } + + /** @test */ + public function itMasksShortSensitiveValues() + { + $input = [ + 'apikey' => '1234' + ]; + + $method = new ReflectionMethod(RemoteCalls::class, 'hideSensitiveData'); + $method->setAccessible(true); + + $result = $method->invoke(null, $input); + + $this->assertEquals('****', $result['apikey']); + } + + /** @test */ + public function itDoesNotModifyNonArrayInput() + { + $method = new ReflectionMethod(RemoteCalls::class, 'hideSensitiveData'); + $method->setAccessible(true); + + $result = $method->invoke(null, 'string'); + + $this->assertEquals('string', $result); + } + + /** @test */ + public function itValidatesMd5Token() + { + global $apbct; + + $apbct = new stdClass(); + $apbct->api_key = 'testKey'; + $apbct->data = []; + + $validToken = strtolower(md5('testKey')); + + $method = new ReflectionMethod(RemoteCalls::class, 'checkToken'); + $method->setAccessible(true); + + $this->assertTrue($method->invoke(null, $validToken)); + } + + /** @test */ + public function itValidatesSha256Token() + { + global $apbct; + + $apbct = new stdClass(); + $apbct->api_key = 'testKey'; + $apbct->data = []; + + $validToken = strtolower(hash('sha256', 'testKey')); + + $method = new ReflectionMethod(RemoteCalls::class, 'checkToken'); + $method->setAccessible(true); + + $this->assertTrue($method->invoke(null, $validToken)); + } + + /** @test */ + public function itReturnsFalseForInvalidToken() + { + global $apbct; + + $apbct = new stdClass(); + $apbct->api_key = 'testKey'; + $apbct->data = []; + + $method = new ReflectionMethod(RemoteCalls::class, 'checkToken'); + $method->setAccessible(true); + + $this->assertFalse($method->invoke(null, 'invalidToken')); + } + + /** @test */ + public function itReturnsFalseIfNoApiKeyProvided() + { + global $apbct; + + $apbct = new stdClass(); + $apbct->api_key = null; + $apbct->data = []; + $apbct->data['moderate_ip'] = null; + + $method = new ReflectionMethod(RemoteCalls::class, 'checkToken'); + $method->setAccessible(true); + + $this->assertFalse($method->invoke(null, md5('anything'))); + } + + /** @test */ + public function itMapsSettingTitlesCorrectly() + { + $settings = [ + 'apikey' => '123', + 'forms__registrations_test' => 1, + 'unknown_key' => 'abc' + ]; + + $method = new ReflectionMethod(RemoteCalls::class, 'getSettings'); + $method->setAccessible(true); + + $result = $method->invoke(null, $settings); + + $this->assertArrayHasKey('apikey - Access key', $result); + $this->assertArrayHasKey('forms__registrations_test - Registration Forms', $result); + $this->assertEquals('123', $result['apikey - Access key']); + $this->assertEquals(1, $result['forms__registrations_test - Registration Forms']); + $this->assertEquals('abc', $result['unknown_key']); + } + + /** @test */ + public function itDetectsAllowedActionsWithoutToken() + { + $method = new ReflectionMethod(RemoteCalls::class, 'isAllowedWithoutToken'); + $method->setAccessible(true); + + $this->assertTrue($method->invoke(null, 'get_fresh_wpnonce')); + $this->assertTrue($method->invoke(null, 'post_api_key')); + $this->assertFalse($method->invoke(null, 'update_license')); + } +} From 59977497d74ff96df5727b7d382a80a8a6104444 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Thu, 12 Feb 2026 16:56:53 +0500 Subject: [PATCH 47/60] Fix. Exclusion. Added path invoice4u/v1/callback. --- inc/cleantalk-public-validate-skip-functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inc/cleantalk-public-validate-skip-functions.php b/inc/cleantalk-public-validate-skip-functions.php index 10da62be6..ebe31ade7 100755 --- a/inc/cleantalk-public-validate-skip-functions.php +++ b/inc/cleantalk-public-validate-skip-functions.php @@ -253,7 +253,10 @@ function skip_for_ct_contact_form_validate() '86' => (isset($_POST['action']) && $_POST['action'] === 'check_email_exists'), // Handling an unknown action check_email_exists '87' => Server::inUri('cleantalk-antispam/v1/alt_sessions'), - '88' => apbct_is_in_uri('wc-api') && apbct_is_in_uri('WC_Invoice4U'), + '88' => ( + (apbct_is_in_uri('wc-api') && apbct_is_in_uri('WC_Invoice4U')) || + (apbct_is_in_uri('wp-json') && apbct_is_in_uri('invoice4u/v1/callback')) + ), // has direct integration lib/Cleantalk/Antispam/Integrations/MemberPress.php '89' => apbct_is_plugin_active('memberpress/memberpress.php') && Post::get('mepr_process_signup_form'), // WooCommerce recovery password form From 3348397a9ebe3232ec8561d2eeb2147ea1a9aaad Mon Sep 17 00:00:00 2001 From: alexandergull Date: Thu, 12 Feb 2026 18:55:32 +0500 Subject: [PATCH 48/60] Fix. Contact Encoder. Every hook that has actions BEFORE modify now have actions AFTER. --- lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php b/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php index a5d5282eb..1c97883b1 100644 --- a/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php +++ b/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php @@ -46,8 +46,6 @@ public function init($params) $this->shortcodes = new ShortCodesService($params); $this->shortcodes->registerAll(); - $this->shortcodes->addActionsAfterModify('the_content', 11); - $this->shortcodes->addActionsAfterModify('the_title', 11); $this->registerHookHandler(); } @@ -90,6 +88,8 @@ public function runEncoding($content = '') } else { foreach ( $hooks_to_encode as $hook ) { $this->shortcodes->addActionsBeforeModify($hook, 9); + //any hook that has actions BEFORE modify, must have actions AFTER + $this->shortcodes->addActionsAfterModify($hook, 999); add_filter($hook, array($this, 'modifyContent'), 10); } } From ffc5c551f9f10ee79064af7e078e03e11186c4e5 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Fri, 13 Feb 2026 15:44:29 +0500 Subject: [PATCH 49/60] Fix. Enqueue. Script individual-disable-comments.js renamed to cleantalk-individual-disable-comments.js --- ...ts.min.js => cleantalk-individual-disable-comments.min.js} | 2 +- js/cleantalk-individual-disable-comments.min.js.map | 1 + js/individual-disable-comments.min.js.map | 1 - ...e-comments.js => cleantalk-individual-disable-comments.js} | 0 lib/Cleantalk/Antispam/DisableComments.php | 4 ++-- 5 files changed, 4 insertions(+), 4 deletions(-) rename js/{individual-disable-comments.min.js => cleantalk-individual-disable-comments.min.js} (71%) create mode 100644 js/cleantalk-individual-disable-comments.min.js.map delete mode 100644 js/individual-disable-comments.min.js.map rename js/src/{individual-disable-comments.js => cleantalk-individual-disable-comments.js} (100%) diff --git a/js/individual-disable-comments.min.js b/js/cleantalk-individual-disable-comments.min.js similarity index 71% rename from js/individual-disable-comments.min.js rename to js/cleantalk-individual-disable-comments.min.js index 1eb7a95b7..1185e2482 100644 --- a/js/individual-disable-comments.min.js +++ b/js/cleantalk-individual-disable-comments.min.js @@ -1,2 +1,2 @@ wp.domReady(function(){wp.blocks&&wp.blocks.getBlockTypes().forEach(function(e){apbctDisableComments.disabled_blocks.includes(e.name)&&wp.blocks.unregisterBlockType(e.name)})}); -//# sourceMappingURL=individual-disable-comments.min.js.map +//# sourceMappingURL=cleantalk-individual-disable-comments.min.js.map diff --git a/js/cleantalk-individual-disable-comments.min.js.map b/js/cleantalk-individual-disable-comments.min.js.map new file mode 100644 index 000000000..d2317d1f2 --- /dev/null +++ b/js/cleantalk-individual-disable-comments.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cleantalk-individual-disable-comments.min.js","sources":["cleantalk-individual-disable-comments.js"],"sourcesContent":["'use strict';\nwp.domReady(function() {\n if (wp.blocks) {\n wp.blocks.getBlockTypes().forEach(function(block) {\n if (apbctDisableComments.disabled_blocks.includes(block.name)) {\n wp.blocks.unregisterBlockType(block.name);\n }\n });\n }\n});\n"],"names":["wp","domReady","blocks","getBlockTypes","forEach","block","apbctDisableComments","disabled_blocks","includes","name","unregisterBlockType"],"mappings":"AACAA,GAAGC,SAAS,WACJD,GAAGE,QACHF,GAAGE,OAAOC,cAAc,EAAEC,QAAQ,SAASC,GACnCC,qBAAqBC,gBAAgBC,SAASH,EAAMI,IAAI,GACxDT,GAAGE,OAAOQ,oBAAoBL,EAAMI,IAAI,CAEhD,CAAC,CAET,CAAC"} \ No newline at end of file diff --git a/js/individual-disable-comments.min.js.map b/js/individual-disable-comments.min.js.map deleted file mode 100644 index cf9bb8188..000000000 --- a/js/individual-disable-comments.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"individual-disable-comments.min.js","sources":["individual-disable-comments.js"],"sourcesContent":["'use strict';\nwp.domReady(function() {\n if (wp.blocks) {\n wp.blocks.getBlockTypes().forEach(function(block) {\n if (apbctDisableComments.disabled_blocks.includes(block.name)) {\n wp.blocks.unregisterBlockType(block.name);\n }\n });\n }\n});\n"],"names":["wp","domReady","blocks","getBlockTypes","forEach","block","apbctDisableComments","disabled_blocks","includes","name","unregisterBlockType"],"mappings":"AACAA,GAAGC,SAAS,WACJD,GAAGE,QACHF,GAAGE,OAAOC,cAAc,EAAEC,QAAQ,SAASC,GACnCC,qBAAqBC,gBAAgBC,SAASH,EAAMI,IAAI,GACxDT,GAAGE,OAAOQ,oBAAoBL,EAAMI,IAAI,CAEhD,CAAC,CAET,CAAC"} \ No newline at end of file diff --git a/js/src/individual-disable-comments.js b/js/src/cleantalk-individual-disable-comments.js similarity index 100% rename from js/src/individual-disable-comments.js rename to js/src/cleantalk-individual-disable-comments.js diff --git a/lib/Cleantalk/Antispam/DisableComments.php b/lib/Cleantalk/Antispam/DisableComments.php index 06ca0548a..386b8b9c3 100644 --- a/lib/Cleantalk/Antispam/DisableComments.php +++ b/lib/Cleantalk/Antispam/DisableComments.php @@ -203,9 +203,9 @@ public function filterAdminBar() public function filterGutenbergBlocks($_hook) { if ( $this->isCurrentTypeToDisable() ) { - ApbctEnqueue::getInstance()->js('apbct-individual-disable-comments.js'); + ApbctEnqueue::getInstance()->js('cleantalk-individual-disable-comments.js'); wp_localize_script( - 'apbct-individual-disable-comments-js', + 'cleantalk-individual-disable-comments-js', 'apbctDisableComments', array( 'disabled_blocks' => array('core/latest-comments'), From b44c42e1d751cb699058aba44b0afb8e3716cae8 Mon Sep 17 00:00:00 2001 From: svfcode Date: Mon, 16 Feb 2026 13:32:40 +0300 Subject: [PATCH 50/60] Upd. CommentsCheck. Improve statement. --- .../ApbctWP/FindSpam/ListTable/Comments.php | 45 +++++++++++-------- .../ApbctWP/FindSpam/ListTable/Users.php | 35 ++++++++++----- .../ApbctWP/WcSpamOrdersListTable.php | 22 ++++++--- 3 files changed, 65 insertions(+), 37 deletions(-) diff --git a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Comments.php b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Comments.php index a9816ff38..e9c16e94a 100644 --- a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Comments.php +++ b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Comments.php @@ -137,25 +137,26 @@ public function column_ct_comment($item) // phpcs:ignore PSR1.Methods.CamelCapsM $page = htmlspecialchars(addslashes(TT::toString(Get::get('page')))); + $approve_url = wp_nonce_url( + admin_url('edit-comments.php?page=' . $page . '&action=approve&spam=' . $id), + 'apbct_ct_check_spam_row', + '_wpnonce' + ); + $spam_url = wp_nonce_url( + admin_url('edit-comments.php?page=' . $page . '&action=spam&spam=' . $id), + 'apbct_ct_check_spam_row', + '_wpnonce' + ); + $trash_url = wp_nonce_url( + admin_url('edit-comments.php?page=' . $page . '&action=trash&spam=' . $id), + 'apbct_ct_check_spam_row', + '_wpnonce' + ); + $actions = array( - 'approve' => sprintf( - 'Approve', - $page, - 'approve', - $id - ), - 'spam' => sprintf( - 'Spam', - $page, - 'spam', - $id - ), - 'trash' => sprintf( - 'Trash', - $page, - 'trash', - $id - ), + 'approve' => 'Approve', + 'spam' => 'Spam', + 'trash' => 'Trash', ); return sprintf('%1$s %2$s', $column_content, $this->row_actions($actions)); @@ -255,6 +256,14 @@ public function row_actions_handler() // phpcs:ignore PSR1.Methods.CamelCapsMeth return; } + if ( ! wp_verify_nonce(Get::getString('_wpnonce'), 'apbct_ct_check_spam_row') ) { + wp_die(esc_html__('Security check failed. Please try again.', 'cleantalk-spam-protect'), 403); + } + + if ( ! current_user_can('moderate_comments') ) { + wp_die(esc_html__('You do not have sufficient permissions to perform this action.', 'cleantalk-spam-protect'), 403); + } + if ( Get::get('action') === 'approve' ) { $id = filter_input(INPUT_GET, 'spam', FILTER_SANITIZE_NUMBER_INT); $this->approveSpam($id); diff --git a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Users.php b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Users.php index ace616a08..341424c90 100644 --- a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Users.php +++ b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Users.php @@ -139,19 +139,20 @@ public function column_ct_username($item) // phpcs:ignore PSR1.Methods.CamelCaps $page = htmlspecialchars(addslashes(TT::toString(Get::get('page')))); + $approve_url = wp_nonce_url( + admin_url('users.php?page=' . $page . '&action=approve&spam=' . $user_obj->ID), + 'apbct_ct_check_users_row', + '_wpnonce' + ); + $delete_url = wp_nonce_url( + admin_url('users.php?page=' . $page . '&action=delete&spam=' . $user_obj->ID), + 'apbct_ct_check_users_row', + '_wpnonce' + ); + $actions = array( - 'approve' => sprintf( - 'Approve', - $page, - 'approve', - $user_obj->ID - ), - 'delete' => sprintf( - 'Delete', - $page, - 'delete', - $user_obj->ID - ), + 'approve' => 'Approve', + 'delete' => 'Delete', ); return sprintf('%1$s %2$s', $column_content, $this->row_actions($actions)); @@ -232,12 +233,22 @@ public function row_actions_handler() // phpcs:ignore PSR1.Methods.CamelCapsMeth return; } + if ( ! wp_verify_nonce(Get::getString('_wpnonce'), 'apbct_ct_check_users_row') ) { + wp_die(esc_html__('Security check failed. Please try again.', 'cleantalk-spam-protect'), 403); + } + if ( Get::get('action') === 'approve' ) { + if ( ! current_user_can('edit_users') ) { + wp_die(esc_html__('You do not have sufficient permissions to perform this action.', 'cleantalk-spam-protect'), 403); + } $id = filter_input(INPUT_GET, 'spam', FILTER_SANITIZE_NUMBER_INT); $this->approveSpam(array($id)); } if ( Get::get('action') === 'delete' ) { + if ( ! current_user_can('delete_users') ) { + wp_die(esc_html__('You do not have sufficient permissions to perform this action.', 'cleantalk-spam-protect'), 403); + } $id = filter_input(INPUT_GET, 'spam', FILTER_SANITIZE_NUMBER_INT); $this->removeSpam(array($id)); } diff --git a/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php b/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php index ed284cbf9..26745c64a 100644 --- a/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php +++ b/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php @@ -82,14 +82,14 @@ public function prepare_items() // phpcs:ignore PSR1.Methods.CamelCapsMethodNam continue; } + $delete_url = wp_nonce_url( + admin_url('admin.php?page=' . Get::getString('page') . '&action=delete&spam=' . $wc_spam_order->id), + 'apbct_wc_spam_orders_row', + '_wpnonce' + ); $actions = array( - 'restore' => '' . esc_html__('Restore', 'cleantalk-spam-protect') . '', - 'delete' => sprintf( - 'Delete', - htmlspecialchars(addslashes(Get::getString('page'))), - 'delete', - $wc_spam_order->id - ), + 'restore' => '' . esc_html__('Restore', 'cleantalk-spam-protect') . '', + 'delete' => 'Delete', /*'approve' => sprintf( 'Approve', htmlspecialchars(addslashes(Get::get('page'))), @@ -176,6 +176,14 @@ public function row_actions_handler() // phpcs:ignore PSR1.Methods.CamelCapsMeth return; } + if ( ! wp_verify_nonce(Get::getString('_wpnonce'), 'apbct_wc_spam_orders_row') ) { + wp_die(esc_html__('Security check failed. Please try again.', 'cleantalk-spam-protect'), 403); + } + + if ( ! current_user_can('activate_plugins') ) { + wp_die(esc_html__('You do not have sufficient permissions to perform this action.', 'cleantalk-spam-protect'), 403); + } + if ( Get::get('action') === 'delete' ) { $id = filter_input(INPUT_GET, 'spam', FILTER_SANITIZE_ENCODED, FILTER_FLAG_STRIP_HIGH); $this->removeSpam(array($id)); From 72d8d7fc4b2697228dddf04229e624a28283fb79 Mon Sep 17 00:00:00 2001 From: svfcode Date: Mon, 16 Feb 2026 14:00:07 +0300 Subject: [PATCH 51/60] add testt --- .../ApbctWP/FindSpam/ListTable/TestUsers.php | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 tests/ApbctWP/FindSpam/ListTable/TestUsers.php diff --git a/tests/ApbctWP/FindSpam/ListTable/TestUsers.php b/tests/ApbctWP/FindSpam/ListTable/TestUsers.php new file mode 100644 index 000000000..cc5c2a915 --- /dev/null +++ b/tests/ApbctWP/FindSpam/ListTable/TestUsers.php @@ -0,0 +1,134 @@ +instance = $reflection->newInstanceWithoutConstructor(); + + $this->columnCtUsername = $reflection->getMethod('column_ct_username'); + $this->columnCtUsername->setAccessible(true); + + // Mock apbct: white_label and login_ip_keeper (object with getIP method) + $ipKeeper = $this->getMockBuilder(\stdClass::class) + ->addMethods(['getIP']) + ->getMock(); + $ipKeeper->method('getIP')->willReturn(null); + + $this->instance->apbct = (object)[ + 'white_label' => true, + 'login_ip_keeper' => $ipKeeper, + ]; + } + + /** + * column_ct_username contains user login and row actions with nonce. + */ + public function testColumnCtUsernameContainsLoginAndActionsWithNonce(): void + { + $_GET['page'] = 'ct_check_users'; + + $user = (object)[ + 'ID' => 42, + 'user_login' => 'testuser', + 'user_email' => 'test@example.com', + ]; + $item = ['ct_username' => $user]; + + $result = $this->columnCtUsername->invoke($this->instance, $item); + + $this->assertStringContainsString('testuser', $result); + $this->assertStringContainsString('test@example.com', $result); + $this->assertStringContainsString('mailto:test@example.com', $result); + $this->assertStringContainsString('Approve', $result); + $this->assertStringContainsString('Delete', $result); + $this->assertStringContainsString('_wpnonce=', $result); + $this->assertStringContainsString('action=approve', $result); + $this->assertStringContainsString('action=delete', $result); + $this->assertStringContainsString('spam=42', $result); + } + + /** + * column_ct_username shows "No email" when user has no email. + */ + public function testColumnCtUsernameShowsNoEmailWhenEmpty(): void + { + $_GET['page'] = 'ct_check_users'; + + $user = (object)[ + 'ID' => 1, + 'user_login' => 'noemailuser', + 'user_email' => '', + ]; + $item = ['ct_username' => $user]; + + $result = $this->columnCtUsername->invoke($this->instance, $item); + + $this->assertStringContainsString('noemailuser', $result); + $this->assertStringContainsString('No email', $result); + } + + /** + * column_ct_username shows IP and link when login_ip_keeper returns IP. + */ + public function testColumnCtUsernameShowsIpWhenKeeperReturnsIp(): void + { + $_GET['page'] = 'ct_check_users'; + + $ipKeeper = $this->getMockBuilder(\stdClass::class) + ->addMethods(['getIP']) + ->getMock(); + $ipKeeper->method('getIP')->with(99)->willReturn('192.168.1.1'); + $this->instance->apbct->login_ip_keeper = $ipKeeper; + + $user = (object)[ + 'ID' => 99, + 'user_login' => 'ipuser', + 'user_email' => 'ip@test.com', + ]; + $item = ['ct_username' => $user]; + + $result = $this->columnCtUsername->invoke($this->instance, $item); + + $this->assertStringContainsString('192.168.1.1', $result); + $this->assertStringContainsString('user-edit.php?user_id=99', $result); + } + + /** + * column_ct_username shows "No IP adress" when keeper returns null. + */ + public function testColumnCtUsernameShowsNoIpWhenKeeperReturnsNull(): void + { + $_GET['page'] = 'ct_check_users'; + + $user = (object)[ + 'ID' => 1, + 'user_login' => 'noipuser', + 'user_email' => 'a@b.com', + ]; + $item = ['ct_username' => $user]; + + $result = $this->columnCtUsername->invoke($this->instance, $item); + + $this->assertStringContainsString('No IP adress', $result); + } +} From 4b93921d249c1e529b60e806b108b7064f12965a Mon Sep 17 00:00:00 2001 From: svfcode Date: Mon, 16 Feb 2026 14:33:14 +0300 Subject: [PATCH 52/60] fix test --- .../ApbctWP/FindSpam/ListTable/TestUsers.php | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/ApbctWP/FindSpam/ListTable/TestUsers.php b/tests/ApbctWP/FindSpam/ListTable/TestUsers.php index cc5c2a915..95a25a2e2 100644 --- a/tests/ApbctWP/FindSpam/ListTable/TestUsers.php +++ b/tests/ApbctWP/FindSpam/ListTable/TestUsers.php @@ -22,6 +22,8 @@ class TestUsers extends TestCase protected function setUp(): void { + global $apbct; + $reflection = new \ReflectionClass(Users::class); $this->instance = $reflection->newInstanceWithoutConstructor(); @@ -34,10 +36,16 @@ protected function setUp(): void ->getMock(); $ipKeeper->method('getIP')->willReturn(null); - $this->instance->apbct = (object)[ + // Set both instance property and global variable + $apbct = (object)[ 'white_label' => true, 'login_ip_keeper' => $ipKeeper, ]; + + // Use reflection to set the protected property + $apbctProperty = $reflection->getProperty('apbct'); + $apbctProperty->setAccessible(true); + $apbctProperty->setValue($this->instance, $apbct); } /** @@ -92,13 +100,25 @@ public function testColumnCtUsernameShowsNoEmailWhenEmpty(): void */ public function testColumnCtUsernameShowsIpWhenKeeperReturnsIp(): void { + global $apbct; + $_GET['page'] = 'ct_check_users'; $ipKeeper = $this->getMockBuilder(\stdClass::class) ->addMethods(['getIP']) ->getMock(); $ipKeeper->method('getIP')->with(99)->willReturn('192.168.1.1'); - $this->instance->apbct->login_ip_keeper = $ipKeeper; + + // Update global apbct + $apbct->login_ip_keeper = $ipKeeper; + + // Update instance apbct using reflection + $reflection = new \ReflectionClass(Users::class); + $apbctProperty = $reflection->getProperty('apbct'); + $apbctProperty->setAccessible(true); + $instanceApbct = $apbctProperty->getValue($this->instance); + $instanceApbct->login_ip_keeper = $ipKeeper; + $apbctProperty->setValue($this->instance, $instanceApbct); $user = (object)[ 'ID' => 99, From 70a874b7e3942a7e2f16a156586997e06796f050 Mon Sep 17 00:00:00 2001 From: svfcode Date: Mon, 16 Feb 2026 14:46:29 +0300 Subject: [PATCH 53/60] add test --- .../FindSpam/ListTable/TestComments.php | 153 +++++++++++++++++ .../ListTable/TestWcSpamOrdersListTable.php | 158 ++++++++++++++++++ 2 files changed, 311 insertions(+) create mode 100644 tests/ApbctWP/FindSpam/ListTable/TestComments.php create mode 100644 tests/ApbctWP/FindSpam/ListTable/TestWcSpamOrdersListTable.php diff --git a/tests/ApbctWP/FindSpam/ListTable/TestComments.php b/tests/ApbctWP/FindSpam/ListTable/TestComments.php new file mode 100644 index 000000000..52ee273fb --- /dev/null +++ b/tests/ApbctWP/FindSpam/ListTable/TestComments.php @@ -0,0 +1,153 @@ +instance = $reflection->newInstanceWithoutConstructor(); + + $this->columnCtAuthor = $reflection->getMethod('column_ct_author'); + $this->columnCtAuthor->setAccessible(true); + + // Set both instance property and global variable + $apbct = (object)[ + 'white_label' => true, + ]; + + // Use reflection to set the protected property + $apbctProperty = $reflection->getProperty('apbct'); + $apbctProperty->setAccessible(true); + $apbctProperty->setValue($this->instance, $apbct); + } + + /** + * column_ct_author contains author name, email, and IP. + */ + public function testColumnCtAuthorContainsAuthorEmailAndIp(): void + { + $comment = (object)[ + 'comment_author' => 'Test Author', + 'comment_author_email' => 'test@example.com', + 'comment_author_IP' => '192.168.1.1', + ]; + $item = ['ct_comment' => $comment]; + + $result = $this->columnCtAuthor->invoke($this->instance, $item); + + $this->assertStringContainsString('Test Author', $result); + $this->assertStringContainsString('test@example.com', $result); + $this->assertStringContainsString('mailto:test@example.com', $result); + $this->assertStringContainsString('192.168.1.1', $result); + $this->assertStringContainsString('edit-comments.php?s=192.168.1.1', $result); + } + + /** + * column_ct_author shows "No email" when comment has no email. + */ + public function testColumnCtAuthorShowsNoEmailWhenEmpty(): void + { + $comment = (object)[ + 'comment_author' => 'No Email Author', + 'comment_author_email' => '', + 'comment_author_IP' => '192.168.1.1', + ]; + $item = ['ct_comment' => $comment]; + + $result = $this->columnCtAuthor->invoke($this->instance, $item); + + $this->assertStringContainsString('No Email Author', $result); + $this->assertStringContainsString('No email', $result); + } + + /** + * column_ct_author shows "No IP adress" when comment has no IP. + */ + public function testColumnCtAuthorShowsNoIpWhenEmpty(): void + { + $comment = (object)[ + 'comment_author' => 'No IP Author', + 'comment_author_email' => 'author@example.com', + 'comment_author_IP' => '', + ]; + $item = ['ct_comment' => $comment]; + + $result = $this->columnCtAuthor->invoke($this->instance, $item); + + $this->assertStringContainsString('No IP Author', $result); + $this->assertStringContainsString('author@example.com', $result); + $this->assertStringContainsString('No IP adress', $result); + } + + /** + * column_ct_author shows email link without cleantalk link when white_label is true. + */ + public function testColumnCtAuthorShowsEmailWithoutCleantalkLinkWhenWhiteLabel(): void + { + global $apbct; + + $comment = (object)[ + 'comment_author' => 'Test Author', + 'comment_author_email' => 'test@example.com', + 'comment_author_IP' => '192.168.1.1', + ]; + $item = ['ct_comment' => $comment]; + + $result = $this->columnCtAuthor->invoke($this->instance, $item); + + $this->assertStringContainsString('mailto:test@example.com', $result); + $this->assertStringNotContainsString('cleantalk.org/blacklists/test@example.com', $result); + } + + /** + * column_ct_author shows email link with cleantalk link when white_label is false. + */ + public function testColumnCtAuthorShowsEmailWithCleantalkLinkWhenNotWhiteLabel(): void + { + global $apbct; + + // Update global apbct + $apbct->white_label = false; + + // Update instance apbct using reflection + $reflection = new \ReflectionClass(Comments::class); + $apbctProperty = $reflection->getProperty('apbct'); + $apbctProperty->setAccessible(true); + $instanceApbct = $apbctProperty->getValue($this->instance); + $instanceApbct->white_label = false; + $apbctProperty->setValue($this->instance, $instanceApbct); + + $comment = (object)[ + 'comment_author' => 'Test Author', + 'comment_author_email' => 'test@example.com', + 'comment_author_IP' => '192.168.1.1', + ]; + $item = ['ct_comment' => $comment]; + + $result = $this->columnCtAuthor->invoke($this->instance, $item); + + $this->assertStringContainsString('mailto:test@example.com', $result); + $this->assertStringContainsString('cleantalk.org/blacklists/test@example.com', $result); + } +} + diff --git a/tests/ApbctWP/FindSpam/ListTable/TestWcSpamOrdersListTable.php b/tests/ApbctWP/FindSpam/ListTable/TestWcSpamOrdersListTable.php new file mode 100644 index 000000000..bf4e1e287 --- /dev/null +++ b/tests/ApbctWP/FindSpam/ListTable/TestWcSpamOrdersListTable.php @@ -0,0 +1,158 @@ +instance = $reflection->newInstanceWithoutConstructor(); + + $this->renderOrderDetailsColumn = $reflection->getMethod('renderOrderDetailsColumn'); + $this->renderOrderDetailsColumn->setAccessible(true); + + $this->renderCustomerDetailsColumn = $reflection->getMethod('renderCustomerDetailsColumn'); + $this->renderCustomerDetailsColumn->setAccessible(true); + + // Set both instance property and global variable + $apbct = (object)[ + 'white_label' => true, + ]; + + // Use reflection to set the protected property + $apbctProperty = $reflection->getProperty('apbct'); + $apbctProperty->setAccessible(true); + $apbctProperty->setValue($this->instance, $apbct); + } + + /** + * renderOrderDetailsColumn renders product title and quantity. + */ + public function testRenderOrderDetailsColumnRendersProductAndQuantity(): void + { + $order_details = json_encode([ + [ + 'product_id' => 123, + 'quantity' => 2, + ], + [ + 'product_id' => 456, + 'quantity' => 1, + ], + ]); + + $result = $this->renderOrderDetailsColumn->invoke($this->instance, $order_details); + + $this->assertStringContainsString('Unavailable product', $result); + $this->assertStringContainsString('2', $result); + $this->assertStringContainsString('1', $result); + } + + /** + * renderOrderDetailsColumn shows error when JSON is invalid. + */ + public function testRenderOrderDetailsColumnShowsErrorWhenJsonInvalid(): void + { + $order_details = 'invalid json'; + + $result = $this->renderOrderDetailsColumn->invoke($this->instance, $order_details); + + $this->assertStringContainsString('Product details decoding error', $result); + } + + /** + * renderOrderDetailsColumn shows error when JSON is not an array. + */ + public function testRenderOrderDetailsColumnShowsErrorWhenNotArray(): void + { + $order_details = json_encode('not an array'); + + $result = $this->renderOrderDetailsColumn->invoke($this->instance, $order_details); + + $this->assertStringContainsString('Product details decoding error', $result); + } + + /** + * renderCustomerDetailsColumn renders customer billing details. + */ + public function testRenderCustomerDetailsColumnRendersBillingDetails(): void + { + $customer_details = json_encode([ + 'billing_first_name' => 'John', + 'billing_last_name' => 'Doe', + 'billing_email' => 'john.doe@example.com', + ]); + + $result = $this->renderCustomerDetailsColumn->invoke($this->instance, $customer_details); + + $this->assertStringContainsString('John', $result); + $this->assertStringContainsString('Doe', $result); + $this->assertStringContainsString('john.doe@example.com', $result); + } + + /** + * renderCustomerDetailsColumn shows error when JSON is invalid. + */ + public function testRenderCustomerDetailsColumnShowsErrorWhenJsonInvalid(): void + { + $customer_details = 'invalid json'; + + $result = $this->renderCustomerDetailsColumn->invoke($this->instance, $customer_details); + + $this->assertStringContainsString('Customer details decoding error', $result); + } + + /** + * renderCustomerDetailsColumn shows error when JSON is not an array. + */ + public function testRenderCustomerDetailsColumnShowsErrorWhenNotArray(): void + { + $customer_details = json_encode('not an array'); + + $result = $this->renderCustomerDetailsColumn->invoke($this->instance, $customer_details); + + $this->assertStringContainsString('Customer details decoding error', $result); + } + + /** + * renderCustomerDetailsColumn handles missing billing fields. + */ + public function testRenderCustomerDetailsColumnHandlesMissingFields(): void + { + $customer_details = json_encode([ + 'billing_first_name' => 'John', + // Missing billing_last_name and billing_email + ]); + + $result = $this->renderCustomerDetailsColumn->invoke($this->instance, $customer_details); + + $this->assertStringContainsString('John', $result); + // Empty fields should still render (empty strings) + $this->assertNotEmpty($result); + } +} + From 449c2ee55721c2f1bb7f5b589ee6b6c5f60be150 Mon Sep 17 00:00:00 2001 From: Viktor Date: Tue, 17 Feb 2026 11:48:21 +0300 Subject: [PATCH 54/60] Upd. JS parameters. Gathering dynamic lod implemented. (#739) * Upd. JS parameters. Gathering dynamic lod implemented. * Fix. Code. JS Re-minified. * Fix. JS parameters. Gathering dynamic load fixed. * Upd. JS parameters. Gathering loaded flag implemented. * Fix. Code. JS Re-minified. * Fix. Code. Debug removed. * Fix. Code. Undefined variable fixed. * Fix. Code. Code style fixed. * Fix. JS parameters. Gathering loading fixed. * Fix. JS parameters. Parameters for the caught ajax requests fixed. * Fix. Code. Code style fixed. --- gulpfile.js | 1 + inc/cleantalk-common.php | 1 + js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- ...lic-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- ...ic-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- ...lic-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 121 +++++++++++++--- .../apbct-public-bundle_ext-protection.js | 121 +++++++++++++--- ...-public-bundle_ext-protection_gathering.js | 121 +++++++++++++--- .../apbct-public-bundle_full-protection.js | 121 +++++++++++++--- ...public-bundle_full-protection_gathering.js | 121 +++++++++++++--- js/prebuild/apbct-public-bundle_gathering.js | 121 +++++++++++++--- .../apbct-public-bundle_int-protection.js | 121 +++++++++++++--- ...-public-bundle_int-protection_gathering.js | 121 +++++++++++++--- js/public-2-gathering-data.min.js | 2 + js/public-2-gathering-data.min.js.map | 1 + js/src/public-1-functions.js | 6 +- js/src/public-1-main.js | 133 ++++++++++++++++-- .../ApbctWP/Variables/AltSessions.php | 1 + 23 files changed, 977 insertions(+), 152 deletions(-) create mode 100644 js/public-2-gathering-data.min.js create mode 100644 js/public-2-gathering-data.min.js.map diff --git a/gulpfile.js b/gulpfile.js index 7ad25355d..b11540449 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -35,6 +35,7 @@ function minify_all_js_files_except_already_bundled() { '!js/src/cleantalk-admin.js', '!js/src/common-decoder.js', 'js/src/public-3-trp.js', + 'js/src/public-2-gathering-data.js', ]) .pipe(sourcemaps.init()) .pipe(uglify()) diff --git a/inc/cleantalk-common.php b/inc/cleantalk-common.php index 9b0728d0e..cccae3ce0 100644 --- a/inc/cleantalk-common.php +++ b/inc/cleantalk-common.php @@ -684,6 +684,7 @@ function apbct_get_sender_info() 'bot_detector_prepared_form_exclusions' => apbct__bot_detector_get_prepared_exclusion(), 'bot_detector_frontend_data_log' => apbct__bot_detector_get_fd_log(), 'submit_time_calculation_enabled' => SubmitTimeHandler::isCalculationDisabled() ? 0 : 1, + 'ct_gathering_loaded' => Cookie::getBool('ct_gathering_loaded'), ); // Unset cookies_enabled from sender_info if cookies_type === none diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index ff28a8002..f5c9ab167 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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 96ba7b647..c85c94766 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.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(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),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 0f8e62776..1991c38e9 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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 6aa42b684..ad1295cc6 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.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(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),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 0ed729b54..1ca65c7fc 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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 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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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 diff --git a/js/apbct-public-bundle_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index 12b6ddad9..1dc51a809 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.prev=10,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,o));case 17: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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6: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 00e44fd65..8a2fe49f5 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index 1b759fb08..29feec71b 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 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;e=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=ApbctShadowRootConfig},[{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(){void 0!==ctPublic.force_alt_cookies&&("undefined"===ctPublic.force_alt_cookies||ctPublic.force_alt_cookies)||+ctPublic.settings__data__bot_detector_enabled||(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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.prev=10,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.next=17):e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(10),e.abrupt("return",defaultFetch.apply(window,n));case 17: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 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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6: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/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 8582320c7..4a456c09d 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -1988,7 +1988,7 @@ class ApbctShadowRootProtection { * Set init params */ // eslint-disable-next-line no-unused-vars,require-jsdoc -function initParams() { +function initParams(gatheringLoaded) { const ctDate = new Date(); const headless = navigator.webdriver; const screenInfo = ( @@ -2067,6 +2067,10 @@ function initParams() { initCookies.push(['ct_checkjs', 0]); } + if (gatheringLoaded) { + initCookies.push(['ct_gathering_loaded', gatheringLoaded]); + } + ctSetCookie(initCookies); } @@ -2605,13 +2609,14 @@ class ApbctEventTokenTransport { class ApbctAttachData { /** * Attach hidden fields to forms + * @param {bool} gatheringLoaded * @return {void} */ - attachHiddenFieldsToForms() { + attachHiddenFieldsToForms(gatheringLoaded) { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -3074,7 +3079,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3088,7 +3093,7 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3143,7 +3148,7 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3441,7 +3446,7 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3508,7 +3513,7 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3520,7 +3525,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { @@ -3968,18 +3973,100 @@ class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { } } +/** + * Additional function to calculate realpath of cleantalk's scripts + * @return {*|null} + */ +function getApbctBasePath() { + // Find apbct-public-bundle in scripts names + const scripts = document.getElementsByTagName('script'); + + for (let script of scripts) { + if (script.src && script.src.includes('apbct-public-bundle')) { + // Get path from `src` js + const match = script.src.match(/^(.*\/js\/)/); + if (match && match[1]) { + return match[1]; // Path exists, return this + } + } + } + + return null; // cleantalk's scripts not found :( +} + +/** + * Load any script into the DOM (i.e. `import()`) + * @param {string} scriptAbsolutePath + * @return {Promise<*|boolean>} + */ +async function apbctImportScript(scriptAbsolutePath) { + // Check it this scripti already is in DOM + const normalizedPath = scriptAbsolutePath.replace(/\/$/, ''); // Replace ending slashes + const scripts = document.querySelectorAll('script[src]'); + for (const script of scripts) { + const scriptSrc = script.src.replace(/\/$/, ''); + if (scriptSrc === normalizedPath) { + // Script already loaded, skipping + return true; + } + } + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + + script.src = scriptAbsolutePath; + script.async = true; + + script.onload = function() { + // Gathering data script loaded successfully + resolve(true); + }; + + script.onerror = function() { + // Failed to load Gathering data script from `scriptAbsolutePath` + reject(new Error('Script loading failed: ' + scriptAbsolutePath)); + }; + + document.head.appendChild(script); + }).catch((error) => { + // Gathering data script loading failed, continuing without it + return false; + }); +} + /** * Ready function */ // eslint-disable-next-line camelcase,require-jsdoc -function apbct_ready() { +async function apbct_ready() { new ApbctShowForbidden().prepareBlockForAjaxForms(); + // Try to get gathering if no worked bot-detector + let gatheringLoaded = false; + + if ( + apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit + +ctPublic.settings__data__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 + ) { + const basePath = getApbctBasePath(); + if ( ! basePath ) { + // We are here because NO any cleantalk bundle script are in frontend: Todo nothing + } else { + const gatheringScriptName = 'public-2-gathering-data.min.js'; + const gatheringFullPath = basePath + gatheringScriptName; + gatheringLoaded = await apbctImportScript(gatheringFullPath); + } + } + const handler = new ApbctHandler(); handler.detectForcedAltCookiesForms(); // Gathering data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if ( + ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + typeof ApbctGatheringData !== 'undefined' + ) { const gatheringData = new ApbctGatheringData(); gatheringData.setSessionId(); gatheringData.writeReferrersToSessionStorage(); @@ -3991,7 +4078,7 @@ function apbct_ready() { // Always call initParams to set cookies and parameters if (typeof initParams === 'function') { try { - initParams(); + initParams(gatheringLoaded); } catch (e) { console.log('initParams error:', e); } @@ -4007,9 +4094,9 @@ function apbct_ready() { const attachData = new ApbctAttachData(); - // Attach data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled) { - attachData.attachHiddenFieldsToForms(); + // Attach data when bot detector is disabled or blocked + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + attachData.attachHiddenFieldsToForms(gatheringLoaded); } for (let i = 0; i < document.forms.length; i++) { @@ -4039,7 +4126,7 @@ function apbct_ready() { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; - if ( botDetectorEventToken && ! botDetectorEventTokenStored ) { + if (botDetectorEventToken && !botDetectorEventTokenStored) { ctSetCookie([ ['ct_bot_detector_event_token', botDetectorEventToken], ]); @@ -4058,6 +4145,8 @@ function apbct_ready() { if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } + + apbctLocalStorage.set('apbct_existing_visitor', 1); } if (ctPublic.data__key_is_ok) { diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index d1e037fc9..5e54627d2 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -1988,7 +1988,7 @@ class ApbctShadowRootProtection { * Set init params */ // eslint-disable-next-line no-unused-vars,require-jsdoc -function initParams() { +function initParams(gatheringLoaded) { const ctDate = new Date(); const headless = navigator.webdriver; const screenInfo = ( @@ -2067,6 +2067,10 @@ function initParams() { initCookies.push(['ct_checkjs', 0]); } + if (gatheringLoaded) { + initCookies.push(['ct_gathering_loaded', gatheringLoaded]); + } + ctSetCookie(initCookies); } @@ -2605,13 +2609,14 @@ class ApbctEventTokenTransport { class ApbctAttachData { /** * Attach hidden fields to forms + * @param {bool} gatheringLoaded * @return {void} */ - attachHiddenFieldsToForms() { + attachHiddenFieldsToForms(gatheringLoaded) { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -3074,7 +3079,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3088,7 +3093,7 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3143,7 +3148,7 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3441,7 +3446,7 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3508,7 +3513,7 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3520,7 +3525,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { @@ -3968,18 +3973,100 @@ class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { } } +/** + * Additional function to calculate realpath of cleantalk's scripts + * @return {*|null} + */ +function getApbctBasePath() { + // Find apbct-public-bundle in scripts names + const scripts = document.getElementsByTagName('script'); + + for (let script of scripts) { + if (script.src && script.src.includes('apbct-public-bundle')) { + // Get path from `src` js + const match = script.src.match(/^(.*\/js\/)/); + if (match && match[1]) { + return match[1]; // Path exists, return this + } + } + } + + return null; // cleantalk's scripts not found :( +} + +/** + * Load any script into the DOM (i.e. `import()`) + * @param {string} scriptAbsolutePath + * @return {Promise<*|boolean>} + */ +async function apbctImportScript(scriptAbsolutePath) { + // Check it this scripti already is in DOM + const normalizedPath = scriptAbsolutePath.replace(/\/$/, ''); // Replace ending slashes + const scripts = document.querySelectorAll('script[src]'); + for (const script of scripts) { + const scriptSrc = script.src.replace(/\/$/, ''); + if (scriptSrc === normalizedPath) { + // Script already loaded, skipping + return true; + } + } + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + + script.src = scriptAbsolutePath; + script.async = true; + + script.onload = function() { + // Gathering data script loaded successfully + resolve(true); + }; + + script.onerror = function() { + // Failed to load Gathering data script from `scriptAbsolutePath` + reject(new Error('Script loading failed: ' + scriptAbsolutePath)); + }; + + document.head.appendChild(script); + }).catch((error) => { + // Gathering data script loading failed, continuing without it + return false; + }); +} + /** * Ready function */ // eslint-disable-next-line camelcase,require-jsdoc -function apbct_ready() { +async function apbct_ready() { new ApbctShowForbidden().prepareBlockForAjaxForms(); + // Try to get gathering if no worked bot-detector + let gatheringLoaded = false; + + if ( + apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit + +ctPublic.settings__data__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 + ) { + const basePath = getApbctBasePath(); + if ( ! basePath ) { + // We are here because NO any cleantalk bundle script are in frontend: Todo nothing + } else { + const gatheringScriptName = 'public-2-gathering-data.min.js'; + const gatheringFullPath = basePath + gatheringScriptName; + gatheringLoaded = await apbctImportScript(gatheringFullPath); + } + } + const handler = new ApbctHandler(); handler.detectForcedAltCookiesForms(); // Gathering data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if ( + ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + typeof ApbctGatheringData !== 'undefined' + ) { const gatheringData = new ApbctGatheringData(); gatheringData.setSessionId(); gatheringData.writeReferrersToSessionStorage(); @@ -3991,7 +4078,7 @@ function apbct_ready() { // Always call initParams to set cookies and parameters if (typeof initParams === 'function') { try { - initParams(); + initParams(gatheringLoaded); } catch (e) { console.log('initParams error:', e); } @@ -4007,9 +4094,9 @@ function apbct_ready() { const attachData = new ApbctAttachData(); - // Attach data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled) { - attachData.attachHiddenFieldsToForms(); + // Attach data when bot detector is disabled or blocked + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + attachData.attachHiddenFieldsToForms(gatheringLoaded); } for (let i = 0; i < document.forms.length; i++) { @@ -4039,7 +4126,7 @@ function apbct_ready() { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; - if ( botDetectorEventToken && ! botDetectorEventTokenStored ) { + if (botDetectorEventToken && !botDetectorEventTokenStored) { ctSetCookie([ ['ct_bot_detector_event_token', botDetectorEventToken], ]); @@ -4058,6 +4145,8 @@ function apbct_ready() { if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } + + apbctLocalStorage.set('apbct_existing_visitor', 1); } if (ctPublic.data__key_is_ok) { diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index d4bce6f76..5f26e897a 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -1988,7 +1988,7 @@ class ApbctShadowRootProtection { * Set init params */ // eslint-disable-next-line no-unused-vars,require-jsdoc -function initParams() { +function initParams(gatheringLoaded) { const ctDate = new Date(); const headless = navigator.webdriver; const screenInfo = ( @@ -2067,6 +2067,10 @@ function initParams() { initCookies.push(['ct_checkjs', 0]); } + if (gatheringLoaded) { + initCookies.push(['ct_gathering_loaded', gatheringLoaded]); + } + ctSetCookie(initCookies); } @@ -2605,13 +2609,14 @@ class ApbctEventTokenTransport { class ApbctAttachData { /** * Attach hidden fields to forms + * @param {bool} gatheringLoaded * @return {void} */ - attachHiddenFieldsToForms() { + attachHiddenFieldsToForms(gatheringLoaded) { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -3074,7 +3079,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3088,7 +3093,7 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3143,7 +3148,7 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3441,7 +3446,7 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3508,7 +3513,7 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3520,7 +3525,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { @@ -3968,18 +3973,100 @@ class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { } } +/** + * Additional function to calculate realpath of cleantalk's scripts + * @return {*|null} + */ +function getApbctBasePath() { + // Find apbct-public-bundle in scripts names + const scripts = document.getElementsByTagName('script'); + + for (let script of scripts) { + if (script.src && script.src.includes('apbct-public-bundle')) { + // Get path from `src` js + const match = script.src.match(/^(.*\/js\/)/); + if (match && match[1]) { + return match[1]; // Path exists, return this + } + } + } + + return null; // cleantalk's scripts not found :( +} + +/** + * Load any script into the DOM (i.e. `import()`) + * @param {string} scriptAbsolutePath + * @return {Promise<*|boolean>} + */ +async function apbctImportScript(scriptAbsolutePath) { + // Check it this scripti already is in DOM + const normalizedPath = scriptAbsolutePath.replace(/\/$/, ''); // Replace ending slashes + const scripts = document.querySelectorAll('script[src]'); + for (const script of scripts) { + const scriptSrc = script.src.replace(/\/$/, ''); + if (scriptSrc === normalizedPath) { + // Script already loaded, skipping + return true; + } + } + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + + script.src = scriptAbsolutePath; + script.async = true; + + script.onload = function() { + // Gathering data script loaded successfully + resolve(true); + }; + + script.onerror = function() { + // Failed to load Gathering data script from `scriptAbsolutePath` + reject(new Error('Script loading failed: ' + scriptAbsolutePath)); + }; + + document.head.appendChild(script); + }).catch((error) => { + // Gathering data script loading failed, continuing without it + return false; + }); +} + /** * Ready function */ // eslint-disable-next-line camelcase,require-jsdoc -function apbct_ready() { +async function apbct_ready() { new ApbctShowForbidden().prepareBlockForAjaxForms(); + // Try to get gathering if no worked bot-detector + let gatheringLoaded = false; + + if ( + apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit + +ctPublic.settings__data__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 + ) { + const basePath = getApbctBasePath(); + if ( ! basePath ) { + // We are here because NO any cleantalk bundle script are in frontend: Todo nothing + } else { + const gatheringScriptName = 'public-2-gathering-data.min.js'; + const gatheringFullPath = basePath + gatheringScriptName; + gatheringLoaded = await apbctImportScript(gatheringFullPath); + } + } + const handler = new ApbctHandler(); handler.detectForcedAltCookiesForms(); // Gathering data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if ( + ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + typeof ApbctGatheringData !== 'undefined' + ) { const gatheringData = new ApbctGatheringData(); gatheringData.setSessionId(); gatheringData.writeReferrersToSessionStorage(); @@ -3991,7 +4078,7 @@ function apbct_ready() { // Always call initParams to set cookies and parameters if (typeof initParams === 'function') { try { - initParams(); + initParams(gatheringLoaded); } catch (e) { console.log('initParams error:', e); } @@ -4007,9 +4094,9 @@ function apbct_ready() { const attachData = new ApbctAttachData(); - // Attach data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled) { - attachData.attachHiddenFieldsToForms(); + // Attach data when bot detector is disabled or blocked + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + attachData.attachHiddenFieldsToForms(gatheringLoaded); } for (let i = 0; i < document.forms.length; i++) { @@ -4039,7 +4126,7 @@ function apbct_ready() { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; - if ( botDetectorEventToken && ! botDetectorEventTokenStored ) { + if (botDetectorEventToken && !botDetectorEventTokenStored) { ctSetCookie([ ['ct_bot_detector_event_token', botDetectorEventToken], ]); @@ -4058,6 +4145,8 @@ function apbct_ready() { if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } + + apbctLocalStorage.set('apbct_existing_visitor', 1); } if (ctPublic.data__key_is_ok) { diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 31d41c678..1d1c6dc6a 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -1988,7 +1988,7 @@ class ApbctShadowRootProtection { * Set init params */ // eslint-disable-next-line no-unused-vars,require-jsdoc -function initParams() { +function initParams(gatheringLoaded) { const ctDate = new Date(); const headless = navigator.webdriver; const screenInfo = ( @@ -2067,6 +2067,10 @@ function initParams() { initCookies.push(['ct_checkjs', 0]); } + if (gatheringLoaded) { + initCookies.push(['ct_gathering_loaded', gatheringLoaded]); + } + ctSetCookie(initCookies); } @@ -2605,13 +2609,14 @@ class ApbctEventTokenTransport { class ApbctAttachData { /** * Attach hidden fields to forms + * @param {bool} gatheringLoaded * @return {void} */ - attachHiddenFieldsToForms() { + attachHiddenFieldsToForms(gatheringLoaded) { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -3074,7 +3079,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3088,7 +3093,7 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3143,7 +3148,7 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3441,7 +3446,7 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3508,7 +3513,7 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3520,7 +3525,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { @@ -3968,18 +3973,100 @@ class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { } } +/** + * Additional function to calculate realpath of cleantalk's scripts + * @return {*|null} + */ +function getApbctBasePath() { + // Find apbct-public-bundle in scripts names + const scripts = document.getElementsByTagName('script'); + + for (let script of scripts) { + if (script.src && script.src.includes('apbct-public-bundle')) { + // Get path from `src` js + const match = script.src.match(/^(.*\/js\/)/); + if (match && match[1]) { + return match[1]; // Path exists, return this + } + } + } + + return null; // cleantalk's scripts not found :( +} + +/** + * Load any script into the DOM (i.e. `import()`) + * @param {string} scriptAbsolutePath + * @return {Promise<*|boolean>} + */ +async function apbctImportScript(scriptAbsolutePath) { + // Check it this scripti already is in DOM + const normalizedPath = scriptAbsolutePath.replace(/\/$/, ''); // Replace ending slashes + const scripts = document.querySelectorAll('script[src]'); + for (const script of scripts) { + const scriptSrc = script.src.replace(/\/$/, ''); + if (scriptSrc === normalizedPath) { + // Script already loaded, skipping + return true; + } + } + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + + script.src = scriptAbsolutePath; + script.async = true; + + script.onload = function() { + // Gathering data script loaded successfully + resolve(true); + }; + + script.onerror = function() { + // Failed to load Gathering data script from `scriptAbsolutePath` + reject(new Error('Script loading failed: ' + scriptAbsolutePath)); + }; + + document.head.appendChild(script); + }).catch((error) => { + // Gathering data script loading failed, continuing without it + return false; + }); +} + /** * Ready function */ // eslint-disable-next-line camelcase,require-jsdoc -function apbct_ready() { +async function apbct_ready() { new ApbctShowForbidden().prepareBlockForAjaxForms(); + // Try to get gathering if no worked bot-detector + let gatheringLoaded = false; + + if ( + apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit + +ctPublic.settings__data__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 + ) { + const basePath = getApbctBasePath(); + if ( ! basePath ) { + // We are here because NO any cleantalk bundle script are in frontend: Todo nothing + } else { + const gatheringScriptName = 'public-2-gathering-data.min.js'; + const gatheringFullPath = basePath + gatheringScriptName; + gatheringLoaded = await apbctImportScript(gatheringFullPath); + } + } + const handler = new ApbctHandler(); handler.detectForcedAltCookiesForms(); // Gathering data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if ( + ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + typeof ApbctGatheringData !== 'undefined' + ) { const gatheringData = new ApbctGatheringData(); gatheringData.setSessionId(); gatheringData.writeReferrersToSessionStorage(); @@ -3991,7 +4078,7 @@ function apbct_ready() { // Always call initParams to set cookies and parameters if (typeof initParams === 'function') { try { - initParams(); + initParams(gatheringLoaded); } catch (e) { console.log('initParams error:', e); } @@ -4007,9 +4094,9 @@ function apbct_ready() { const attachData = new ApbctAttachData(); - // Attach data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled) { - attachData.attachHiddenFieldsToForms(); + // Attach data when bot detector is disabled or blocked + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + attachData.attachHiddenFieldsToForms(gatheringLoaded); } for (let i = 0; i < document.forms.length; i++) { @@ -4039,7 +4126,7 @@ function apbct_ready() { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; - if ( botDetectorEventToken && ! botDetectorEventTokenStored ) { + if (botDetectorEventToken && !botDetectorEventTokenStored) { ctSetCookie([ ['ct_bot_detector_event_token', botDetectorEventToken], ]); @@ -4058,6 +4145,8 @@ function apbct_ready() { if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } + + apbctLocalStorage.set('apbct_existing_visitor', 1); } if (ctPublic.data__key_is_ok) { diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 161f2228d..66e4ee65b 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -1988,7 +1988,7 @@ class ApbctShadowRootProtection { * Set init params */ // eslint-disable-next-line no-unused-vars,require-jsdoc -function initParams() { +function initParams(gatheringLoaded) { const ctDate = new Date(); const headless = navigator.webdriver; const screenInfo = ( @@ -2067,6 +2067,10 @@ function initParams() { initCookies.push(['ct_checkjs', 0]); } + if (gatheringLoaded) { + initCookies.push(['ct_gathering_loaded', gatheringLoaded]); + } + ctSetCookie(initCookies); } @@ -2605,13 +2609,14 @@ class ApbctEventTokenTransport { class ApbctAttachData { /** * Attach hidden fields to forms + * @param {bool} gatheringLoaded * @return {void} */ - attachHiddenFieldsToForms() { + attachHiddenFieldsToForms(gatheringLoaded) { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -3074,7 +3079,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3088,7 +3093,7 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3143,7 +3148,7 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3441,7 +3446,7 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3508,7 +3513,7 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3520,7 +3525,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { @@ -3968,18 +3973,100 @@ class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { } } +/** + * Additional function to calculate realpath of cleantalk's scripts + * @return {*|null} + */ +function getApbctBasePath() { + // Find apbct-public-bundle in scripts names + const scripts = document.getElementsByTagName('script'); + + for (let script of scripts) { + if (script.src && script.src.includes('apbct-public-bundle')) { + // Get path from `src` js + const match = script.src.match(/^(.*\/js\/)/); + if (match && match[1]) { + return match[1]; // Path exists, return this + } + } + } + + return null; // cleantalk's scripts not found :( +} + +/** + * Load any script into the DOM (i.e. `import()`) + * @param {string} scriptAbsolutePath + * @return {Promise<*|boolean>} + */ +async function apbctImportScript(scriptAbsolutePath) { + // Check it this scripti already is in DOM + const normalizedPath = scriptAbsolutePath.replace(/\/$/, ''); // Replace ending slashes + const scripts = document.querySelectorAll('script[src]'); + for (const script of scripts) { + const scriptSrc = script.src.replace(/\/$/, ''); + if (scriptSrc === normalizedPath) { + // Script already loaded, skipping + return true; + } + } + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + + script.src = scriptAbsolutePath; + script.async = true; + + script.onload = function() { + // Gathering data script loaded successfully + resolve(true); + }; + + script.onerror = function() { + // Failed to load Gathering data script from `scriptAbsolutePath` + reject(new Error('Script loading failed: ' + scriptAbsolutePath)); + }; + + document.head.appendChild(script); + }).catch((error) => { + // Gathering data script loading failed, continuing without it + return false; + }); +} + /** * Ready function */ // eslint-disable-next-line camelcase,require-jsdoc -function apbct_ready() { +async function apbct_ready() { new ApbctShowForbidden().prepareBlockForAjaxForms(); + // Try to get gathering if no worked bot-detector + let gatheringLoaded = false; + + if ( + apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit + +ctPublic.settings__data__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 + ) { + const basePath = getApbctBasePath(); + if ( ! basePath ) { + // We are here because NO any cleantalk bundle script are in frontend: Todo nothing + } else { + const gatheringScriptName = 'public-2-gathering-data.min.js'; + const gatheringFullPath = basePath + gatheringScriptName; + gatheringLoaded = await apbctImportScript(gatheringFullPath); + } + } + const handler = new ApbctHandler(); handler.detectForcedAltCookiesForms(); // Gathering data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if ( + ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + typeof ApbctGatheringData !== 'undefined' + ) { const gatheringData = new ApbctGatheringData(); gatheringData.setSessionId(); gatheringData.writeReferrersToSessionStorage(); @@ -3991,7 +4078,7 @@ function apbct_ready() { // Always call initParams to set cookies and parameters if (typeof initParams === 'function') { try { - initParams(); + initParams(gatheringLoaded); } catch (e) { console.log('initParams error:', e); } @@ -4007,9 +4094,9 @@ function apbct_ready() { const attachData = new ApbctAttachData(); - // Attach data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled) { - attachData.attachHiddenFieldsToForms(); + // Attach data when bot detector is disabled or blocked + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + attachData.attachHiddenFieldsToForms(gatheringLoaded); } for (let i = 0; i < document.forms.length; i++) { @@ -4039,7 +4126,7 @@ function apbct_ready() { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; - if ( botDetectorEventToken && ! botDetectorEventTokenStored ) { + if (botDetectorEventToken && !botDetectorEventTokenStored) { ctSetCookie([ ['ct_bot_detector_event_token', botDetectorEventToken], ]); @@ -4058,6 +4145,8 @@ function apbct_ready() { if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } + + apbctLocalStorage.set('apbct_existing_visitor', 1); } if (ctPublic.data__key_is_ok) { diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index c3d72fc09..bd90092a9 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -1988,7 +1988,7 @@ class ApbctShadowRootProtection { * Set init params */ // eslint-disable-next-line no-unused-vars,require-jsdoc -function initParams() { +function initParams(gatheringLoaded) { const ctDate = new Date(); const headless = navigator.webdriver; const screenInfo = ( @@ -2067,6 +2067,10 @@ function initParams() { initCookies.push(['ct_checkjs', 0]); } + if (gatheringLoaded) { + initCookies.push(['ct_gathering_loaded', gatheringLoaded]); + } + ctSetCookie(initCookies); } @@ -2605,13 +2609,14 @@ class ApbctEventTokenTransport { class ApbctAttachData { /** * Attach hidden fields to forms + * @param {bool} gatheringLoaded * @return {void} */ - attachHiddenFieldsToForms() { + attachHiddenFieldsToForms(gatheringLoaded) { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -3074,7 +3079,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3088,7 +3093,7 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3143,7 +3148,7 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3441,7 +3446,7 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3508,7 +3513,7 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3520,7 +3525,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { @@ -3968,18 +3973,100 @@ class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { } } +/** + * Additional function to calculate realpath of cleantalk's scripts + * @return {*|null} + */ +function getApbctBasePath() { + // Find apbct-public-bundle in scripts names + const scripts = document.getElementsByTagName('script'); + + for (let script of scripts) { + if (script.src && script.src.includes('apbct-public-bundle')) { + // Get path from `src` js + const match = script.src.match(/^(.*\/js\/)/); + if (match && match[1]) { + return match[1]; // Path exists, return this + } + } + } + + return null; // cleantalk's scripts not found :( +} + +/** + * Load any script into the DOM (i.e. `import()`) + * @param {string} scriptAbsolutePath + * @return {Promise<*|boolean>} + */ +async function apbctImportScript(scriptAbsolutePath) { + // Check it this scripti already is in DOM + const normalizedPath = scriptAbsolutePath.replace(/\/$/, ''); // Replace ending slashes + const scripts = document.querySelectorAll('script[src]'); + for (const script of scripts) { + const scriptSrc = script.src.replace(/\/$/, ''); + if (scriptSrc === normalizedPath) { + // Script already loaded, skipping + return true; + } + } + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + + script.src = scriptAbsolutePath; + script.async = true; + + script.onload = function() { + // Gathering data script loaded successfully + resolve(true); + }; + + script.onerror = function() { + // Failed to load Gathering data script from `scriptAbsolutePath` + reject(new Error('Script loading failed: ' + scriptAbsolutePath)); + }; + + document.head.appendChild(script); + }).catch((error) => { + // Gathering data script loading failed, continuing without it + return false; + }); +} + /** * Ready function */ // eslint-disable-next-line camelcase,require-jsdoc -function apbct_ready() { +async function apbct_ready() { new ApbctShowForbidden().prepareBlockForAjaxForms(); + // Try to get gathering if no worked bot-detector + let gatheringLoaded = false; + + if ( + apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit + +ctPublic.settings__data__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 + ) { + const basePath = getApbctBasePath(); + if ( ! basePath ) { + // We are here because NO any cleantalk bundle script are in frontend: Todo nothing + } else { + const gatheringScriptName = 'public-2-gathering-data.min.js'; + const gatheringFullPath = basePath + gatheringScriptName; + gatheringLoaded = await apbctImportScript(gatheringFullPath); + } + } + const handler = new ApbctHandler(); handler.detectForcedAltCookiesForms(); // Gathering data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if ( + ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + typeof ApbctGatheringData !== 'undefined' + ) { const gatheringData = new ApbctGatheringData(); gatheringData.setSessionId(); gatheringData.writeReferrersToSessionStorage(); @@ -3991,7 +4078,7 @@ function apbct_ready() { // Always call initParams to set cookies and parameters if (typeof initParams === 'function') { try { - initParams(); + initParams(gatheringLoaded); } catch (e) { console.log('initParams error:', e); } @@ -4007,9 +4094,9 @@ function apbct_ready() { const attachData = new ApbctAttachData(); - // Attach data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled) { - attachData.attachHiddenFieldsToForms(); + // Attach data when bot detector is disabled or blocked + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + attachData.attachHiddenFieldsToForms(gatheringLoaded); } for (let i = 0; i < document.forms.length; i++) { @@ -4039,7 +4126,7 @@ function apbct_ready() { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; - if ( botDetectorEventToken && ! botDetectorEventTokenStored ) { + if (botDetectorEventToken && !botDetectorEventTokenStored) { ctSetCookie([ ['ct_bot_detector_event_token', botDetectorEventToken], ]); @@ -4058,6 +4145,8 @@ function apbct_ready() { if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } + + apbctLocalStorage.set('apbct_existing_visitor', 1); } if (ctPublic.data__key_is_ok) { diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index 99cf91d2f..87675a45c 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -1988,7 +1988,7 @@ class ApbctShadowRootProtection { * Set init params */ // eslint-disable-next-line no-unused-vars,require-jsdoc -function initParams() { +function initParams(gatheringLoaded) { const ctDate = new Date(); const headless = navigator.webdriver; const screenInfo = ( @@ -2067,6 +2067,10 @@ function initParams() { initCookies.push(['ct_checkjs', 0]); } + if (gatheringLoaded) { + initCookies.push(['ct_gathering_loaded', gatheringLoaded]); + } + ctSetCookie(initCookies); } @@ -2605,13 +2609,14 @@ class ApbctEventTokenTransport { class ApbctAttachData { /** * Attach hidden fields to forms + * @param {bool} gatheringLoaded * @return {void} */ - attachHiddenFieldsToForms() { + attachHiddenFieldsToForms(gatheringLoaded) { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -3074,7 +3079,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3088,7 +3093,7 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3143,7 +3148,7 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3441,7 +3446,7 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3508,7 +3513,7 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3520,7 +3525,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { @@ -3968,18 +3973,100 @@ class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { } } +/** + * Additional function to calculate realpath of cleantalk's scripts + * @return {*|null} + */ +function getApbctBasePath() { + // Find apbct-public-bundle in scripts names + const scripts = document.getElementsByTagName('script'); + + for (let script of scripts) { + if (script.src && script.src.includes('apbct-public-bundle')) { + // Get path from `src` js + const match = script.src.match(/^(.*\/js\/)/); + if (match && match[1]) { + return match[1]; // Path exists, return this + } + } + } + + return null; // cleantalk's scripts not found :( +} + +/** + * Load any script into the DOM (i.e. `import()`) + * @param {string} scriptAbsolutePath + * @return {Promise<*|boolean>} + */ +async function apbctImportScript(scriptAbsolutePath) { + // Check it this scripti already is in DOM + const normalizedPath = scriptAbsolutePath.replace(/\/$/, ''); // Replace ending slashes + const scripts = document.querySelectorAll('script[src]'); + for (const script of scripts) { + const scriptSrc = script.src.replace(/\/$/, ''); + if (scriptSrc === normalizedPath) { + // Script already loaded, skipping + return true; + } + } + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + + script.src = scriptAbsolutePath; + script.async = true; + + script.onload = function() { + // Gathering data script loaded successfully + resolve(true); + }; + + script.onerror = function() { + // Failed to load Gathering data script from `scriptAbsolutePath` + reject(new Error('Script loading failed: ' + scriptAbsolutePath)); + }; + + document.head.appendChild(script); + }).catch((error) => { + // Gathering data script loading failed, continuing without it + return false; + }); +} + /** * Ready function */ // eslint-disable-next-line camelcase,require-jsdoc -function apbct_ready() { +async function apbct_ready() { new ApbctShowForbidden().prepareBlockForAjaxForms(); + // Try to get gathering if no worked bot-detector + let gatheringLoaded = false; + + if ( + apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit + +ctPublic.settings__data__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 + ) { + const basePath = getApbctBasePath(); + if ( ! basePath ) { + // We are here because NO any cleantalk bundle script are in frontend: Todo nothing + } else { + const gatheringScriptName = 'public-2-gathering-data.min.js'; + const gatheringFullPath = basePath + gatheringScriptName; + gatheringLoaded = await apbctImportScript(gatheringFullPath); + } + } + const handler = new ApbctHandler(); handler.detectForcedAltCookiesForms(); // Gathering data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if ( + ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + typeof ApbctGatheringData !== 'undefined' + ) { const gatheringData = new ApbctGatheringData(); gatheringData.setSessionId(); gatheringData.writeReferrersToSessionStorage(); @@ -3991,7 +4078,7 @@ function apbct_ready() { // Always call initParams to set cookies and parameters if (typeof initParams === 'function') { try { - initParams(); + initParams(gatheringLoaded); } catch (e) { console.log('initParams error:', e); } @@ -4007,9 +4094,9 @@ function apbct_ready() { const attachData = new ApbctAttachData(); - // Attach data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled) { - attachData.attachHiddenFieldsToForms(); + // Attach data when bot detector is disabled or blocked + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + attachData.attachHiddenFieldsToForms(gatheringLoaded); } for (let i = 0; i < document.forms.length; i++) { @@ -4039,7 +4126,7 @@ function apbct_ready() { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; - if ( botDetectorEventToken && ! botDetectorEventTokenStored ) { + if (botDetectorEventToken && !botDetectorEventTokenStored) { ctSetCookie([ ['ct_bot_detector_event_token', botDetectorEventToken], ]); @@ -4058,6 +4145,8 @@ function apbct_ready() { if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } + + apbctLocalStorage.set('apbct_existing_visitor', 1); } if (ctPublic.data__key_is_ok) { diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index dda3b581c..bddc1bc3b 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -1988,7 +1988,7 @@ class ApbctShadowRootProtection { * Set init params */ // eslint-disable-next-line no-unused-vars,require-jsdoc -function initParams() { +function initParams(gatheringLoaded) { const ctDate = new Date(); const headless = navigator.webdriver; const screenInfo = ( @@ -2067,6 +2067,10 @@ function initParams() { initCookies.push(['ct_checkjs', 0]); } + if (gatheringLoaded) { + initCookies.push(['ct_gathering_loaded', gatheringLoaded]); + } + ctSetCookie(initCookies); } @@ -2605,13 +2609,14 @@ class ApbctEventTokenTransport { class ApbctAttachData { /** * Attach hidden fields to forms + * @param {bool} gatheringLoaded * @return {void} */ - attachHiddenFieldsToForms() { + attachHiddenFieldsToForms(gatheringLoaded) { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -3074,7 +3079,7 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3088,7 +3093,7 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3143,7 +3148,7 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3441,7 +3446,7 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3508,7 +3513,7 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3520,7 +3525,7 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { @@ -3968,18 +3973,100 @@ class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { } } +/** + * Additional function to calculate realpath of cleantalk's scripts + * @return {*|null} + */ +function getApbctBasePath() { + // Find apbct-public-bundle in scripts names + const scripts = document.getElementsByTagName('script'); + + for (let script of scripts) { + if (script.src && script.src.includes('apbct-public-bundle')) { + // Get path from `src` js + const match = script.src.match(/^(.*\/js\/)/); + if (match && match[1]) { + return match[1]; // Path exists, return this + } + } + } + + return null; // cleantalk's scripts not found :( +} + +/** + * Load any script into the DOM (i.e. `import()`) + * @param {string} scriptAbsolutePath + * @return {Promise<*|boolean>} + */ +async function apbctImportScript(scriptAbsolutePath) { + // Check it this scripti already is in DOM + const normalizedPath = scriptAbsolutePath.replace(/\/$/, ''); // Replace ending slashes + const scripts = document.querySelectorAll('script[src]'); + for (const script of scripts) { + const scriptSrc = script.src.replace(/\/$/, ''); + if (scriptSrc === normalizedPath) { + // Script already loaded, skipping + return true; + } + } + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + + script.src = scriptAbsolutePath; + script.async = true; + + script.onload = function() { + // Gathering data script loaded successfully + resolve(true); + }; + + script.onerror = function() { + // Failed to load Gathering data script from `scriptAbsolutePath` + reject(new Error('Script loading failed: ' + scriptAbsolutePath)); + }; + + document.head.appendChild(script); + }).catch((error) => { + // Gathering data script loading failed, continuing without it + return false; + }); +} + /** * Ready function */ // eslint-disable-next-line camelcase,require-jsdoc -function apbct_ready() { +async function apbct_ready() { new ApbctShowForbidden().prepareBlockForAjaxForms(); + // Try to get gathering if no worked bot-detector + let gatheringLoaded = false; + + if ( + apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit + +ctPublic.settings__data__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 + ) { + const basePath = getApbctBasePath(); + if ( ! basePath ) { + // We are here because NO any cleantalk bundle script are in frontend: Todo nothing + } else { + const gatheringScriptName = 'public-2-gathering-data.min.js'; + const gatheringFullPath = basePath + gatheringScriptName; + gatheringLoaded = await apbctImportScript(gatheringFullPath); + } + } + const handler = new ApbctHandler(); handler.detectForcedAltCookiesForms(); // Gathering data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if ( + ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + typeof ApbctGatheringData !== 'undefined' + ) { const gatheringData = new ApbctGatheringData(); gatheringData.setSessionId(); gatheringData.writeReferrersToSessionStorage(); @@ -3991,7 +4078,7 @@ function apbct_ready() { // Always call initParams to set cookies and parameters if (typeof initParams === 'function') { try { - initParams(); + initParams(gatheringLoaded); } catch (e) { console.log('initParams error:', e); } @@ -4007,9 +4094,9 @@ function apbct_ready() { const attachData = new ApbctAttachData(); - // Attach data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled) { - attachData.attachHiddenFieldsToForms(); + // Attach data when bot detector is disabled or blocked + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + attachData.attachHiddenFieldsToForms(gatheringLoaded); } for (let i = 0; i < document.forms.length; i++) { @@ -4039,7 +4126,7 @@ function apbct_ready() { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; - if ( botDetectorEventToken && ! botDetectorEventTokenStored ) { + if (botDetectorEventToken && !botDetectorEventTokenStored) { ctSetCookie([ ['ct_bot_detector_event_token', botDetectorEventToken], ]); @@ -4058,6 +4145,8 @@ function apbct_ready() { if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } + + apbctLocalStorage.set('apbct_existing_visitor', 1); } if (ctPublic.data__key_is_ok) { diff --git a/js/public-2-gathering-data.min.js b/js/public-2-gathering-data.min.js new file mode 100644 index 000000000..6807272b9 --- /dev/null +++ b/js/public-2-gathering-data.min.js @@ -0,0 +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 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":"MAGMA,mBAKFC,eACI,IACUC,EADLC,oBAAoBC,MAAM,kBAAkB,EAW7CC,kBAAkBC,IAAI,kBAAmBC,OAAOF,kBAAkBG,IAAI,iBAAiB,CAAC,EAAI,CAAC,GAVvFN,EAAYO,KAAKC,OAAO,EAAEC,SAAS,EAAE,EAAEC,QAAQ,WAAY,EAAE,EAAEC,OAAO,EAAG,EAAE,EACjFV,oBAAoBG,IAAI,mBAAoBJ,EAAW,CAAA,CAAK,EAC5DG,kBAAkBC,IAAI,kBAAmB,CAAC,EACtCQ,SAASC,UACQ,IAAIC,IAAIF,SAASC,QAAQ,EAC3BE,OAASC,SAASD,MAC7Bd,oBAAoBG,IAAI,qBAAsBQ,SAASC,SAAU,CAAA,CAAK,EAMtF,CAMAI,iCACI,IAAMC,EAAqBjB,oBAAoBK,IAAI,4BAA4B,EAErD,CAAA,IAAtBY,GAA+BN,SAASI,SAASG,OAASD,GAC1DjB,oBAAoBG,IAAI,qBAAsBc,EAAoB,CAAA,CAAK,EAG3EjB,oBAAoBG,IAAI,6BAA8BQ,SAASI,SAASG,KAAM,CAAA,CAAK,CACvF,CAOAC,iBACI,IAAMC,EAAclB,kBAAkBG,IAAI,iBAAiB,EACpDe,GAAeA,IAAgBC,SAASC,qBAC3CpB,kBAAkBC,IAAI,kBAAmBkB,SAASC,kBAAkB,EACpEpB,kBAAkBqB,OAAO,gBAAgB,EACzCrB,kBAAkBqB,OAAO,iBAAiB,EAElD,CAMAC,uBACwC,gBAAhCH,SAASC,qBACTG,KAAKD,qBAAqB,EAE1BE,WAAWD,KAAKD,qBAAsB,GAAI,EAElD,CAMAG,qBACIC,OAAOC,iBAAiB,iBAAkBJ,KAAKK,sBAAuB,CAAA,CAAI,EAC1EF,OAAOC,iBAAiB,QAASJ,KAAKM,aAAc,CAAA,CAAI,CAC5D,CAMAC,oBACIrB,SAASsB,WAAa,IAAIC,WAC1BvB,SAASsB,WAAWE,gBAAgB,EACpCxB,SAASsB,WAAWG,aAAa,CACrC,CAMAC,qBACI,IAAIC,gCACR,CAMAC,gBAEI,IAAMC,EAAQ7B,SAAS8B,gBACjBC,EAAO/B,SAAS+B,KAGhBC,EAAa,CACfC,YAAaJ,EAAMI,YACnBC,iBAAkBH,EAAKI,aACvBC,gBAAiBP,EAAMM,aACvBE,iBAAkBN,EAAKO,aACvBC,gBAAiBV,EAAMS,aACvBE,iBAAkBT,EAAKU,aACvBC,gBAAiBb,EAAMY,aACvBE,eAAgBd,EAAMe,WAC1B,EAEA,OAAOC,KAAKC,UAAU,CAClBC,UAAWf,EAAWC,YACtBe,WAAYrD,KAAKsD,IACbjB,EAAWE,iBAAkBF,EAAWI,gBACxCJ,EAAWK,iBAAkBL,EAAWO,gBACxCP,EAAWQ,iBAAkBR,EAAWU,eAC5C,EACAQ,aAAclB,EAAWW,eACzBQ,cAAenB,EAAWU,eAC9B,CAAC,CACL,CAMAU,yBACS7D,kBAAkBD,MAAM,sBAAsB,GAAMC,kBAAkBD,MAAM,eAAe,GAC5FwB,KAAKD,qBAAqB,CAElC,CAMAA,uBACI,GACKtB,CAAAA,kBAAkBD,MAAM,eAAe,GAAKC,CAAAA,kBAAkBG,IAAI,eAAe,GACjFH,CAAAA,kBAAkBD,MAAM,sBAAsB,GAAKC,CAAAA,kBAAkBG,IAAI,sBAAsB,GAE5D,WAAhCgB,SAASC,oBAC+B0C,KAAAA,IAAxCC,YAAY,sBAAsB,GACDD,KAAAA,IAAjCC,YAAY,eAAe,EANnC,CAaAC,IAAIC,EAAQC,eAAe,EAG3B,GAFA/C,SAASgD,eAAiB,GAEP,EAAfF,EAAMG,OACN,IAAKJ,IAAIK,EAAI,EAAGA,EAAIJ,EAAMG,OAAQC,CAAC,GAAI,CAEnC,IAAMC,EAAoBL,EAAMI,GAAGE,iBAAiB,gBAAgB,EACpE,IAAKP,IAAIK,EAAI,EAAGA,EAAIC,EAAkBF,OAAQC,CAAC,GACT,WAA9BC,EAAkBD,GAAGG,OAErBrD,SAASgD,eAAeM,KAAKH,EAAkBD,EAAE,EAEjDK,2BAA2BJ,EAAkBD,GAAI,QAASM,yBAAyB,EACnFD,2BAA2BJ,EAAkBD,GAAI,QAASO,kBAAkB,EAGxF,CAlBJ,CAoBJ,CACJ,OAOMxC,iCACFyC,YAAcpE,SAASqE,cAAc,MAAM,EAC3CC,gBAAkBtE,SAASwD,MAI3Be,cACIzD,KAAKW,aAAa,CACtB,CAKAA,eACIX,KAAKsD,YAAYlD,iBAAiB,QAAS,IACvCJ,KAAK0D,oBAAoBC,EAAO,WAAW,CAC/C,CAAC,EAED3D,KAAKsD,YAAYlD,iBAAiB,UAAW,IAErB,SADClB,SAAS0E,aAAa,EAAEX,KAAKlE,SAAS,GAEvDiB,KAAK6D,YAAY,CAEzB,CAAC,EAED7D,KAAKsD,YAAYlD,iBAAiB,YAAa,IAC3CJ,KAAK0D,oBAAoBC,EAAO,oBAAoB,CACxD,CAAC,CACL,CAOAD,oBAAoBC,EAAOG,GACvBrB,IAAIsB,EACJ,IAAKtB,IAAIK,EAAI,EAAGA,EAAI9C,KAAKwD,gBAAgBX,OAAQC,CAAC,GAK1CiB,EAHgC,EAAhCJ,EAAMK,OAAOC,UAAUpB,QACoB,EAA3C7C,KAAKwD,gBAAgBV,GAAGoB,UAAUrB,OAEpB7C,KAAKwD,gBAAgBV,GAAGoB,UAAUC,QAAQR,EAAMK,OAAOC,SAAS,EAEhE,CAAC,EAIvB,OAAQH,GACR,IAAK,YACGC,EAAc,GACd/D,KAAKoE,UAAU,EAEnB,MACJ,IAAK,qBACiB,CAAC,EAAfL,GACA/D,KAAKqE,mBAAmB,CAKhC,CACJ,CAKAD,YACQlF,SAASoF,6BACLpF,SAASoF,6BAA6BC,OACtCrF,SAASoF,6BAA6BC,MAAM,GAE5CrF,SAASoF,6BAA6BC,OAAS,EAKvDrF,SAASoF,6BAA+B,CAACC,OAAQ,CAAC,CACtD,CAKAV,cACQ3E,SAASoF,6BACLpF,SAASoF,6BAA6BE,SACtCtF,SAASoF,6BAA6BE,QAAQ,GAE9CtF,SAASoF,6BAA6BE,SAAW,EAKzDtF,SAASoF,6BAA+B,CAACE,SAAU,CAAC,CACxD,CAKAH,qBACSnF,SAASoF,+BACVpF,SAASoF,6BAA+B,IAEvCpF,SAASoF,6BAA6BG,2BACvCvF,SAASoF,6BAA6BG,yBAA2B,CAAA,GAGrEvF,SAASoF,6BAA6BG,yBAA2B,CAAA,CACrE,CACJ,OAkBMhE,WACFiE,UAAY,CACRC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,WAAY,EACZC,kBAAmB,EACnBC,iBAAkB,EAClBC,UAAW,EACXC,WAAY,CAChB,EAEAC,OAAShG,SAAS8D,iBAAiB,wBAAwB,EAE3DmC,KAAO,GAKPzE,kBACmB0E,MAAMC,UAAUC,MAAMC,KAAKvF,KAAKkF,MAAM,EAC5CM,QAAQ,CAACC,EAAO3C,KACrB9C,KAAKmF,KAAKjC,KAAKwC,OAAOC,OAAO,GAAI3F,KAAK0E,SAAS,CAAC,CACpD,CAAC,CACL,CAKA/D,eACIX,KAAKkF,OAAOM,QAAQ,CAACC,EAAO3C,KACxB2C,EAAMrF,iBAAiB,QAAS,KAC5BJ,KAAKmF,KAAKrC,GAAG8B,YAAc,CAAA,CAC/B,CAAC,CACL,CAAC,EAED5E,KAAKkF,OAAOM,QAAQ,CAACC,EAAO3C,KACxB2C,EAAMrF,iBAAiB,iBAAkB,KACrCJ,KAAKmF,KAAKrC,GAAG6B,WAAa,CAAA,CAC9B,CAAC,CACL,CAAC,EAED3E,KAAKkF,OAAOM,QAAQ,CAACC,EAAO3C,KACxB2C,EAAMrF,iBAAiB,QAAS,KAC5BJ,KAAKmF,KAAKrC,GAAGmC,UAAU,GACvBxC,IACImD,EADAC,EAAO,CAAE,IAAIC,KAGe,IAA5B9F,KAAKmF,KAAKrC,GAAGmC,YACbjF,KAAKmF,KAAKrC,GAAGiC,iBAAmBc,EAChC7F,KAAKmF,KAAKrC,GAAGgC,kBAAoBe,IAIrCD,EAAeC,EAAO7F,KAAKmF,KAAKrC,GAAGiC,iBACH,IAA5B/E,KAAKmF,KAAKrC,GAAGmC,YACbjF,KAAKmF,KAAKrC,GAAGiC,iBAAmBc,EAChC7F,KAAKmF,KAAKrC,GAAGkC,UAAYY,GAIC,EAA1B5F,KAAKmF,KAAKrC,GAAGmC,aACbjF,KAAKmF,KAAKrC,GAAG+B,YAAchG,KAAKkH,IAAI/F,KAAKmF,KAAKrC,GAAGkC,UAAYY,CAAY,EACzE5F,KAAKmF,KAAKrC,GAAGiC,iBAAmBc,EAChC7F,KAAKmF,KAAKrC,GAAGkC,UAAYY,GAEjC,CAAC,CACL,CAAC,CACL,CACJ,CAGA,IAAMI,UAAW,IAAIF,MAAOG,QAAQ,EAChCC,sBAAwB,CAAA,EACxBC,YAAc,GACdC,mBAAqB,EACrBC,oBACAC,yBAIEC,mBAAqB,SAAgB5C,GACvClB,IAAI+D,EAAe3H,KAAK4H,OAAM,IAAIX,MAAOG,QAAQ,EAAI,GAAI,EACzDS,YAAY,mBAAoBF,CAAY,EAC5CG,uBAAuB,CAC3B,EAKA,SAASC,kBACLC,2BAA2B3H,SAAU,YAAa4H,mBAAmB,EACrEC,cAAcV,mBAAmB,EACjCU,cAAcT,wBAAwB,CAC1C,CAII1G,SAASoH,kBAETX,oBAAsBY,YAAY,WAC9Bf,sBAAwB,CAAA,CAC5B,EAAG,GAAG,EAGNI,yBAA2BW,YAAY,WACnCP,YAAY,kBAAmB3E,KAAKC,UAAUmE,WAAW,CAAC,CAC9D,EAAG,IAAI,GAIX,IAAMW,oBAAsB,SAAgBnD,GACxCuD,gBAAgB,EACc,CAAA,IAA1BhB,wBACAC,YAAYjD,KAAK,CACbrE,KAAKsI,MAAMxD,EAAMyD,OAAO,EACxBvI,KAAKsI,MAAMxD,EAAM0D,OAAO,EACxBxI,KAAKsI,OAAM,IAAIrB,MAAOG,QAAQ,EAAID,QAAQ,EAC7C,EAEDI,kBAAkB,GAClBF,sBAAwB,CAAA,EACE,IAAtBE,qBACAQ,gBAAgB,CAG5B,EAKA,SAASD,yBACLE,2BAA2B3H,SAAU,YAAaqH,kBAAkB,EACpEM,2BAA2B3H,SAAU,UAAWqH,kBAAkB,CACtE,CAKA,SAASe,mBACE7I,kBAAkBD,MAAM,iBAAiB,GAAOC,kBAAkBG,IAAI,iBAAiB,IAC1F8H,YAAY,kBAAmB,MAAM,EACrCjI,kBAAkBC,IAAI,kBAAmB,CAAA,CAAI,GAGb,WAAhCkB,SAASC,oBAC0B0C,KAAAA,IAAnCC,YAAY,iBAAiB,GAE7BkE,YAAY,kBAAmB,MAAM,CAE7C,CAKA,SAASQ,kBACEzI,kBAAkBD,MAAM,gBAAgB,GAAOC,kBAAkBG,IAAI,gBAAgB,IACxF8H,YAAY,iBAAkB,MAAM,EACpCjI,kBAAkBC,IAAI,iBAAkB,CAAA,CAAI,GAGZ,WAAhCkB,SAASC,oBACyB0C,KAAAA,IAAlCC,YAAY,gBAAgB,GAE5BkE,YAAY,iBAAkB,MAAM,CAE5C,CAOA,SAASa,sBAAsBC,EAAWC,GACtC,GAAuC,KAAA,IAA5B7H,SAASgD,gBAAmE,EAAjChD,SAASgD,eAAeC,OAC1E,IAAKJ,IAAIK,EAAI,EAAGA,EAAIlD,SAASgD,eAAeC,OAAQC,CAAC,GACjD+D,2BAA2BjH,SAASgD,eAAeE,GAAI0E,EAAWC,CAAY,CAG1F,CAEAhF,IAAIW,0BAA4B,SAAgBO,GAC5C+D,qBAAqB,EACrBH,sBAAsB,QAASnE,yBAAyB,CAC5D,EAEIC,mBAAqB,SAAgBM,GACrCgE,cAAc,EACdJ,sBAAsB,QAASlE,kBAAkB,CACrD,EAKA,SAASqE,uBACEjJ,kBAAkBD,MAAM,sBAAsB,GAAOC,kBAAkBG,IAAI,sBAAsB,GACpGH,kBAAkBC,IAAI,uBAAwB,CAAA,CAAI,GAKV,WAAhCkB,SAASC,oBAC+B0C,KAAAA,IAAxCC,YAAY,sBAAsB,GAEN,gBAAhC5C,SAASC,oBAGuB,SAAhCD,SAASC,qBAEiC,KAAA,IAA/BD,SAASgI,mBACgBrF,KAAAA,IAA/B3C,SAASgI,mBAAmChI,SAASgI,qBAI9DlB,YAAY,uBAAwB,MAAM,CAElD,CAKA,SAASiB,gBACElJ,kBAAkBD,MAAM,eAAe,GAAOC,kBAAkBG,IAAI,eAAe,GACtFH,kBAAkBC,IAAI,gBAAiB,CAAA,CAAI,GAKH,WAAhCkB,SAASC,oBACwB0C,KAAAA,IAAjCC,YAAY,eAAe,GAEC,gBAAhC5C,SAASC,oBAGuB,SAAhCD,SAASC,qBAEiC,KAAA,IAA/BD,SAASgI,mBACgBrF,KAAAA,IAA/B3C,SAASgI,mBAAmChI,SAASgI,qBAI9DlB,YAAY,gBAAiB,MAAM,CAE3C,CAaA,SAASmB,wBAAwBC,EAAgB,IAC7CrF,IAAIsF,EAAiB,GAErBA,EAAeC,kBAAoBxF,YAAYyF,kBAAkBC,aAAe,mBAAmB,EACnGH,EAAeI,wBAA0B3F,YAAYyF,kBAAkBC,aAAe,yBAAyB,EAC/GH,EAAeK,WAAa5F,YAAYyF,kBAAkBC,aAAe,YAAY,EACrFH,EAAeM,iBAAmB7F,YAAYyF,kBAAkBC,aAAe,kBAAkB,EACjGH,EAAeO,gBAAkB9F,YAAYyF,kBAAkBC,aAAe,iBAAiB,EAC/FH,EAAeQ,gBAAkB/F,YAAYyF,kBAAkBC,aAAe,iBAAiB,EAC/FH,EAAeS,eAAiBhG,YAAYyF,kBAAkBC,aAAe,gBAAgB,EAC7FH,EAAeU,YAAcjG,YAAYyF,kBAAkBC,aAAe,aAAa,EAGvF,IAAMQ,EAA2BjK,kBAAkBG,IAAIqJ,kBAAkBC,aAAe,gBAAgB,EAClGS,EAA4BlK,kBAAkBG,IAAIqJ,kBAAkBC,aAAe,iBAAiB,EACpGU,EAA4BnK,kBAAkBG,IAAIqJ,kBAAkBC,aAAe,iBAAiB,EACpGW,EAAgBpK,kBAAkBG,IAAI,iBAAiB,EACvDkK,EAAmBvK,oBAAoBK,IAAI,oBAAoB,EAC/DmK,EAAmBxK,oBAAoBK,IAAI,oBAAoB,EAC/DoK,EAAyBvK,kBAAkBG,IAAIqJ,kBAAkBC,aAAe,cAAc,EAC9Fe,EAAaxK,kBAAkBG,IAAIqJ,kBAAkBC,aAAe,iBAAiB,EACrFgB,EAAgBzK,kBAAkBG,IAAIqJ,kBAAkBC,aAAe,gBAAgB,EACvFiB,EAA+B1K,kBAAkBG,IACnDqJ,kBAAkBC,aAAe,mCACrC,EAGMkB,EAAqB5G,YAAYyF,kBAAkBC,aAAe,gBAAgB,EAClFmB,EAAsB7G,YAAYyF,kBAAkBC,aAAe,iBAAiB,EACpFoB,EAAsB9G,YAAYyF,kBAAkBC,aAAe,iBAAiB,EACpFqB,EAAoB/G,YAAYyF,kBAAkBC,aAAe,iBAAiB,EAClFsB,EAAsB,CAAC,CAAChH,YAAYyF,kBAAkBC,aAAe,gBAAgB,EA8B3F,GA3BAH,EAAe0B,eAA8ClH,KAAAA,IAA7BmG,EAC5BA,EAA2BU,EAC/BrB,EAAe2B,gBAAgDnH,KAAAA,IAA9BoG,EAC7BA,EAA4BU,EAChCtB,EAAe4B,gBAAgDpH,KAAAA,IAA9BqG,EAC7BA,EAA4BU,EAChCvB,EAAe6B,gBAAiCrH,KAAAA,IAAf0G,EAC7BA,EAAaM,EACjBxB,EAAe8B,eAAmCtH,KAAAA,IAAlB2G,EAC5BA,EAAgBM,EACpBzB,EAAe+B,kCAAqEvH,KAAAA,IAAjC4G,EAC/CA,EAA+B,GAC/BpB,EAAe6B,iBAA6D,UAA1C,OAAO7B,EAA8B,iBACnEA,EAAe6B,gBAAgBzF,QAAQ,QAAQ,IAC/C4D,EAAe6B,gBAAkBG,mBAAmBhC,EAAe6B,eAAe,GAI1F7B,EAAeiC,gBAAkBnB,EACjCd,EAAekC,mBAAqBnB,EACpCf,EAAemC,mBAAqBnB,EACpChB,EAAeoC,mBAAqBnB,EAE/BjB,EAAe6B,kBAChB7B,EAAe6B,gBAAkBhK,SAASwK,YAGf,UAA3B,OAAO,EACP,IAAK3H,IAAIK,EAAI,EAAGA,EAAIgF,EAAcjF,OAAQ,EAAEC,EACF,UAAjC,OAAQgF,EAAchF,GAAG,GAE1BiF,EAAeD,EAAchF,GAAG,GAAG,IAAMgF,EAAchF,GAAG,GAAG,GAE7DiF,EAAeD,EAAchF,GAAG,IAAMgF,EAAchF,GAAG,QAI/DuH,QAAQC,IAAI,+CAA+C,EAO/D,OAHAvC,EAAiBwC,yBAAyBxC,CAAc,EAGjDhG,KAAKC,UAAU+F,CAAc,CACxC,CAKA,SAASyC,gBACL,OAA+B,KAA3B5K,SAAS6K,gBAA0E,KAAjD7K,SAAS8K,wCAIxC,CAAC9K,SAAS+K,gBACoB,SAAhC/K,SAASC,oBAAyF,IAAxDX,SAAS8D,iBAAiB,iBAAiB,EAAEH,QACvD,gBAAhCjD,SAASC,oBAAgG,IAAxDX,SAAS8D,iBAAiB,iBAAiB,EAAEH,OACvG,CAMA,SAAS+H,cAAcC,GACnB,GAA+B,KAA3BjL,SAAS6K,gBAA0E,KAAjD7K,SAAS8K,qCAC3C,MAAO,CAAA,EAGX,IAEYI,EAHZpE,YAAY,kBAAmBmE,CAAQ,EAClCL,cAAc,GACRtL,CAAAA,SAAS6L,eAAe,aAAa,KACpCD,EAAc5L,SAAS8L,cAAc,KAAK,GAClCC,aAAa,MAAO,iBAAiB,EACjDH,EAAYG,aAAa,QAAS,iBAAiB,EACnDH,EAAYG,aAAa,KAAM,aAAa,EAC5CH,EAAYG,aAAa,QAAS,+BAA+B,EACjEH,EAAYG,aAAa,MAAOJ,CAAQ,EACxCK,MAAM,MAAM,EAAEC,OAAOL,CAAW,EAG5C,CAMA,SAASM,8BAA8BP,GACnC,GAA+B,KAA3BjL,SAAS6K,gBAA0E,KAAjD7K,SAAS8K,qCAC3C,MAAO,CAAA,EAEX,IAEYI,EAFPN,cAAc,GACRtL,CAAAA,SAAS6L,eAAe,aAAa,KACpCD,EAAc5L,SAAS8L,cAAc,KAAK,GAClCC,aAAa,MAAO,iBAAiB,EACjDH,EAAYG,aAAa,QAAS,iBAAiB,EACnDH,EAAYG,aAAa,KAAM,aAAa,EAC5CH,EAAYG,aAAa,QAAS,+BAA+B,EACjEH,EAAYG,aAAa,MAAOlB,mBAAmBc,CAAQ,CAAC,EAC5DK,MAAM,MAAM,EAAEC,OAAOL,CAAW,EAG5C,CAOA,SAASO,gBACL,GAA+B,KAA3BzL,SAAS6K,gBAA0E,KAAjD7K,SAAS8K,qCAC3C,MAAO,CAAA,EAIXjI,IAAI6I,EAAuB7M,kBAAkBG,IAAI,iBAAiB,EAClE,GAA8B,CAAA,IAAzB0M,EAAiC,CAClC,GAAO7M,kBAAkB8M,QAAQ,kBAAmB,KAAQ,EAKxD,OADAH,KAAAA,8BAA8BE,CAAoB,EAHlD7M,kBAAkBqB,OAAO,iBAAiB,CAMlD,CAE2C,SAAtCmI,kBAAkBuD,gBACnBC,sBACI,sBACA,CACIC,OAAQ,OACRC,SAAU,SAASC,GACXA,IACmB,UAAlB,OAAOA,GAAuBA,aAAkBC,SAAuC,IAA5BD,EAAOzH,QAAQ,OAAO,IAE3E1F,kBAAkBG,IAAI,iBAAiB,IAE1CH,kBAAkBC,IAAI,kBAAmBkN,CAAM,EAE/CE,oCAAoC,GAGxClB,cAAcgB,CAAM,EAE5B,CACJ,CACJ,EAGAG,sBACI,CACIC,OAAQ,qBACZ,EACA,CACIC,QAAS,CAAA,EACTN,SAAU,SAASC,GACXA,IACmB,UAAlB,OAAOA,GAAuBA,aAAkBC,SAAuC,IAA5BD,EAAOzH,QAAQ,OAAO,IAE3E1F,kBAAkBG,IAAI,iBAAiB,IAE1CH,kBAAkBC,IAAI,kBAAmBkN,CAAM,EAE/CE,oCAAoC,GAGxClB,cAAcgB,CAAM,EAE5B,EACAM,WAAY,SAASC,GACjBA,EAAIC,iBAAiB,eAAgB,mBAAmB,CAC5D,CACJ,CACJ,CAER,CAGA,SAASC,0BAA0BC,GAE/B5F,YAAY,kBAAmB4F,CAAY,CAC/C,CAUA,SAASjM,sBAAsBsD,IAC1B,oBAAsBA,EAAM4I,cACzBC,kBAAkCC,yBAAhB9I,EAAMK,MAAM,CACtC,CAUA,SAAS1D,aAAaqD,IACjB,0BAA4BA,EAAM+I,WAAe,SAAU/I,EACtB8I,wBAAlCD,mBAA0D7I,EAAMK,MAAM,CAC9E,CAWA,SAASwI,kBAAkBG,GACvB,IAGIhJ,EAHAgJ,EAAQC,aAAa,eAAe,IACxCD,EAAQ1B,aAAa,gBAAiB,EAAE,EAEpCtH,EAAQ,IAAIxD,OAAO0M,YAAY,iBAAkB,CACjDC,QAAS,CAAA,EAAMC,WAAY,CAAA,EAAMC,OAAQ,IAC7C,CAAC,EAGIL,EAAQM,cAActJ,CAAK,KAC5BgJ,EAAQO,MAAQ,GAExB,CAWA,SAAST,wBAAwBE,GACxBA,EAAQC,aAAa,eAAe,IACzCD,EAAQQ,gBAAgB,eAAe,EAGvCR,EAAQM,cAAc,IAAI9M,OAAO0M,YAAY,iBAAkB,CAC3DC,QAAS,CAAA,EAAMC,WAAY,CAAA,EAAOC,OAAQ,IAC9C,CAAC,CAAC,EACN,CAKA,SAASlB,sCACL,GAAoC,SAAhClM,SAASC,mBAAb,CAIA4C,IAAIC,EAAQC,eAAe,EAE3B,GAAID,EACA,IAAMD,IAAIK,EAAI,EAAGA,EAAIJ,EAAMG,OAAQC,CAAC,GAChC,GAAK,EAAA,IAAIsK,cAAeC,4BAA4BnO,SAASwD,MAAMI,GAAI,WAAW,IAKjC,OAA7C5D,SAASwD,MAAMI,GAAGwK,aAAa,QAAQ,GACoB,SAA3DpO,SAASwD,MAAMI,GAAGwK,aAAa,QAAQ,EAAEC,YAAY,GAAc,CAEnE9K,IAAIyC,EAASxC,EAAMI,GAAGE,iBAAiB,4BAA4B,EACnE,IAAMP,IAAI+K,EAAI,EAAGA,EAAItI,EAAOrC,OAAQ2K,CAAC,GACjCtI,EAAOsI,GAAGvJ,UAAY,GAG1B/E,SAASwD,MAAMI,GAAGqI,QAAO,IAAIsC,iBAAkBC,6BAA6B,CAAC,CACjF,CApBR,CAuBJ,CApUI9N,SAASoH,kBACT7D,2BAA2BjE,SAAU,YAAa4H,mBAAmB,EACrE3D,2BAA2BjE,SAAU,YAAaqH,kBAAkB,EACpEpD,2BAA2BjE,SAAU,UAAWqH,kBAAkB,EAClEpD,2BAA2BjE,SAAU,SAAUoI,gBAAgB"} \ No newline at end of file diff --git a/js/src/public-1-functions.js b/js/src/public-1-functions.js index a6a5abfea..5e27ff3f7 100644 --- a/js/src/public-1-functions.js +++ b/js/src/public-1-functions.js @@ -2,7 +2,7 @@ * Set init params */ // eslint-disable-next-line no-unused-vars,require-jsdoc -function initParams() { +function initParams(gatheringLoaded) { const ctDate = new Date(); const headless = navigator.webdriver; const screenInfo = ( @@ -81,6 +81,10 @@ function initParams() { initCookies.push(['ct_checkjs', 0]); } + if (gatheringLoaded) { + initCookies.push(['ct_gathering_loaded', gatheringLoaded]); + } + ctSetCookie(initCookies); } diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index a331c7f2b..6181b3173 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -85,13 +85,14 @@ class ApbctEventTokenTransport { class ApbctAttachData { /** * Attach hidden fields to forms + * @param {bool} gatheringLoaded * @return {void} */ - attachHiddenFieldsToForms() { + attachHiddenFieldsToForms(gatheringLoaded) { if (typeof ctPublic.force_alt_cookies == 'undefined' || (ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies) ) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { ctNoCookieAttachHiddenFieldsToForms(); document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms); } @@ -554,7 +555,10 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -568,7 +572,10 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!+ctPublic.settings__data__bot_detector_enabled) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -623,7 +630,10 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -921,7 +931,10 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -988,7 +1001,10 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -1000,7 +1016,10 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { @@ -1448,18 +1467,100 @@ class ApbctMailpoetVisibleFields extends ApbctVisibleFieldsExtractor { } } +/** + * Additional function to calculate realpath of cleantalk's scripts + * @return {*|null} + */ +function getApbctBasePath() { + // Find apbct-public-bundle in scripts names + const scripts = document.getElementsByTagName('script'); + + for (let script of scripts) { + if (script.src && script.src.includes('apbct-public-bundle')) { + // Get path from `src` js + const match = script.src.match(/^(.*\/js\/)/); + if (match && match[1]) { + return match[1]; // Path exists, return this + } + } + } + + return null; // cleantalk's scripts not found :( +} + +/** + * Load any script into the DOM (i.e. `import()`) + * @param {string} scriptAbsolutePath + * @return {Promise<*|boolean>} + */ +async function apbctImportScript(scriptAbsolutePath) { + // Check it this scripti already is in DOM + const normalizedPath = scriptAbsolutePath.replace(/\/$/, ''); // Replace ending slashes + const scripts = document.querySelectorAll('script[src]'); + for (const script of scripts) { + const scriptSrc = script.src.replace(/\/$/, ''); + if (scriptSrc === normalizedPath) { + // Script already loaded, skipping + return true; + } + } + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + + script.src = scriptAbsolutePath; + script.async = true; + + script.onload = function() { + // Gathering data script loaded successfully + resolve(true); + }; + + script.onerror = function() { + // Failed to load Gathering data script from `scriptAbsolutePath` + reject(new Error('Script loading failed: ' + scriptAbsolutePath)); + }; + + document.head.appendChild(script); + }).catch((error) => { + // Gathering data script loading failed, continuing without it + return false; + }); +} + /** * Ready function */ // eslint-disable-next-line camelcase,require-jsdoc -function apbct_ready() { +async function apbct_ready() { new ApbctShowForbidden().prepareBlockForAjaxForms(); + // Try to get gathering if no worked bot-detector + let gatheringLoaded = false; + + if ( + apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit + +ctPublic.settings__data__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 + ) { + const basePath = getApbctBasePath(); + if ( ! basePath ) { + // We are here because NO any cleantalk bundle script are in frontend: Todo nothing + } else { + const gatheringScriptName = 'public-2-gathering-data.min.js'; + const gatheringFullPath = basePath + gatheringScriptName; + gatheringLoaded = await apbctImportScript(gatheringFullPath); + } + } + const handler = new ApbctHandler(); handler.detectForcedAltCookiesForms(); // Gathering data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') { + if ( + ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) && + typeof ApbctGatheringData !== 'undefined' + ) { const gatheringData = new ApbctGatheringData(); gatheringData.setSessionId(); gatheringData.writeReferrersToSessionStorage(); @@ -1471,7 +1572,7 @@ function apbct_ready() { // Always call initParams to set cookies and parameters if (typeof initParams === 'function') { try { - initParams(); + initParams(gatheringLoaded); } catch (e) { console.log('initParams error:', e); } @@ -1487,9 +1588,9 @@ function apbct_ready() { const attachData = new ApbctAttachData(); - // Attach data when bot detector is disabled - if (!+ctPublic.settings__data__bot_detector_enabled) { - attachData.attachHiddenFieldsToForms(); + // Attach data when bot detector is disabled or blocked + if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) { + attachData.attachHiddenFieldsToForms(gatheringLoaded); } for (let i = 0; i < document.forms.length; i++) { @@ -1519,7 +1620,7 @@ function apbct_ready() { let botDetectorEventTokenStored = false; window.addEventListener('botDetectorEventTokenUpdated', (event) => { const botDetectorEventToken = event.detail?.eventToken; - if ( botDetectorEventToken && ! botDetectorEventTokenStored ) { + if (botDetectorEventToken && !botDetectorEventTokenStored) { ctSetCookie([ ['ct_bot_detector_event_token', botDetectorEventToken], ]); @@ -1538,6 +1639,8 @@ function apbct_ready() { if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) { handler.toolForAntiCrawlerCheckDuringBotDetector(); } + + apbctLocalStorage.set('apbct_existing_visitor', 1); } if (ctPublic.data__key_is_ok) { diff --git a/lib/Cleantalk/ApbctWP/Variables/AltSessions.php b/lib/Cleantalk/ApbctWP/Variables/AltSessions.php index f1f116e71..3c455a887 100644 --- a/lib/Cleantalk/ApbctWP/Variables/AltSessions.php +++ b/lib/Cleantalk/ApbctWP/Variables/AltSessions.php @@ -34,6 +34,7 @@ class AltSessions 'apbct_antiflood_passed' => 'int', 'ct_sfw_pass_key' => 'string', 'ct_sfw_passed' => 'int', + 'ct_gathering_loaded' => 'bool', ]; public static function getID() From 71f14cf09249a9204aeabc9dc95800a7b834ee35 Mon Sep 17 00:00:00 2001 From: svfcode Date: Tue, 17 Feb 2026 11:55:57 +0300 Subject: [PATCH 55/60] upd flow --- .../ApbctWP/FindSpam/ListTable/BadUsers.php | 15 ++++++++------- .../ApbctWP/FindSpam/ListTable/Comments.php | 10 ++++++++-- .../ApbctWP/FindSpam/ListTable/Users.php | 5 +++++ lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php | 5 ++++- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/BadUsers.php b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/BadUsers.php index f7bc81b40..d0df4ba2e 100644 --- a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/BadUsers.php +++ b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/BadUsers.php @@ -111,13 +111,14 @@ public function column_ct_username($item) // phpcs:ignore PSR1.Methods.CamelCaps $column_content .= esc_html__('No IP adress', 'cleantalk-spam-protect'); } - $actions = array( - 'delete' => sprintf( - 'Delete', - htmlspecialchars(addslashes(TT::toString(Get::get('page')))), - 'delete', - $user_obj->ID - ) + $page = htmlspecialchars(addslashes(TT::toString(Get::get('page')))); + $delete_url = wp_nonce_url( + admin_url('users.php?page=' . $page . '&action=delete&spam=' . $user_obj->ID), + 'apbct_ct_check_users_row', + '_wpnonce' + ); + $actions = array( + 'delete' => 'Delete', ); return sprintf('%1$s %2$s', $column_content, $this->row_actions($actions)); diff --git a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Comments.php b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Comments.php index e9c16e94a..7565dafc3 100644 --- a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Comments.php +++ b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Comments.php @@ -304,7 +304,10 @@ public function moveToTrash($ids) { if ( ! empty($ids) ) { foreach ( $ids as $id ) { - delete_comment_meta((int)$id, 'ct_marked_as_spam'); + // Only act on comments that were marked as spam by CleanTalk + if ( ! delete_comment_meta((int)$id, 'ct_marked_as_spam') ) { + continue; + } $comment = get_comment((int)$id); if (is_int($comment) || $comment instanceof \WP_Comment) { wp_trash_comment($comment); @@ -317,7 +320,10 @@ public function moveToSpam($ids) { if ( ! empty($ids) ) { foreach ( $ids as $id ) { - delete_comment_meta((int)$id, 'ct_marked_as_spam'); + // Only act on comments that were marked as spam by CleanTalk + if ( ! delete_comment_meta((int)$id, 'ct_marked_as_spam') ) { + continue; + } $comment = get_comment((int)$id); if (is_int($comment) || $comment instanceof \WP_Comment) { wp_spam_comment($comment); diff --git a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Users.php b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Users.php index 341424c90..f6ce5478e 100644 --- a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Users.php +++ b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/Users.php @@ -293,6 +293,11 @@ public function removeSpam($ids) foreach ( $ids as $id ) { $user_id = (int)sanitize_key($id); + // Only act on users that were marked as spam by CleanTalk + if ( ! delete_user_meta($user_id, 'ct_marked_as_spam') ) { + continue; + } + //Send feedback $hash = get_user_meta($user_id, 'ct_hash', true); if ( $hash ) { diff --git a/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php b/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php index 26745c64a..c50e65e1f 100644 --- a/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php +++ b/lib/Cleantalk/ApbctWP/WcSpamOrdersListTable.php @@ -322,12 +322,15 @@ private function removeSpam($ids) global $wpdb; $ids_sql_prepare = []; - foreach ( $ids as $id ) { $id = sanitize_key($id); $ids_sql_prepare[] = "'$id'"; } + if ( empty($ids_sql_prepare) ) { + return; + } + $ids_sql_prepare = implode(',', $ids_sql_prepare); $wpdb->query( From f3da2f92437cea318707db9262a869dfdb1882e8 Mon Sep 17 00:00:00 2001 From: Viktor Date: Tue, 17 Feb 2026 16:04:46 +0300 Subject: [PATCH 56/60] Fix. Connection reports. Email for reports fixed. (#736) * Fix. Connection reports. Email for reports fixed. * Fix. Connection reports. Remote call connection reports dates fixed. * Fix. Connection reports. RC link removed. * Fix. Connection reports. Dates in reports fixed. --- inc/cleantalk-settings.php | 2 +- lib/Cleantalk/ApbctWP/ConnectionReports.php | 31 +++---------------- .../ApbctWP/Firewall/SFWUpdateSentinel.php | 13 +------- lib/Cleantalk/ApbctWP/JsErrorsReport.php | 2 +- 4 files changed, 7 insertions(+), 41 deletions(-) diff --git a/inc/cleantalk-settings.php b/inc/cleantalk-settings.php index ed0a9cd91..f3fee95bd 100644 --- a/inc/cleantalk-settings.php +++ b/inc/cleantalk-settings.php @@ -928,7 +928,7 @@ function apbct_settings__set_fields() . __(' - connection status to ' . $apbct->data["wl_brandname_short"] . ' cloud during Anti-Spam request', 'cleantalk-spam-protect') . $send_connection_reports__sfw_text . '
' - . sprintf(esc_html__('The reports are to be sent to %s'), $apbct->data['wl_support_email']) + . sprintf(esc_html__('The reports are to be sent to %s'), 'pluginreports@cleantalk.org') ), 'misc__async_js' => array( 'type' => 'checkbox', diff --git a/lib/Cleantalk/ApbctWP/ConnectionReports.php b/lib/Cleantalk/ApbctWP/ConnectionReports.php index dd61b7d51..51d0f6f1d 100644 --- a/lib/Cleantalk/ApbctWP/ConnectionReports.php +++ b/lib/Cleantalk/ApbctWP/ConnectionReports.php @@ -118,7 +118,7 @@ private function loadReportsDataFromDb() return; } - $sql = "SELECT * FROM " . $this->cr_table_name . " ORDER BY date;"; + $sql = "SELECT *, FROM_UNIXTIME(date) AS date, FROM_UNIXTIME(sent_on) AS sent_on FROM " . $this->cr_table_name . " ORDER BY date;"; $this->reports_data = TT::toArray($this->db->fetchAll($sql)); $this->reports_data_dirty = false; $this->unsent_reports_cache = null; // Invalidate cache @@ -357,7 +357,7 @@ private function prepareReportRow($key, $report) return '' . '' . Escape::escHtml((int)$key + 1) . '.' - . '' . Escape::escHtml(date('m-d-y H:i:s', $report_date)) . '' + . '' . Escape::escHtml($report_date) . '' . '' . Escape::escUrl($report_page_url) . '' . '' . Escape::escHtml($report_lib_report) . '' . '' . Escape::escHtml($report_failed_work_urls) . '' @@ -430,7 +430,7 @@ private function sendEmail(array $unsent_reports_ids, $is_cron_task = false) return false; } - $to = $apbct->data['wl_support_email']; + $to = 'pluginreports@cleantalk.org'; $subject = "Connection report for " . TT::toString(Server::get('HTTP_HOST')); $message = $this->prepareEmailContent($selection, $is_cron_task); @@ -451,8 +451,6 @@ private function sendEmail(array $unsent_reports_ids, $is_cron_task = false) */ private function prepareEmailContent(array $selection, $is_cron_task = false) { - global $apbct; - $stat_since = isset($this->reports_count['stat_since']) ? $this->reports_count['stat_since'] : ''; $total = isset($this->reports_count['total']) ? $this->reports_count['total'] : ''; $positive = isset($this->reports_count['positive']) ? $this->reports_count['positive'] : ''; @@ -481,7 +479,7 @@ private function prepareEmailContent(array $selection, $is_cron_task = false) foreach ($selection as $report) { $message .= '' . '' . (++$counter) . '.' - . '' . TT::toString(date('m-d-y H:i:s', $report['date'])) . '' + . '' . TT::toString($report['date']) . '' . '' . Escape::escUrl($report['page_url']) . '' . '' . Escape::escHtml($report['lib_report']) . '' . '' . Escape::escHtml($report['failed_work_urls']) . '' @@ -490,33 +488,12 @@ private function prepareEmailContent(array $selection, $is_cron_task = false) } $message .= '
'; - $message .= $this->prepareRemoteCallLink($apbct); $message .= '
' . ($is_cron_task ? 'This is a cron task.' : 'This is a manual task.') . '
'; $message .= ''; return $message; } - /** - * Prepare remote call link for email - * @param mixed $apbct - * @return string - */ - private function prepareRemoteCallLink($apbct) - { - $show_connection_reports_link = - (substr(get_option('home'), -1) === '/' ? get_option('home') : get_option('home') . '/') - . '?' - . http_build_query([ - 'plugin_name' => 'apbct', - 'spbc_remote_call_token' => md5($apbct->api_key), - 'spbc_remote_call_action' => 'debug', - 'show_only' => 'connection_reports', - ]); - - return 'Show connection reports with remote call'; - } - /** * Init reports sending * @param bool $is_cron_task Set if this is a cron task diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php index 8585022ff..0fcc76e96 100644 --- a/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php +++ b/lib/Cleantalk/ApbctWP/Firewall/SFWUpdateSentinel.php @@ -87,7 +87,7 @@ private function sendSentinelEmail() return false; } - $to = $apbct->data['wl_support_email']; + $to = 'pluginreports@cleantalk.org'; $subject = "SFW failed updates report for " . TT::toString(Server::get('HTTP_HOST')); $message = ' @@ -151,19 +151,8 @@ private function sendSentinelEmail() $last_fw_stats_html .= ''; - - $show_connection_reports_link = - substr(get_option('home'), -1) === '/' ? get_option('home') : get_option('home') . '/' - . '?' - . http_build_query([ - 'plugin_name' => 'apbct', - 'spbc_remote_call_token' => md5($apbct->api_key), - 'spbc_remote_call_action' => 'debug', - 'show_only' => 'connection_reports', - ]); $message .= '

Last FW stats:

'; $message .= '

' . $last_fw_stats_html . '

'; - $message .= 'Show connection reports with remote call'; $message .= '
'; $message .= '

This report is sent by cron task on: ' . current_time('m-d-y H:i:s') . '

'; diff --git a/lib/Cleantalk/ApbctWP/JsErrorsReport.php b/lib/Cleantalk/ApbctWP/JsErrorsReport.php index 3c884299a..d4772a963 100644 --- a/lib/Cleantalk/ApbctWP/JsErrorsReport.php +++ b/lib/Cleantalk/ApbctWP/JsErrorsReport.php @@ -21,7 +21,7 @@ public function sendEmail($is_cron_task = false) return false; } - $to = "support@cleantalk.org"; + $to = "pluginreports@cleantalk.org"; $subject = "JS errors report for " . TT::toString(Server::get('HTTP_HOST')); $message = ' From 8816c6a2b32538e05acf9975c9f211bf5e16a20c Mon Sep 17 00:00:00 2001 From: Viktor Date: Tue, 17 Feb 2026 16:26:49 +0300 Subject: [PATCH 57/60] Fix. Integration. SmartQuizBuilder integration fixed. (#735) * Fix. Integration. SmartQuizBuilder integration fixed. * Fix. Code. Code re-minified. --- js/apbct-public-bundle.min.js | 2 +- js/apbct-public-bundle_ext-protection.min.js | 2 +- ...lic-bundle_ext-protection_gathering.min.js | 2 +- js/apbct-public-bundle_full-protection.min.js | 2 +- ...ic-bundle_full-protection_gathering.min.js | 2 +- js/apbct-public-bundle_gathering.min.js | 2 +- js/apbct-public-bundle_int-protection.min.js | 2 +- ...lic-bundle_int-protection_gathering.min.js | 2 +- js/prebuild/apbct-public-bundle.js | 40 ++++++++++++++----- .../apbct-public-bundle_ext-protection.js | 40 ++++++++++++++----- ...-public-bundle_ext-protection_gathering.js | 40 ++++++++++++++----- .../apbct-public-bundle_full-protection.js | 40 ++++++++++++++----- ...public-bundle_full-protection_gathering.js | 40 ++++++++++++++----- js/prebuild/apbct-public-bundle_gathering.js | 40 ++++++++++++++----- .../apbct-public-bundle_int-protection.js | 40 ++++++++++++++----- ...-public-bundle_int-protection_gathering.js | 40 ++++++++++++++----- js/src/public-1-main.js | 10 +++-- .../Integrations/SmartQuizBuilder.php | 2 - 18 files changed, 263 insertions(+), 85 deletions(-) diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index f5c9ab167..b239355fc 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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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 c85c94766..650847cf7 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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.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(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.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(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),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 1991c38e9..2de18c58f 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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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 ad1295cc6..d623afd14 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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.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(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),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||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(r.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="";r.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=r.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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=u(n[1].body,d(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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__"]'),r=null,i=(null!==c&&null!==c.value&&(r=c.value),getCleanTalkStorageDataArray()),l=apbctLocalStorage.get("bot_detector_event_token");null===i&&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=i,null!==r&&(o.apbct_search_form__honeypot_value=r),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,r=this.findParentContainer(c);if(r){var i=this.getIdFromHTML(r);if(i===n){var l=r.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,c,r,i,l,s,d;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",u.imgPersonUrl),o.setAttribute("class","apbct-real-user-popup-img"),(a=document.createElement("div")).setAttribute("class","apbct-real-user-popup"),(i=document.createElement("strong")).append(u.phrases.trpHeading),(c=document.createElement("div")).setAttribute("class","apbct-real-user-popup-content_row"),c.setAttribute("style","white-space: nowrap"),(r=document.createElement("div")).append(i),r.append(" "),r.append(u.phrases.trpContent1),(i=document.createElement("div")).style.display="flex",i.style.gap="5px",(l=document.createElement("div")).append(u.phrases.trpContent2),i.append(l),p&&(l=document.createElement("div"),(s=document.createElement("a")).setAttribute("href",u.trpContentLink),s.setAttribute("target","_blank"),(d=document.createElement("img")).setAttribute("src",ctAdminCommon.new_window_gif),d.setAttribute("alt","New window"),d.setAttribute("style","padding-top:3px"),s.append(d),l.append(s),i.append(l)),c.append(r,i),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_gathering.min.js b/js/apbct-public-bundle_full-protection_gathering.min.js index 1ca65c7fc..f8ace5581 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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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 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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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 diff --git a/js/apbct-public-bundle_gathering.min.js b/js/apbct-public-bundle_gathering.min.js index 1dc51a809..6856bb608 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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6: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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6: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 8a2fe49f5..760d8353e 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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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=ApbctShadowRootConfig},[{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{try{return n[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,n)}})())?(e.p=4,n[1].body=d(n[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,n));case 6: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_int-protection_gathering.min.js b/js/apbct-public-bundle_int-protection_gathering.min.js index 29feec71b..f2aa4fe87 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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6: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=ApbctShadowRootConfig},[{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 r(){_classCallCheck(this,r)}return _createClass(r,[{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{try{return o[0].includes(new URL(ctPublicFunctions._rest_url).pathname+"metform/")}catch(e){return defaultFetch.apply(window,o)}})())?(e.p=4,o[1].body=d(o[1].body,u(+ctPublic.settings__data__bot_detector_enabled)),e.n=6):e.n=6;break;case 5:return e.p=5,e.a(2,defaultFetch.apply(window,o));case 6: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/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js index 4a456c09d..2db23e876 100644 --- a/js/prebuild/apbct-public-bundle.js +++ b/js/prebuild/apbct-public-bundle.js @@ -3022,7 +3022,6 @@ class ApbctHandler { let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; - let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3030,8 +3029,7 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup || - otterForm || - smartQuizBuilder; + otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3079,7 +3077,10 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3093,7 +3094,10 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3148,7 +3152,10 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3435,6 +3442,12 @@ class ApbctHandler { sourceSign.found = 'action=uael_register_user'; sourceSign.keepUnwrapped = true; } + if ( + settings.data.indexOf('action=SQBSubmitQuizAjax') !== -1 + ) { + sourceSign.found = 'action=SQBSubmitQuizAjax'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { @@ -3446,7 +3459,10 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3513,7 +3529,10 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3525,7 +3544,10 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js index 5e54627d2..b8c7a2c0a 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection.js +++ b/js/prebuild/apbct-public-bundle_ext-protection.js @@ -3022,7 +3022,6 @@ class ApbctHandler { let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; - let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3030,8 +3029,7 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup || - otterForm || - smartQuizBuilder; + otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3079,7 +3077,10 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3093,7 +3094,10 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3148,7 +3152,10 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3435,6 +3442,12 @@ class ApbctHandler { sourceSign.found = 'action=uael_register_user'; sourceSign.keepUnwrapped = true; } + if ( + settings.data.indexOf('action=SQBSubmitQuizAjax') !== -1 + ) { + sourceSign.found = 'action=SQBSubmitQuizAjax'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { @@ -3446,7 +3459,10 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3513,7 +3529,10 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3525,7 +3544,10 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js index 5f26e897a..cc0122cb6 100644 --- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js @@ -3022,7 +3022,6 @@ class ApbctHandler { let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; - let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3030,8 +3029,7 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup || - otterForm || - smartQuizBuilder; + otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3079,7 +3077,10 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3093,7 +3094,10 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3148,7 +3152,10 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3435,6 +3442,12 @@ class ApbctHandler { sourceSign.found = 'action=uael_register_user'; sourceSign.keepUnwrapped = true; } + if ( + settings.data.indexOf('action=SQBSubmitQuizAjax') !== -1 + ) { + sourceSign.found = 'action=SQBSubmitQuizAjax'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { @@ -3446,7 +3459,10 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3513,7 +3529,10 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3525,7 +3544,10 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js index 1d1c6dc6a..abab6ff61 100644 --- a/js/prebuild/apbct-public-bundle_full-protection.js +++ b/js/prebuild/apbct-public-bundle_full-protection.js @@ -3022,7 +3022,6 @@ class ApbctHandler { let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; - let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3030,8 +3029,7 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup || - otterForm || - smartQuizBuilder; + otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3079,7 +3077,10 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3093,7 +3094,10 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3148,7 +3152,10 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3435,6 +3442,12 @@ class ApbctHandler { sourceSign.found = 'action=uael_register_user'; sourceSign.keepUnwrapped = true; } + if ( + settings.data.indexOf('action=SQBSubmitQuizAjax') !== -1 + ) { + sourceSign.found = 'action=SQBSubmitQuizAjax'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { @@ -3446,7 +3459,10 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3513,7 +3529,10 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3525,7 +3544,10 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js index 66e4ee65b..9ecbc320f 100644 --- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js @@ -3022,7 +3022,6 @@ class ApbctHandler { let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; - let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3030,8 +3029,7 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup || - otterForm || - smartQuizBuilder; + otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3079,7 +3077,10 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3093,7 +3094,10 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3148,7 +3152,10 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3435,6 +3442,12 @@ class ApbctHandler { sourceSign.found = 'action=uael_register_user'; sourceSign.keepUnwrapped = true; } + if ( + settings.data.indexOf('action=SQBSubmitQuizAjax') !== -1 + ) { + sourceSign.found = 'action=SQBSubmitQuizAjax'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { @@ -3446,7 +3459,10 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3513,7 +3529,10 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3525,7 +3544,10 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js index bd90092a9..0b40c9833 100644 --- a/js/prebuild/apbct-public-bundle_gathering.js +++ b/js/prebuild/apbct-public-bundle_gathering.js @@ -3022,7 +3022,6 @@ class ApbctHandler { let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; - let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3030,8 +3029,7 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup || - otterForm || - smartQuizBuilder; + otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3079,7 +3077,10 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3093,7 +3094,10 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3148,7 +3152,10 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3435,6 +3442,12 @@ class ApbctHandler { sourceSign.found = 'action=uael_register_user'; sourceSign.keepUnwrapped = true; } + if ( + settings.data.indexOf('action=SQBSubmitQuizAjax') !== -1 + ) { + sourceSign.found = 'action=SQBSubmitQuizAjax'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { @@ -3446,7 +3459,10 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3513,7 +3529,10 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3525,7 +3544,10 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js index 87675a45c..5c870c8e5 100644 --- a/js/prebuild/apbct-public-bundle_int-protection.js +++ b/js/prebuild/apbct-public-bundle_int-protection.js @@ -3022,7 +3022,6 @@ class ApbctHandler { let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; - let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3030,8 +3029,7 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup || - otterForm || - smartQuizBuilder; + otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3079,7 +3077,10 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3093,7 +3094,10 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3148,7 +3152,10 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3435,6 +3442,12 @@ class ApbctHandler { sourceSign.found = 'action=uael_register_user'; sourceSign.keepUnwrapped = true; } + if ( + settings.data.indexOf('action=SQBSubmitQuizAjax') !== -1 + ) { + sourceSign.found = 'action=SQBSubmitQuizAjax'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { @@ -3446,7 +3459,10 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3513,7 +3529,10 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3525,7 +3544,10 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js index bddc1bc3b..22bd9d6e0 100644 --- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js +++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js @@ -3022,7 +3022,6 @@ class ApbctHandler { let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; - let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -3030,8 +3029,7 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup || - otterForm || - smartQuizBuilder; + otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -3079,7 +3077,10 @@ class ApbctHandler { if (isNeedToAddCleantalkDataCheckString) { let addidionalCleantalkData = ''; - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); addidionalCleantalkData += '&' + 'data%5Bct_no_cookie_hidden_field%5D=' + noCookieData; } else { @@ -3093,7 +3094,10 @@ class ApbctHandler { } if (isNeedToAddCleantalkDataCheckFormData) { - if (!(+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token'))) { + if (!( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + )) { let noCookieData = getNoCookieData(); body.append('ct_no_cookie_hidden_field', noCookieData); } else { @@ -3148,7 +3152,10 @@ class ApbctHandler { if ( args[1].body instanceof FormData || (typeof args[1].body.append === 'function') ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { args[1].body.append( 'ct_bot_detector_event_token', apbctLocalStorage.get('bot_detector_event_token'), @@ -3435,6 +3442,12 @@ class ApbctHandler { sourceSign.found = 'action=uael_register_user'; sourceSign.keepUnwrapped = true; } + if ( + settings.data.indexOf('action=SQBSubmitQuizAjax') !== -1 + ) { + sourceSign.found = 'action=SQBSubmitQuizAjax'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { @@ -3446,7 +3459,10 @@ class ApbctHandler { let eventToken = ''; let noCookieData = ''; let visibleFieldsString = ''; - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { const token = new ApbctHandler().toolGetEventToken(); if (token) { if (sourceSign.keepUnwrapped) { @@ -3513,7 +3529,10 @@ class ApbctHandler { options.data.requests[0].hasOwnProperty('path') && options.data.requests[0].path === '/wc/store/v1/cart/add-item' ) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { let token = localStorage.getItem('bot_detector_event_token'); options.data.requests[0].data.ct_bot_detector_event_token = token; } else { @@ -3525,7 +3544,10 @@ class ApbctHandler { // checkout if (options.path.includes('/wc/store/v1/checkout')) { - if (+ctPublic.settings__data__bot_detector_enabled && apbctLocalStorage.get('bot_detector_event_token')) { + if ( + +ctPublic.settings__data__bot_detector_enabled && + apbctLocalStorage.get('bot_detector_event_token') + ) { options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token'); } else { if (ctPublic.data__cookies_type === 'none') { diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js index 6181b3173..cdd662fc1 100644 --- a/js/src/public-1-main.js +++ b/js/src/public-1-main.js @@ -498,7 +498,6 @@ class ApbctHandler { let bloomPopup = document.querySelectorAll('div[class^="et_bloom_form_container"]').length > 0; let pafeFormsFormElementor = document.querySelectorAll('div[class*="pafe-form"]').length > 0; let otterForm = document.querySelectorAll('div [class*="otter-form"]').length > 0; - let smartQuizBuilder = document.querySelectorAll('form .sqbform, .fields_reorder_enabled').length > 0; ctPublic.force_alt_cookies = smartFormsSign || jetpackCommentsForm || userRegistrationProForm || @@ -506,8 +505,7 @@ class ApbctHandler { fluentBookingApp || pafeFormsFormElementor || bloomPopup || - otterForm || - smartQuizBuilder; + otterForm; setTimeout(function() { if (!ctPublic.force_alt_cookies) { @@ -920,6 +918,12 @@ class ApbctHandler { sourceSign.found = 'action=uael_register_user'; sourceSign.keepUnwrapped = true; } + if ( + settings.data.indexOf('action=SQBSubmitQuizAjax') !== -1 + ) { + sourceSign.found = 'action=SQBSubmitQuizAjax'; + sourceSign.keepUnwrapped = true; + } } if ( typeof settings.url === 'string' ) { if (settings.url.indexOf('wc-ajax=add_to_cart') !== -1) { diff --git a/lib/Cleantalk/Antispam/Integrations/SmartQuizBuilder.php b/lib/Cleantalk/Antispam/Integrations/SmartQuizBuilder.php index 17426604c..50790fdef 100644 --- a/lib/Cleantalk/Antispam/Integrations/SmartQuizBuilder.php +++ b/lib/Cleantalk/Antispam/Integrations/SmartQuizBuilder.php @@ -9,9 +9,7 @@ class SmartQuizBuilder extends IntegrationBase { public function getDataForChecking($argument) { - Cookie::$force_alt_cookies_global = true; $input_array = apply_filters('apbct__filter_post', $_POST); - $input_array['event_token'] = Cookie::getString('ct_bot_detector_event_token'); $data = ct_gfa_dto($input_array, $input_array['email'])->getArray(); $data['message'] = ''; return $data; From 94b37d6bc19ba95d4b395f2d9171bbe192e726f5 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Tue, 17 Feb 2026 20:41:18 +0700 Subject: [PATCH 58/60] upd changelog --- readme.txt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/readme.txt b/readme.txt index e8fa13844..849612552 100644 --- a/readme.txt +++ b/readme.txt @@ -412,6 +412,35 @@ Yes, it is. Please read this article, == Changelog == += 6.73 19.02.2026 = +* Upd. Code. SFW Update. HTTP multi request refactored. +* New. ShadowrootProtection. Implementation of form protection in Shadowroot elements, integration with Mailchimp shadowroot +* Mod. ShadowrootPrt. Architectural changes in logic, the addition of situational callbacks +* Fix. CurlMulti. Editing implementation comments +* Fix. Integration. Ninja forms. Filter NF common fields before processing. +* Fix. Exclusions. "woocommerce-abandoned-cart" +* Fix. Exclusions. "woo-abandoned-cart-recovery" +* Fix. Exclusions. "abandoned-cart-capture" +* Fix. Code. Returned the lost code during the merge +* Fix. FluentForm. Vendor integration compliance fixed. +* Upd. Integrations. Elementor UltimateAddons Register integration handler to use ajax middleware. +* Fix. IntegMailChimp. Clearing all fields except for the field whose name contains message +* Fix. Code. Edit Remote Calls +* Fix. AdminActions. Checking permissions for Actions +* Upd. Exclusions. Ajax. Plugin "wp-multi-step-checkout". +* Fix. Exclusions. Ajax. Plugin "woo-abandoned-cart-recovery". Fixed condition. +* Code. Unit tests for apbct_is_skip_request() refactored. +* Fix. Code. Escaping woocommerce order data +* Upd. Exclusions. Ajax. Plugin "woocommerce-sendinblue-newsletter-subscription" +* Fix. Remote Calls. Skip check if no sign of RC action provided in Request. +* Fix. Exclusion. Added path invoice4u/v1/callback. +* Fix. Contact Encoder. Every hook that has actions BEFORE modify now have actions AFTER. +* Fix. Enqueue. Script individual-disable-comments.js renamed to cleantalk-individual-disable-comments.js +* Upd. CommentsCheck. Improve statement. +* Upd. JS parameters. Gathering dynamic lod implemented. +* Fix. Connection reports. Email for reports fixed. +* Fix. Integration. SmartQuizBuilder integration fixed. + = 6.72 05.02.2026 = * Upd. WooCommSpamOrders. Added a hint for the disabled option to save spam orders. * Fix. Integrations. Fluent Forms. Visible fields collection fixed. From b02cf3d15180f02f9cc29996fb7b43b43d769642 Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 18 Feb 2026 17:03:24 +0700 Subject: [PATCH 59/60] Fix. ContentEncoder. Editing the data type in the 3rd str_replace argument --- .../ApbctWP/ContactsEncoder/Shortcodes/EncodeContentSC.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Cleantalk/ApbctWP/ContactsEncoder/Shortcodes/EncodeContentSC.php b/lib/Cleantalk/ApbctWP/ContactsEncoder/Shortcodes/EncodeContentSC.php index 787ce8a44..a77d7ff42 100644 --- a/lib/Cleantalk/ApbctWP/ContactsEncoder/Shortcodes/EncodeContentSC.php +++ b/lib/Cleantalk/ApbctWP/ContactsEncoder/Shortcodes/EncodeContentSC.php @@ -133,6 +133,8 @@ public function changeContentBeforeEncoderModify($content) public function changeContentAfterEncoderModify($content) { // Restore shortcodes + $content = $content === null ? '' : $content; + foreach ($this->shortcode_replacements as $placeholder => $original) { $content = str_replace($placeholder, $original, $content); } From 630da0ffe0cb1e48edd99b7b27586984a1a84aed Mon Sep 17 00:00:00 2001 From: AntonV1211 Date: Wed, 18 Feb 2026 17:05:24 +0700 Subject: [PATCH 60/60] Upd changelog --- readme.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 849612552..0f63d509f 100644 --- a/readme.txt +++ b/readme.txt @@ -439,7 +439,8 @@ Yes, it is. Please read this article, * Upd. CommentsCheck. Improve statement. * Upd. JS parameters. Gathering dynamic lod implemented. * Fix. Connection reports. Email for reports fixed. -* Fix. Integration. SmartQuizBuilder integration fixed. +* Fix. Integration. SmartQuizBuilder integration fixed. +* Fix. ContentEncoder. Editing the data type in the 3rd str_replace argument = 6.72 05.02.2026 = * Upd. WooCommSpamOrders. Added a hint for the disabled option to save spam orders.