/*! For license information please see shield-notbot.bundle.js.LICENSE.txt */ (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._init_data=e,this._base_data=this.retrieveBaseData(),this.init()},(r=[{key:"retrieveBaseData",value:function(){return this._init_data}},{key:"init",value:function(){}},{key:"run",value:function(){}},{key:"exec",value:function(){this.canRun()&&this.run()}},{key:"canRun",value:function(){return!0}}])&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}());function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function y(t,e){for(var r=0;r=0?(n=t.indexOf(r)+13,o=t.lastIndexOf("##APTO_CLOSE##")):(n=t.indexOf("{"),o=t.lastIndexOf("}"));try{e=JSON.parse(t.substring(n,o))}catch(t){e={}}}return e}}],(e=null)&&y(t.prototype,e),r&&y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function b(t,e){for(var r=0;r=0;--i){var u=this.tryEntries[i],a=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var c=n.call(u,"catchLoc"),f=n.call(u,"finallyLoc");if(c&&f){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function k(t,e,r,n,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void r(t)}a.done?e(c):Promise.resolve(c).then(n,o)}function E(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function u(t){k(i,n,o,u,a,"next",t)}function a(t){k(i,n,o,u,a,"throw",t)}u(void 0)}))}}function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function R(t,e){for(var r=0;r0&&this.setNotBotNonce(t),t}},{key:"setNotBotNonce",value:function(t){this._base_data.ajax.not_bot.exnonce=t}},{key:"getNotBotNonce",value:function(){return this.readNotBotNonceFromCookie(),this._base_data.ajax.not_bot.exnonce}},{key:"isNotBotRequestRequired",value:function(){return this._base_data.flags.required||"1"===x.Retrieve("force_notbot")}},{key:"isNotBotFlagCookieMissing",value:function(){var t=m.Get("icwp-wpsf-notbot");return"undefined"===L(t)||void 0===t||""===t}},{key:"runNotBot",value:(a=E(N().mark((function t(){var e=this;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.fetch_RetrieveNotBotNonce().then((function(){return e.fetch_NotBot()}));case 2:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"fetch_RetrieveNotBotNonce",value:(u=E(N().mark((function t(){var e=this;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:0===this.getNotBotNonce().length&&fetch(this.shield_ajaxurl,this.constructFetchRequestData(this._base_data.ajax.not_bot_nonce)).then((function(t){return t.text()})).then((function(t){var r=h.ParseIt(t);return e.can_send_request=!j.IsEmpty(r),0===e.getNotBotNonce().length&&e.setNotBotNonce(r.data.nonce),t})).catch((function(t){return console.log(t)}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return u.apply(this,arguments)})},{key:"fetch_NotBot",value:(i=E(N().mark((function t(){var e=this;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.getNotBotNonce().length>0&&fetch(this.shield_ajaxurl,this.constructFetchRequestData(this._base_data.ajax.not_bot)).then((function(t){return 401===t.status&&e.setNotBotNonce(""),t})).then((function(t){return t.text()})).then((function(t){var r=h.ParseIt(t);return j.IsEmpty(r)?e.can_send_request=e.notbot_request_success=!1:(e.can_send_request=!0,e.notbot_request_success=r.success),t})).catch((function(t){console.log("notBotSendReqWithFetch() error: "+t)}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"constructFetchRequestData",value:function(t){return{method:"POST",body:new URLSearchParams(t).toString(),headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8","X-Requested-With":"XMLHttpRequest"}}}},{key:"legacyReq",value:function(){var t=this,e=new XMLHttpRequest;e.open("POST",this.shield_ajaxurl,!0),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.onreadystatechange=function(){if(4===e.readyState){var r=e.response;if(null!=r&&""!==r&&"{"===r.charAt(0)){var n=JSON.parse(r);t.can_send_request=n&&n.success,t.can_send_request||console.log(e.response)}}else t.can_send_request=!1},e.send(new URLSearchParams(this._base_data.ajax.not_bot).toString())}}],n&&R(r.prototype,n),o&&R(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i,u,a}(s);"shield_vars_notbot"in window&&new I(window.shield_vars_notbot.comps.notbot)})();