@foxford/services 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var e=require('./../../dependencies/@babel/runtime/helpers/esm/asyncToGenerator.js');var r=require('../../utils/uuid.js');var a=require('../error.js');var t=require('../log.js');var o=require('./constants.js');var n=function(){};class GoogleCaptcha{constructor(e){var{sitekey:r,locale:a,notify:t,onRenderCaptcha:o,onSuccessChallenge:c,onWarnChallenge:i,onErrorChallenge:l}=e;this.sitekey=null,this.locale='ru',this.container=null,this.provider='recaptcha',this.notifyHandler=void 0,this.onRenderCaptcha=void 0,this.onSuccessChallenge=void 0,this.onErrorChallenge=void 0,this.onWarnChallenge=void 0,this.sitekey=null!=r?r:null,this.notifyHandler=null!=t?t:n,this.onRenderCaptcha=null!=o?o:n,this.onSuccessChallenge=null!=c?c:n,this.onWarnChallenge=null!=i?i:n,this.onErrorChallenge=null!=l?l:n,a&&(this.locale=a),this.addDomElements(),GoogleCaptcha.DEBUG&&(window.gr=this)}recaptchaReady(){t.log('Google recaptcha is ready',window.grecaptcha)}addDomElements(){if(!this.container&&!document.getElementById(o.NODE_ID)){document.body.insertAdjacentHTML('beforeend',"<div id=\"".concat(o.NODE_ID,"\"></div>"));var e=document.getElementById(o.NODE_ID);e.style.display='none',this.container=e}}getGrecaptchaCallbackNames(){return{error:"".concat(GoogleCaptcha.ERROR_FUNC_NAME),expired:"".concat(GoogleCaptcha.EXPIRED_FUNC_NAME),resolve:"".concat(GoogleCaptcha.RESOLVE_FUNC_NAME)}}appendScript(r){return e((function*(){if('string'!=typeof r||''===r)throw new TypeError('src script is not defined');var e=document.createElement('script');return e.src=r,document.body&&document.body.appendChild(e),new Promise(((r,a)=>{e.addEventListener('load',(()=>{r(true)})),e.addEventListener('error',(()=>{a()}))}))}))()}loadScript(){var r=this;return e((function*(){if(window.grecaptcha)return Promise.resolve(window.grecaptcha);var t=function(){var a=e((function*(){return yield r.appendScript("https://www.google.com/recaptcha/api.js?hl=".concat(r.locale,"&onload=onloadRecaptchaCallback"))}));return function(){return a.apply(this,arguments)}}();return new Promise(((e,o)=>{window.onloadRecaptchaCallback=()=>{r.recaptchaReady(),window.grecaptcha?e(window.grecaptcha):o(new a.CaptchaError('Recaptcha is not available'))},t().catch((()=>o(new a.CaptchaError('Could not load Recaptcha'))))}))}))()}notify(){this.notifyHandler&&this.notifyHandler(...arguments)}errorHandler(e){switch(t.log("Recaptcha error:",e),e){case'expired':this.notify('Прошло слишком много времени с момента начала проверки. Попробуйте еще раз.');break;case'timeout':this.notify('Возможно произшла ошибка с сетевым подключением. Попробуйте ещё раз. Если не помогает, обратитесь в поддержку.');break;default:this.notify('Что-то пошло не так. Попробуйте ещё раз. Если не помогает, обратитесь в поддержку.')}}renderWidget(e){return new Promise(((e,a)=>{var t,n,c;var i=document.createElement('div');var l="".concat(o.NODE_ID,"_").concat(r.generateUUID());i.id=l,null===(t=document.getElementById(o.NODE_ID))||void 0===t||t.appendChild(i);var d=this.getGrecaptchaCallbackNames();var h=NaN;function s(){var e;null===(e=window.grecaptcha)||void 0===e||e.reset(),setTimeout((()=>{i.remove()}),1e3)}window[d.resolve]=()=>{var r;var a=null===(r=window.grecaptcha)||void 0===r?void 0:r.getResponse(h);e(null!=a?a:''),s()},window[d.error]=()=>{a('error'),s()},window[d.expired]=()=>{a('expired'),s()},h=null===(n=window.grecaptcha)||void 0===n?void 0:n.render(l,{callback:d.resolve,'error-callback':d.error,'expired-callback':d.expired,sitekey:this.sitekey,size:'invisible'});var p=null===(c=window.grecaptcha)||void 0===c?void 0:c.execute(h);if(!p)return a(new Error('cannot call method execute from grecaptcha')),void s();p.catch((e=>{a(e instanceof Error?e:new Error(e.toString())),s()}))}))}execute(r){var o=this;return e((function*(){if(o.sitekey){t.log('Load recaptcha script');try{yield o.loadScript()}catch(r){var e=r instanceof a.CaptchaError?r:new a.CaptchaError('Could not load captcha with error: '+r.toString());throw o.onErrorChallenge(o.provider,e),e}if(!window.grecaptcha){var n=new a.CaptchaError('Recaptcha is not available in window');throw o.onErrorChallenge(o.provider,n),n}try{t.log('Render Recaptcha widget'),o.onRenderCaptcha(o.provider);var c=yield o.renderWidget(r);return o.onSuccessChallenge(o.provider),c}catch(e){if(o.errorHandler(e),'string'!=typeof e){var i=new a.CaptchaError('Could not execute captcha with error: '+e.toString());throw o.onErrorChallenge(o.provider,i),i}if('expired'===e){var l=new a.CaptchaError("Challenge or token expired");l.reason='expired',l.capture=false,o.onWarnChallenge(o.provider,l)}if('error'===e){var d=new a.CaptchaError("Error during captcha execution");d.reason='error',d.capture=false,o.onErrorChallenge(o.provider,d)}}}}))()}}GoogleCaptcha.RESOLVE_FUNC_NAME='grecaptcha_resolved',GoogleCaptcha.ERROR_FUNC_NAME='grecaptcha_error',GoogleCaptcha.EXPIRED_FUNC_NAME='grecaptcha_expired',GoogleCaptcha.DEBUG=false,exports.GoogleCaptcha=GoogleCaptcha;
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var e=require('./../../dependencies/@babel/runtime/helpers/esm/asyncToGenerator.js');var r=require('../../utils/uuid.js');var a=require('../error.js');var t=require('../log.js');var o=require('./constants.js');var n=function(){};class GoogleCaptcha{constructor(e){var{sitekey:r,locale:a,notify:t,onRenderCaptcha:o,onSuccessChallenge:c,onWarnChallenge:i,onErrorChallenge:l}=e;this.sitekey=null,this.locale='ru',this.container=null,this.provider='recaptcha',this.notifyHandler=void 0,this.onRenderCaptcha=void 0,this.onSuccessChallenge=void 0,this.onErrorChallenge=void 0,this.onWarnChallenge=void 0,this.sitekey=null!=r?r:null,this.notifyHandler=null!=t?t:n,this.onRenderCaptcha=null!=o?o:n,this.onSuccessChallenge=null!=c?c:n,this.onWarnChallenge=null!=i?i:n,this.onErrorChallenge=null!=l?l:n,a&&(this.locale=a),this.addDomElements(),GoogleCaptcha.DEBUG&&(window.gr=this)}recaptchaReady(){t.log('Google recaptcha is ready',window.grecaptcha)}addDomElements(){if(!this.container&&!document.getElementById(o.NODE_ID)){document.body.insertAdjacentHTML('beforeend',"<div id=\"".concat(o.NODE_ID,"\"></div>"));var e=document.getElementById(o.NODE_ID);e.style.display='none',this.container=e}}getGrecaptchaCallbackNames(){return{error:"".concat(GoogleCaptcha.ERROR_FUNC_NAME),expired:"".concat(GoogleCaptcha.EXPIRED_FUNC_NAME),resolve:"".concat(GoogleCaptcha.RESOLVE_FUNC_NAME)}}appendScript(r){return e((function*(){if('string'!=typeof r||''===r)throw new TypeError('src script is not defined');var e=document.createElement('script');return e.src=r,document.body&&document.body.appendChild(e),new Promise(((r,a)=>{e.addEventListener('load',(()=>{r(true)})),e.addEventListener('error',(()=>{a()}))}))}))()}loadScript(){var r=this;return e((function*(){if(window.grecaptcha)return Promise.resolve(window.grecaptcha);var t=function(){var a=e((function*(){return yield r.appendScript("https://www.google.com/recaptcha/api.js?hl=".concat(r.locale,"&onload=onloadRecaptchaCallback"))}));return function(){return a.apply(this,arguments)}}();return new Promise(((e,o)=>{window.onloadRecaptchaCallback=()=>{r.recaptchaReady(),window.grecaptcha?e(window.grecaptcha):o(new a.CaptchaError('Recaptcha is not available'))},t().catch((()=>o(new a.CaptchaError('Could not load Recaptcha'))))}))}))()}notify(){this.notifyHandler&&this.notifyHandler(...arguments)}errorHandler(e){switch(t.log("Recaptcha error:",e),e){case'expired':this.notify('Прошло слишком много времени с момента начала проверки. Попробуйте еще раз.');break;case'closed':this.notify('Вы не завершили прохождение проверки. Попробуйте еще раз.');break;case'timeout':this.notify('Возможно произшла ошибка с сетевым подключением. Попробуйте ещё раз. Если не помогает, обратитесь в поддержку.');break;default:this.notify('Что-то пошло не так. Попробуйте ещё раз. Если не помогает, обратитесь в поддержку.')}}detectCaptchaChallengeIsShown(){return new Promise((function(e){var r=document.body;var a=new MutationObserver((function(r){r.forEach((r=>{if(r.addedNodes.length){var t=r.addedNodes[0];if(!t)return;if(t.querySelectorAll('iframe[src^="https://www.google.com/recaptcha"][src*="bframe"]').length){var o=t.firstChild;o&&(a.disconnect(),e(o))}}}))}));a.observe(r,{attributeOldValue:false,attributes:false,characterData:false,characterDataOldValue:false,childList:true,subtree:false})}))}renderWidget(e){return new Promise(((e,a)=>{var t,n,c;var i=document.createElement('div');var l="".concat(o.NODE_ID,"_").concat(r.generateUUID());i.id=l,null===(t=document.getElementById(o.NODE_ID))||void 0===t||t.appendChild(i);var d=this.getGrecaptchaCallbackNames();var s=NaN;function h(){var e;null===(e=window.grecaptcha)||void 0===e||e.reset(),setTimeout((()=>{i.remove()}),1e3)}this.detectCaptchaChallengeIsShown().then((e=>{if(e.parentElement){var r=new MutationObserver((function(){var t,o;'hidden'!==(null===(t=e.parentElement)||void 0===t?void 0:t.style.visibility)||null!==(o=window.grecaptcha)&&void 0!==o&&o.getResponse(s)||(r.disconnect(),a('closed'),h())}));r.observe(e.parentElement,{attributeFilter:['style'],attributes:true})}})),window[d.resolve]=()=>{var r;var a=null===(r=window.grecaptcha)||void 0===r?void 0:r.getResponse(s);e(null!=a?a:''),h()},window[d.error]=()=>{a('error'),h()},window[d.expired]=()=>{a('expired'),h()},s=null===(n=window.grecaptcha)||void 0===n?void 0:n.render(l,{callback:d.resolve,'error-callback':d.error,'expired-callback':d.expired,sitekey:this.sitekey,size:'invisible'});var p=null===(c=window.grecaptcha)||void 0===c?void 0:c.execute(s);if(!p)return a(new Error('cannot call method execute from grecaptcha')),void h();p.catch((e=>{a(e instanceof Error?e:new Error(e.toString())),h()}))}))}execute(r){var o=this;return e((function*(){if(o.sitekey){t.log('Load recaptcha script');try{yield o.loadScript()}catch(r){var e=r instanceof a.CaptchaError?r:new a.CaptchaError('Could not load captcha with error: '+r.toString());throw o.onErrorChallenge(o.provider,e),e}if(!window.grecaptcha){var n=new a.CaptchaError('Recaptcha is not available in window');throw o.onErrorChallenge(o.provider,n),n}try{t.log('Render Recaptcha widget'),o.onRenderCaptcha(o.provider);var c=yield o.renderWidget(r);return o.onSuccessChallenge(o.provider),c}catch(e){if(o.errorHandler(e),'string'!=typeof e){var i=new a.CaptchaError('Could not execute captcha with error: '+e.toString());throw o.onErrorChallenge(o.provider,i),i}if('expired'===e){var l=new a.CaptchaError("Challenge or token expired");l.reason='expired',l.capture=false,o.onWarnChallenge(o.provider,l)}if('error'===e){var d=new a.CaptchaError("Error during captcha execution");d.reason='error',d.capture=false,o.onErrorChallenge(o.provider,d)}}}}))()}}GoogleCaptcha.RESOLVE_FUNC_NAME='grecaptcha_resolved',GoogleCaptcha.ERROR_FUNC_NAME='grecaptcha_error',GoogleCaptcha.EXPIRED_FUNC_NAME='grecaptcha_expired',GoogleCaptcha.DEBUG=false,exports.GoogleCaptcha=GoogleCaptcha;
@@ -1 +1 @@
1
- import e from'./../../dependencies/@babel/runtime/helpers/esm/asyncToGenerator.mjs';import{generateUUID as r}from'../../utils/uuid.mjs';import{CaptchaError as a}from'../error.mjs';import{log as o}from'../log.mjs';import{NODE_ID as t}from'./constants.mjs';var n=function(){};class GoogleCaptcha{constructor(e){var{sitekey:r,locale:a,notify:o,onRenderCaptcha:t,onSuccessChallenge:i,onWarnChallenge:c,onErrorChallenge:l}=e;this.sitekey=null,this.locale='ru',this.container=null,this.provider='recaptcha',this.notifyHandler=void 0,this.onRenderCaptcha=void 0,this.onSuccessChallenge=void 0,this.onErrorChallenge=void 0,this.onWarnChallenge=void 0,this.sitekey=null!=r?r:null,this.notifyHandler=null!=o?o:n,this.onRenderCaptcha=null!=t?t:n,this.onSuccessChallenge=null!=i?i:n,this.onWarnChallenge=null!=c?c:n,this.onErrorChallenge=null!=l?l:n,a&&(this.locale=a),this.addDomElements(),GoogleCaptcha.DEBUG&&(window.gr=this)}recaptchaReady(){o('Google recaptcha is ready',window.grecaptcha)}addDomElements(){if(!this.container&&!document.getElementById(t)){document.body.insertAdjacentHTML('beforeend',"<div id=\"".concat(t,"\"></div>"));var e=document.getElementById(t);e.style.display='none',this.container=e}}getGrecaptchaCallbackNames(){return{error:"".concat(GoogleCaptcha.ERROR_FUNC_NAME),expired:"".concat(GoogleCaptcha.EXPIRED_FUNC_NAME),resolve:"".concat(GoogleCaptcha.RESOLVE_FUNC_NAME)}}appendScript(r){return e((function*(){if('string'!=typeof r||''===r)throw new TypeError('src script is not defined');var e=document.createElement('script');return e.src=r,document.body&&document.body.appendChild(e),new Promise(((r,a)=>{e.addEventListener('load',(()=>{r(true)})),e.addEventListener('error',(()=>{a()}))}))}))()}loadScript(){var r=this;return e((function*(){if(window.grecaptcha)return Promise.resolve(window.grecaptcha);var o=function(){var a=e((function*(){return yield r.appendScript("https://www.google.com/recaptcha/api.js?hl=".concat(r.locale,"&onload=onloadRecaptchaCallback"))}));return function(){return a.apply(this,arguments)}}();return new Promise(((e,t)=>{window.onloadRecaptchaCallback=()=>{r.recaptchaReady(),window.grecaptcha?e(window.grecaptcha):t(new a('Recaptcha is not available'))},o().catch((()=>t(new a('Could not load Recaptcha'))))}))}))()}notify(){this.notifyHandler&&this.notifyHandler(...arguments)}errorHandler(e){switch(o("Recaptcha error:",e),e){case'expired':this.notify('Прошло слишком много времени с момента начала проверки. Попробуйте еще раз.');break;case'timeout':this.notify('Возможно произшла ошибка с сетевым подключением. Попробуйте ещё раз. Если не помогает, обратитесь в поддержку.');break;default:this.notify('Что-то пошло не так. Попробуйте ещё раз. Если не помогает, обратитесь в поддержку.')}}renderWidget(e){return new Promise(((e,a)=>{var o,n,i;var c=document.createElement('div');var l="".concat(t,"_").concat(r());c.id=l,null===(o=document.getElementById(t))||void 0===o||o.appendChild(c);var d=this.getGrecaptchaCallbackNames();var h=NaN;function s(){var e;null===(e=window.grecaptcha)||void 0===e||e.reset(),setTimeout((()=>{c.remove()}),1e3)}window[d.resolve]=()=>{var r;var a=null===(r=window.grecaptcha)||void 0===r?void 0:r.getResponse(h);e(null!=a?a:''),s()},window[d.error]=()=>{a('error'),s()},window[d.expired]=()=>{a('expired'),s()},h=null===(n=window.grecaptcha)||void 0===n?void 0:n.render(l,{callback:d.resolve,'error-callback':d.error,'expired-callback':d.expired,sitekey:this.sitekey,size:'invisible'});var p=null===(i=window.grecaptcha)||void 0===i?void 0:i.execute(h);if(!p)return a(new Error('cannot call method execute from grecaptcha')),void s();p.catch((e=>{a(e instanceof Error?e:new Error(e.toString())),s()}))}))}execute(r){var t=this;return e((function*(){if(t.sitekey){o('Load recaptcha script');try{yield t.loadScript()}catch(r){var e=r instanceof a?r:new a('Could not load captcha with error: '+r.toString());throw t.onErrorChallenge(t.provider,e),e}if(!window.grecaptcha){var n=new a('Recaptcha is not available in window');throw t.onErrorChallenge(t.provider,n),n}try{o('Render Recaptcha widget'),t.onRenderCaptcha(t.provider);var i=yield t.renderWidget(r);return t.onSuccessChallenge(t.provider),i}catch(e){if(t.errorHandler(e),'string'!=typeof e){var c=new a('Could not execute captcha with error: '+e.toString());throw t.onErrorChallenge(t.provider,c),c}if('expired'===e){var l=new a("Challenge or token expired");l.reason='expired',l.capture=false,t.onWarnChallenge(t.provider,l)}if('error'===e){var d=new a("Error during captcha execution");d.reason='error',d.capture=false,t.onErrorChallenge(t.provider,d)}}}}))()}}GoogleCaptcha.RESOLVE_FUNC_NAME='grecaptcha_resolved',GoogleCaptcha.ERROR_FUNC_NAME='grecaptcha_error',GoogleCaptcha.EXPIRED_FUNC_NAME='grecaptcha_expired',GoogleCaptcha.DEBUG=false;export{GoogleCaptcha};
1
+ import e from'./../../dependencies/@babel/runtime/helpers/esm/asyncToGenerator.mjs';import{generateUUID as r}from'../../utils/uuid.mjs';import{CaptchaError as t}from'../error.mjs';import{log as a}from'../log.mjs';import{NODE_ID as o}from'./constants.mjs';var n=function(){};class GoogleCaptcha{constructor(e){var{sitekey:r,locale:t,notify:a,onRenderCaptcha:o,onSuccessChallenge:i,onWarnChallenge:c,onErrorChallenge:l}=e;this.sitekey=null,this.locale='ru',this.container=null,this.provider='recaptcha',this.notifyHandler=void 0,this.onRenderCaptcha=void 0,this.onSuccessChallenge=void 0,this.onErrorChallenge=void 0,this.onWarnChallenge=void 0,this.sitekey=null!=r?r:null,this.notifyHandler=null!=a?a:n,this.onRenderCaptcha=null!=o?o:n,this.onSuccessChallenge=null!=i?i:n,this.onWarnChallenge=null!=c?c:n,this.onErrorChallenge=null!=l?l:n,t&&(this.locale=t),this.addDomElements(),GoogleCaptcha.DEBUG&&(window.gr=this)}recaptchaReady(){a('Google recaptcha is ready',window.grecaptcha)}addDomElements(){if(!this.container&&!document.getElementById(o)){document.body.insertAdjacentHTML('beforeend',"<div id=\"".concat(o,"\"></div>"));var e=document.getElementById(o);e.style.display='none',this.container=e}}getGrecaptchaCallbackNames(){return{error:"".concat(GoogleCaptcha.ERROR_FUNC_NAME),expired:"".concat(GoogleCaptcha.EXPIRED_FUNC_NAME),resolve:"".concat(GoogleCaptcha.RESOLVE_FUNC_NAME)}}appendScript(r){return e((function*(){if('string'!=typeof r||''===r)throw new TypeError('src script is not defined');var e=document.createElement('script');return e.src=r,document.body&&document.body.appendChild(e),new Promise(((r,t)=>{e.addEventListener('load',(()=>{r(true)})),e.addEventListener('error',(()=>{t()}))}))}))()}loadScript(){var r=this;return e((function*(){if(window.grecaptcha)return Promise.resolve(window.grecaptcha);var a=function(){var t=e((function*(){return yield r.appendScript("https://www.google.com/recaptcha/api.js?hl=".concat(r.locale,"&onload=onloadRecaptchaCallback"))}));return function(){return t.apply(this,arguments)}}();return new Promise(((e,o)=>{window.onloadRecaptchaCallback=()=>{r.recaptchaReady(),window.grecaptcha?e(window.grecaptcha):o(new t('Recaptcha is not available'))},a().catch((()=>o(new t('Could not load Recaptcha'))))}))}))()}notify(){this.notifyHandler&&this.notifyHandler(...arguments)}errorHandler(e){switch(a("Recaptcha error:",e),e){case'expired':this.notify('Прошло слишком много времени с момента начала проверки. Попробуйте еще раз.');break;case'closed':this.notify('Вы не завершили прохождение проверки. Попробуйте еще раз.');break;case'timeout':this.notify('Возможно произшла ошибка с сетевым подключением. Попробуйте ещё раз. Если не помогает, обратитесь в поддержку.');break;default:this.notify('Что-то пошло не так. Попробуйте ещё раз. Если не помогает, обратитесь в поддержку.')}}detectCaptchaChallengeIsShown(){return new Promise((function(e){var r=document.body;var t=new MutationObserver((function(r){r.forEach((r=>{if(r.addedNodes.length){var a=r.addedNodes[0];if(!a)return;if(a.querySelectorAll('iframe[src^="https://www.google.com/recaptcha"][src*="bframe"]').length){var o=a.firstChild;o&&(t.disconnect(),e(o))}}}))}));t.observe(r,{attributeOldValue:false,attributes:false,characterData:false,characterDataOldValue:false,childList:true,subtree:false})}))}renderWidget(e){return new Promise(((e,t)=>{var a,n,i;var c=document.createElement('div');var l="".concat(o,"_").concat(r());c.id=l,null===(a=document.getElementById(o))||void 0===a||a.appendChild(c);var d=this.getGrecaptchaCallbackNames();var s=NaN;function h(){var e;null===(e=window.grecaptcha)||void 0===e||e.reset(),setTimeout((()=>{c.remove()}),1e3)}this.detectCaptchaChallengeIsShown().then((e=>{if(e.parentElement){var r=new MutationObserver((function(){var a,o;'hidden'!==(null===(a=e.parentElement)||void 0===a?void 0:a.style.visibility)||null!==(o=window.grecaptcha)&&void 0!==o&&o.getResponse(s)||(r.disconnect(),t('closed'),h())}));r.observe(e.parentElement,{attributeFilter:['style'],attributes:true})}})),window[d.resolve]=()=>{var r;var t=null===(r=window.grecaptcha)||void 0===r?void 0:r.getResponse(s);e(null!=t?t:''),h()},window[d.error]=()=>{t('error'),h()},window[d.expired]=()=>{t('expired'),h()},s=null===(n=window.grecaptcha)||void 0===n?void 0:n.render(l,{callback:d.resolve,'error-callback':d.error,'expired-callback':d.expired,sitekey:this.sitekey,size:'invisible'});var p=null===(i=window.grecaptcha)||void 0===i?void 0:i.execute(s);if(!p)return t(new Error('cannot call method execute from grecaptcha')),void h();p.catch((e=>{t(e instanceof Error?e:new Error(e.toString())),h()}))}))}execute(r){var o=this;return e((function*(){if(o.sitekey){a('Load recaptcha script');try{yield o.loadScript()}catch(r){var e=r instanceof t?r:new t('Could not load captcha with error: '+r.toString());throw o.onErrorChallenge(o.provider,e),e}if(!window.grecaptcha){var n=new t('Recaptcha is not available in window');throw o.onErrorChallenge(o.provider,n),n}try{a('Render Recaptcha widget'),o.onRenderCaptcha(o.provider);var i=yield o.renderWidget(r);return o.onSuccessChallenge(o.provider),i}catch(e){if(o.errorHandler(e),'string'!=typeof e){var c=new t('Could not execute captcha with error: '+e.toString());throw o.onErrorChallenge(o.provider,c),c}if('expired'===e){var l=new t("Challenge or token expired");l.reason='expired',l.capture=false,o.onWarnChallenge(o.provider,l)}if('error'===e){var d=new t("Error during captcha execution");d.reason='error',d.capture=false,o.onErrorChallenge(o.provider,d)}}}}))()}}GoogleCaptcha.RESOLVE_FUNC_NAME='grecaptcha_resolved',GoogleCaptcha.ERROR_FUNC_NAME='grecaptcha_error',GoogleCaptcha.EXPIRED_FUNC_NAME='grecaptcha_expired',GoogleCaptcha.DEBUG=false;export{GoogleCaptcha};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foxford/services",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Foxford services",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",