-
Notifications
You must be signed in to change notification settings - Fork 0
/
gRecaptcha.js
1 lines (1 loc) · 14.5 KB
/
gRecaptcha.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{199:function(e,t,n){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(1),i=function(e){return e&&e.__esModule?e:{default:e}}(n(2)),a="https://www.google.com/recaptcha/api.js?&onload=recaptchaLoaded&render=explicit"+("undefined"!=typeof window&&window.recaptchaOptions&&window.recaptchaOptions.lang?"&hl="+window.recaptchaOptions.lang:""),c=function(){return"undefined"!=typeof window&&void 0!==window.grecaptcha},l=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this));return n.execute=function(){return!(!c()||!n.element||null===n.recaptchaId||"invisible"!==n.props.size||(grecaptcha.execute(n.recaptchaId),0))},n.reset=function(){return!(!c()||!n.element||null===n.recaptchaId||(grecaptcha.reset(n.recaptchaId),0))},n.getResponse=function(){return c()&&n.element&&null!==n.recaptchaId?grecaptcha.getResponse(n.recaptchaId):null},n.handleChange=function(e){n.props.onChange&&n.props.onChange(e)},n.handleExpired=function(){n.props.onExpired&&n.props.onExpired()},n.removeRecaptcha=function(){grecaptcha.reset(n.recaptchaId)},n.renderRecaptcha=function(){n.recaptchaId=grecaptcha.render(n.element,{sitekey:n.props.sitekey,callback:n._handleChange,theme:n.props.theme,type:n.props.type,tabindex:n.props.tabindex,"expired-callback":n._handleExpired,size:n.props.size,stoken:n.props.stoken,badge:n.props.badge})},n.captureRef=function(e){n.element=e},n.initializeRecaptcha=function(){if(c())n.clearTimer(),n.renderRecaptcha();else if(n.isRecaptchaJSLibInjected())n.startTimer();else{var e=document.createElement("script");window.recaptchaLoaded=n.initializeRecaptcha.bind(n),e.src=a,e.async=1,e.defer=1,e.onerror=function(){},document.body.appendChild(e)}},n.isRecaptchaJSLibInjected=function(){return"undefined"!=typeof window&&!(!document.scripts||0===document.scripts.length)&&Object.assign([],document.scripts).filter((function(e){return null!==e.src.match(/((http|https):)?\/\/(www\.)?google\.com\/recaptcha\/(.*)/i)})).length>0},n.startTimer=function(){n.waitingTimer=setTimeout(n._initializeRecaptcha,200)},n.clearTimer=function(){null!==n.waitingTimer&&clearInterval(n.waitingTimer)},n.waitingTimer=null,n.element=null,n.recaptchaId=null,n._captureRef=n.captureRef.bind(n),n._initializeRecaptcha=n.initializeRecaptcha.bind(n),n._handleExpired=n.handleExpired.bind(n),n._handleChange=n.handleChange.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.componentDidMount=function(){this.initializeRecaptcha()},t.prototype.componentWillUnmount=function(){this.clearTimer(),c()&&this.element&&null!==this.recaptchaId&&this.removeRecaptcha(),window.___grecaptcha_cfg.count=0,window.___grecaptcha_cfg.clients={}},t.prototype.render=function(){var e=function(e,t){var n={};for(var r in e)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(this.props,["sitekey","onChange","theme","type","tabindex","onExpired","size","stoken","grecaptcha","badge"]);return(0,o.h)("div",r({},e,{ref:this._captureRef}))},t}(o.Component);t.default=l,l.propTypes={sitekey:i.default.string.isRequired,theme:i.default.oneOf(["dark","light"]),type:i.default.oneOf(["image","audio"]),tabindex:i.default.number,size:i.default.oneOf(["compact","normal","invisible"]),stoken:i.default.string,badge:i.default.oneOf(["bottomright","bottomleft","inline"]),onChange:i.default.func,onExpired:i.default.func},l.defaultProps={theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"}},function(e,t,n){"use strict";function r(){}function o(e,t){var n,o,i,a,c=I;for(a=arguments.length;a-- >2;)S.push(arguments[a]);for(t&&null!=t.children&&(S.length||S.push(t.children),delete t.children);S.length;)if((o=S.pop())&&void 0!==o.pop)for(a=o.length;a--;)S.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o+="":"string"!=typeof o&&(i=!1)),i&&n?c[c.length-1]+=o:c===I?c=[o]:c.push(o),n=i;var l=new r;return l.nodeName=e,l.children=c,l.attributes=null==t?void 0:t,l.key=null==t?void 0:t.key,void 0!==P.vnode&&P.vnode(l),l}function i(e,t){for(var n in t)e[n]=t[n];return e}function a(e,t){return o(e.nodeName,i(i({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}function c(e){!e._dirty&&(e._dirty=!0)&&1==U.push(e)&&(P.debounceRendering||j)(l)}function l(){var e,t=U;for(U=[];e=t.pop();)e._dirty&&T(e)}function p(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&u(e,t.nodeName):n||e._componentConstructor===t.nodeName}function u(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function s(e){var t=i({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function d(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===L.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,h,a):e.removeEventListener(t,h,a),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)(function(e,t,n){try{e[t]=n}catch(e){}})(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var c=o&&t!==(t=t.replace(/^xlink\:?/,""));null==r||!1===r?c?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(c?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function h(e){return this._listeners[e.type](P.event&&P.event(e)||e)}function m(){for(var e;e=M.pop();)P.afterMount&&P.afterMount(e),e.componentDidMount&&e.componentDidMount()}function _(e,t,n,r,o,i){z++||(B=null!=o&&void 0!==o.ownerSVGElement,W=null!=e&&!("__preactattr_"in e));var a=v(e,t,n,r,i);return o&&a.parentNode!==o&&o.appendChild(a),--z||(W=!1,i||m()),a}function v(e,t,n,r,o){var i=e,a=B;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||o)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0))),i.__preactattr_=!0,i;var c=t.nodeName;if("function"==typeof c)return N(e,t,n,r);if(B="svg"===c||"foreignObject"!==c&&B,c+="",(!e||!u(e,c))&&(i=function(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.normalizedNodeName=e,n}(c,B),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0)}var l=i.firstChild,p=i.__preactattr_,s=t.children;if(null==p){p=i.__preactattr_={};for(var f=i.attributes,d=f.length;d--;)p[f[d].name]=f[d].value}return!W&&s&&1===s.length&&"string"==typeof s[0]&&null!=l&&void 0!==l.splitText&&null==l.nextSibling?l.nodeValue!=s[0]&&(l.nodeValue=s[0]):(s&&s.length||null!=l)&&b(i,s,n,r,W||null!=p.dangerouslySetInnerHTML),w(i,t.attributes,p),B=a,i}function b(e,t,n,r,o){var i,a,c,l,u,s=e.childNodes,d=[],h={},m=0,_=0,b=s.length,g=0,w=t?t.length:0;if(0!==b)for(var x=0;b>x;x++){var C=s[x],k=C.__preactattr_;null!=(T=w&&k?C._component?C._component.__key:k.key:null)?(m++,h[T]=C):(k||(void 0!==C.splitText?!o||C.nodeValue.trim():o))&&(d[g++]=C)}if(0!==w)for(x=0;w>x;x++){var T;if(u=null,null!=(T=(l=t[x]).key))m&&void 0!==h[T]&&(u=h[T],h[T]=void 0,m--);else if(!u&&g>_)for(i=_;g>i;i++)if(void 0!==d[i]&&p(a=d[i],l,o)){u=a,d[i]=void 0,i===g-1&&g--,i===_&&_++;break}u=v(u,l,n,r),c=s[x],u&&u!==e&&u!==c&&(null==c?e.appendChild(u):u===c.nextSibling?f(c):e.insertBefore(u,c))}if(m)for(var x in h)void 0!==h[x]&&y(h[x],!1);for(;g>=_;)void 0!==(u=d[g--])&&y(u,!1)}function y(e,t){var n=e._component;n?R(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||f(e),g(e))}function g(e){for(e=e.lastChild;e;){var t=e.previousSibling;y(e,!0),e=t}}function w(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||d(e,r,n[r],n[r]=void 0,B);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||d(e,r,n[r],n[r]=t[r],B)}function x(e,t,n){var r,o=A[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),O.call(r,t,n)):((r=new O(t,n)).constructor=e,r.render=C),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.nextBase=o[i].nextBase,o.splice(i,1);break}return r}function C(e,t,n){return this.constructor(e,n)}function k(e,t,n,r,o){e._disable||(e._disable=!0,(e.__ref=t.ref)&&delete t.ref,(e.__key=t.key)&&delete t.key,!e.base||o?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=t,e._disable=!1,0!==n&&(1!==n&&!1===P.syncComponentUpdates&&e.base?c(e):T(e,1,o)),e.__ref&&e.__ref(e))}function T(e,t,n,r){if(!e._disable){var o,a,c,l=e.props,p=e.state,u=e.context,f=e.prevProps||l,d=e.prevState||p,h=e.prevContext||u,v=e.base,b=e.nextBase,g=v||b,w=e._component,C=!1;if(v&&(e.props=f,e.state=d,e.context=h,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(l,p,u)?C=!0:e.componentWillUpdate&&e.componentWillUpdate(l,p,u),e.props=l,e.state=p,e.context=u),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!C){o=e.render(l,p,u),e.getChildContext&&(u=i(i({},u),e.getChildContext()));var N,O,E=o&&o.nodeName;if("function"==typeof E){var S=s(o);(a=w)&&a.constructor===E&&S.key==a.__key?k(a,S,1,u,!1):(N=a,e._component=a=x(E,S,u),a.nextBase=a.nextBase||b,a._parentComponent=e,k(a,S,0,u,!1),T(a,1,n,!0)),O=a.base}else c=g,(N=w)&&(c=e._component=null),(g||1===t)&&(c&&(c._component=null),O=_(c,o,u,n||!v,g&&g.parentNode,!0));if(g&&O!==g&&a!==w){var I=g.parentNode;I&&O!==I&&(I.replaceChild(O,g),N||(g._component=null,y(g,!1)))}if(N&&R(N),e.base=O,O&&!r){for(var j=e,L=e;L=L._parentComponent;)(j=L).base=O;O._component=j,O._componentConstructor=j.constructor}}if(!v||n?M.unshift(e):C||(e.componentDidUpdate&&e.componentDidUpdate(f,d,h),P.afterUpdate&&P.afterUpdate(e)),null!=e._renderCallbacks)for(;e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);z||r||m()}}function N(e,t,n,r){for(var o=e&&e._component,i=o,a=e,c=o&&e._componentConstructor===t.nodeName,l=c,p=s(t);o&&!l&&(o=o._parentComponent);)l=o.constructor===t.nodeName;return o&&l&&(!r||o._component)?(k(o,p,3,n,r),e=o.base):(i&&!c&&(R(i),e=a=null),o=x(t.nodeName,p,n),e&&!o.nextBase&&(o.nextBase=e,a=null),k(o,p,1,n,r),e=o.base,a&&e!==a&&(a._component=null,y(a,!1))),e}function R(e){P.beforeUnmount&&P.beforeUnmount(e);var t=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?R(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.nextBase=t,f(t),function(e){var t=e.constructor.name;(A[t]||(A[t]=[])).push(e)}(e),g(t)),e.__ref&&e.__ref(null)}function O(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{}}function E(e,t,n){return _(n,e,{},!1,t,!1)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"h",(function(){return o})),n.d(t,"createElement",(function(){return o})),n.d(t,"cloneElement",(function(){return a})),n.d(t,"Component",(function(){return O})),n.d(t,"render",(function(){return E})),n.d(t,"rerender",(function(){return l})),n.d(t,"options",(function(){return P}));var P={},S=[],I=[],j="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,L=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,U=[],M=[],z=0,B=!1,W=!1,A={};i(O.prototype,{setState:function(e,t){var n=this.state;this.prevState||(this.prevState=i({},n)),i(n,"function"==typeof e?e(n,this.props):e),t&&(this._renderCallbacks=this._renderCallbacks||[]).push(t),c(this)},forceUpdate:function(e){e&&(this._renderCallbacks=this._renderCallbacks||[]).push(e),T(this,2)},render:function(){}}),t.default={h:o,createElement:o,cloneElement:a,Component:O,render:E,rerender:l,options:P}},function(e,t,n){e.exports=n(3)()},function(e,t,n){"use strict";var r=n(4),o=n(5),i=n(6);e.exports=function(){function e(e,t,n,r,a,c){c!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e){"use strict";function t(e){return function(){return e}}var n=function(){};n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},function(e){"use strict";var t=function(){};e.exports=function(e,n,r,o,i,a,c,l){if(t(n),!e){var p;if(void 0===n)p=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,o,i,a,c,l],s=0;(p=Error(n.replace(/%s/g,(function(){return u[s++]})))).name="Invariant Violation"}throw p.framesToPop=1,p}}},function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}])}}]);