diff --git a/Classes/Configuration.php b/Classes/Configuration.php index 591cfe0..b6e6726 100644 --- a/Classes/Configuration.php +++ b/Classes/Configuration.php @@ -11,11 +11,11 @@ class Configuration { - public const DEFAULT_JS_PATH = 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/widget-0.9.12.min.js'; + public const DEFAULT_JS_PATH = 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/sdk@0.1.8-site.compat.min.js'; protected string $siteKey = ''; protected string $siteSecretKey = ''; - protected string $puzzleUrl = ''; + protected string $puzzleEndpoint = ''; protected string $verifyUrl = ''; protected string $jsPath = ''; protected bool $skipDevValidation = false; @@ -31,7 +31,7 @@ public function __construct(Site $site = null) $siteConfiguration = $site->getConfiguration(); $this->siteKey = trim($siteConfiguration['friendlycaptcha_site_key'] ?? ''); $this->siteSecretKey = trim($siteConfiguration['friendlycaptcha_secret_key'] ?? ''); - $this->puzzleUrl = trim($siteConfiguration['friendlycaptcha_puzzle_url'] ?? ''); + $this->puzzleEndpoint = trim($siteConfiguration['friendlycaptcha_puzzle_endpoint'] ?? ''); $this->verifyUrl = trim($siteConfiguration['friendlycaptcha_verify_url'] ?? ''); $this->jsPath = trim($siteConfiguration['friendlycaptcha_js_path'] ?? ''); $this->skipDevValidation = (bool)($siteConfiguration['friendlycaptcha_skip_dev_validation'] ?? false); @@ -39,7 +39,7 @@ public function __construct(Site $site = null) public function isEnabled(): bool { - return $this->siteKey !== '' && $this->siteSecretKey !== '' && $this->puzzleUrl !== '' && $this->verifyUrl !== '' && !$this->hasSkipHeaderValidation(); + return $this->siteKey !== '' && $this->siteSecretKey !== '' && $this->verifyUrl !== '' && !$this->hasSkipHeaderValidation(); } public function getSiteKey(): string @@ -52,9 +52,9 @@ public function getSiteSecretKey(): string return $this->siteSecretKey; } - public function getPuzzleUrl(): string + public function getPuzzleEndpoint(): string { - return $this->puzzleUrl; + return $this->puzzleEndpoint; } public function getVerifyUrl(): string diff --git a/Classes/Service/Api.php b/Classes/Service/Api.php index 7fecaa0..7b1c41c 100644 --- a/Classes/Service/Api.php +++ b/Classes/Service/Api.php @@ -30,7 +30,7 @@ public function __construct( $this->configuration = new Configuration(); } - public function verify(string $solution = ''): bool + public function verify(string $response = ''): bool { if ($this->configuration->hasSkipDevValidation()) { return true; @@ -39,17 +39,19 @@ public function verify(string $solution = ''): bool return true; } - $solution = $solution ?: $this->getSolutionFromRequest(); - if (!$solution || !$this->configuration->isEnabled()) { + $response = $response ?: $this->getResponseFromRequest(); + if (!$response || !$this->configuration->isEnabled()) { return false; } $options = [ - 'headers' => ['Cache-Control' => 'no-cache'], + 'headers' => [ + 'Cache-Control' => 'no-cache', + 'X-API-Key' => $this->configuration->getSiteSecretKey(), + ], 'allow_redirects' => true, 'form_params' => [ - 'secret' => $this->configuration->getSiteSecretKey(), - 'solution' => $solution, + 'response' => $response, ], ]; @@ -86,13 +88,13 @@ protected function request(string $method, string $url, array $options = []) return $result->getBody()->getContents(); } - protected function getSolutionFromRequest(): string + protected function getResponseFromRequest(): string { /** @var ServerRequest $request */ $request = $GLOBALS['TYPO3_REQUEST'] ?? null; if (!$request) { return ''; } - return $request->getParsedBody()['frc-captcha-solution'] ?? $request->getQueryParams()['frc-captcha-solution'] ?? ''; + return $request->getParsedBody()['frc-captcha-response'] ?? $request->getQueryParams()['frc-captcha-response'] ?? ''; } } diff --git a/Classes/ViewHelpers/ConfigurationViewHelper.php b/Classes/ViewHelpers/ConfigurationViewHelper.php index 61b98b4..ea1356c 100644 --- a/Classes/ViewHelpers/ConfigurationViewHelper.php +++ b/Classes/ViewHelpers/ConfigurationViewHelper.php @@ -5,8 +5,6 @@ namespace StudioMitte\FriendlyCaptcha\ViewHelpers; use StudioMitte\FriendlyCaptcha\Configuration; -use TYPO3\CMS\Core\Information\Typo3Version; -use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; @@ -14,28 +12,15 @@ class ConfigurationViewHelper extends AbstractViewHelper { use CompileWithRenderStatic; - public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) + public static function render() { $configuration = new Configuration(); return [ - 'languageIsoCode' => self::getLanguageIsoCode(), 'siteKey' => $configuration->getSiteKey(), 'verifyUrl' => $configuration->getVerifyUrl(), - 'puzzleUrl' => $configuration->getPuzzleUrl(), + 'puzzleEndpoint' => $configuration->getPuzzleEndpoint(), 'jsPath' => $configuration->getJsPath(), 'enabled' => $configuration->isEnabled(), ]; } - - protected static function getLanguageIsoCode(): string - { - $language = $GLOBALS['TYPO3_REQUEST']->getAttribute('language'); - if (!$language) { - return ''; - } - if ((new Typo3Version())->getMajorVersion() >= 12) { - return $language->getLocale()->getLanguageCode(); - } - return $language->getTwoLetterIsoCode(); - } } diff --git a/Configuration/PageTsConfig/powermail.typoscript b/Configuration/PageTsConfig/powermail.typoscript index eb7ea98..b9f3bcd 100644 --- a/Configuration/PageTsConfig/powermail.typoscript +++ b/Configuration/PageTsConfig/powermail.typoscript @@ -1,4 +1,4 @@ # Add FriendlyCaptcha field to Powermail tx_powermail.flexForm.type.addFieldOptions { - friendlycaptcha = FriendlyCaptcha + friendlycaptcha = FriendlyCaptcha V2 } diff --git a/Configuration/SiteConfiguration/Overrides/sites.php b/Configuration/SiteConfiguration/Overrides/sites.php index 9a01e6b..fb153d8 100644 --- a/Configuration/SiteConfiguration/Overrides/sites.php +++ b/Configuration/SiteConfiguration/Overrides/sites.php @@ -17,20 +17,20 @@ static function () { 'placeholder' => 'A16UE6NICBMVQKG1I1BFMLBD56K53D3CS0L5N00AJNBT1R41P8O7N1KFMH', ], ]; - $GLOBALS['SiteConfiguration']['site']['columns']['friendlycaptcha_puzzle_url'] = [ - 'label' => $lll . 'site.configuration.puzzle_url', + $GLOBALS['SiteConfiguration']['site']['columns']['friendlycaptcha_puzzle_endpoint'] = [ + 'label' => $lll . 'site.configuration.puzzle_endpoint', 'config' => [ 'type' => 'input', - 'placeholder' => 'https://eu-api.friendlycaptcha.eu/api/v1/puzzle', - 'default' => 'https://eu-api.friendlycaptcha.eu/api/v1/puzzle', + 'placeholder' => 'eu', + 'default' => '', ], ]; $GLOBALS['SiteConfiguration']['site']['columns']['friendlycaptcha_verify_url'] = [ 'label' => $lll . 'site.configuration.verify_url', 'config' => [ 'type' => 'input', - 'placeholder' => 'https://api.friendlycaptcha.com/api/v1/siteverify', - 'default' => 'https://eu-api.friendlycaptcha.eu/api/v1/siteverify', + 'placeholder' => 'https://global.frcapi.com/api/v2/captcha/siteverify', + 'default' => 'https://global.frcapi.com/api/v2/captcha/siteverify', ], ]; $GLOBALS['SiteConfiguration']['site']['columns']['friendlycaptcha_js_path'] = [ @@ -48,6 +48,6 @@ static function () { 'type' => 'check', ], ]; - $GLOBALS['SiteConfiguration']['site']['types']['0']['showitem'] .= ',--div--;' . $lll . 'site.configuration.tab, friendlycaptcha_site_key,friendlycaptcha_secret_key,friendlycaptcha_puzzle_url,friendlycaptcha_verify_url,friendlycaptcha_js_path,friendlycaptcha_skip_dev_validation,'; + $GLOBALS['SiteConfiguration']['site']['types']['0']['showitem'] .= ',--div--;' . $lll . 'site.configuration.tab, friendlycaptcha_site_key,friendlycaptcha_secret_key,friendlycaptcha_puzzle_endpoint,friendlycaptcha_verify_url,friendlycaptcha_js_path,friendlycaptcha_skip_dev_validation,'; } ); diff --git a/Configuration/Yaml/FormSetup.yaml b/Configuration/Yaml/FormSetup.yaml index 2846b6f..53476d1 100644 --- a/Configuration/Yaml/FormSetup.yaml +++ b/Configuration/Yaml/FormSetup.yaml @@ -34,7 +34,7 @@ TYPO3: # Headline (appears as a title in the overview and above the form) formEditor: - label: 'Friendly Captcha' + label: 'Friendly Captcha V2' group: custom groupSorting: 1010 diff --git a/Documentation/Configuration/General.rst b/Documentation/Configuration/General.rst index 660a42e..20a502d 100644 --- a/Documentation/Configuration/General.rst +++ b/Documentation/Configuration/General.rst @@ -17,6 +17,9 @@ After creating the account, you need to setup a so called *Application* Creation of an application +.. note:: + This version on the Plugin supports only FriendlyCaptcha V2. The V2 version has to be enabled in your Application + and afterwards you need to create new a new *API Key*. Please copy the generated key as you need it later! .. figure:: /Images/setup/apikey.png diff --git a/Documentation/Images/configuration_site.png b/Documentation/Images/configuration_site.png index eac8f2b..1130f8a 100644 Binary files a/Documentation/Images/configuration_site.png and b/Documentation/Images/configuration_site.png differ diff --git a/Documentation/Index.rst b/Documentation/Index.rst index fe656f8..b5cd16f 100644 --- a/Documentation/Index.rst +++ b/Documentation/Index.rst @@ -45,6 +45,7 @@ TYPO3 Extension friendlycaptcha_official Installation/Index Configuration/Index Using/Index + V2_Migration/Index .. Meta Menu diff --git a/Documentation/Introduction/Index.rst b/Documentation/Introduction/Index.rst index ed6ad1b..ddbdd70 100644 --- a/Documentation/Introduction/Index.rst +++ b/Documentation/Introduction/Index.rst @@ -17,7 +17,7 @@ What does it do? ================ This extension integrates the service of **Friendly Captcha** into your site by using the -official API. +official API. This version only supports **Friendly Captcha V2**. For **V1** support, please install an earlier version of the plugin. Currently it supports the following form solutions: diff --git a/Documentation/V2_Migration/Index.rst b/Documentation/V2_Migration/Index.rst new file mode 100644 index 0000000..91ab2ca --- /dev/null +++ b/Documentation/V2_Migration/Index.rst @@ -0,0 +1,16 @@ +.. include:: /Includes.rst.txt + +.. _v2_migration: + +============ +Migration to FriendlyCaptcha V2 +============ + +If you’re currently using an earlier version of the plugin with **Friendly Captcha V1** and want to switch to **Friendly Captcha V2**: + +* Enable **V2** in yout Application in the Panel at https://friendlycaptcha.com/ +* Install the newest version of the plugin (min v1.0) +* In TYPO3 backend, go to the *Site Management*/*Sites* module and switch to the **FriendlyCaptcha** tab. You need to change the URLs +**Puzzle Endpoint** - save empty or `eu` if you want to use the EU Endpoint +**Verify URL** - `https://global.frcapi.com/api/v2/captcha/siteverify` or `https://eu.frcapi.com/api/v2/captcha/siteverify` if you prefer to use EU endpoint +**JavaScript Path** - `EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/sdk@0.1.8-site.compat.min.js` \ No newline at end of file diff --git a/Resources/Private/Form/Partials/Friendlycaptcha.html b/Resources/Private/Form/Partials/Friendlycaptcha.html index 092014e..7a85df0 100644 --- a/Resources/Private/Form/Partials/Friendlycaptcha.html +++ b/Resources/Private/Form/Partials/Friendlycaptcha.html @@ -24,7 +24,7 @@ value="1" additionalAttributes="{formvh:translateElementProperty(element: element, property: 'fluidAdditionalAttributes')}" /> -
+
diff --git a/Resources/Private/Language/Configuration.xlf b/Resources/Private/Language/Configuration.xlf index 900430c..9124165 100644 --- a/Resources/Private/Language/Configuration.xlf +++ b/Resources/Private/Language/Configuration.xlf @@ -14,8 +14,8 @@ Verify URL - - Puzzle URL + + Puzzle Endpoint JavaScript Path diff --git a/Resources/Private/Powermail/Partials/Form/Field/Friendlycaptcha.html b/Resources/Private/Powermail/Partials/Form/Field/Friendlycaptcha.html index 242b9fd..b775d6e 100644 --- a/Resources/Private/Powermail/Partials/Form/Field/Friendlycaptcha.html +++ b/Resources/Private/Powermail/Partials/Form/Field/Friendlycaptcha.html @@ -6,7 +6,7 @@ -
+

{f:translate(key:'LLL:EXT:friendlycaptcha_official/Resources/Private/Language/locallang.xlf:configuration_missing')}

diff --git a/Resources/Public/JavaScript/lib/sdk@0.1.8-site.compat.min.js b/Resources/Public/JavaScript/lib/sdk@0.1.8-site.compat.min.js new file mode 100644 index 0000000..5e639b8 --- /dev/null +++ b/Resources/Public/JavaScript/lib/sdk@0.1.8-site.compat.min.js @@ -0,0 +1,7 @@ +function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1},clear:function(){this.k.length=this.v.length=this.size=0},forEach:function(e,t){t&&(e=e.bind(t));for(var n=-1,r=this.size;++n!==r;)e(this.v[n],this.k[n],this)},entries:function(){var e=0,t=this;return{next:function(){return e!==t.size?{value:[t.k[e++],t.v[e]],done:!1}:{done:!0}}}},keys:function(){var e=0,t=this;return{next:function(){return e!==t.size?{value:t.k[e++],done:!1}:{done:!0}}}},values:function(){var e=0,t=this;return{next:function(){return e!==t.size?{value:t.v[e++],done:!1}:{done:!0}}}},toString:function(){return"[object Map]"}};WeakMap=Map=function(t){if(i=this.k=[],o=this.v=[],r=0,null!=t){if(s=Object(t),(n=+s.length)!=n)throw new TypeError("("+(t.toString||s.toString)()+") is not iterable");for(;n--;){if(!(s[n]instanceof Object))throw new TypeError("Iterator value "+s[n]+" is not an entry object");~e(i,s[n][0])||(i[r]=s[n][0],o[r++]=s[n][1])}i.reverse(),o.reverse()}this.size=r},Map.prototype=a,WeakSet=Set=function(t){if(i=this.k=this.v=[],r=0,null!=t){if(s=Object(t),(n=+s.length)!=n)throw new TypeError("("+(t.toString||s.toString)()+") is not iterable");for(;n--;)~e(i,s[n])||(i[r++]=s[n]);i.reverse()}this.size=r},Set.prototype={delete:function(n){return!!~(t=e(this.k,n))&&(this.k.splice(t,1),--this.size,!0)},add:function(n){return~(t=e(this.k,n))||(t=this.size++),this.k[t]=n,this},has:a.has,clear:a.clear,forEach:a.forEach,entries:a.entries,keys:a.keys,values:a.keys,toString:function(){return"[object Set]"}}}(),function(){function e(){return document.querySelectorAll(".frc-captcha")}function t(e,t,n){""===e.style[t]&&(e.style[t]=n)}function n(e){var t,n,r=new Promise((function(e,r){t=e,n=r}));return e&&e(t,n),{promise:r,resolve:t,reject:n}}function r(e,t){return 0===e.lastIndexOf(t,0)}function i(e){for(var t=[],n=Object.keys(e),r=encodeURIComponent,i=0;i1&&void 0!==arguments[1]?arguments[1]:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",r=0;re[6]&&(e[6]=t))}}}function p(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:document.body,o=m(),s=!1;return i[Y](e,(function(e){s&&!r||(n=e.timeStamp,s=!0)})),i[Y](t,(function(e){s&&(o.add(e.timeStamp-n),s=!1)})),o.s}function v(e){for(var t=[],n=function(n){t.push(0),document[Y](e[n],(function(){return t[n]++}))},r=0;r180?-360:n<-180?360:0)}function _(e){return e?K[e]||e:K.global}var k,S,E,C,P=/^((?:\w+:)?\/\/([^\/]+))/,R=function(){function e(t){_classCallCheck(this,e),this.ready=!1,this.buffer=[],this.id=t.id,this.type=t.type,this.element=t.element,this.onReady=t.onReady,this.origin=o(t.element.src)}return _createClass(e,[{key:"send",value:function(e){this.ready?this.element.contentWindow.postMessage(e,this.origin):this.buffer.push(e)}},{key:"setReady",value:function(e){this.onReady(),this.ready=e,this.ready&&this.flush()}},{key:"flush",value:function(){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:u())("readonly",(function(t){return a(t.get(e))}))}(i,n.idb):n.mem.get(e);try{var o=sessionStorage.getItem(i);return null===o?void 0:o}catch(s){}return n.mem.get(e)}))}},{key:"set",value:function(e,t,n){var r=this;return this.setup().then((function(i){var o=r.storePrefix+"__"+e;if(n.p){if(i)return function(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:u())("readwrite",(function(n){return n.put(t,e),a(n.transaction)}))}(o,t,r.idb);void 0===t?r.mem.delete(e):r.mem.set(e,t)}else try{void 0===t?(r.mem.delete(e),sessionStorage.removeItem(o)):(r.mem.set(e,t),sessionStorage.setItem(o,t))}catch(s){}}))}},{key:"hasSA",value:function(){return this._hasSA}}]),e}(),I="undefined"!=typeof navigator&&void 0!==navigator.userAgentData,D="FrcFrameId",W="frc-i-agent",N=function(){function e(t){var n=this;_classCallCheck(this,e),this.state="init",this.response=".UNINITIALIZED",this.focusEventPending=!1,this.isDestroyed=!1,this.id=t.id;var r=t.createOpts;if(this.e=r.element,this.ready=t.registered,!this.e)throw new Error("No element provided to mount widget under.");if(this.e.frcWidget=this,this.formFieldName=void 0===r.formFieldName?"frc-captcha-response":r.formFieldName,this.sitekey=r.sitekey,this._reset=t.callbacks.onReset,this._destroy=t.callbacks.onDestroy,this._trigger=t.callbacks.onTrigger,this.startMode=t.createOpts.startMode||"focus",null!==this.formFieldName){var i=document.createElement("input");i.type="hidden",i.style.display="none",i.name=this.formFieldName,this.hiddenFormEl=i,this.e.appendChild(i)}this.setState({response:".UNCONNECTED",state:"init"}),this.ready.then((function(){n.handleStartMode()}))}return _createClass(e,[{key:"handleStartMode",value:function(){var e,t=this;if("focus"!==this.startMode||this.focusEventPending||this.isDestroyed)"auto"===this.startMode&&this.trigger("auto");else{var n=function(e){for(;"FORM"!==e.tagName;)if(!(e=e.parentElement))return null;return e}(this.e);n&&(this.focusEventPending=!0,e=function(e){t.trigger("focus",{ev:e}),t.focusEventPending=!1},n.addEventListener("focusin",e,{once:!0,passive:!0}))}}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{trigger:"root"};if(this.isDestroyed)throw new Error("Can not reset destroyed widget.");this.setState({response:".RESET",state:"reset",resetTrigger:e.trigger}),this._reset(e),this.handleStartMode()}},{key:"destroy",value:function(){var e;this.isDestroyed=!0,null===(e=this.hiddenFormEl)||void 0===e||e.remove(),this.hiddenFormEl=void 0,this.setState({response:".DESTROYED",state:"destroyed"}),this._destroy()}},{key:"trigger",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.isDestroyed)throw new Error("Can not start destroyed widget.");var n=function(e,t,n,r){var i=h(),o=n.getBoundingClientRect(),s={v:1,tt:e,pnow:i,sm:t,el:{bcr:[o.left,o.top,o.width,o.height],con:document.body.contains(n)},stack:(new Error).stack||"",we:!!window.event,weit:!!window.event&&!!window.event.isTrusted};return r&&(s.ev={ts:r.timeStamp,rt:!!r.relatedTarget,eot:!!r.explicitOriginalTarget,it:r.isTrusted}),s}(e,this.startMode,this.e,t.ev);this._trigger({trigger:n})}},{key:"start",value:function(){this.trigger("programmatic")}},{key:"setState",value:function(e){var t=this.state!==e.state;this.response=e.response,this.state=e.state,this.hiddenFormEl&&!1!==this.e.isConnected&&(this.hiddenFormEl.value=e.response),t&&this.dispatchWidgetEvent({name:"frc:widget.statechange",error:e.error}),"expired"===this.state?this.dispatchWidgetEvent({name:"frc:widget.expire"}):"completed"===this.state?this.dispatchWidgetEvent({name:"frc:widget.complete"}):"error"===this.state?this.dispatchWidgetEvent({name:"frc:widget.error",error:e.error}):"reset"===this.state&&this.dispatchWidgetEvent({name:"frc:widget.reset",trigger:e.resetTrigger})}},{key:"dispatchWidgetEvent",value:function(e){var t={response:this.response,state:this.state,id:this.id};g(t,e),function(e,t){var n;"function"==typeof window.CustomEvent?n=new CustomEvent(t.name,{bubbles:!0,detail:t}):(n=document.createEvent("CustomEvent")).initCustomEvent(t.name,!0,!1,t),e.dispatchEvent(n)}(this.e,t)}},{key:"addEventListener",value:function(e,t,n){this.e.addEventListener(e,t,n)}},{key:"removeEventListener",value:function(e,t,n){this.e.removeEventListener(e,t,n)}},{key:"getState",value:function(){return this.state}},{key:"getResponse",value:function(){return this.response}},{key:"getElement",value:function(){return this.e}}]),e}(),L=function(e){return"function"==typeof e},X=function(){var e=[],t=new Map,n=window,r=function(){try{var e=document.createElement("iframe");e.style.display="none",(document.body||document.head).appendChild(e);var t=e?e.contentWindow:0;return e.remove(),t||n}catch(r){return n}}(),i=Function.prototype.toString,o=function(){if(!L(this)){for(var e=!!L(this)&&t.get(this),n=this===o?i:e||this,r=arguments.length,s=new Array(r),a=0;a=112&&r<=123&&t[0]++})),t),mov:this.setupMovementMetrics(),dm:this.setupMotionMetrics(),do:this.setupOrientationMetrics()}}return _createClass(e,[{key:"setupMovementMetrics",value:function(){var e=this,t=void 0,n=[],r=m(),i=m(),o=m(),s={t:r.s,v:o.s,d:i.s,ns:0},a=document.body,c=function(){var a=n[n.length-1];if(n.length>=200||a&&(a[0]&&e.tm.timeStamp===a[1]||!a[0]&&e.mm.timeStamp===a[1])){if(clearInterval(t),t=void 0,1===n.length)return s.ns++,void(n=[]);var c=n[0];r.add(a[1]-c[1]),i.add(y(a[2],c[2],a[3],c[3]));for(var u=1;ue.tm.timeStamp?0:1:e.mm||(g=1),g){var m=e.tm.touches[0];m&&n.push([1,e.tm.timeStamp,m.screenX,m.screenY])}else n.push([0,e.mm.timeStamp,e.mm.screenX,e.mm.screenY])}};a[Y]("mousemove",(function(n){e.mm=n,void 0===t&&(c(),t=setInterval(c,50))}));var u=-1;return a[Y]("touchmove",(function(n){e.tm=n;var r=n.touches[0];if(r){var i=r.radiusX+1.234*r.radiusY;i!==u&&(u=i,e.rn++)}void 0===t&&(c(),t=setInterval(c,50))})),s}},{key:"setupMotionMetrics",value:function(){var e=m(),t=m(),n={n:0,ts:0,ac:e.s,rr:t.s,i:0,g:!1};return window[Y]("devicemotion",(function(r){n.ts=r.timeStamp,n.i=r.interval,n.g=!r.acceleration;var i=r.acceleration||r.accelerationIncludingGravity;i&&e.add(w(i.x,i.y,i.z));var o=r.rotationRate;o&&t.add(w(o.alpha,o.beta,o.gamma))})),n}},{key:"setupOrientationMetrics",value:function(){var e,t=m(),n=m(),r={fts:0,ts:0,gd:t.s,bd:n.s};return window[Y]("deviceorientation",(function(i){null!=i.gamma&&null!=i.beta&&null!=i.alpha&&(r.ts=i.timeStamp,r.a=i.alpha,r.b=i.beta,r.g=i.gamma,e?(t.add(b(i.gamma,r.g)),n.add(b(r.b,i.beta))):(r.fts=r.ts,e=!0))})),r}},{key:"gmm",value:function(){var e=this.mm;return e&&{xy:[e.clientX,e.clientY,e.screenX,e.screenY,e.offsetX,e.offsetY,e.pageX,e.pageY,e.movementX,e.movementY],ts:e.timeStamp}}},{key:"gtm",value:function(){var e=this.tm,t=e&&e.touches,n=t&&t[0];return e&&n&&{id:n.identifier,xy:[n.clientX,n.clientY,n.screenX,n.screenY,n.pageX,n.pageY],r:[n.radiusX,n.radiusX,n.rotationAngle,n.force],n:t.length,ts:e.timeStamp,rn:this.rn}}},{key:"get",value:function(e){var t=document.body,n=window,r=n.performance;return{v:1,i:++this.i,hl:history.length,fe:!!window.frameElement,wid:e,sc:parseInt(d(!1)),sid:l(),conv:0,t:{pnow:h(),pto:r&&r.timeOrigin||0,ts:Date.now()},dims:{d:[n.innerWidth,n.innerHeight,n.outerWidth,n.outerHeight,n.screenX,n.screenY,n.pageXOffset,n.pageYOffset,t.clientWidth,t.clientHeight],dpr:n.devicePixelRatio},mel:this.smel,mm:this.gmm(),tm:this.gtm(),bh:this.bh,stack:(new Error).stack||"",trc:X()}}}]),e}(),K={eu:"https://eu.frcapi.com/api/v2/captcha",global:"https://global.frcapi.com/api/v2/captcha"},q="FrcFrameId",H=0,B=function(){function a(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,a),this.agents=new Map,this.agentState=new Map,this.widgets=new Map,this._attached=n(),this.attached=this._attached.promise,this.signals=S||(S=new U),this.baseURL=_(t.apiEndpoint||function(){var e=document.querySelector('meta[name="frc-api-endpoint"]');if(e)return e.content;var t=document.currentScript;if(t){var n=t.dataset.frcApiEndpoint;if(n)return n}var r=document.querySelector(".frc-captcha[data-api-endpoint]");if(r){var i=r.dataset.apiEndpoint;if(i)return i}}()),(E=E||new M).addOrigin(o(this.baseURL)),E.listen((function(t){return e.onReceiveMessage(t)})),this.bus=E,++H>1&&console.warn("Multiple Friendly Captcha SDKs created, this is not recommended. Please use a single SDK instance."),!1!==t.startAgent&&this.ensureAgentIFrame(),this.setupPeriodicRefresh()}return _createClass(a,[{key:"onReceiveMessage",value:function(e){if("root_set_response"===e.type){var t=this.widgets.get(e.widget_id);if(!t)return void(1===H&&console.warn("Received set response message for widget ".concat(e.widget_id," that doesn't exist")));t.setState(e)}else if(r(e.type,"root_store"))this.handleStoreMessage(e);else if("root_signals_get"===e.type)this.handleSignalsGetMessage(e);else if("widget_reset"===e.type){var n=this.widgets.get(e.from_id);if(!n)return void(1===H&&console.warn("Received reset message for widget ".concat(e.from_id," that doesn't exist")));n.reset({trigger:"widget"})}}},{key:"handleSignalsGetMessage",value:function(e){var t=this.signals.get(e.widget_id);this.bus.send({type:"root_signals_get_reply",from_id:"",to_id:e.from_id,_frc:1,rid:e.rid,value:t})}},{key:"handleStoreMessage",value:function(e){var t=this,n=e.from_id,r=this.agentState.get(n);r?"root_store_get"===e.type?r.store.get(e.key,{p:e.p}).then((function(i){t.bus.send({type:"root_store_get_reply",from_id:"",to_id:n,_frc:1,rid:e.rid,value:i,sa:r.store.hasSA()})})):"root_store_set"===e.type&&r.store.set(e.key,e.value,{p:e.p}).then((function(){t.bus.send({type:"root_store_set_reply",from_id:"",to_id:n,_frc:1,rid:e.rid,sa:r.store.hasSA()})})):console.error("Store not found ".concat(n))}},{key:"getAPIUrls",value:function(e){if(e&&"string"!=typeof e)return{agent:e.agent,widget:e.widget};var t=e||this.baseURL;return{agent:t+"/agent",widget:t+"/widget"}}},{key:"ensureAgentIFrame",value:function(e){for(var t=this,n=this.getAPIUrls(e).agent,r=o(n),a=document.getElementsByClassName(W),c=0;c15)return console.error("[Friendly Captcha] Failed to load agent iframe after 15 retries."),h.remove(),void t.agents.delete(r);console.warn("[Friendly Captcha] Retrying agent iframe load."),h.src+="&retry="+g++,e()}}))}(),f}},{key:"setupPeriodicRefresh",value:function(){var e=this,t=1;setInterval((function(){var n="&expire="+t++;e.agents.forEach((function(e){e.src+=n})),e.widgets.forEach((function(e){e.getElement().querySelector("iframe").src+=n}))}),1296e5)}},{key:"attach",value:function(t){void 0===t&&(t=e()),Array.isArray(t)||t instanceof NodeList||(t=[t]);for(var n=[],r=0;r4)return console.error("[Friendly Captcha] Failed to load widget iframe after 4 retries."),v.setState({state:"error",response:".ERROR",error:{code:"network_error",detail:"Widget load timeout, stopped retrying"}}),E.borderColor="#f00",E.fontSize="12px",void(S.textContent="Anti-Robot check failed to connect to page or ".concat(o(k.src),"\nCheck your connection and try again."));E.backgroundColor="#fee",E.color="#222",S.textContent="Anti-Robot check took too long to connect.\n\nRetrying... (".concat(C,")"),console.warn("[Friendly Captcha] Retrying widget ".concat(u," iframe load.")),v.setState({state:"error",response:".ERROR",error:{code:"network_error",detail:"Widget load timeout, will retry."}}),k.src+="&retry="+C++,t()}else"registered"===n&&(e.element.removeChild(S),k.style.display="")}))}(),p.resolve(),v}},{key:"getAllWidgets",value:function(){var e=[];return this.widgets.forEach((function(t){e.push(t)})),e}},{key:"getWidgetById",value:function(e){return this.widgets.get(e)}},{key:"clear",value:function(){this.widgets.forEach((function(e){e.destroy()})),this.agents.forEach((function(e){e.remove()})),this.agents.clear()}}]),a}();window.frcaptcha=new B,C=function(){var t=e();window.frcaptcha.attach(t)},"loading"!==document.readyState?C():document.addEventListener("DOMContentLoaded",C)}(); +/*! + * Copyright (c) Friendly Captcha GmbH 2023. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ \ No newline at end of file diff --git a/Resources/Public/JavaScript/lib/widget-0.9.12.min.js b/Resources/Public/JavaScript/lib/widget-0.9.12.min.js deleted file mode 100644 index 694176e..0000000 --- a/Resources/Public/JavaScript/lib/widget-0.9.12.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r6&&void 0!==arguments[6]&&arguments[6],A=arguments.length>7?arguments[7]:void 0,s=arguments.length>8?arguments[8]:void 0;return'
\n\n
\n ").concat(n,"\n ").concat(o?'"):"","\n ").concat(a?'0%':"",'\n
\n
FriendlyCaptcha ⇗\n')}function a(t,e,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return o(t,i,!0,"".concat(e.text_error,"
").concat(r),a?".HEADLESS_ERROR":".ERROR",n?e.button_retry:void 0)}function A(){if(!document.querySelector("#frc-style")){var t=document.createElement("style");t.id="frc-style",t.innerHTML=".frc-captcha *{margin:0;padding:0;border:0;text-align:initial;border-radius:px;filter:none!important;transition:none!important;font-weight:400;font-size:14px;line-height:1.2;text-decoration:none;background-color:initial;color:#222}.frc-captcha{position:relative;min-width:250px;max-width:312px;border:1px solid #f4f4f4;padding-bottom:12px;background-color:#fff}.frc-captcha b{font-weight:700}.frc-container{display:flex;align-items:center;min-height:52px}.frc-icon{fill:#222;stroke:#222;flex-shrink:0;margin:8px 8px 0}.frc-icon.frc-warning{fill:#c00}.frc-success .frc-icon{animation:1s ease-in both frc-fade-in}.frc-content{white-space:nowrap;display:flex;flex-direction:column;margin:4px 6px 0 0;overflow-x:auto;flex-grow:1}.frc-banner{position:absolute;bottom:0;right:6px;line-height:1}.frc-banner *{font-size:10px;opacity:.8;text-decoration:none}.frc-progress{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:3px 0;height:4px;border:none;background-color:#eee;color:#222;width:100%;transition:.5s linear}.frc-progress::-webkit-progress-bar{background:#eee}.frc-progress::-webkit-progress-value{background:#222}.frc-progress::-moz-progress-bar{background:#222}.frc-button{cursor:pointer;padding:2px 6px;background-color:#f1f1f1;border:1px solid transparent;text-align:center;font-weight:600;text-transform:none}.frc-button:focus{border:1px solid #333}.frc-button:hover{background-color:#ddd}.frc-captcha-solution{display:none}.frc-err-url{text-decoration:underline;font-size:.9em}.dark.frc-captcha{color:#fff;background-color:#222;border-color:#333}.dark.frc-captcha *{color:#fff}.dark.frc-captcha button{background-color:#444}.dark .frc-icon{fill:#fff;stroke:#fff}.dark .frc-progress{background-color:#444}.dark .frc-progress::-webkit-progress-bar{background:#444}.dark .frc-progress::-webkit-progress-value{background:#ddd}.dark .frc-progress::-moz-progress-bar{background:#ddd}@keyframes frc-fade-in{from{opacity:0}to{opacity:1}}",document.head.appendChild(t)}}for(var s,c,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l="=".charCodeAt(0),h=new Uint8Array(256),f=0;f>>2),A+=u.charAt((3&i)<<4|o>>>4),A+=u.charAt((15&o)<<2|a>>>6),r+=A+=u.charAt(63&a)}return e%3==2?r=r.substring(0,r.length-1)+"=":e%3==1&&(r=r.substring(0,r.length-2)+"=="),r}function d(t,e,r){return new Promise((function(i,o){var a,A,s;function c(){var t,e=(t=s(),function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],r=!0,n=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done)&&(e.push(o.value),1!==e.length);r=!0);}catch(A){n=!0,i=A}finally{try{r||null==a.return||a.return()}finally{if(n)throw i}}return e}}(t)||function(t){if(t){if("string"==typeof t)return n(t,1);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,1):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return e++,u.bind(this,e)}function u(t){if(s=function(){return[t]},!(t').concat(a[t],""))).rawError=e,n}catch(i){return o(i)}};try{var A;return Promise.resolve(p(a[t]+"?sitekey="+e,{headers:[["x-frc-client","js-0.9.12"]],mode:"cors"},2)).then(function(e){try{var r=function(){return function(){try{return c}catch(t){return o(t)}}()};if((A=e).ok)return Promise.resolve(A.json()).then((function(t){try{return i(t.data.puzzle)}catch(e){return n(e)}}),n);var s,u=function(){try{if(s&&s.errors&&"endpoint_not_enabled"===s.errors[0])throw Error("Endpoint not allowed (".concat(A.status,")"));if(t===a.length-1)throw Error("Response status ".concat(A.status," ").concat(A.statusText," ").concat(s?s.errors:""));return r.call(this)}catch(e){return n(e)}}.bind(this),l=function(){try{return u()}catch(t){return n(t)}};try{return Promise.resolve(A.json()).then((function(t){try{return s=t,u()}catch(e){return l()}}),l)}catch(h){l()}return r.call(this)}catch(f){return n(f)}}.bind(this),n)}catch(u){n(u)}}return a=t.split(","),(A=function(t){for(;t;){if(t.then)return void t.then(A,o);try{if(t.pop){if(t.length)return t.pop()?l.call(this):t;t=c}else t=t.call(this)}catch(e){return o(e)}}}.bind(this))(u.bind(this,0));function l(){return o(Error("Internal error"))}}))}function p(t,e,r){return new Promise((function(n){var i=1e3;return n(fetch(t,e).catch((function(n){return new Promise((function(o,a){return 0===r?a(n):Promise.resolve(new Promise((function(t){return setTimeout(t,i)}))).then((function(){try{return i*=4,o(p(t,e,r-1))}catch(n){return a(n)}}),a)}))})))}))}"undefined"!=typeof navigator&&(s=navigator,c=s.userAgent.toLowerCase());var _,x={text_init:" Aktiverer...",text_ready:"Jeg er ikke en robot",button_start:"Klikk for å starte verifiseringen",text_fetching:"Henter data",text_solving:"Sjekker at du er et menneske...",text_completed:"Jeg er et menneske",text_completed_sr:"Automatisk spam-sjekk fullført",text_expired:"Verifisering kunne ikke fullføres",button_restart:"Omstart",text_error:"Bekreftelsen mislyktes",button_retry:"Prøv på nytt",text_fetch_error:"Tilkoblingen mislyktes"},m={en:{text_init:"Initializing...",text_ready:"Anti-Robot Verification",button_start:"Click to start verification",text_fetching:"Fetching Challenge",text_solving:"Verifying you are human...",text_completed:"I am human",text_completed_sr:"Automatic spam check completed",text_expired:"Anti-Robot verification expired",button_restart:"Restart",text_error:"Verification failed",button_retry:"Retry",text_fetch_error:"Failed to connect to"},de:{text_init:"Initialisierung...",text_ready:"Anti-Roboter-Verifizierung",button_start:"Hier klicken",text_fetching:"Herausforderung laden...",text_solving:"Verifizierung, dass Sie ein Mensch sind...",text_completed:"Ich bin ein Mensch",text_completed_sr:"Automatische Spamprüfung abgeschlossen",text_expired:"Verifizierung abgelaufen",button_restart:"Erneut starten",text_error:"Verifizierung fehlgeschlagen",button_retry:"Erneut versuchen",text_fetch_error:"Verbindungsproblem mit"},nl:{text_init:"Initializeren...",text_ready:"Anti-robotverificatie",button_start:"Klik om te starten",text_fetching:"Aan het laden...",text_solving:"Anti-robotverificatie bezig...",text_completed:"Ik ben een mens",text_completed_sr:"Automatische anti-spamcheck voltooid",text_expired:"Verificatie verlopen",button_restart:"Opnieuw starten",text_error:"Verificatie mislukt",button_retry:"Opnieuw proberen",text_fetch_error:"Verbinding mislukt met"},fr:{text_init:"Chargement...",text_ready:"Vérification Anti-Robot",button_start:"Cliquez ici pour vérifier",text_fetching:"Chargement du défi",text_solving:"Vérification que vous êtes un humain...",text_completed:"Je suis un humain",text_completed_sr:"Vérification automatique des spams terminée",text_expired:"Vérification anti-robot expirée",button_restart:"Redémarrer",text_error:"Échec de la vérification",button_retry:"Recommencer",text_fetch_error:"Problème de connexion avec"},it:{text_init:"Inizializzazione...",text_ready:"Verifica Anti-Robot",button_start:"Clicca per iniziare",text_fetching:"Caricamento...",text_solving:"Verificando che sei umano...",text_completed:"Non sono un robot",text_completed_sr:"Controllo automatico dello spam completato",text_expired:"Verifica Anti-Robot scaduta",button_restart:"Ricomincia",text_error:"Verifica fallita",button_retry:"Riprova",text_fetch_error:"Problema di connessione con"},pt:{text_init:"Inicializando...",text_ready:"Verificação Anti-Robô",button_start:"Clique para iniciar verificação",text_fetching:"Carregando...",text_solving:"Verificando se você é humano...",text_completed:"Eu sou humano",text_completed_sr:"Verificação automática de spam concluída",text_expired:"Verificação Anti-Robô expirada",button_restart:"Reiniciar",text_error:"Verificação falhou",button_retry:"Tentar novamente",text_fetch_error:"Falha de conexão com"},es:{text_init:"Inicializando...",text_ready:"Verificación Anti-Robot",button_start:"Haga clic para iniciar la verificación",text_fetching:"Cargando desafío",text_solving:"Verificando que eres humano...",text_completed:"Soy humano",text_completed_sr:"Verificación automática de spam completada",text_expired:"Verificación Anti-Robot expirada",button_restart:"Reiniciar",text_error:"Ha fallado la verificación",button_retry:"Intentar de nuevo",text_fetch_error:"Error al conectarse a"},ca:{text_init:"Inicialitzant...",text_ready:"Verificació Anti-Robot",button_start:"Fes clic per començar la verificació",text_fetching:"Carregant repte",text_solving:"Verificant que ets humà...",text_completed:"Soc humà",text_completed_sr:"Verificació automàtica de correu brossa completada",text_expired:"La verificació Anti-Robot ha expirat",button_restart:"Reiniciar",text_error:"Ha fallat la verificació",button_retry:"Tornar a provar",text_fetch_error:"Error connectant a"},ja:{text_init:"開始しています...",text_ready:"アンチロボット認証",button_start:"クリックして認証を開始",text_fetching:"ロードしています",text_solving:"認証中...",text_completed:"私はロボットではありません",text_completed_sr:"自動スパムチェックが完了しました",text_expired:"認証の期限が切れています",button_restart:"再度認証を行う",text_error:"認証にエラーが発生しました",button_retry:"再度認証を行う",text_fetch_error:"接続ができませんでした"},da:{text_init:"Aktiverer...",text_ready:"Jeg er ikke en robot",button_start:"Klik for at starte verifikationen",text_fetching:"Henter data",text_solving:"Kontrollerer at du er et menneske...",text_completed:"Jeg er et menneske.",text_completed_sr:"Automatisk spamkontrol gennemført",text_expired:"Verifikationen kunne ikke fuldføres",button_restart:"Genstart",text_error:"Bekræftelse mislykkedes",button_retry:"Prøv igen",text_fetch_error:"Forbindelsen mislykkedes"},ru:{text_init:"Инициализация...",text_ready:"АнтиРобот проверка",button_start:"Нажмите, чтобы начать проверку",text_fetching:"Получаю задачу",text_solving:"Проверяю, что вы человек...",text_completed:"Я человек",text_completed_sr:"Aвтоматическая проверка на спам завершена",text_expired:"Срок АнтиРоботной проверки истёк",button_restart:"Начать заново",text_error:"Ошибка проверки",button_retry:"Повторить ещё раз",text_fetch_error:"Ошибка подключения"},sv:{text_init:"Aktiverar...",text_ready:"Jag är inte en robot",button_start:"Klicka för att verifiera",text_fetching:"Hämtar data",text_solving:"Kontrollerar att du är människa...",text_completed:"Jag är en människa",text_completed_sr:"Automatisk spamkontroll slutförd",text_expired:"Anti-robot-verifieringen har löpt ut",button_restart:"Börja om",text_error:"Verifiering kunde inte slutföras",button_retry:"Omstart",text_fetch_error:"Verifiering misslyckades"},tr:{text_init:"Başlatılıyor...",text_ready:"Anti-Robot Doğrulaması",button_start:"Doğrulamayı başlatmak için tıklayın",text_fetching:"Yükleniyor",text_solving:"Robot olmadığınız doğrulanıyor...",text_completed:"Ben bir insanım",text_completed_sr:"Otomatik spam kontrolü tamamlandı",text_expired:"Anti-Robot doğrulamasının süresi doldu",button_restart:"Yeniden başlat",text_error:"Doğrulama başarısız oldu",button_retry:"Tekrar dene",text_fetch_error:"Bağlantı başarısız oldu"},el:{text_init:"Προετοιμασία...",text_ready:"Anti-Robot Επαλήθευση",button_start:" Κάντε κλικ για να ξεκινήσει η επαλήθευση",text_fetching:" Λήψη πρόκλησης",text_solving:" Επιβεβαίωση ανθρώπου...",text_completed:"Είμαι άνθρωπος",text_completed_sr:" Ο αυτόματος έλεγχος ανεπιθύμητου περιεχομένου ολοκληρώθηκε",text_expired:" Η επαλήθευση Anti-Robot έληξε",button_restart:" Επανεκκίνηση",text_error:" Η επαλήθευση απέτυχε",button_retry:" Δοκιμάστε ξανά",text_fetch_error:" Αποτυχία σύνδεσης με"},uk:{text_init:"Ініціалізація...",text_ready:"Антиробот верифікація",button_start:"Натисніть, щоб розпочати верифікацію",text_fetching:"З’єднання",text_solving:"Перевірка, що ви не робот...",text_completed:"Я не робот",text_completed_sr:"Автоматична перевірка спаму завершена",text_expired:"Час вичерпано",button_restart:"Почати знову",text_error:"Верифікація не вдалась",button_retry:"Спробувати знову",text_fetch_error:"Не вдалось з’єднатись"},bg:{text_init:"Инициализиране...",text_ready:"Анти-робот проверка",button_start:"Щракнете, за да започнете проверката",text_fetching:"Предизвикателство",text_solving:"Проверяваме дали си човек...",text_completed:"Аз съм човек",text_completed_sr:"Автоматичната проверка за спам е завършена",text_expired:"Анти-Робот проверката изтече",button_restart:"Рестартирайте",text_error:"Неуспешна проверка",button_retry:"Опитайте пак",text_fetch_error:"Неуспешно свързване с"},cs:{text_init:"Inicializace...",text_ready:"Ověření proti robotům",button_start:"Klikněte pro ověření",text_fetching:"Problém při načítání",text_solving:"Ověření, že jste člověk...",text_completed:"Jsem člověk",text_completed_sr:"Automatická kontrola spamu dokončena",text_expired:"Ověření proti robotům vypršelo",button_restart:"Restartovat",text_error:"Ověření se nezdařilo",button_retry:"Zkusit znovu",text_fetch_error:"Připojení se nezdařilo"},sk:{text_init:"Inicializácia...",text_ready:"Overenie proti robotom",button_start:"Kliknite pre overenie",text_fetching:"Problém pri načítaní",text_solving:"Overenie, že ste človek...",text_completed:"Som človek",text_completed_sr:"Automatická kontrola spamu dokončená",text_expired:"Overenie proti robotom vypršalo",button_restart:"Reštartovať",text_error:"Overenie sa nepodarilo",button_retry:"Skúsiť znova",text_fetch_error:"Pripojenie sa nepodarilo"},no:x,fi:{text_init:"Aktivoidaan...",text_ready:"En ole robotti",button_start:"Aloita vahvistus klikkaamalla",text_fetching:"Haetaan tietoja",text_solving:"Tarkistaa, että olet ihminen...",text_completed:"Olen ihminen",text_completed_sr:"Automaattinen roskapostin tarkistus suoritettu",text_expired:"Vahvistusta ei voitu suorittaa loppuun",button_restart:"Uudelleenkäynnistys",text_error:"Vahvistus epäonnistui",button_retry:"Yritä uudelleen",text_fetch_error:"Yhteys epäonnistui"},lv:{text_init:"Notiek inicializēšana...",text_ready:"Verifikācija, ka neesat robots",button_start:"Noklikšķiniet, lai sāktu verifikāciju",text_fetching:"Notiek drošības uzdevuma izgūšana",text_solving:"Notiek pārbaude, vai esat cilvēks...",text_completed:"Es esmu cilvēks",text_completed_sr:"Automātiska surogātpasta pārbaude pabeigta",text_expired:"Verifikācijas, ka neesat robots, derīgums beidzies",button_restart:"Restartēt",text_error:"Verifikācija neizdevās",button_retry:"Mēģināt vēlreiz",text_fetch_error:"Neizdevās izveidot savienojumu ar"},lt:{text_init:"Inicijuojama...",text_ready:"Patikrinimas, ar nesate robotas",button_start:"Spustelėkite patikrinimui pradėti",text_fetching:"Gavimo iššūkis",text_solving:"Tikrinama, ar esate žmogus...",text_completed:"Esu žmogus",text_completed_sr:"Automatinė patikra dėl pašto šiukšlių atlikta",text_expired:"Patikrinimas, ar nesate robotas, baigė galioti",button_restart:"Pradėti iš naujo",text_error:"Patikrinimas nepavyko",button_retry:"Kartoti",text_fetch_error:"Nepavyko prisijungti prie"},pl:{text_init:"Inicjowanie...",text_ready:"Weryfikacja antybotowa",button_start:"Kliknij, aby rozpocząć weryfikację",text_fetching:"Pobieranie",text_solving:"Weryfikacja, czy nie jesteś robotem...",text_completed:"Nie jestem robotem",text_completed_sr:"Zakończono automatyczne sprawdzanie spamu",text_expired:"Weryfikacja antybotowa wygasła",button_restart:"Uruchom ponownie",text_error:"Weryfikacja nie powiodła się",button_retry:"Spróbuj ponownie",text_fetch_error:"Nie udało się połączyć z"},et:{text_init:"Initsialiseerimine...",text_ready:"Robotivastane kinnitus",button_start:"Kinnitamisega alustamiseks klõpsake",text_fetching:"Väljakutse toomine",text_solving:"Kinnitatakse, et sa oled inimene...",text_completed:"Ma olen inimene",text_completed_sr:"Automaatne rämpsposti kontroll on lõpetatud",text_expired:"Robotivastane kinnitus aegus",button_restart:"Taaskäivita",text_error:"Kinnitamine nurjus",button_retry:"Proovi uuesti",text_fetch_error:"Ühenduse loomine nurjus"},hr:{text_init:"Početno postavljanje...",text_ready:"Provjera protiv robota",button_start:"Kliknite za početak provjere",text_fetching:"Dohvaćanje izazova",text_solving:"Provjeravamo jeste li čovjek...",text_completed:"Nisam robot",text_completed_sr:"Automatska provjera je završena",text_expired:"Vrijeme za provjeru protiv robota je isteklo",button_restart:"Osvježi",text_error:"Provjera nije uspjlela",button_retry:" Ponovo pokreni",text_fetch_error:"Nije moguće uspostaviti vezu"},sr:{text_init:"Pokretanje...",text_ready:"Anti-Robot Verifikacija",button_start:"Kliknite da biste započeli verifikaciju",text_fetching:"Učitavanje izazova",text_solving:"Verifikacija da ste čovek...",text_completed:"Ja sam čovek",text_completed_sr:"Automatska provera neželjene pošte je završena",text_expired:"Anti-Robot verifikacija je istekla",button_restart:"Ponovo pokrenuti",text_error:"Verifikacija nije uspela",button_retry:"Pokušajte ponovo",text_fetch_error:"Neuspelo povezivanje sa..."},sl:{text_init:"Inicializiranje...",text_ready:"Preverjanje robotov",button_start:"Kliknite za začetek preverjanja",text_fetching:"Prenašanje izziva",text_solving:"Preverjamo, ali ste človek",text_completed:"Nisem robot",text_completed_sr:"Avtomatsko preverjanje je zaključeno",text_expired:"Preverjanje robotov je poteklo",button_restart:"Osveži",text_error:"Preverjanje ni uspelo",button_retry:"Poskusi ponovno",text_fetch_error:"Povezave ni bilo mogoče vzpostaviti"},hu:{text_init:"Inicializálás...",text_ready:"Robotellenes ellenőrzés",button_start:"Kattintson az ellenőrzés megkezdéséhez",text_fetching:"Feladvány lekérése",text_solving:"Annak igazolása, hogy Ön nem robot...",text_completed:"Nem vagyok robot",text_completed_sr:"Automatikus spam ellenőrzés befejeződött",text_expired:"Robotellenes ellenőrzés lejárt",button_restart:"Újraindítás",text_error:"Az ellenőrzés nem sikerült",button_retry:"Próbálja újra",text_fetch_error:"Nem sikerült csatlakozni"},ro:{text_init:"Se inițializează...",text_ready:"Verificare anti-robot",button_start:"Click pentru a începe verificarea",text_fetching:"Downloading",text_solving:"Verificare că ești om...",text_completed:"Sunt om",text_completed_sr:"Verificarea automată a spam-ului a fost finalizată",text_expired:"Verificarea anti-robot a expirat",button_restart:"Restart",text_error:"Verificare eșuată",button_retry:"Reîncearcă",text_fetch_error:"Nu s-a putut conecta"},zh:{text_init:"初始化中……",text_ready:"人机验证",button_start:"点击开始",text_fetching:"正在加载",text_solving:"人机校验中……",text_completed:"我不是机器人",text_completed_sr:"人机验证完成",text_expired:"验证已过期",button_restart:"重新开始",text_error:"校验失败",button_retry:"重试",text_fetch_error:"无法连接到"},zh_tw:{text_init:"正在初始化……",text_ready:"反機器人驗證",button_start:"點擊開始驗證",text_fetching:"載入中",text_solving:"反機器人驗證中……",text_completed:"我不是機器人",text_completed_sr:"驗證完成",text_expired:"驗證超時",button_restart:"重新開始",text_error:"驗證失敗",button_retry:"重試",text_fetch_error:"無法連線到"},vi:{text_init:"Đang khởi tạo...",text_ready:"Xác minh chống Robot",button_start:"Bấm vào đây để xác minh",text_fetching:"Tìm nạp và xử lý thử thách",text_solving:"Xác minh bạn là người...",text_completed:"Bạn là con người",text_completed_sr:"Xác minh hoàn tất",text_expired:"Xác minh đã hết hạn",button_restart:"Khởi động lại",text_error:"Xác minh thất bại",button_retry:"Thử lại",text_fetch_error:"Không kết nối được"},nb:x};"undefined"!=typeof window&&(_=window.URL||window.webkitURL);var v=function(){function e(){t(this,e),this.workers=[],this.puzzleNumber=0,this.numPuzzles=0,this.threshold=0,this.startTime=0,this.progress=0,this.totalHashes=0,this.puzzleSolverInputs=[],this.puzzleIndex=0,this.solutionBuffer=new Uint8Array(0),this.solverType=1,this.readyCount=0,this.startCount=0,this.progressCallback=function(){return 0},this.readyCallback=function(){return 0},this.startedCallback=function(){return 0},this.doneCallback=function(){return 0},this.errorCallback=function(){return 0}}return r(e,[{key:"init",value:function(){var t=this;this.terminateWorkers(),this.progress=0,this.totalHashes=0,this.readyCount=0,this.startCount=0,this.workers=new Array(4);for(var e=new Blob(['!function(){function A(A,r){return function(A){if(Array.isArray(A))return A}(A)||function(A,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(A)){var r=[],n=!0,e=!1,o=void 0;try{for(var i,g=A[Symbol.iterator]();!(n=(i=g.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(I){e=!0,o=I}finally{try{n||null==g.return||g.return()}finally{if(e)throw o}}return r}}(A,r)||function(A,r){if(A){if("string"==typeof A)return t(A,r);var n=Object.prototype.toString.call(A).slice(8,-1);return"Object"===n&&A.constructor&&(n=A.constructor.name),"Map"===n||"Set"===n?Array.from(A):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(A,r):void 0}}(A,r)||function(){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 t(A,t){(null==t||t>A.length)&&(t=A.length);for(var r=0,n=new Array(t);r>>31))+a+(((u=I)&c|(u|c)&~(I=u+c))>>>31)),E=(Q=(h=(Q=h^(l=l+(D=C=y^(u=I))+((w&(y=Q)|(w|y)&~(I=w+y))>>>31)))>>>24^(C=E^(w=I))<<8)^(l=l+(D=(Q=D^(s=(s=s+h+((u&(E=C>>>24^Q<<8)|(u|E)&~(I=u+E))>>>31))+f+(((u=I)&B|(u|B)&~(I=u+B))>>>31)))>>>16^(C=y^(u=I))<<16)+((w&(y=C>>>16^Q<<16)|(w|y)&~(I=w+y))>>>31)))>>>31^(C=E^(w=I))<<1,h=C>>>31^Q<<1,A[r]=u,A[r+1]=s,A[n]=E,A[n+1]=h,A[e]=w,A[e+1]=l,A[o]=y,A[o+1]=D}var I,C,Q=[4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225],c=[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6,22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8,14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16,18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26,4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18,24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22,26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20,12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10,20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6];function a(A,t){for(var r=A.v,n=A.m,e=0;e<16;e++)r[e]=A.h[e],r[e+16]=Q[e];r[24]=r[24]^A.t,r[25]=r[25]^A.t/4294967296,t&&(r[28]=~r[28],r[29]=~r[29]);for(var o=0;o<32;o++)n[o]=i(A.b,4*o);for(var I=0;I<12;I++)g(r,n,0,8,16,24,c[16*I+0],c[16*I+1]),g(r,n,2,10,18,26,c[16*I+2],c[16*I+3]),g(r,n,4,12,20,28,c[16*I+4],c[16*I+5]),g(r,n,6,14,22,30,c[16*I+6],c[16*I+7]),g(r,n,0,10,20,30,c[16*I+8],c[16*I+9]),g(r,n,2,12,22,24,c[16*I+10],c[16*I+11]),g(r,n,4,14,16,26,c[16*I+12],c[16*I+13]),g(r,n,6,8,18,28,c[16*I+14],c[16*I+15]);for(var C=0;C<16;C++)A.h[C]=A.h[C]^r[C]^r[C+16]}function B(A,t){for(var r=0;r<16;r++)A.h[r]=Q[r];A.b.set(t),A.h[0]^=16842752^A.outlen}function f(A,t,r){if(128!=A.length)throw Error("Invalid input");var n=A.buffer,e=new DataView(n),i=new o(32);i.t=128;for(var g=e.getUint32(124,!0),I=g+r,C=g;C2&&void 0!==arguments[2]?arguments[2]:4294967295,n=f(A,t,r);return[A,n]}))}))}Uint8Array.prototype.slice||Object.defineProperty(Uint8Array.prototype,"slice",{value:function(A,t){return new Uint8Array(Array.prototype.slice.call(this,A,t))}}),self.ASC_TARGET=0;var s=new Promise((function(A){return C=A}));self.onerror=function(A){self.postMessage({type:"error",message:JSON.stringify(A)})},self.onmessage=function(t){return new Promise((function(e,o){var i;i=t.data;var g=function(){try{return e()}catch(A){return o(A)}},Q=function(A){try{return setTimeout((function(){throw A})),g()}catch(t){return o(t)}};try{var c=function(){return g()};if("solver"!==i.type){var a,B,f,E,h=function(){return c.call(this)};return"start"===i.type?Promise.resolve(s).then(function(t){try{a=t,self.postMessage({type:"started"}),B=0;for(var r=0;r<256;r++){i.puzzleSolverInput[123]=r;var n=A(a(i.puzzleSolverInput,i.threshold),2),e=n[0];if(0!==n[1].length){f=e;break}console.warn("FC: Internal error or no solution found"),B+=Math.pow(2,32)-1}return E=new DataView(f.slice(-4).buffer),B+=E.getUint32(0,!0),self.postMessage({type:"done",solution:f.slice(-8),h:B,puzzleIndex:i.puzzleIndex,puzzleNumber:i.puzzleNumber}),h.call(this)}catch(o){return Q(o)}}.bind(this),Q):h.call(this)}var w=function(){return self.postMessage({type:"ready",solver:I}),c.call(this)};if(i.forceJS)return I=1,Promise.resolve(u()).then(function(A){try{return C(A),w.call(this)}catch(t){return Q(t)}}.bind(this),Q);var l=function(){try{return w.call(this)}catch(A){return Q(A)}}.bind(this),y=function(A){try{return console.log("FriendlyCaptcha failed to initialize WebAssembly, falling back to Javascript solver: "+A.toString()),I=1,Promise.resolve(u()).then((function(A){try{return C(A),l()}catch(t){return Q(t)}}),Q)}catch(t){return Q(t)}};try{var D;return I=2,D=WebAssembly.compile(function(A){var t=A.length,e=3*t>>>2;A.charCodeAt(t-1)===r&&e--,A.charCodeAt(t-2)===r&&e--;for(var o=new Uint8Array(e),i=0,g=0;i>4,o[g++]=(15&C)<<4|Q>>2,o[g++]=(3&Q)<<6|63&c}return o}("AGFzbQEAAAABKghgAABgAn9/AGADf39/AX9gAX8AYAR/f39/AGAAAX9gAX8Bf2ACf38BfwINAQNlbnYFYWJvcnQABAMMCwcGAwAAAQIFAQIABQMBAAEGFgR/AUEAC38BQQALfwBBAwt/AEHgDAsHbgkGbWVtb3J5AgAHX19hbGxvYwABCF9fcmV0YWluAAIJX19yZWxlYXNlAAMJX19jb2xsZWN0AAQHX19yZXNldAAFC19fcnR0aV9iYXNlAwMNVWludDhBcnJheV9JRAMCDHNvbHZlQmxha2UyYgAKCAELCvQSC5IBAQV/IABB8P///wNLBEAACyMBQRBqIgQgAEEPakFwcSICQRAgAkEQSxsiBmoiAj8AIgVBEHQiA0sEQCAFIAIgA2tB//8DakGAgHxxQRB2IgMgBSADShtAAEEASARAIANAAEEASARAAAsLCyACJAEgBEEQayICIAY2AgAgAkEBNgIEIAIgATYCCCACIAA2AgwgBAsEACAACwMAAQsDAAELBgAjACQBC7sCAQF/AkAgAUUNACAAQQA6AAAgACABakEEayICQQA6AAMgAUECTQ0AIABBADoAASAAQQA6AAIgAkEAOgACIAJBADoAASABQQZNDQAgAEEAOgADIAJBADoAACABQQhNDQAgAEEAIABrQQNxIgJqIgBBADYCACAAIAEgAmtBfHEiAmpBHGsiAUEANgIYIAJBCE0NACAAQQA2AgQgAEEANgIIIAFBADYCECABQQA2AhQgAkEYTQ0AIABBADYCDCAAQQA2AhAgAEEANgIUIABBADYCGCABQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgwgACAAQQRxQRhqIgFqIQAgAiABayEBA0AgAUEgTwRAIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGCABQSBrIQEgAEEgaiEADAELCwsLcgACfyAARQRAQQxBAhABIQALIAALQQA2AgAgAEEANgIEIABBADYCCCABQfD///8DIAJ2SwRAQcAKQfAKQRJBORAAAAsgASACdCIBQQAQASICIAEQBiAAKAIAGiAAIAI2AgAgACACNgIEIAAgATYCCCAAC88BAQJ/QaABQQAQASIAQQxBAxABQYABQQAQBzYCACAAQQxBBBABQQhBAxAHNgIEIABCADcDCCAAQQA2AhAgAEIANwMYIABC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")),Promise.resolve(D).then((function(A){try{return Promise.resolve(function(A){return new Promise((function(t,r){var n,e,o;return Promise.resolve(function(A){return new Promise((function(t,r){var n,e;return n={env:{abort:function(){throw Error("Wasm aborted")}}},Promise.resolve(WebAssembly.instantiate(A,n)).then((function(A){try{return e=function(A){var t={},r=A.exports,n=r.memory,e=r.__alloc,o=r.__retain,i=r.__rtti_base||-1;return t.__allocArray=function(A,t){var r=function(A){return new Uint32Array(n.buffer)[(i+4>>>2)+2*A]}(A),g=31-Math.clz32(r>>>6&31),I=t.length,C=e(I<>>2]=o(C),c[Q+4>>>2]=C,c[Q+8>>>2]=I<>>g)+f]=o(t[f]);else B.set(t,C>>>g);return Q},t.__getUint8Array=function(A){var t=new Uint32Array(n.buffer),r=t[A+4>>>2];return new Uint8Array(n.buffer,r,t[r-4>>>2]>>>0)},function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=A.__argumentsLength?function(t){A.__argumentsLength.value=t}:A.__setArgumentsLength||A.__setargc||function(){return{}},n=function(n){if(!Object.prototype.hasOwnProperty.call(A,n))return"continue";var e=A[n],o=n.split(".")[0];"function"==typeof e&&e!==r?(t[o]=function(){return r(arguments.length),e.apply(void 0,arguments)}).original=e:t[o]=e};for(var e in A)n(e);return t}(r,t)}(A),t({exports:e})}catch(n){return r(n)}}),r)}))}(A)).then((function(A){try{return e=(n=A).exports.__retain(n.exports.__allocArray(n.exports.Uint8Array_ID,new Uint8Array(128))),o=n.exports.__getUint8Array(e),t((function(A,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4294967295;o.set(A);var i=n.exports.solveBlake2b(e,t,r);o=n.exports.__getUint8Array(e);var g=n.exports.__getUint8Array(i);return n.exports.__release(i),[o,g]}))}catch(i){return r(i)}}),r)}))}(A)).then((function(A){try{return C(A),l()}catch(t){return y(t)}}),y)}catch(t){return y(t)}}),y)}catch(v){y(v)}}catch(v){Q(v)}}))}}()}("undefined"==typeof frcWorker?frcWorker={}:frcWorker);'],{type:"text/javascript"}),r=function(r){t.workers[r]=new Worker(_.createObjectURL(e)),t.workers[r].onerror=function(e){return t.errorCallback(e)},t.workers[r].onmessage=function(e){var n,i,o,a,A=e.data;if(A)if("ready"===A.type)t.readyCount++,t.solverType=A.solver,t.readyCount==t.workers.length&&t.readyCallback();else if("started"===A.type)t.startCount++,1==t.startCount&&(t.startTime=Date.now(),t.startedCallback());else if("done"===A.type){if(A.puzzleNumber!==t.puzzleNumber)return;if(t.puzzleIndex0&&void 0!==arguments[0]&&arguments[0],e={type:"solver",forceJS:t},r=0;r1&&void 0!==arguments[1]?arguments[1]:{};t(this,n),this.workerGroup=new v,this.valid=!1,this.needsReInit=!1,this.hasBeenStarted=!1,this.hasBeenDestroyed=!1,this.opts=Object.assign({forceJSFallback:!1,skipStyleInjection:!1,startMode:"focus",puzzleEndpoint:e.dataset.puzzleEndpoint||y,startedCallback:function(){return 0},readyCallback:function(){return 0},doneCallback:function(){return 0},errorCallback:function(){return 0},sitekey:e.dataset.sitekey||"",language:e.dataset.lang||"en",solutionFieldName:e.dataset.solutionFieldName||"frc-captcha-solution"},r),this.e=e,this.e.friendlyChallengeWidget=this,this.loadLanguage(),e.innerText=this.lang.text_init,this.opts.skipStyleInjection||A(),this.init("auto"===this.opts.startMode||"auto"===this.e.dataset.start)}return r(n,[{key:"init",value:function(t){var e,r=this;if(this.hasBeenDestroyed)console.error("FriendlyCaptcha widget has been destroyed using destroy(), it can not be used anymore.");else if(this.initWorkerGroup(),t)this.start();else if("none"!==this.e.dataset.start&&("focus"===this.opts.startMode||"focus"===this.e.dataset.start)){var n=function(t){for(;"FORM"!==t.tagName;)if(!(t=t.parentElement))return null;return t}(this.e);n?(e=function(){return r.start()},n.addEventListener("focusin",e,{once:!0,passive:!0})):console.log("FriendlyCaptcha div seems not to be contained in a form, autostart will not work")}}},{key:"loadLanguage",value:function(t){if(void 0!==t?this.opts.language=t:this.e.dataset.lang&&(this.opts.language=this.e.dataset.lang),"string"==typeof this.opts.language){var e=m[this.opts.language.toLowerCase()];void 0===e&&(console.error('FriendlyCaptcha: language "'+this.opts.language+'" not found.'),e=m.en),this.lang=e}else this.lang=Object.assign(Object.assign({},m.en),this.opts.language)}},{key:"makeButtonStart",value:function(){var t=this,e=this.e.querySelector("button");e&&(e.addEventListener("click",(function(){return t.start()}),{once:!0,passive:!0}),e.addEventListener("touchstart",(function(){return t.start()}),{once:!0,passive:!0}))}},{key:"onWorkerError",value:function(t){this.hasBeenStarted=!1,this.needsReInit=!0,this.expiryTimeout&&clearTimeout(this.expiryTimeout),console.error("[FRC]",t),this.e.innerHTML=a(this.opts.solutionFieldName,this.lang,"Background worker error "+t.message),this.makeButtonStart(),this.opts.forceJSFallback=!0}},{key:"initWorkerGroup",value:function(){var t=this;this.workerGroup.progressCallback=function(e){var r,n,i;r=e,n=t.e.querySelector(".frc-progress"),i=(r.i+1)/r.n,n&&(n.value=i,n.innerText=i.toFixed(2)+"%",n.title=r.i+1+"/"+r.n+" ("+(r.h/r.t*.001).toFixed(0)+"K/s)")},this.workerGroup.readyCallback=function(){var e;t.e.innerHTML=o(t.opts.solutionFieldName,'',!0,(e=t.lang).text_ready,".UNSTARTED",e.button_start,!1),t.makeButtonStart(),t.opts.readyCallback()},this.workerGroup.startedCallback=function(){var r,n;t.e.innerHTML=(r=t.opts.solutionFieldName,n=t.lang,o(r,e,!0,n.text_solving,".UNFINISHED",void 0,!0)),t.opts.startedCallback()},this.workerGroup.doneCallback=function(e){var r=t.handleDone(e);t.opts.doneCallback(r);var n=t.e.dataset.callback;n&&window[n](r)},this.workerGroup.errorCallback=function(e){t.onWorkerError(e)},this.workerGroup.init(),this.workerGroup.setupSolver(this.opts.forceJSFallback)}},{key:"expire",value:function(){var t,e;this.hasBeenStarted=!1,!1!==this.e.isConnected&&(this.e.innerHTML=(t=this.opts.solutionFieldName,e=this.lang,o(t,i,!0,e.text_expired,".EXPIRED",e.button_restart)),this.makeButtonStart())}},{key:"start",value:function(){return new Promise(function(t,r){var n;if(this.hasBeenDestroyed)return console.error("Can not start FriendlyCaptcha widget which has been destroyed"),t();if(this.hasBeenStarted)return console.warn("Can not start FriendlyCaptcha widget which has already been started"),t();if(!(n=this.opts.sitekey||this.e.dataset.sitekey))return console.error("FriendlyCaptcha: sitekey not set on frc-captcha element"),this.e.innerHTML=a(this.opts.solutionFieldName,this.lang,"Website problem: sitekey not set",!1),t();if(-1!==c.indexOf("headless")||-1!==s.appVersion.indexOf("Headless")||-1!==c.indexOf("bot")||-1!==c.indexOf("crawl")||!0===s.webdriver||!s.language||void 0!==s.languages&&!s.languages.length)return this.e.innerHTML=a(this.opts.solutionFieldName,this.lang,"Browser check failed, try a different browser",!1,!0),t();if(this.needsReInit)return this.needsReInit=!1,this.init(!0),t();this.hasBeenStarted=!0;var i,A,u=function(){try{return this.workerGroup.start(this.puzzle),t()}catch(e){return r(e)}}.bind(this),f=function(e){try{var n;return console.error("[FRC]",e),this.hasBeenStarted=!1,this.expiryTimeout&&clearTimeout(this.expiryTimeout),this.e.innerHTML=a(this.opts.solutionFieldName,this.lang,e.message),this.makeButtonStart(),this.opts.errorCallback({code:"error_getting_puzzle",description:e.toString(),error:e}),(n=this.e.dataset["callback-error"])&&window[n](this),t()}catch(i){return r(i)}}.bind(this);try{return this.e.innerHTML=(i=this.opts.solutionFieldName,A=this.lang,o(i,e,!0,A.text_fetching,".FETCHING",void 0,!0)),Promise.resolve(d(this.opts.puzzleEndpoint,n,this.lang)).then(function(t){var e,r,n,i,o=this;try{return this.puzzle=(i=function(t){var e=t.length,r=3*e>>>2;t.charCodeAt(e-1)===l&&r--,t.charCodeAt(e-2)===l&&r--;for(var n=new Uint8Array(r),i=0,o=0;i>4,n[o++]=(15&A)<<4|s>>2,n[o++]=(3&s)<<6|63&c}return n}(n=(r=t.split("."))[1]),{signature:r[0],base64:n,buffer:i,n:i[14],threshold:(e=i[15],e>255?e=255:e<0&&(e=0),Math.pow(2,(255.999-e)/8)>>>0),expiry:3e5*i[13]}),this.expiryTimeout&&clearTimeout(this.expiryTimeout),this.expiryTimeout=setTimeout((function(){return o.expire()}),this.puzzle.expiry-3e4),u()}catch(a){return f(a)}}.bind(this),f)}catch(g){f(g)}}.bind(this))}},{key:"handleDone",value:function(t){this.valid=!0;var e="".concat(this.puzzle.signature,".").concat(this.puzzle.base64,".").concat(g(t.solution),".").concat(g(t.diagnostics));return this.e.innerHTML=function(t,e,r,n){var i="".concat(n.t.toFixed(0),"s (").concat((n.h/n.t*.001).toFixed(0),"K/s)").concat(1===n.solver?" JS Fallback":"");return o(t,"".concat(e.text_completed_sr,''),!1,e.text_completed,r,void 0,!1,i,"frc-success")}(this.opts.solutionFieldName,this.lang,e,t),this.needsReInit=!0,e}},{key:"destroy",value:function(){this.workerGroup.terminateWorkers(),this.needsReInit=!1,this.hasBeenStarted=!1,this.expiryTimeout&&clearTimeout(this.expiryTimeout),this.e&&(this.e.remove(),delete this.e),this.hasBeenDestroyed=!0}},{key:"reset",value:function(){this.hasBeenDestroyed?console.error("FriendlyCaptcha widget has been destroyed, it can not be used anymore"):(this.workerGroup.terminateWorkers(),this.needsReInit=!1,this.hasBeenStarted=!1,this.expiryTimeout&&clearTimeout(this.expiryTimeout),this.init("auto"===this.opts.startMode||"auto"===this.e.dataset.start))}}]),n}();function I(){for(var t=window.friendlyChallenge.autoWidget,e=function(){var t=document.querySelectorAll(".frc-captcha");return 0===t.length&&console.warn("FriendlyCaptcha: No div was found with .frc-captcha class"),t}(),r=0;r\n\n
\n ${i}\n ${n?``:""}\n ${a?'0%':""}\n
\nFriendlyCaptcha ⇗\n`}function i(t,i,o,n=!0,a=!1){return r(t,e,!0,`${i.text_error}
${o}`,a?".HEADLESS_ERROR":".ERROR",n?i.button_retry:void 0)}const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="=".charCodeAt(0),a=new Uint8Array(256);for(let t=0;t>>2),s+=o.charAt((3&e)<<4|n>>>4),s+=o.charAt((15&n)<<2|a>>>6),s+=o.charAt(63&a),r+=s}return e%3==2?r=r.substring(0,r.length-1)+"=":e%3==1&&(r=r.substring(0,r.length-2)+"=="),r}let A,l;async function c(t,e,r){let i=1e3;return fetch(t,e).catch((async o=>{if(0===r)throw o;return await new Promise((t=>setTimeout(t,i))),i*=4,c(t,e,r-1)}))}"undefined"!=typeof navigator&&(A=navigator,l=A.userAgent.toLowerCase());const g={text_init:" Aktiverer...",text_ready:"Jeg er ikke en robot",button_start:"Klikk for å starte verifiseringen",text_fetching:"Henter data",text_solving:"Sjekker at du er et menneske...",text_completed:"Jeg er et menneske",text_completed_sr:"Automatisk spam-sjekk fullført",text_expired:"Verifisering kunne ikke fullføres",button_restart:"Omstart",text_error:"Bekreftelsen mislyktes",button_retry:"Prøv på nytt",text_fetch_error:"Tilkoblingen mislyktes"},h={en:{text_init:"Initializing...",text_ready:"Anti-Robot Verification",button_start:"Click to start verification",text_fetching:"Fetching Challenge",text_solving:"Verifying you are human...",text_completed:"I am human",text_completed_sr:"Automatic spam check completed",text_expired:"Anti-Robot verification expired",button_restart:"Restart",text_error:"Verification failed",button_retry:"Retry",text_fetch_error:"Failed to connect to"},de:{text_init:"Initialisierung...",text_ready:"Anti-Roboter-Verifizierung",button_start:"Hier klicken",text_fetching:"Herausforderung laden...",text_solving:"Verifizierung, dass Sie ein Mensch sind...",text_completed:"Ich bin ein Mensch",text_completed_sr:"Automatische Spamprüfung abgeschlossen",text_expired:"Verifizierung abgelaufen",button_restart:"Erneut starten",text_error:"Verifizierung fehlgeschlagen",button_retry:"Erneut versuchen",text_fetch_error:"Verbindungsproblem mit"},nl:{text_init:"Initializeren...",text_ready:"Anti-robotverificatie",button_start:"Klik om te starten",text_fetching:"Aan het laden...",text_solving:"Anti-robotverificatie bezig...",text_completed:"Ik ben een mens",text_completed_sr:"Automatische anti-spamcheck voltooid",text_expired:"Verificatie verlopen",button_restart:"Opnieuw starten",text_error:"Verificatie mislukt",button_retry:"Opnieuw proberen",text_fetch_error:"Verbinding mislukt met"},fr:{text_init:"Chargement...",text_ready:"Vérification Anti-Robot",button_start:"Cliquez ici pour vérifier",text_fetching:"Chargement du défi",text_solving:"Vérification que vous êtes un humain...",text_completed:"Je suis un humain",text_completed_sr:"Vérification automatique des spams terminée",text_expired:"Vérification anti-robot expirée",button_restart:"Redémarrer",text_error:"Échec de la vérification",button_retry:"Recommencer",text_fetch_error:"Problème de connexion avec"},it:{text_init:"Inizializzazione...",text_ready:"Verifica Anti-Robot",button_start:"Clicca per iniziare",text_fetching:"Caricamento...",text_solving:"Verificando che sei umano...",text_completed:"Non sono un robot",text_completed_sr:"Controllo automatico dello spam completato",text_expired:"Verifica Anti-Robot scaduta",button_restart:"Ricomincia",text_error:"Verifica fallita",button_retry:"Riprova",text_fetch_error:"Problema di connessione con"},pt:{text_init:"Inicializando...",text_ready:"Verificação Anti-Robô",button_start:"Clique para iniciar verificação",text_fetching:"Carregando...",text_solving:"Verificando se você é humano...",text_completed:"Eu sou humano",text_completed_sr:"Verificação automática de spam concluída",text_expired:"Verificação Anti-Robô expirada",button_restart:"Reiniciar",text_error:"Verificação falhou",button_retry:"Tentar novamente",text_fetch_error:"Falha de conexão com"},es:{text_init:"Inicializando...",text_ready:"Verificación Anti-Robot",button_start:"Haga clic para iniciar la verificación",text_fetching:"Cargando desafío",text_solving:"Verificando que eres humano...",text_completed:"Soy humano",text_completed_sr:"Verificación automática de spam completada",text_expired:"Verificación Anti-Robot expirada",button_restart:"Reiniciar",text_error:"Ha fallado la verificación",button_retry:"Intentar de nuevo",text_fetch_error:"Error al conectarse a"},ca:{text_init:"Inicialitzant...",text_ready:"Verificació Anti-Robot",button_start:"Fes clic per començar la verificació",text_fetching:"Carregant repte",text_solving:"Verificant que ets humà...",text_completed:"Soc humà",text_completed_sr:"Verificació automàtica de correu brossa completada",text_expired:"La verificació Anti-Robot ha expirat",button_restart:"Reiniciar",text_error:"Ha fallat la verificació",button_retry:"Tornar a provar",text_fetch_error:"Error connectant a"},ja:{text_init:"開始しています...",text_ready:"アンチロボット認証",button_start:"クリックして認証を開始",text_fetching:"ロードしています",text_solving:"認証中...",text_completed:"私はロボットではありません",text_completed_sr:"自動スパムチェックが完了しました",text_expired:"認証の期限が切れています",button_restart:"再度認証を行う",text_error:"認証にエラーが発生しました",button_retry:"再度認証を行う",text_fetch_error:"接続ができませんでした"},da:{text_init:"Aktiverer...",text_ready:"Jeg er ikke en robot",button_start:"Klik for at starte verifikationen",text_fetching:"Henter data",text_solving:"Kontrollerer at du er et menneske...",text_completed:"Jeg er et menneske.",text_completed_sr:"Automatisk spamkontrol gennemført",text_expired:"Verifikationen kunne ikke fuldføres",button_restart:"Genstart",text_error:"Bekræftelse mislykkedes",button_retry:"Prøv igen",text_fetch_error:"Forbindelsen mislykkedes"},ru:{text_init:"Инициализация...",text_ready:"АнтиРобот проверка",button_start:"Нажмите, чтобы начать проверку",text_fetching:"Получаю задачу",text_solving:"Проверяю, что вы человек...",text_completed:"Я человек",text_completed_sr:"Aвтоматическая проверка на спам завершена",text_expired:"Срок АнтиРоботной проверки истёк",button_restart:"Начать заново",text_error:"Ошибка проверки",button_retry:"Повторить ещё раз",text_fetch_error:"Ошибка подключения"},sv:{text_init:"Aktiverar...",text_ready:"Jag är inte en robot",button_start:"Klicka för att verifiera",text_fetching:"Hämtar data",text_solving:"Kontrollerar att du är människa...",text_completed:"Jag är en människa",text_completed_sr:"Automatisk spamkontroll slutförd",text_expired:"Anti-robot-verifieringen har löpt ut",button_restart:"Börja om",text_error:"Verifiering kunde inte slutföras",button_retry:"Omstart",text_fetch_error:"Verifiering misslyckades"},tr:{text_init:"Başlatılıyor...",text_ready:"Anti-Robot Doğrulaması",button_start:"Doğrulamayı başlatmak için tıklayın",text_fetching:"Yükleniyor",text_solving:"Robot olmadığınız doğrulanıyor...",text_completed:"Ben bir insanım",text_completed_sr:"Otomatik spam kontrolü tamamlandı",text_expired:"Anti-Robot doğrulamasının süresi doldu",button_restart:"Yeniden başlat",text_error:"Doğrulama başarısız oldu",button_retry:"Tekrar dene",text_fetch_error:"Bağlantı başarısız oldu"},el:{text_init:"Προετοιμασία...",text_ready:"Anti-Robot Επαλήθευση",button_start:" Κάντε κλικ για να ξεκινήσει η επαλήθευση",text_fetching:" Λήψη πρόκλησης",text_solving:" Επιβεβαίωση ανθρώπου...",text_completed:"Είμαι άνθρωπος",text_completed_sr:" Ο αυτόματος έλεγχος ανεπιθύμητου περιεχομένου ολοκληρώθηκε",text_expired:" Η επαλήθευση Anti-Robot έληξε",button_restart:" Επανεκκίνηση",text_error:" Η επαλήθευση απέτυχε",button_retry:" Δοκιμάστε ξανά",text_fetch_error:" Αποτυχία σύνδεσης με"},uk:{text_init:"Ініціалізація...",text_ready:"Антиробот верифікація",button_start:"Натисніть, щоб розпочати верифікацію",text_fetching:"З’єднання",text_solving:"Перевірка, що ви не робот...",text_completed:"Я не робот",text_completed_sr:"Автоматична перевірка спаму завершена",text_expired:"Час вичерпано",button_restart:"Почати знову",text_error:"Верифікація не вдалась",button_retry:"Спробувати знову",text_fetch_error:"Не вдалось з’єднатись"},bg:{text_init:"Инициализиране...",text_ready:"Анти-робот проверка",button_start:"Щракнете, за да започнете проверката",text_fetching:"Предизвикателство",text_solving:"Проверяваме дали си човек...",text_completed:"Аз съм човек",text_completed_sr:"Автоматичната проверка за спам е завършена",text_expired:"Анти-Робот проверката изтече",button_restart:"Рестартирайте",text_error:"Неуспешна проверка",button_retry:"Опитайте пак",text_fetch_error:"Неуспешно свързване с"},cs:{text_init:"Inicializace...",text_ready:"Ověření proti robotům",button_start:"Klikněte pro ověření",text_fetching:"Problém při načítání",text_solving:"Ověření, že jste člověk...",text_completed:"Jsem člověk",text_completed_sr:"Automatická kontrola spamu dokončena",text_expired:"Ověření proti robotům vypršelo",button_restart:"Restartovat",text_error:"Ověření se nezdařilo",button_retry:"Zkusit znovu",text_fetch_error:"Připojení se nezdařilo"},sk:{text_init:"Inicializácia...",text_ready:"Overenie proti robotom",button_start:"Kliknite pre overenie",text_fetching:"Problém pri načítaní",text_solving:"Overenie, že ste človek...",text_completed:"Som človek",text_completed_sr:"Automatická kontrola spamu dokončená",text_expired:"Overenie proti robotom vypršalo",button_restart:"Reštartovať",text_error:"Overenie sa nepodarilo",button_retry:"Skúsiť znova",text_fetch_error:"Pripojenie sa nepodarilo"},no:g,fi:{text_init:"Aktivoidaan...",text_ready:"En ole robotti",button_start:"Aloita vahvistus klikkaamalla",text_fetching:"Haetaan tietoja",text_solving:"Tarkistaa, että olet ihminen...",text_completed:"Olen ihminen",text_completed_sr:"Automaattinen roskapostin tarkistus suoritettu",text_expired:"Vahvistusta ei voitu suorittaa loppuun",button_restart:"Uudelleenkäynnistys",text_error:"Vahvistus epäonnistui",button_retry:"Yritä uudelleen",text_fetch_error:"Yhteys epäonnistui"},lv:{text_init:"Notiek inicializēšana...",text_ready:"Verifikācija, ka neesat robots",button_start:"Noklikšķiniet, lai sāktu verifikāciju",text_fetching:"Notiek drošības uzdevuma izgūšana",text_solving:"Notiek pārbaude, vai esat cilvēks...",text_completed:"Es esmu cilvēks",text_completed_sr:"Automātiska surogātpasta pārbaude pabeigta",text_expired:"Verifikācijas, ka neesat robots, derīgums beidzies",button_restart:"Restartēt",text_error:"Verifikācija neizdevās",button_retry:"Mēģināt vēlreiz",text_fetch_error:"Neizdevās izveidot savienojumu ar"},lt:{text_init:"Inicijuojama...",text_ready:"Patikrinimas, ar nesate robotas",button_start:"Spustelėkite patikrinimui pradėti",text_fetching:"Gavimo iššūkis",text_solving:"Tikrinama, ar esate žmogus...",text_completed:"Esu žmogus",text_completed_sr:"Automatinė patikra dėl pašto šiukšlių atlikta",text_expired:"Patikrinimas, ar nesate robotas, baigė galioti",button_restart:"Pradėti iš naujo",text_error:"Patikrinimas nepavyko",button_retry:"Kartoti",text_fetch_error:"Nepavyko prisijungti prie"},pl:{text_init:"Inicjowanie...",text_ready:"Weryfikacja antybotowa",button_start:"Kliknij, aby rozpocząć weryfikację",text_fetching:"Pobieranie",text_solving:"Weryfikacja, czy nie jesteś robotem...",text_completed:"Nie jestem robotem",text_completed_sr:"Zakończono automatyczne sprawdzanie spamu",text_expired:"Weryfikacja antybotowa wygasła",button_restart:"Uruchom ponownie",text_error:"Weryfikacja nie powiodła się",button_retry:"Spróbuj ponownie",text_fetch_error:"Nie udało się połączyć z"},et:{text_init:"Initsialiseerimine...",text_ready:"Robotivastane kinnitus",button_start:"Kinnitamisega alustamiseks klõpsake",text_fetching:"Väljakutse toomine",text_solving:"Kinnitatakse, et sa oled inimene...",text_completed:"Ma olen inimene",text_completed_sr:"Automaatne rämpsposti kontroll on lõpetatud",text_expired:"Robotivastane kinnitus aegus",button_restart:"Taaskäivita",text_error:"Kinnitamine nurjus",button_retry:"Proovi uuesti",text_fetch_error:"Ühenduse loomine nurjus"},hr:{text_init:"Početno postavljanje...",text_ready:"Provjera protiv robota",button_start:"Kliknite za početak provjere",text_fetching:"Dohvaćanje izazova",text_solving:"Provjeravamo jeste li čovjek...",text_completed:"Nisam robot",text_completed_sr:"Automatska provjera je završena",text_expired:"Vrijeme za provjeru protiv robota je isteklo",button_restart:"Osvježi",text_error:"Provjera nije uspjlela",button_retry:" Ponovo pokreni",text_fetch_error:"Nije moguće uspostaviti vezu"},sr:{text_init:"Pokretanje...",text_ready:"Anti-Robot Verifikacija",button_start:"Kliknite da biste započeli verifikaciju",text_fetching:"Učitavanje izazova",text_solving:"Verifikacija da ste čovek...",text_completed:"Ja sam čovek",text_completed_sr:"Automatska provera neželjene pošte je završena",text_expired:"Anti-Robot verifikacija je istekla",button_restart:"Ponovo pokrenuti",text_error:"Verifikacija nije uspela",button_retry:"Pokušajte ponovo",text_fetch_error:"Neuspelo povezivanje sa..."},sl:{text_init:"Inicializiranje...",text_ready:"Preverjanje robotov",button_start:"Kliknite za začetek preverjanja",text_fetching:"Prenašanje izziva",text_solving:"Preverjamo, ali ste človek",text_completed:"Nisem robot",text_completed_sr:"Avtomatsko preverjanje je zaključeno",text_expired:"Preverjanje robotov je poteklo",button_restart:"Osveži",text_error:"Preverjanje ni uspelo",button_retry:"Poskusi ponovno",text_fetch_error:"Povezave ni bilo mogoče vzpostaviti"},hu:{text_init:"Inicializálás...",text_ready:"Robotellenes ellenőrzés",button_start:"Kattintson az ellenőrzés megkezdéséhez",text_fetching:"Feladvány lekérése",text_solving:"Annak igazolása, hogy Ön nem robot...",text_completed:"Nem vagyok robot",text_completed_sr:"Automatikus spam ellenőrzés befejeződött",text_expired:"Robotellenes ellenőrzés lejárt",button_restart:"Újraindítás",text_error:"Az ellenőrzés nem sikerült",button_retry:"Próbálja újra",text_fetch_error:"Nem sikerült csatlakozni"},ro:{text_init:"Se inițializează...",text_ready:"Verificare anti-robot",button_start:"Click pentru a începe verificarea",text_fetching:"Downloading",text_solving:"Verificare că ești om...",text_completed:"Sunt om",text_completed_sr:"Verificarea automată a spam-ului a fost finalizată",text_expired:"Verificarea anti-robot a expirat",button_restart:"Restart",text_error:"Verificare eșuată",button_retry:"Reîncearcă",text_fetch_error:"Nu s-a putut conecta"},zh:{text_init:"初始化中……",text_ready:"人机验证",button_start:"点击开始",text_fetching:"正在加载",text_solving:"人机校验中……",text_completed:"我不是机器人",text_completed_sr:"人机验证完成",text_expired:"验证已过期",button_restart:"重新开始",text_error:"校验失败",button_retry:"重试",text_fetch_error:"无法连接到"},zh_tw:{text_init:"正在初始化……",text_ready:"反機器人驗證",button_start:"點擊開始驗證",text_fetching:"載入中",text_solving:"反機器人驗證中……",text_completed:"我不是機器人",text_completed_sr:"驗證完成",text_expired:"驗證超時",button_restart:"重新開始",text_error:"驗證失敗",button_retry:"重試",text_fetch_error:"無法連線到"},vi:{text_init:"Đang khởi tạo...",text_ready:"Xác minh chống Robot",button_start:"Bấm vào đây để xác minh",text_fetching:"Tìm nạp và xử lý thử thách",text_solving:"Xác minh bạn là người...",text_completed:"Bạn là con người",text_completed_sr:"Xác minh hoàn tất",text_expired:"Xác minh đã hết hạn",button_restart:"Khởi động lại",text_error:"Xác minh thất bại",button_retry:"Thử lại",text_fetch_error:"Không kết nối được"},nb:g};function u(t,e){const r=new Uint8Array(3),i=new DataView(r.buffer);return i.setUint8(0,t),i.setUint16(1,e),r}let d;"undefined"!=typeof window&&(d=window.URL||window.webkitURL);class p{constructor(){this.workers=[],this.puzzleNumber=0,this.numPuzzles=0,this.threshold=0,this.startTime=0,this.progress=0,this.totalHashes=0,this.puzzleSolverInputs=[],this.puzzleIndex=0,this.solutionBuffer=new Uint8Array(0),this.solverType=1,this.readyCount=0,this.startCount=0,this.progressCallback=()=>0,this.readyCallback=()=>0,this.startedCallback=()=>0,this.doneCallback=()=>0,this.errorCallback=()=>0}init(){this.terminateWorkers(),this.progress=0,this.totalHashes=0,this.readyCount=0,this.startCount=0,this.workers=new Array(4);const t=new Blob(['!function(){"use strict";const A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I="=".charCodeAt(0),g=new Uint8Array(256);for(let I=0;I{const g=function(A){return new Uint32Array(C.buffer)[(B+4>>>2)+2*A]}(A),e=31-Math.clz32(g>>>6&31),o=I.length,i=Q(o<>>2]=t(i),n[r+4>>>2]=i,n[r+8>>>2]=o<>>e)+A]=t(I[A]);else s.set(I,i>>>e);return r},I.__getUint8Array=A=>{const I=new Uint32Array(C.buffer),g=I[A+4>>>2];return new Uint8Array(C.buffer,g,I[g-4>>>2]>>>0)},function(A,I={}){const g=A.__argumentsLength?I=>{A.__argumentsLength.value=I}:A.__setArgumentsLength||A.__setargc||(()=>({}));for(const C in A){if(!Object.prototype.hasOwnProperty.call(A,C))continue;const Q=A[C],t=C.split(".")[0];"function"==typeof Q&&Q!==g?(I[t]=(...A)=>(g(A.length),Q(...A))).original=Q:I[t]=Q}return I}(g,I)}class Q{constructor(A){this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.v=new Uint32Array(32),this.m=new Uint32Array(32),this.outlen=A}}function t(A,I){return A[I]^A[I+1]<<8^A[I+2]<<16^A[I+3]<<24}function B(A,I,g,C,Q,t,B,e){const o=I[B],i=I[B+1],r=I[e],n=I[e+1];let E,s,w,c,a=A[g],D=A[g+1],h=A[C],f=A[C+1],y=A[Q],l=A[Q+1],u=A[t],N=A[t+1];E=a+h,s=(a&h|(a|h)&~E)>>>31,a=E,D=D+f+s,E=a+o,s=(a&o|(a|o)&~E)>>>31,a=E,D=D+i+s,w=u^a,c=N^D,u=c,N=w,E=y+u,s=(y&u|(y|u)&~E)>>>31,y=E,l=l+N+s,w=h^y,c=f^l,h=w>>>24^c<<8,f=c>>>24^w<<8,E=a+h,s=(a&h|(a|h)&~E)>>>31,a=E,D=D+f+s,E=a+r,s=(a&r|(a|r)&~E)>>>31,a=E,D=D+n+s,w=u^a,c=N^D,u=w>>>16^c<<16,N=c>>>16^w<<16,E=y+u,s=(y&u|(y|u)&~E)>>>31,y=E,l=l+N+s,w=h^y,c=f^l,h=c>>>31^w<<1,f=w>>>31^c<<1,A[g]=a,A[g+1]=D,A[C]=h,A[C+1]=f,A[Q]=y,A[Q+1]=l,A[t]=u,A[t+1]=N}const e=[4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225],o=[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6,22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8,14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16,18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26,4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18,24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22,26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20,12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10,20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6];function i(A,I){const g=A.v,C=A.m;for(let I=0;I<16;I++)g[I]=A.h[I],g[I+16]=e[I];g[24]=g[24]^A.t,g[25]=g[25]^A.t/4294967296,I&&(g[28]=~g[28],g[29]=~g[29]);for(let I=0;I<32;I++)C[I]=t(A.b,4*I);for(let A=0;A<12;A++)B(g,C,0,8,16,24,o[16*A+0],o[16*A+1]),B(g,C,2,10,18,26,o[16*A+2],o[16*A+3]),B(g,C,4,12,20,28,o[16*A+4],o[16*A+5]),B(g,C,6,14,22,30,o[16*A+6],o[16*A+7]),B(g,C,0,10,20,30,o[16*A+8],o[16*A+9]),B(g,C,2,12,22,24,o[16*A+10],o[16*A+11]),B(g,C,4,14,16,26,o[16*A+12],o[16*A+13]),B(g,C,6,8,18,28,o[16*A+14],o[16*A+15]);for(let I=0;I<16;I++)A.h[I]=A.h[I]^g[I]^g[I+16]}function r(A,I){for(let I=0;I<16;I++)A.h[I]=e[I];A.b.set(I),A.h[0]^=16842752^A.outlen}async function n(){return(A,I,g=4294967295)=>{const C=function(A,I,g){if(128!=A.length)throw Error("Invalid input");const C=A.buffer,t=new DataView(C),B=new Q(32);B.t=128;const e=t.getUint32(124,!0),o=e+g;for(let g=e;gs=A));self.onerror=A=>{self.postMessage({type:"error",message:JSON.stringify(A)})},self.onmessage=async A=>{const Q=A.data;try{if("solver"===Q.type){if(Q.forceJS){E=1;const A=await n();s(A)}else try{E=2;const A=WebAssembly.compile(function(A){const C=A.length;let Q=3*C>>>2;A.charCodeAt(C-1)===I&&Q--,A.charCodeAt(C-2)===I&&Q--;const t=new Uint8Array(Q);for(let I=0,Q=0;I>4,t[Q++]=(15&B)<<4|e>>2,t[Q++]=(3&e)<<6|63&o}return t}("AGFzbQEAAAABKghgAABgAn9/AGADf39/AX9gAX8AYAR/f39/AGAAAX9gAX8Bf2ACf38BfwINAQNlbnYFYWJvcnQABAMMCwcGAwAAAQIFAQIABQMBAAEGFgR/AUEAC38BQQALfwBBAwt/AEHgDAsHbgkGbWVtb3J5AgAHX19hbGxvYwABCF9fcmV0YWluAAIJX19yZWxlYXNlAAMJX19jb2xsZWN0AAQHX19yZXNldAAFC19fcnR0aV9iYXNlAwMNVWludDhBcnJheV9JRAMCDHNvbHZlQmxha2UyYgAKCAELCvQSC5IBAQV/IABB8P///wNLBEAACyMBQRBqIgQgAEEPakFwcSICQRAgAkEQSxsiBmoiAj8AIgVBEHQiA0sEQCAFIAIgA2tB//8DakGAgHxxQRB2IgMgBSADShtAAEEASARAIANAAEEASARAAAsLCyACJAEgBEEQayICIAY2AgAgAkEBNgIEIAIgATYCCCACIAA2AgwgBAsEACAACwMAAQsDAAELBgAjACQBC7sCAQF/AkAgAUUNACAAQQA6AAAgACABakEEayICQQA6AAMgAUECTQ0AIABBADoAASAAQQA6AAIgAkEAOgACIAJBADoAASABQQZNDQAgAEEAOgADIAJBADoAACABQQhNDQAgAEEAIABrQQNxIgJqIgBBADYCACAAIAEgAmtBfHEiAmpBHGsiAUEANgIYIAJBCE0NACAAQQA2AgQgAEEANgIIIAFBADYCECABQQA2AhQgAkEYTQ0AIABBADYCDCAAQQA2AhAgAEEANgIUIABBADYCGCABQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgwgACAAQQRxQRhqIgFqIQAgAiABayEBA0AgAUEgTwRAIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGCABQSBrIQEgAEEgaiEADAELCwsLcgACfyAARQRAQQxBAhABIQALIAALQQA2AgAgAEEANgIEIABBADYCCCABQfD///8DIAJ2SwRAQcAKQfAKQRJBORAAAAsgASACdCIBQQAQASICIAEQBiAAKAIAGiAAIAI2AgAgACACNgIEIAAgATYCCCAAC88BAQJ/QaABQQAQASIAQQxBAxABQYABQQAQBzYCACAAQQxBBBABQQhBAxAHNgIEIABCADcDCCAAQQA2AhAgAEIANwMYIABCADcDICAAQgA3AyggAEIANwMwIABCADcDOCAAQgA3A0AgAEIANwNIIABCADcDUCAAQgA3A1ggAEIANwNgIABCADcDaCAAQgA3A3AgAEIANwN4IABCADcDgAEgAEIANwOIASAAQgA3A5ABQYABQQUQASIBQYABEAYgACABNgKYASAAQSA2ApwBIAAL2AkCA38SfiAAKAIEIQIgACgCmAEhAwNAIARBgAFIBEAgAyAEaiABIARqKQMANwMAIARBCGohBAwBCwsgAigCBCkDACEMIAIoAgQpAwghDSACKAIEKQMQIQ4gAigCBCkDGCEPIAIoAgQpAyAhBSACKAIEKQMoIQsgAigCBCkDMCEGIAIoAgQpAzghB0KIkvOd/8z5hOoAIQhCu86qptjQ67O7fyEJQqvw0/Sv7ry3PCEQQvHt9Pilp/2npX8hCiAAKQMIQtGFmu/6z5SH0QCFIRFCn9j52cKR2oKbfyESQpSF+aXAyom+YCETQvnC+JuRo7Pw2wAhFEEAIQQDQCAEQcABSARAIAUgCCARIAwgBSADIARBgAhqIgEtAABBA3RqKQMAfHwiBYVCIIoiDHwiCIVCGIoiESAIIAwgBSARIAMgAS0AAUEDdGopAwB8fCIMhUIQiiIIfCIVhUI/iiEFIAsgCSASIA0gCyADIAEtAAJBA3RqKQMAfHwiDYVCIIoiCXwiEYVCGIohCyAGIBAgEyAOIAYgAyABLQAEQQN0aikDAHx8IgaFQiCKIg58IhCFQhiKIhIgECAOIAYgEiADIAEtAAVBA3RqKQMAfHwiDoVCEIoiE3wiEIVCP4ohBiAHIAogFCAPIAcgAyABLQAGQQN0aikDAHx8IgeFQiCKIg98IgqFQhiKIhIgCiAPIAcgEiADIAEtAAdBA3RqKQMAfHwiD4VCEIoiCnwiEoVCP4ohByAQIAogDCARIAkgDSALIAMgAS0AA0EDdGopAwB8fCINhUIQiiIJfCIWIAuFQj+KIgwgAyABLQAIQQN0aikDAHx8IhCFQiCKIgp8IgsgECALIAyFQhiKIhEgAyABLQAJQQN0aikDAHx8IgwgCoVCEIoiFHwiECARhUI/iiELIAYgEiAIIA0gBiADIAEtAApBA3RqKQMAfHwiDYVCIIoiCHwiCoVCGIoiBiANIAYgAyABLQALQQN0aikDAHx8Ig0gCIVCEIoiESAKfCIKhUI/iiEGIAcgFSAJIA4gByADIAEtAAxBA3RqKQMAfHwiDoVCIIoiCHwiCYVCGIoiByAOIAcgAyABLQANQQN0aikDAHx8Ig4gCIVCEIoiEiAJfCIIhUI/iiEHIAUgFiATIA8gBSADIAEtAA5BA3RqKQMAfHwiD4VCIIoiCXwiFYVCGIoiBSAPIAUgAyABLQAPQQN0aikDAHx8Ig8gCYVCEIoiEyAVfCIJhUI/iiEFIARBEGohBAwBCwsgAigCBCACKAIEKQMAIAggDIWFNwMAIAIoAgQgAigCBCkDCCAJIA2FhTcDCCACKAIEIAIoAgQpAxAgDiAQhYU3AxAgAigCBCACKAIEKQMYIAogD4WFNwMYIAIoAgQgAigCBCkDICAFIBGFhTcDICACKAIEIAIoAgQpAyggCyAShYU3AyggAigCBCACKAIEKQMwIAYgE4WFNwMwIAIoAgQgAigCBCkDOCAHIBSFhTcDOCAAIAw3AxggACANNwMgIAAgDjcDKCAAIA83AzAgACAFNwM4IAAgCzcDQCAAIAY3A0ggACAHNwNQIAAgCDcDWCAAIAk3A2AgACAQNwNoIAAgCjcDcCAAIBE3A3ggACASNwOAASAAIBM3A4gBIAAgFDcDkAEL4QIBBH8gACgCCEGAAUcEQEHQCUGACkEeQQUQAAALIAAoAgAhBBAIIgMoAgQhBSADQoABNwMIIAQoAnwiACACaiEGA0AgACAGSQRAIAQgADYCfCADKAIEIgIoAgQgAygCnAGtQoiS95X/zPmE6gCFNwMAIAIoAgRCu86qptjQ67O7fzcDCCACKAIEQqvw0/Sv7ry3PDcDECACKAIEQvHt9Pilp/2npX83AxggAigCBELRhZrv+s+Uh9EANwMgIAIoAgRCn9j52cKR2oKbfzcDKCACKAIEQuv6htq/tfbBHzcDMCACKAIEQvnC+JuRo7Pw2wA3AzggAyAEEAkgBSgCBCkDAKcgAUkEQEEAIAUoAgAiAUEQaygCDCICSwRAQfALQbAMQc0NQQUQAAALQQxBAxABIgAgATYCACAAIAI2AgggACABNgIEIAAPCyAAQQFqIQAMAQsLQQxBAxABQQBBABAHCwwAQaANJABBoA0kAQsL+gQJAEGBCAu/AQECAwQFBgcICQoLDA0ODw4KBAgJDw0GAQwAAgsHBQMLCAwABQIPDQoOAwYHAQkEBwkDAQ0MCw4CBgUKBAAPCAkABQcCBAoPDgELDAYIAw0CDAYKAAsIAwQNBwUPDgEJDAUBDw4NBAoABwYDCQIICw0LBw4MAQMJBQAPBAgGAgoGDw4JCwMACAwCDQcBBAoFCgIIBAcGAQUPCwkOAwwNAAABAgMEBQYHCAkKCwwNDg8OCgQICQ8NBgEMAAILBwUDAEHACQspGgAAAAEAAAABAAAAGgAAAEkAbgB2AGEAbABpAGQAIABpAG4AcAB1AHQAQfAJCzEiAAAAAQAAAAEAAAAiAAAAcwByAGMALwBzAG8AbAB2AGUAcgBXAGEAcwBtAC4AdABzAEGwCgsrHAAAAAEAAAABAAAAHAAAAEkAbgB2AGEAbABpAGQAIABsAGUAbgBnAHQAaABB4AoLNSYAAAABAAAAAQAAACYAAAB+AGwAaQBiAC8AYQByAHIAYQB5AGIAdQBmAGYAZQByAC4AdABzAEGgCws1JgAAAAEAAAABAAAAJgAAAH4AbABpAGIALwBzAHQAYQB0AGkAYwBhAHIAcgBhAHkALgB0AHMAQeALCzMkAAAAAQAAAAEAAAAkAAAASQBuAGQAZQB4ACAAbwB1AHQAIABvAGYAIAByAGEAbgBnAGUAQaAMCzMkAAAAAQAAAAEAAAAkAAAAfgBsAGkAYgAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQeAMCy4GAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAYQAAAAIAAAAhAgAAAgAAACQC")),Q=await async function(A){const I=await async function(A){const I={env:{abort(){throw Error("Wasm aborted")}}};return{exports:C(await WebAssembly.instantiate(A,I))}}(A),g=I.exports.__retain(I.exports.__allocArray(I.exports.Uint8Array_ID,new Uint8Array(128)));let Q=I.exports.__getUint8Array(g);return(A,C,t=4294967295)=>{Q.set(A);const B=I.exports.solveBlake2b(g,C,t);Q=I.exports.__getUint8Array(g);const e=I.exports.__getUint8Array(B);return I.exports.__release(B),[Q,e]}}(await A);s(Q)}catch(A){console.log("FriendlyCaptcha failed to initialize WebAssembly, falling back to Javascript solver: "+A.toString()),E=1;const I=await n();s(I)}self.postMessage({type:"ready",solver:E})}else if("start"===Q.type){const A=await w;self.postMessage({type:"started"});let I,g=0;for(let C=0;C<256;C++){Q.puzzleSolverInput[123]=C;const[t,B]=A(Q.puzzleSolverInput,Q.threshold);if(0!==B.length){I=t;break}console.warn("FC: Internal error or no solution found"),g+=Math.pow(2,32)-1}g+=new DataView(I.slice(-4).buffer).getUint32(0,!0),self.postMessage({type:"done",solution:I.slice(-8),h:g,puzzleIndex:Q.puzzleIndex,puzzleNumber:Q.puzzleNumber})}}catch(A){setTimeout((()=>{throw A}))}}}();'],{type:"text/javascript"});for(let e=0;ethis.errorCallback(t),this.workers[e].onmessage=t=>{const r=t.data;if(r)if("ready"===r.type)this.readyCount++,this.solverType=r.solver,this.readyCount==this.workers.length&&this.readyCallback();else if("started"===r.type)this.startCount++,1==this.startCount&&(this.startTime=Date.now(),this.startedCallback());else if("done"===r.type){if(r.puzzleNumber!==this.puzzleNumber)return;if(this.puzzleIndex0,readyCallback:()=>0,doneCallback:()=>0,errorCallback:()=>0,sitekey:t.dataset.sitekey||"",language:t.dataset.lang||"en",solutionFieldName:t.dataset.solutionFieldName||"frc-captcha-solution"},e),this.e=t,this.e.friendlyChallengeWidget=this,this.loadLanguage(),t.innerText=this.lang.text_init,this.opts.skipStyleInjection||function(){if(!document.querySelector("#frc-style")){const t=document.createElement("style");t.id="frc-style",t.innerHTML=".frc-captcha *{margin:0;padding:0;border:0;text-align:initial;border-radius:px;filter:none!important;transition:none!important;font-weight:400;font-size:14px;line-height:1.2;text-decoration:none;background-color:initial;color:#222}.frc-captcha{position:relative;min-width:250px;max-width:312px;border:1px solid #f4f4f4;padding-bottom:12px;background-color:#fff}.frc-captcha b{font-weight:700}.frc-container{display:flex;align-items:center;min-height:52px}.frc-icon{fill:#222;stroke:#222;flex-shrink:0;margin:8px 8px 0}.frc-icon.frc-warning{fill:#c00}.frc-success .frc-icon{animation:1s ease-in both frc-fade-in}.frc-content{white-space:nowrap;display:flex;flex-direction:column;margin:4px 6px 0 0;overflow-x:auto;flex-grow:1}.frc-banner{position:absolute;bottom:0;right:6px;line-height:1}.frc-banner *{font-size:10px;opacity:.8;text-decoration:none}.frc-progress{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:3px 0;height:4px;border:none;background-color:#eee;color:#222;width:100%;transition:.5s linear}.frc-progress::-webkit-progress-bar{background:#eee}.frc-progress::-webkit-progress-value{background:#222}.frc-progress::-moz-progress-bar{background:#222}.frc-button{cursor:pointer;padding:2px 6px;background-color:#f1f1f1;border:1px solid transparent;text-align:center;font-weight:600;text-transform:none}.frc-button:focus{border:1px solid #333}.frc-button:hover{background-color:#ddd}.frc-captcha-solution{display:none}.frc-err-url{text-decoration:underline;font-size:.9em}.dark.frc-captcha{color:#fff;background-color:#222;border-color:#333}.dark.frc-captcha *{color:#fff}.dark.frc-captcha button{background-color:#444}.dark .frc-icon{fill:#fff;stroke:#fff}.dark .frc-progress{background-color:#444}.dark .frc-progress::-webkit-progress-bar{background:#444}.dark .frc-progress::-webkit-progress-value{background:#ddd}.dark .frc-progress::-moz-progress-bar{background:#ddd}@keyframes frc-fade-in{from{opacity:0}to{opacity:1}}",document.head.appendChild(t)}}(),this.init("auto"===this.opts.startMode||"auto"===this.e.dataset.start)}init(t){var e;if(this.hasBeenDestroyed)console.error("FriendlyCaptcha widget has been destroyed using destroy(), it can not be used anymore.");else if(this.initWorkerGroup(),t)this.start();else if("none"!==this.e.dataset.start&&("focus"===this.opts.startMode||"focus"===this.e.dataset.start)){const t=function(t){for(;"FORM"!==t.tagName;)if(!(t=t.parentElement))return null;return t}(this.e);t?(e=()=>this.start(),t.addEventListener("focusin",e,{once:!0,passive:!0})):console.log("FriendlyCaptcha div seems not to be contained in a form, autostart will not work")}}loadLanguage(t){if(void 0!==t?this.opts.language=t:this.e.dataset.lang&&(this.opts.language=this.e.dataset.lang),"string"==typeof this.opts.language){let t=h[this.opts.language.toLowerCase()];void 0===t&&(console.error('FriendlyCaptcha: language "'+this.opts.language+'" not found.'),t=h.en),this.lang=t}else this.lang=Object.assign(Object.assign({},h.en),this.opts.language)}makeButtonStart(){const t=this.e.querySelector("button");t&&(t.addEventListener("click",(()=>this.start()),{once:!0,passive:!0}),t.addEventListener("touchstart",(()=>this.start()),{once:!0,passive:!0}))}onWorkerError(t){this.hasBeenStarted=!1,this.needsReInit=!0,this.expiryTimeout&&clearTimeout(this.expiryTimeout),console.error("[FRC]",t),this.e.innerHTML=i(this.opts.solutionFieldName,this.lang,"Background worker error "+t.message),this.makeButtonStart(),this.opts.forceJSFallback=!0}initWorkerGroup(){this.workerGroup.progressCallback=t=>{!function(t,e){const r=t.querySelector(".frc-progress"),i=(e.i+1)/e.n;r&&(r.value=i,r.innerText=i.toFixed(2)+"%",r.title=e.i+1+"/"+e.n+" ("+(e.h/e.t*.001).toFixed(0)+"K/s)")}(this.e,t)},this.workerGroup.readyCallback=()=>{var t;this.e.innerHTML=r(this.opts.solutionFieldName,'',!0,(t=this.lang).text_ready,".UNSTARTED",t.button_start,!1),this.makeButtonStart(),this.opts.readyCallback()},this.workerGroup.startedCallback=()=>{var e,i;this.e.innerHTML=(e=this.opts.solutionFieldName,i=this.lang,r(e,t,!0,i.text_solving,".UNFINISHED",void 0,!0)),this.opts.startedCallback()},this.workerGroup.doneCallback=t=>{const e=this.handleDone(t);this.opts.doneCallback(e);const r=this.e.dataset.callback;r&&window[r](e)},this.workerGroup.errorCallback=t=>{this.onWorkerError(t)},this.workerGroup.init(),this.workerGroup.setupSolver(this.opts.forceJSFallback)}expire(){var t,i;this.hasBeenStarted=!1,!1!==this.e.isConnected&&(this.e.innerHTML=(t=this.opts.solutionFieldName,i=this.lang,r(t,e,!0,i.text_expired,".EXPIRED",i.button_restart)),this.makeButtonStart())}async start(){if(this.hasBeenDestroyed)return void console.error("Can not start FriendlyCaptcha widget which has been destroyed");if(this.hasBeenStarted)return void console.warn("Can not start FriendlyCaptcha widget which has already been started");const e=this.opts.sitekey||this.e.dataset.sitekey;if(!e)return console.error("FriendlyCaptcha: sitekey not set on frc-captcha element"),void(this.e.innerHTML=i(this.opts.solutionFieldName,this.lang,"Website problem: sitekey not set",!1));if(-1===l.indexOf("headless")&&-1===A.appVersion.indexOf("Headless")&&-1===l.indexOf("bot")&&-1===l.indexOf("crawl")&&!0!==A.webdriver&&A.language&&(void 0===A.languages||A.languages.length)){if(this.needsReInit)return this.needsReInit=!1,void this.init(!0);this.hasBeenStarted=!0;try{this.e.innerHTML=(o=this.opts.solutionFieldName,s=this.lang,r(o,t,!0,s.text_fetching,".FETCHING",void 0,!0)),this.puzzle=function(t){const e=t.split("."),r=e[1],i=function(t){const e=t.length;let r=3*e>>>2;t.charCodeAt(e-1)===n&&r--,t.charCodeAt(e-2)===n&&r--;const i=new Uint8Array(r);for(let r=0,o=0;r>4,i[o++]=(15&n)<<4|s>>2,i[o++]=(3&s)<<6|63&A}return i}(r);return{signature:e[0],base64:r,buffer:i,n:i[14],threshold:(o=i[15],o>255?o=255:o<0&&(o=0),Math.pow(2,(255.999-o)/8)>>>0),expiry:3e5*i[13]};var o}(await async function(t,e,r){const i=t.split(",");for(let t=0;t${i[t]}`);throw o.rawError=e,o}throw Error("Internal error")}(this.opts.puzzleEndpoint,e,this.lang)),this.expiryTimeout&&clearTimeout(this.expiryTimeout),this.expiryTimeout=setTimeout((()=>this.expire()),this.puzzle.expiry-3e4)}catch(t){console.error("[FRC]",t),this.hasBeenStarted=!1,this.expiryTimeout&&clearTimeout(this.expiryTimeout),this.e.innerHTML=i(this.opts.solutionFieldName,this.lang,t.message),this.makeButtonStart();const e="error_getting_puzzle";this.opts.errorCallback({code:e,description:t.toString(),error:t});const r=this.e.dataset["callback-error"];return void(r&&window[r](this))}var o,s;this.workerGroup.start(this.puzzle)}else this.e.innerHTML=i(this.opts.solutionFieldName,this.lang,"Browser check failed, try a different browser",!1,!0)}handleDone(t){this.valid=!0;const e=`${this.puzzle.signature}.${this.puzzle.base64}.${s(t.solution)}.${s(t.diagnostics)}`;return this.e.innerHTML=function(t,e,i,o){const n=`${o.t.toFixed(0)}s (${(o.h/o.t*.001).toFixed(0)}K/s)${1===o.solver?" JS Fallback":""}`;return r(t,`${e.text_completed_sr}`,!1,e.text_completed,i,void 0,!1,n,"frc-success")}(this.opts.solutionFieldName,this.lang,e,t),this.needsReInit=!0,e}destroy(){this.workerGroup.terminateWorkers(),this.needsReInit=!1,this.hasBeenStarted=!1,this.expiryTimeout&&clearTimeout(this.expiryTimeout),this.e&&(this.e.remove(),delete this.e),this.hasBeenDestroyed=!0}reset(){this.hasBeenDestroyed?console.error("FriendlyCaptcha widget has been destroyed, it can not be used anymore"):(this.workerGroup.terminateWorkers(),this.needsReInit=!1,this.hasBeenStarted=!1,this.expiryTimeout&&clearTimeout(this.expiryTimeout),this.init("auto"===this.opts.startMode||"auto"===this.e.dataset.start))}}function f(){let t=window.friendlyChallenge.autoWidget;const e=function(){const t=document.querySelectorAll(".frc-captcha");return 0===t.length&&console.warn("FriendlyCaptcha: No div was found with .frc-captcha class"),t}();for(let r=0;rgetSiteKey()); self::assertEquals('ABCDEF', $configuration->getSiteSecretKey()); - self::assertEquals('https://puzzle', $configuration->getPuzzleUrl()); + self::assertEquals('', $configuration->getPuzzleEndpoint()); self::assertEquals('https://verify,https://verify2', $configuration->getVerifyUrl()); self::assertEquals('https://verify', $configuration->getFirstVerifyUrl()); self::assertTrue($configuration->isEnabled()); diff --git a/Tests/Unit/Service/ApiTest.php b/Tests/Unit/Service/ApiTest.php index 56919a0..007bbec 100644 --- a/Tests/Unit/Service/ApiTest.php +++ b/Tests/Unit/Service/ApiTest.php @@ -28,7 +28,7 @@ public function verifyUrlIsCalledWithProperData(): void { self::setupRequest(); $GLOBALS['TYPO3_REQUEST'] = $GLOBALS['TYPO3_REQUEST'] - ->withParsedBody(['frc-captcha-solution' => '1234']); + ->withParsedBody(['frc-captcha-response' => '1234']); $historyContainer = []; $client = $this->createClientWithHistory( [new Response(200, [], '{"success": true}')], @@ -52,15 +52,15 @@ public function solutionIsRetrieved(): void self::setupRequest(); $mockedApi = $this->getAccessibleMock(Api::class, null, [], '', false); - self::assertSame('', $mockedApi->_call('getSolutionFromRequest')); + self::assertSame('', $mockedApi->_call('getResponseFromRequest')); $GLOBALS['TYPO3_REQUEST'] = $GLOBALS['TYPO3_REQUEST'] - ->withQueryParams(['frc-captcha-solution' => '12345']); - self::assertSame('12345', $mockedApi->_call('getSolutionFromRequest')); + ->withQueryParams(['frc-captcha-response' => '12345']); + self::assertSame('12345', $mockedApi->_call('getResponseFromRequest')); $GLOBALS['TYPO3_REQUEST'] = $GLOBALS['TYPO3_REQUEST'] - ->withParsedBody(['frc-captcha-solution' => '1234']); - self::assertSame('1234', $mockedApi->_call('getSolutionFromRequest')); + ->withParsedBody(['frc-captcha-response' => '1234']); + self::assertSame('1234', $mockedApi->_call('getResponseFromRequest')); } private function createClientWithHistory(array $responses, array &$historyContainer): Client diff --git a/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php b/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php index c4c35a9..e5ae211 100644 --- a/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php @@ -6,7 +6,6 @@ use StudioMitte\FriendlyCaptcha\Tests\RequestTrait; use StudioMitte\FriendlyCaptcha\ViewHelpers\ConfigurationViewHelper; -use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext; use TYPO3\TestingFramework\Core\BaseTestCase; class ConfigurationViewHelperTest extends BaseTestCase @@ -19,17 +18,14 @@ class ConfigurationViewHelperTest extends BaseTestCase public function viewHelperReturnsProperConfiguration() { self::setupRequest(); + $configurationViewHelper = new ConfigurationViewHelper(); - $renderingContext = new class () extends RenderingContext { - public function __construct() {} - }; self::assertSame([ - 'languageIsoCode' => 'en', 'siteKey' => '1234', 'verifyUrl' => 'https://verify,https://verify2', - 'puzzleUrl' => 'https://puzzle', - 'jsPath' => 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/widget-0.9.12.min.js', + 'puzzleEndpoint' => '', + 'jsPath' => 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/sdk@0.1.8-site.compat.min.js', 'enabled' => true, - ], ConfigurationViewHelper::renderStatic([], static fn() => '', $renderingContext)); + ], $configurationViewHelper->render()); } } diff --git a/ext_emconf.php b/ext_emconf.php index cde67a9..40d3ef0 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -17,5 +17,5 @@ ], ], 'state' => 'beta', - 'version' => '0.1.8', + 'version' => '1.0.0', ];