You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

reaptcha

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reaptcha - npm Package Compare versions

Comparing version

to
1.12.1

2

dist/index.esm.js

@@ -1,2 +0,2 @@

import e,{Component as t}from"react";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}var n=function(e){var t=document.createElement("script");t.async=!0,t.defer=!0,t.src=e,document.head&&document.head.appendChild(t)},i=function(e){return Array.from(document.scripts).reduce(function(t,r){return t||e.test(r.src)},!1)},o=/(http|https):\/\/(www)?.+\/recaptcha/,a=["sitekey","theme","size","badge","tabindex","hl","isolated"],c=/*#__PURE__*/function(t){var c,s;function p(){for(var r,a=arguments.length,c=new Array(a),s=0;s<a;s++)c[s]=arguments[s];return(r=t.call.apply(t,[this].concat(c))||this).container=void 0,r.state={instanceKey:Date.now(),ready:!1,rendered:!1,invisible:"invisible"===r.props.size},r._isAvailable=function(){var e;return Boolean(null==(e=window.grecaptcha)?void 0:e.ready)},r._inject=function(){r.props.inject&&!i(o)&&n("https://recaptcha.net/recaptcha/api.js?render=explicit"+(r.props.hl?"&hl="+r.props.hl:""))},r._prepare=function(){var e=r.props,t=e.explicit,n=e.onLoad;window.grecaptcha.ready(function(){r.setState({ready:!0},function(){t||r.renderExplicitly(),n&&n()})})},r._renderRecaptcha=function(e,t){return window.grecaptcha.render(e,t)},r._resetRecaptcha=function(){return window.grecaptcha.reset(r.state.instanceId)},r._executeRecaptcha=function(){return window.grecaptcha.execute(r.state.instanceId)},r._getResponseRecaptcha=function(){return window.grecaptcha.getResponse(r.state.instanceId)},r._onVerify=function(e){return r.props.onVerify(e)},r._onExpire=function(){return r.props.onExpire&&r.props.onExpire()},r._onError=function(){return r.props.onError&&r.props.onError()},r._stopTimer=function(){r.state.timer&&clearInterval(r.state.timer)},r.componentDidMount=function(){if(r._inject(),r._isAvailable())r._prepare();else{var e=window.setInterval(function(){r._isAvailable()&&(r._prepare(),r._stopTimer())},500);r.setState({timer:e})}},r.componentWillUnmount=function(){r._stopTimer()},r.renderExplicitly=function(){return new Promise(function(e,t){if(r.state.rendered)return t(new Error("This recaptcha instance has been already rendered."));if(!r.state.ready||!r.container)return t(new Error("Recaptcha is not ready for rendering yet."));var n=r._renderRecaptcha(r.container,{sitekey:r.props.sitekey,theme:r.props.theme,size:r.props.size,badge:r.state.invisible?r.props.badge:void 0,tabindex:r.props.tabindex,callback:r._onVerify,"expired-callback":r._onExpire,"error-callback":r._onError,isolated:r.state.invisible?r.props.isolated:void 0,hl:r.state.invisible?void 0:r.props.hl});r.setState({instanceId:n,rendered:!0},function(){r.props.onRender&&r.props.onRender(),e()})})},r.reset=function(){return new Promise(function(e,t){if(r.state.rendered)return r._resetRecaptcha(),e();t(new Error("This recaptcha instance did not render yet."))})},r.execute=function(){return new Promise(function(e,t){return r.state.invisible?(r.state.rendered&&(r._executeRecaptcha(),e()),t(new Error("This recaptcha instance did not render yet."))):t(new Error("Manual execution is only available for invisible size."))})},r.getResponse=function(){return new Promise(function(e,t){if(r.state.rendered)return e(r._getResponseRecaptcha());t(new Error("This recaptcha instance did not render yet."))})},r.render=function(){var t=/*#__PURE__*/e.createElement("div",{key:r.state.instanceKey,id:r.props.id,className:r.props.className,ref:function(e){return r.container=e}});return r.props.children?r.props.children({renderExplicitly:r.renderExplicitly,reset:r.reset,execute:r.execute,getResponse:r.getResponse,recaptchaComponent:t}):t},r}return s=t,(c=p).prototype=Object.create(s.prototype),c.prototype.constructor=c,r(c,s),p.getDerivedStateFromProps=function(e,t){var r="invisible"===e.size;return r!==t.invisible?{invisible:r}:null},p.prototype.componentDidUpdate=function(e){var t=this;a.reduce(function(r,n){return t.props[n]!==e[n]?[].concat(r,[n]):r},[]).length>0&&this.setState({instanceKey:Date.now(),rendered:!1},function(){t.props.explicit||t.renderExplicitly()})},p}(t);c.defaultProps={id:"",className:"g-recaptcha",theme:"light",size:"normal",badge:"bottomright",tabindex:0,explicit:!1,inject:!0,isolated:!1,hl:""};export{c as default};
import e,{Component as t}from"react";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}var n=function(e){var t=document.createElement("script");t.async=!0,t.defer=!0,t.src=e,document.head&&document.head.appendChild(t)},i=function(e){return Array.from(document.scripts).reduce(function(t,r){return t||e.test(r.src)},!1)},o=/(http|https):\/\/(www)?.+\/recaptcha/,a=["sitekey","theme","size","badge","tabindex","hl","isolated"],c=/*#__PURE__*/function(t){var c,s;function p(){for(var r,a=arguments.length,c=new Array(a),s=0;s<a;s++)c[s]=arguments[s];return(r=t.call.apply(t,[this].concat(c))||this).container=void 0,r.timer=void 0,r.state={instanceKey:Date.now(),ready:!1,rendered:!1,invisible:"invisible"===r.props.size},r._isAvailable=function(){var e;return Boolean(null==(e=window.grecaptcha)?void 0:e.ready)},r._inject=function(){r.props.inject&&!i(o)&&n("https://recaptcha.net/recaptcha/api.js?render=explicit"+(r.props.hl?"&hl="+r.props.hl:""))},r._prepare=function(){var e=r.props,t=e.explicit,n=e.onLoad;window.grecaptcha.ready(function(){r.setState({ready:!0},function(){t||r.renderExplicitly(),n&&n()})})},r._renderRecaptcha=function(e,t){return window.grecaptcha.render(e,t)},r._resetRecaptcha=function(){return window.grecaptcha.reset(r.state.instanceId)},r._executeRecaptcha=function(){return window.grecaptcha.execute(r.state.instanceId)},r._getResponseRecaptcha=function(){return window.grecaptcha.getResponse(r.state.instanceId)},r._onVerify=function(e){return r.props.onVerify(e)},r._onExpire=function(){return r.props.onExpire&&r.props.onExpire()},r._onError=function(){return r.props.onError&&r.props.onError()},r._stopTimer=function(){r.timer&&clearInterval(r.timer)},r.componentDidMount=function(){r._inject(),r._isAvailable()?r._prepare():r.timer=window.setInterval(function(){r._isAvailable()&&(r._prepare(),r._stopTimer())},500)},r.componentWillUnmount=function(){r._stopTimer()},r.renderExplicitly=function(){return new Promise(function(e,t){if(r.state.rendered)return t(new Error("This recaptcha instance has been already rendered."));if(!r.state.ready||!r.container)return t(new Error("Recaptcha is not ready for rendering yet."));var n=r._renderRecaptcha(r.container,{sitekey:r.props.sitekey,theme:r.props.theme,size:r.props.size,badge:r.state.invisible?r.props.badge:void 0,tabindex:r.props.tabindex,callback:r._onVerify,"expired-callback":r._onExpire,"error-callback":r._onError,isolated:r.state.invisible?r.props.isolated:void 0,hl:r.state.invisible?void 0:r.props.hl});r.setState({instanceId:n,rendered:!0},function(){r.props.onRender&&r.props.onRender(),e()})})},r.reset=function(){return new Promise(function(e,t){if(r.state.rendered)return r._resetRecaptcha(),e();t(new Error("This recaptcha instance did not render yet."))})},r.execute=function(){return new Promise(function(e,t){return r.state.invisible?(r.state.rendered&&(r._executeRecaptcha(),e()),t(new Error("This recaptcha instance did not render yet."))):t(new Error("Manual execution is only available for invisible size."))})},r.getResponse=function(){return new Promise(function(e,t){if(r.state.rendered)return e(r._getResponseRecaptcha());t(new Error("This recaptcha instance did not render yet."))})},r.render=function(){var t=/*#__PURE__*/e.createElement("div",{key:r.state.instanceKey,id:r.props.id,className:r.props.className,ref:function(e){return r.container=e}});return r.props.children?r.props.children({renderExplicitly:r.renderExplicitly,reset:r.reset,execute:r.execute,getResponse:r.getResponse,recaptchaComponent:t}):t},r}return s=t,(c=p).prototype=Object.create(s.prototype),c.prototype.constructor=c,r(c,s),p.getDerivedStateFromProps=function(e,t){var r="invisible"===e.size;return r!==t.invisible?{invisible:r}:null},p.prototype.componentDidUpdate=function(e){var t=this;a.reduce(function(r,n){return t.props[n]!==e[n]?[].concat(r,[n]):r},[]).length>0&&this.setState({instanceKey:Date.now(),rendered:!1},function(){t.props.explicit||t.renderExplicitly()})},p}(t);c.defaultProps={id:"",className:"g-recaptcha",theme:"light",size:"normal",badge:"bottomright",tabindex:0,explicit:!1,inject:!0,isolated:!1,hl:""};export{c as default};
//# sourceMappingURL=index.esm.js.map

