FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
cleantalk-spam-protect
/
js
Edit File: public-2-gathering-data.min.js
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<e.length)for(let t=0;t<e.length;t++){var c=e[t].querySelectorAll("input,textarea");for(let t=0;t<c.length;t++)"hidden"!==c[t].type&&(ctPublic.handled_fields.push(c[t]),apbct_attach_event_handler(c[t],"focus",ctFunctionHasInputFocused),apbct_attach_event_handler(c[t],"keyup",ctFunctionHasKeyUp))}}}}class ApbctCollectingUserMouseActivity{elementBody=document.querySelector("body");collectionForms=document.forms;constructor(){this.setListeners()}setListeners(){this.elementBody.addEventListener("click",t=>{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.collectionForms.length;t++)c=0<e.target.outerHTML.length&&0<this.collectionForms[t].innerHTML.length?this.collectionForms[t].innerHTML.indexOf(e.target.outerHTML):-1;switch(t){case"addClicks":c<0&&this.addClicks();break;case"trackMouseMovement":-1<c&&this.trackMouseMovement()}}addClicks(){document.ctCollectingUserActivityData?document.ctCollectingUserActivityData.clicks?document.ctCollectingUserActivityData.clicks++:document.ctCollectingUserActivityData.clicks=1:document.ctCollectingUserActivityData={clicks:1}}addSelected(){document.ctCollectingUserActivityData?document.ctCollectingUserActivityData.selected?document.ctCollectingUserActivityData.selected++:document.ctCollectingUserActivityData.selected=1:document.ctCollectingUserActivityData={selected:1}}trackMouseMovement(){document.ctCollectingUserActivityData||(document.ctCollectingUserActivityData={}),document.ctCollectingUserActivityData.mouseMovementsInsideForm||(document.ctCollectingUserActivityData.mouseMovementsInsideForm=!1),document.ctCollectingUserActivityData.mouseMovementsInsideForm=!0}}class CTTypoData{fieldData={isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0};fields=document.querySelectorAll("textarea[name=comment]");data=[];gatheringFields(){Array.prototype.slice.call(this.fields).forEach((t,e)=>{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((t,e)=>{t.addEventListener("paste",()=>{this.data[e].isUseBuffer=!0})}),this.fields.forEach((t,e)=>{t.addEventListener("onautocomplete",()=>{this.data[e].isAutoFill=!0})}),this.fields.forEach((t,c)=>{t.addEventListener("input",()=>{this.data[c].countOfKey++;var t,e=+new Date;1===this.data[c].countOfKey?(this.data[c].lastKeyTimestamp=e,this.data[c].firstKeyTimestamp=e):(t=e-this.data[c].lastKeyTimestamp,2===this.data[c].countOfKey?(this.data[c].lastKeyTimestamp=e,this.data[c].lastDelta=t):2<this.data[c].countOfKey&&(this.data[c].speedDelta+=Math.abs(this.data[c].lastDelta-t),this.data[c].lastKeyTimestamp=e,this.data[c].lastDelta=t))})})}}let ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctMouseReadInterval,ctMouseWriteDataInterval,ctFunctionFirstKey=function(t){var e=Math.floor((new Date).getTime()/1e3);ctSetCookie("ct_fkp_timestamp",e),ctKeyStopStopListening()};function ctMouseStopData(){apbct_remove_event_handler(document,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}ctPublic.data__key_is_ok&&(ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200));let ctFunctionMouseMove=function(t){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(t.clientY),Math.round(t.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseDataCounter++,ctMouseEventTimerFlag=!1,50<=ctMouseDataCounter)&&ctMouseStopData()};function ctKeyStopStopListening(){apbct_remove_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(document,"keydown",ctFunctionFirstKey)}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0)),"native"===ctPublic.data__cookies_type&&void 0===ctGetCookie("ct_has_scrolled")&&ctSetCookie("ct_has_scrolled","true")}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0)),"native"===ctPublic.data__cookies_type&&void 0===ctGetCookie("ct_mouse_moved")&&ctSetCookie("ct_mouse_moved","true")}function ctStopFieldsListening(e,c){if(void 0!==ctPublic.handled_fields&&0<ctPublic.handled_fields.length)for(let t=0;t<ctPublic.handled_fields.length;t++)apbct_remove_event_handler(ctPublic.handled_fields[t],e,c)}let ctFunctionHasInputFocused=function(t){ctSetHasInputFocused(),ctStopFieldsListening("focus",ctFunctionHasInputFocused)},ctFunctionHasKeyUp=function(t){ctSetHasKeyUp(),ctStopFieldsListening("keyup",ctFunctionHasKeyUp)};function ctSetHasInputFocused(){apbctLocalStorage.isSet("ct_has_input_focused")&&apbctLocalStorage.get("ct_has_input_focused")||apbctLocalStorage.set("ct_has_input_focused",!0),("native"===ctPublic.data__cookies_type&&void 0===ctGetCookie("ct_has_input_focused")||"alternative"===ctPublic.data__cookies_type||"none"===ctPublic.data__cookies_type&&(void 0!==ctPublic.force_alt_cookies||void 0!==ctPublic.force_alt_cookies&&ctPublic.force_alt_cookies))&&ctSetCookie("ct_has_input_focused","true")}function ctSetHasKeyUp(){apbctLocalStorage.isSet("ct_has_key_up")&&apbctLocalStorage.get("ct_has_key_up")||apbctLocalStorage.set("ct_has_key_up",!0),("native"===ctPublic.data__cookies_type&&void 0===ctGetCookie("ct_has_key_up")||"alternative"===ctPublic.data__cookies_type||"none"===ctPublic.data__cookies_type&&(void 0!==ctPublic.force_alt_cookies||void 0!==ctPublic.force_alt_cookies&&ctPublic.force_alt_cookies))&&ctSetCookie("ct_has_key_up","true")}function getJavascriptClientData(e=[]){let c={};c.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),c.ct_checked_emails_exist=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails_exist"),c.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),c.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),c.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),c.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),c.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),c.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone");var t=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),o=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),i=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),a=apbctLocalStorage.get("apbct_page_hits"),s=apbctSessionStorage.get("apbct_prev_referer"),n=apbctSessionStorage.get("apbct_site_referer"),l=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_js_errors"),r=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),_=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"apbct_headless"),u=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_bot_detector_frontend_data_log"),d=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),p=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),b=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),g=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),m=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless");if(c.ct_mouse_moved=void 0!==t?t:d,c.ct_has_scrolled=void 0!==o?o:p,c.ct_cookies_type=void 0!==i?i:b,c.apbct_pixel_url=void 0!==r?r:g,c.apbct_headless=void 0!==_?_:m,c.ct_bot_detector_frontend_data_log=void 0!==u?u:"",c.apbct_pixel_url&&"string"==typeof c.apbct_pixel_url&&c.apbct_pixel_url.indexOf("%3A%2F")&&(c.apbct_pixel_url=decodeURIComponent(c.apbct_pixel_url)),c.apbct_page_hits=a,c.apbct_prev_referer=s,c.apbct_site_referer=n,c.apbct_ct_js_errors=l,c.apbct_pixel_url||(c.apbct_pixel_url=ctPublic.pixel__url),"object"==typeof e)for(let t=0;t<e.length;++t)"object"==typeof e[t][1]?c[e[t][1][0]]=e[t][1][1]:c[e[t][0]]=e[t][1];else console.log("APBCT JS ERROR: Collecting data type mismatch");return c=removeDoubleJsonEncoding(c),JSON.stringify(c)}function ctIsDrawPixel(){return("3"!=ctPublic.pixel__setting||"1"!=ctPublic.settings__data__bot_detector_enabled)&&(+ctPublic.pixel__enabled||"none"===ctPublic.data__cookies_type&&0===document.querySelectorAll("img#apbct_pixel").length||"alternative"===ctPublic.data__cookies_type&&0===document.querySelectorAll("img#apbct_pixel").length)}function ctSetPixelImg(t){if("3"==ctPublic.pixel__setting&&"1"==ctPublic.settings__data__bot_detector_enabled)return!1;var e;ctSetCookie("apbct_pixel_url",t),ctIsDrawPixel()&&!document.getElementById("apbct_pixel")&&((e=document.createElement("img")).setAttribute("alt","CleanTalk Pixel"),e.setAttribute("title","CleanTalk Pixel"),e.setAttribute("id","apbct_pixel"),e.setAttribute("style","display: none; left: 99999px;"),e.setAttribute("src",t),apbct("body").append(e))}function ctSetPixelImgFromLocalstorage(t){if("3"==ctPublic.pixel__setting&&"1"==ctPublic.settings__data__bot_detector_enabled)return!1;var e;ctIsDrawPixel()&&!document.getElementById("apbct_pixel")&&((e=document.createElement("img")).setAttribute("alt","CleanTalk Pixel"),e.setAttribute("title","CleanTalk Pixel"),e.setAttribute("id","apbct_pixel"),e.setAttribute("style","display: none; left: 99999px;"),e.setAttribute("src",decodeURIComponent(t)),apbct("body").append(e))}function ctGetPixelUrl(){if("3"==ctPublic.pixel__setting&&"1"==ctPublic.settings__data__bot_detector_enabled)return!1;var t=apbctLocalStorage.get("apbct_pixel_url");if(!1!==t){if(apbctLocalStorage.isAlive("apbct_pixel_url",10800))return void ctSetPixelImgFromLocalstorage(t);apbctLocalStorage.delete("apbct_pixel_url")}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(t){t&&("string"==typeof t||t instanceof String)&&0===t.indexOf("https")&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",t),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(t))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(t){t&&("string"==typeof t||t instanceof String)&&0===t.indexOf("https")&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",t),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(t))},beforeSend:function(t){t.setRequestHeader("X-Robots-Tag","noindex, nofollow")}})}function ctSetPixelUrlLocalstorage(t){ctSetCookie("apbct_pixel_url",t)}function apbctOnAnimationStart(t){("onautofillstart"===t.animationName?apbctAutocomplete:apbctCancelAutocomplete)(t.target)}function apbctOnInput(t){("insertReplacementText"!==t.inputType&&"data"in t?apbctCancelAutocomplete:apbctAutocomplete)(t.target)}function apbctAutocomplete(t){var e;t.hasAttribute("autocompleted")||(t.setAttribute("autocompleted",""),e=new window.CustomEvent("onautocomplete",{bubbles:!0,cancelable:!0,detail:null}),t.dispatchEvent(e))||(t.value="")}function apbctCancelAutocomplete(t){t.hasAttribute("autocompleted")&&(t.removeAttribute("autocompleted"),t.dispatchEvent(new window.CustomEvent("onautocomplete",{bubbles:!0,cancelable:!1,detail:null})))}function ctNoCookieAttachHiddenFieldsToForms(){if("none"===ctPublic.data__cookies_type){var e=ctGetPageForms();if(e)for(let t=0;t<e.length;t++)if(!(new ApbctHandler).checkHiddenFieldsExclusions(document.forms[t],"no_cookie")&&(null===document.forms[t].getAttribute("method")||"post"===document.forms[t].getAttribute("method").toLowerCase())){var c=e[t].querySelectorAll(".ct_no_cookie_hidden_field");for(let t=0;t<c.length;t++)c[t].outerHTML="";document.forms[t].append((new ApbctAttachData).constructNoCookieHiddenField())}}}ctPublic.data__key_is_ok&&(apbct_attach_event_handler(document,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(document,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(document,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(document,"scroll",ctSetHasScrolled)); //# sourceMappingURL=public-2-gathering-data.min.js.map
Save
Back