@@ -1,2 +0,2 @@

var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=/*#__PURE__*/t(e);function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}var i=function(e){var t=document.createElement("script");t.async=!0,t.defer=!0,t.src=e,document.head&&document.head.appendChild(t)},o=function(e){return Array.from(document.scripts).reduce(function(t,r){return t||e.test(r.src)},!1)},a=/(http|https):\/\/(www)?.+\/recaptcha/,c=["sitekey","theme","size","badge","tabindex","hl","isolated"],s=/*#__PURE__*/function(e){var t,s;function p(){for(var t,n=arguments.length,c=new Array(n),s=0;s<n;s++)c[s]=arguments[s];return(t=e.call.apply(e,[this].concat(c))||this).container=void 0,t.state={instanceKey:Date.now(),ready:!1,rendered:!1,invisible:"invisible"===t.props.size},t._isAvailable=function(){var e;return Boolean(null==(e=window.grecaptcha)?void 0:e.ready)},t._inject=function(){t.props.inject&&!o(a)&&i("https://recaptcha.net/recaptcha/api.js?render=explicit"+(t.props.hl?"&hl="+t.props.hl:""))},t._prepare=function(){var e=t.props,r=e.explicit,n=e.onLoad;window.grecaptcha.ready(function(){t.setState({ready:!0},function(){r||t.renderExplicitly(),n&&n()})})},t._renderRecaptcha=function(e,t){return window.grecaptcha.render(e,t)},t._resetRecaptcha=function(){return window.grecaptcha.reset(t.state.instanceId)},t._executeRecaptcha=function(){return window.grecaptcha.execute(t.state.instanceId)},t._getResponseRecaptcha=function(){return window.grecaptcha.getResponse(t.state.instanceId)},t._onVerify=function(e){return t.props.onVerify(e)},t._onExpire=function(){return t.props.onExpire&&t.props.onExpire()},t._onError=function(){return t.props.onError&&t.props.onError()},t._stopTimer=function(){t.state.timer&&clearInterval(t.state.timer)},t.componentDidMount=function(){if(t._inject(),t._isAvailable())t._prepare();else{var e=window.setInterval(function(){t._isAvailable()&&(t._prepare(),t._stopTimer())},500);t.setState({timer:e})}},t.componentWillUnmount=function(){t._stopTimer()},t.renderExplicitly=function(){return new Promise(function(e,r){if(t.state.rendered)return r(new Error("This recaptcha instance has been already rendered."));if(!t.state.ready||!t.container)return r(new Error("Recaptcha is not ready for rendering yet."));var n=t._renderRecaptcha(t.container,{sitekey:t.props.sitekey,theme:t.props.theme,size:t.props.size,badge:t.state.invisible?t.props.badge:void 0,tabindex:t.props.tabindex,callback:t._onVerify,"expired-callback":t._onExpire,"error-callback":t._onError,isolated:t.state.invisible?t.props.isolated:void 0,hl:t.state.invisible?void 0:t.props.hl});t.setState({instanceId:n,rendered:!0},function(){t.props.onRender&&t.props.onRender(),e()})})},t.reset=function(){return new Promise(function(e,r){if(t.state.rendered)return t._resetRecaptcha(),e();r(new Error("This recaptcha instance did not render yet."))})},t.execute=function(){return new Promise(function(e,r){return t.state.invisible?(t.state.rendered&&(t._executeRecaptcha(),e()),r(new Error("This recaptcha instance did not render yet."))):r(new Error("Manual execution is only available for invisible size."))})},t.getResponse=function(){return new Promise(function(e,r){if(t.state.rendered)return e(t._getResponseRecaptcha());r(new Error("This recaptcha instance did not render yet."))})},t.render=function(){var e=/*#__PURE__*/r.default.createElement("div",{key:t.state.instanceKey,id:t.props.id,className:t.props.className,ref:function(e){return t.container=e}});return t.props.children?t.props.children({renderExplicitly:t.renderExplicitly,reset:t.reset,execute:t.execute,getResponse:t.getResponse,recaptchaComponent:e}):e},t}return s=e,(t=p).prototype=Object.create(s.prototype),t.prototype.constructor=t,n(t,s),p.getDerivedStateFromProps=function(e,t){var r="invisible"===e.size;return r!==t.invisible?{invisible:r}:null},p.prototype.componentDidUpdate=function(e){var t=this;c.reduce(function(r,n){return t.props[n]!==e[n]?[].concat(r,[n]):r},[]).length>0&&this.setState({instanceKey:Date.now(),rendered:!1},function(){t.props.explicit||t.renderExplicitly()})},p}(e.Component);s.defaultProps={id:"",className:"g-recaptcha",theme:"light",size:"normal",badge:"bottomright",tabindex:0,explicit:!1,inject:!0,isolated:!1,hl:""},module.exports=s;
var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=/*#__PURE__*/t(e);function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}var i=function(e){var t=document.createElement("script");t.async=!0,t.defer=!0,t.src=e,document.head&&document.head.appendChild(t)},o=function(e){return Array.from(document.scripts).reduce(function(t,r){return t||e.test(r.src)},!1)},a=/(http|https):\/\/(www)?.+\/recaptcha/,c=["sitekey","theme","size","badge","tabindex","hl","isolated"],s=/*#__PURE__*/function(e){var t,s;function p(){for(var t,n=arguments.length,c=new Array(n),s=0;s<n;s++)c[s]=arguments[s];return(t=e.call.apply(e,[this].concat(c))||this).container=void 0,t.timer=void 0,t.state={instanceKey:Date.now(),ready:!1,rendered:!1,invisible:"invisible"===t.props.size},t._isAvailable=function(){var e;return Boolean(null==(e=window.grecaptcha)?void 0:e.ready)},t._inject=function(){t.props.inject&&!o(a)&&i("https://recaptcha.net/recaptcha/api.js?render=explicit"+(t.props.hl?"&hl="+t.props.hl:""))},t._prepare=function(){var e=t.props,r=e.explicit,n=e.onLoad;window.grecaptcha.ready(function(){t.setState({ready:!0},function(){r||t.renderExplicitly(),n&&n()})})},t._renderRecaptcha=function(e,t){return window.grecaptcha.render(e,t)},t._resetRecaptcha=function(){return window.grecaptcha.reset(t.state.instanceId)},t._executeRecaptcha=function(){return window.grecaptcha.execute(t.state.instanceId)},t._getResponseRecaptcha=function(){return window.grecaptcha.getResponse(t.state.instanceId)},t._onVerify=function(e){return t.props.onVerify(e)},t._onExpire=function(){return t.props.onExpire&&t.props.onExpire()},t._onError=function(){return t.props.onError&&t.props.onError()},t._stopTimer=function(){t.timer&&clearInterval(t.timer)},t.componentDidMount=function(){t._inject(),t._isAvailable()?t._prepare():t.timer=window.setInterval(function(){t._isAvailable()&&(t._prepare(),t._stopTimer())},500)},t.componentWillUnmount=function(){t._stopTimer()},t.renderExplicitly=function(){return new Promise(function(e,r){if(t.state.rendered)return r(new Error("This recaptcha instance has been already rendered."));if(!t.state.ready||!t.container)return r(new Error("Recaptcha is not ready for rendering yet."));var n=t._renderRecaptcha(t.container,{sitekey:t.props.sitekey,theme:t.props.theme,size:t.props.size,badge:t.state.invisible?t.props.badge:void 0,tabindex:t.props.tabindex,callback:t._onVerify,"expired-callback":t._onExpire,"error-callback":t._onError,isolated:t.state.invisible?t.props.isolated:void 0,hl:t.state.invisible?void 0:t.props.hl});t.setState({instanceId:n,rendered:!0},function(){t.props.onRender&&t.props.onRender(),e()})})},t.reset=function(){return new Promise(function(e,r){if(t.state.rendered)return t._resetRecaptcha(),e();r(new Error("This recaptcha instance did not render yet."))})},t.execute=function(){return new Promise(function(e,r){return t.state.invisible?(t.state.rendered&&(t._executeRecaptcha(),e()),r(new Error("This recaptcha instance did not render yet."))):r(new Error("Manual execution is only available for invisible size."))})},t.getResponse=function(){return new Promise(function(e,r){if(t.state.rendered)return e(t._getResponseRecaptcha());r(new Error("This recaptcha instance did not render yet."))})},t.render=function(){var e=/*#__PURE__*/r.default.createElement("div",{key:t.state.instanceKey,id:t.props.id,className:t.props.className,ref:function(e){return t.container=e}});return t.props.children?t.props.children({renderExplicitly:t.renderExplicitly,reset:t.reset,execute:t.execute,getResponse:t.getResponse,recaptchaComponent:e}):e},t}return s=e,(t=p).prototype=Object.create(s.prototype),t.prototype.constructor=t,n(t,s),p.getDerivedStateFromProps=function(e,t){var r="invisible"===e.size;return r!==t.invisible?{invisible:r}:null},p.prototype.componentDidUpdate=function(e){var t=this;c.reduce(function(r,n){return t.props[n]!==e[n]?[].concat(r,[n]):r},[]).length>0&&this.setState({instanceKey:Date.now(),rendered:!1},function(){t.props.explicit||t.renderExplicitly()})},p}(e.Component);s.defaultProps={id:"",className:"g-recaptcha",theme:"light",size:"normal",badge:"bottomright",tabindex:0,explicit:!1,inject:!0,isolated:!1,hl:""},module.exports=s;
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import e,{Component as t}from"react";const i=/(http|https):\/\/(www)?.+\/recaptcha/,s=["sitekey","theme","size","badge","tabindex","hl","isolated"];class r extends t{constructor(...t){super(...t),this.container=void 0,this.state={instanceKey:Date.now(),ready:!1,rendered:!1,invisible:"invisible"===this.props.size},this._isAvailable=()=>{var e;return Boolean(null==(e=window.grecaptcha)?void 0:e.ready)},this._inject=()=>{var e;this.props.inject&&(e=i,!Array.from(document.scripts).reduce((t,i)=>t||e.test(i.src),!1))&&(e=>{const t=document.createElement("script");t.async=!0,t.defer=!0,t.src=e,document.head&&document.head.appendChild(t)})("https://recaptcha.net/recaptcha/api.js?render=explicit"+(this.props.hl?`&hl=${this.props.hl}`:""))},this._prepare=()=>{const{explicit:e,onLoad:t}=this.props;window.grecaptcha.ready(()=>{this.setState({ready:!0},()=>{e||this.renderExplicitly(),t&&t()})})},this._renderRecaptcha=(e,t)=>window.grecaptcha.render(e,t),this._resetRecaptcha=()=>window.grecaptcha.reset(this.state.instanceId),this._executeRecaptcha=()=>window.grecaptcha.execute(this.state.instanceId),this._getResponseRecaptcha=()=>window.grecaptcha.getResponse(this.state.instanceId),this._onVerify=e=>this.props.onVerify(e),this._onExpire=()=>this.props.onExpire&&this.props.onExpire(),this._onError=()=>this.props.onError&&this.props.onError(),this._stopTimer=()=>{this.state.timer&&clearInterval(this.state.timer)},this.componentDidMount=()=>{if(this._inject(),this._isAvailable())this._prepare();else{const e=window.setInterval(()=>{this._isAvailable()&&(this._prepare(),this._stopTimer())},500);this.setState({timer:e})}},this.componentWillUnmount=()=>{this._stopTimer()},this.renderExplicitly=()=>new Promise((e,t)=>{if(this.state.rendered)return t(new Error("This recaptcha instance has been already rendered."));if(!this.state.ready||!this.container)return t(new Error("Recaptcha is not ready for rendering yet."));{const t=this._renderRecaptcha(this.container,{sitekey:this.props.sitekey,theme:this.props.theme,size:this.props.size,badge:this.state.invisible?this.props.badge:void 0,tabindex:this.props.tabindex,callback:this._onVerify,"expired-callback":this._onExpire,"error-callback":this._onError,isolated:this.state.invisible?this.props.isolated:void 0,hl:this.state.invisible?void 0:this.props.hl});this.setState({instanceId:t,rendered:!0},()=>{this.props.onRender&&this.props.onRender(),e()})}}),this.reset=()=>new Promise((e,t)=>{if(this.state.rendered)return this._resetRecaptcha(),e();t(new Error("This recaptcha instance did not render yet."))}),this.execute=()=>new Promise((e,t)=>this.state.invisible?(this.state.rendered&&(this._executeRecaptcha(),e()),t(new Error("This recaptcha instance did not render yet."))):t(new Error("Manual execution is only available for invisible size."))),this.getResponse=()=>new Promise((e,t)=>{if(this.state.rendered)return e(this._getResponseRecaptcha());t(new Error("This recaptcha instance did not render yet."))}),this.render=()=>{const t=/*#__PURE__*/e.createElement("div",{key:this.state.instanceKey,id:this.props.id,className:this.props.className,ref:e=>this.container=e});return this.props.children?this.props.children({renderExplicitly:this.renderExplicitly,reset:this.reset,execute:this.execute,getResponse:this.getResponse,recaptchaComponent:t}):t}}static getDerivedStateFromProps(e,t){const i="invisible"===e.size;return i!==t.invisible?{invisible:i}:null}componentDidUpdate(e){s.reduce((t,i)=>this.props[i]!==e[i]?[...t,i]:t,[]).length>0&&this.setState({instanceKey:Date.now(),rendered:!1},()=>{this.props.explicit||this.renderExplicitly()})}}r.defaultProps={id:"",className:"g-recaptcha",theme:"light",size:"normal",badge:"bottomright",tabindex:0,explicit:!1,inject:!0,isolated:!1,hl:""};export{r as default};
import e,{Component as t}from"react";const i=/(http|https):\/\/(www)?.+\/recaptcha/,s=["sitekey","theme","size","badge","tabindex","hl","isolated"];class r extends t{constructor(...t){super(...t),this.container=void 0,this.timer=void 0,this.state={instanceKey:Date.now(),ready:!1,rendered:!1,invisible:"invisible"===this.props.size},this._isAvailable=()=>{var e;return Boolean(null==(e=window.grecaptcha)?void 0:e.ready)},this._inject=()=>{var e;this.props.inject&&(e=i,!Array.from(document.scripts).reduce((t,i)=>t||e.test(i.src),!1))&&(e=>{const t=document.createElement("script");t.async=!0,t.defer=!0,t.src=e,document.head&&document.head.appendChild(t)})("https://recaptcha.net/recaptcha/api.js?render=explicit"+(this.props.hl?`&hl=${this.props.hl}`:""))},this._prepare=()=>{const{explicit:e,onLoad:t}=this.props;window.grecaptcha.ready(()=>{this.setState({ready:!0},()=>{e||this.renderExplicitly(),t&&t()})})},this._renderRecaptcha=(e,t)=>window.grecaptcha.render(e,t),this._resetRecaptcha=()=>window.grecaptcha.reset(this.state.instanceId),this._executeRecaptcha=()=>window.grecaptcha.execute(this.state.instanceId),this._getResponseRecaptcha=()=>window.grecaptcha.getResponse(this.state.instanceId),this._onVerify=e=>this.props.onVerify(e),this._onExpire=()=>this.props.onExpire&&this.props.onExpire(),this._onError=()=>this.props.onError&&this.props.onError(),this._stopTimer=()=>{this.timer&&clearInterval(this.timer)},this.componentDidMount=()=>{this._inject(),this._isAvailable()?this._prepare():this.timer=window.setInterval(()=>{this._isAvailable()&&(this._prepare(),this._stopTimer())},500)},this.componentWillUnmount=()=>{this._stopTimer()},this.renderExplicitly=()=>new Promise((e,t)=>{if(this.state.rendered)return t(new Error("This recaptcha instance has been already rendered."));if(!this.state.ready||!this.container)return t(new Error("Recaptcha is not ready for rendering yet."));{const t=this._renderRecaptcha(this.container,{sitekey:this.props.sitekey,theme:this.props.theme,size:this.props.size,badge:this.state.invisible?this.props.badge:void 0,tabindex:this.props.tabindex,callback:this._onVerify,"expired-callback":this._onExpire,"error-callback":this._onError,isolated:this.state.invisible?this.props.isolated:void 0,hl:this.state.invisible?void 0:this.props.hl});this.setState({instanceId:t,rendered:!0},()=>{this.props.onRender&&this.props.onRender(),e()})}}),this.reset=()=>new Promise((e,t)=>{if(this.state.rendered)return this._resetRecaptcha(),e();t(new Error("This recaptcha instance did not render yet."))}),this.execute=()=>new Promise((e,t)=>this.state.invisible?(this.state.rendered&&(this._executeRecaptcha(),e()),t(new Error("This recaptcha instance did not render yet."))):t(new Error("Manual execution is only available for invisible size."))),this.getResponse=()=>new Promise((e,t)=>{if(this.state.rendered)return e(this._getResponseRecaptcha());t(new Error("This recaptcha instance did not render yet."))}),this.render=()=>{const t=/*#__PURE__*/e.createElement("div",{key:this.state.instanceKey,id:this.props.id,className:this.props.className,ref:e=>this.container=e});return this.props.children?this.props.children({renderExplicitly:this.renderExplicitly,reset:this.reset,execute:this.execute,getResponse:this.getResponse,recaptchaComponent:t}):t}}static getDerivedStateFromProps(e,t){const i="invisible"===e.size;return i!==t.invisible?{invisible:i}:null}componentDidUpdate(e){s.reduce((t,i)=>this.props[i]!==e[i]?[...t,i]:t,[]).length>0&&this.setState({instanceKey:Date.now(),rendered:!1},()=>{this.props.explicit||this.renderExplicitly()})}}r.defaultProps={id:"",className:"g-recaptcha",theme:"light",size:"normal",badge:"bottomright",tabindex:0,explicit:!1,inject:!0,isolated:!1,hl:""};export{r as default};
//# sourceMappingURL=index.modern.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e||self).reaptcha=t(e.react)}(this,function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=/*#__PURE__*/t(e);function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}var i=function(e){var t=document.createElement("script");t.async=!0,t.defer=!0,t.src=e,document.head&&document.head.appendChild(t)},o=function(e){return Array.from(document.scripts).reduce(function(t,n){return t||e.test(n.src)},!1)},a="https://recaptcha.net/recaptcha/api.js",c=/(http|https):\/\/(www)?.+\/recaptcha/,s=["sitekey","theme","size","badge","tabindex","hl","isolated"],p=/*#__PURE__*/function(e){var t,p;function d(){for(var t,r=arguments.length,s=new Array(r),p=0;p<r;p++)s[p]=arguments[p];return(t=e.call.apply(e,[this].concat(s))||this).container=void 0,t.state={instanceKey:Date.now(),ready:!1,rendered:!1,invisible:"invisible"===t.props.size},t._isAvailable=function(){var e;return Boolean(null==(e=window.grecaptcha)?void 0:e.ready)},t._inject=function(){t.props.inject&&!o(c)&&i(a+"?render=explicit"+(t.props.hl?"&hl="+t.props.hl:""))},t._prepare=function(){var e=t.props,n=e.explicit,r=e.onLoad;window.grecaptcha.ready(function(){t.setState({ready:!0},function(){n||t.renderExplicitly(),r&&r()})})},t._renderRecaptcha=function(e,t){return window.grecaptcha.render(e,t)},t._resetRecaptcha=function(){return window.grecaptcha.reset(t.state.instanceId)},t._executeRecaptcha=function(){return window.grecaptcha.execute(t.state.instanceId)},t._getResponseRecaptcha=function(){return window.grecaptcha.getResponse(t.state.instanceId)},t._onVerify=function(e){return t.props.onVerify(e)},t._onExpire=function(){return t.props.onExpire&&t.props.onExpire()},t._onError=function(){return t.props.onError&&t.props.onError()},t._stopTimer=function(){t.state.timer&&clearInterval(t.state.timer)},t.componentDidMount=function(){if(t._inject(),t._isAvailable())t._prepare();else{var e=window.setInterval(function(){t._isAvailable()&&(t._prepare(),t._stopTimer())},500);t.setState({timer:e})}},t.componentWillUnmount=function(){t._stopTimer()},t.renderExplicitly=function(){return new Promise(function(e,n){if(t.state.rendered)return n(new Error("This recaptcha instance has been already rendered."));if(!t.state.ready||!t.container)return n(new Error("Recaptcha is not ready for rendering yet."));var r=t._renderRecaptcha(t.container,{sitekey:t.props.sitekey,theme:t.props.theme,size:t.props.size,badge:t.state.invisible?t.props.badge:void 0,tabindex:t.props.tabindex,callback:t._onVerify,"expired-callback":t._onExpire,"error-callback":t._onError,isolated:t.state.invisible?t.props.isolated:void 0,hl:t.state.invisible?void 0:t.props.hl});t.setState({instanceId:r,rendered:!0},function(){t.props.onRender&&t.props.onRender(),e()})})},t.reset=function(){return new Promise(function(e,n){if(t.state.rendered)return t._resetRecaptcha(),e();n(new Error("This recaptcha instance did not render yet."))})},t.execute=function(){return new Promise(function(e,n){return t.state.invisible?(t.state.rendered&&(t._executeRecaptcha(),e()),n(new Error("This recaptcha instance did not render yet."))):n(new Error("Manual execution is only available for invisible size."))})},t.getResponse=function(){return new Promise(function(e,n){if(t.state.rendered)return e(t._getResponseRecaptcha());n(new Error("This recaptcha instance did not render yet."))})},t.render=function(){var e=/*#__PURE__*/n.default.createElement("div",{key:t.state.instanceKey,id:t.props.id,className:t.props.className,ref:function(e){return t.container=e}});return t.props.children?t.props.children({renderExplicitly:t.renderExplicitly,reset:t.reset,execute:t.execute,getResponse:t.getResponse,recaptchaComponent:e}):e},t}return p=e,(t=d).prototype=Object.create(p.prototype),t.prototype.constructor=t,r(t,p),d.getDerivedStateFromProps=function(e,t){var n="invisible"===e.size;return n!==t.invisible?{invisible:n}:null},d.prototype.componentDidUpdate=function(e){var t=this;s.reduce(function(n,r){return t.props[r]!==e[r]?[].concat(n,[r]):n},[]).length>0&&this.setState({instanceKey:Date.now(),rendered:!1},function(){t.props.explicit||t.renderExplicitly()})},d}(e.Component);return p.defaultProps={id:"",className:"g-recaptcha",theme:"light",size:"normal",badge:"bottomright",tabindex:0,explicit:!1,inject:!0,isolated:!1,hl:""},p});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e||self).reaptcha=t(e.react)}(this,function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=/*#__PURE__*/t(e);function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}var i=function(e){var t=document.createElement("script");t.async=!0,t.defer=!0,t.src=e,document.head&&document.head.appendChild(t)},o=function(e){return Array.from(document.scripts).reduce(function(t,n){return t||e.test(n.src)},!1)},a="https://recaptcha.net/recaptcha/api.js",c=/(http|https):\/\/(www)?.+\/recaptcha/,s=["sitekey","theme","size","badge","tabindex","hl","isolated"],p=/*#__PURE__*/function(e){var t,p;function d(){for(var t,r=arguments.length,s=new Array(r),p=0;p<r;p++)s[p]=arguments[p];return(t=e.call.apply(e,[this].concat(s))||this).container=void 0,t.timer=void 0,t.state={instanceKey:Date.now(),ready:!1,rendered:!1,invisible:"invisible"===t.props.size},t._isAvailable=function(){var e;return Boolean(null==(e=window.grecaptcha)?void 0:e.ready)},t._inject=function(){t.props.inject&&!o(c)&&i(a+"?render=explicit"+(t.props.hl?"&hl="+t.props.hl:""))},t._prepare=function(){var e=t.props,n=e.explicit,r=e.onLoad;window.grecaptcha.ready(function(){t.setState({ready:!0},function(){n||t.renderExplicitly(),r&&r()})})},t._renderRecaptcha=function(e,t){return window.grecaptcha.render(e,t)},t._resetRecaptcha=function(){return window.grecaptcha.reset(t.state.instanceId)},t._executeRecaptcha=function(){return window.grecaptcha.execute(t.state.instanceId)},t._getResponseRecaptcha=function(){return window.grecaptcha.getResponse(t.state.instanceId)},t._onVerify=function(e){return t.props.onVerify(e)},t._onExpire=function(){return t.props.onExpire&&t.props.onExpire()},t._onError=function(){return t.props.onError&&t.props.onError()},t._stopTimer=function(){t.timer&&clearInterval(t.timer)},t.componentDidMount=function(){t._inject(),t._isAvailable()?t._prepare():t.timer=window.setInterval(function(){t._isAvailable()&&(t._prepare(),t._stopTimer())},500)},t.componentWillUnmount=function(){t._stopTimer()},t.renderExplicitly=function(){return new Promise(function(e,n){if(t.state.rendered)return n(new Error("This recaptcha instance has been already rendered."));if(!t.state.ready||!t.container)return n(new Error("Recaptcha is not ready for rendering yet."));var r=t._renderRecaptcha(t.container,{sitekey:t.props.sitekey,theme:t.props.theme,size:t.props.size,badge:t.state.invisible?t.props.badge:void 0,tabindex:t.props.tabindex,callback:t._onVerify,"expired-callback":t._onExpire,"error-callback":t._onError,isolated:t.state.invisible?t.props.isolated:void 0,hl:t.state.invisible?void 0:t.props.hl});t.setState({instanceId:r,rendered:!0},function(){t.props.onRender&&t.props.onRender(),e()})})},t.reset=function(){return new Promise(function(e,n){if(t.state.rendered)return t._resetRecaptcha(),e();n(new Error("This recaptcha instance did not render yet."))})},t.execute=function(){return new Promise(function(e,n){return t.state.invisible?(t.state.rendered&&(t._executeRecaptcha(),e()),n(new Error("This recaptcha instance did not render yet."))):n(new Error("Manual execution is only available for invisible size."))})},t.getResponse=function(){return new Promise(function(e,n){if(t.state.rendered)return e(t._getResponseRecaptcha());n(new Error("This recaptcha instance did not render yet."))})},t.render=function(){var e=/*#__PURE__*/n.default.createElement("div",{key:t.state.instanceKey,id:t.props.id,className:t.props.className,ref:function(e){return t.container=e}});return t.props.children?t.props.children({renderExplicitly:t.renderExplicitly,reset:t.reset,execute:t.execute,getResponse:t.getResponse,recaptchaComponent:e}):e},t}return p=e,(t=d).prototype=Object.create(p.prototype),t.prototype.constructor=t,r(t,p),d.getDerivedStateFromProps=function(e,t){var n="invisible"===e.size;return n!==t.invisible?{invisible:n}:null},d.prototype.componentDidUpdate=function(e){var t=this;s.reduce(function(n,r){return t.props[r]!==e[r]?[].concat(n,[r]):n},[]).length>0&&this.setState({instanceKey:Date.now(),rendered:!1},function(){t.props.explicit||t.renderExplicitly()})},d}(e.Component);return p.defaultProps={id:"",className:"g-recaptcha",theme:"light",size:"normal",badge:"bottomright",tabindex:0,explicit:!1,inject:!0,isolated:!1,hl:""},p});
//# sourceMappingURL=index.umd.js.map

@@ -53,6 +53,6 @@ import React, { Component, ReactNode } from 'react';

invisible: boolean;
timer?: number;
};
declare class Reaptcha extends Component<Props, State> {
container?: HTMLDivElement | null;
timer?: number | undefined;
state: State;

@@ -81,4 +81,4 @@ static defaultProps: Partial<Props>;

getResponse: () => Promise<string>;
render: () => React.ReactNode;
render: () => string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
}
export default Reaptcha;
{
"name": "reaptcha",
"version": "1.12.0",
"version": "1.12.1",
"description": "Google reCAPTCHA for React",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet