(()=>{"use strict";var e={n:t=>{var c=t&&t.__esModule?()=>t.default:()=>t;return e.d(c,{a:c}),c},d:(t,c)=>{for(var a in c)e.o(c,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:c[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.data,c=window.wc.wcSettings,a=window.wc.blocksCheckoutEvents,r=window.wc.wcBlocksData,s=window.grecaptcha;var n=e.n(s);const o=(0,c.getSetting)("ppcpReCaptcha_data"),i=async()=>{const{paymentMethods:e,siteKey:c}=o,a=(0,t.select)(r.PAYMENT_STORE_KEY).getActivePaymentMethod();if(!e.some(e=>a?.startsWith(e)))return null;try{return await new Promise(e=>n().ready(e)),{type:"success",data:{ppcp_recaptcha_response:await n().execute(c,{action:"submit"})}}}catch(e){return null}};a.checkoutEventsEmitter.subscribe(()=>i(),10,"ppcp_order_create"),a.checkoutEventsEmitter.subscribe(()=>i(),10,"ppcp_vault_token_create"),a.checkoutEventsEmitter.subscribe(()=>i(),10,"ppcp_billing_agreement_create"),(this.wcPPCP=this.wcPPCP||{})["recaptcha-block"]={}})();
//# sourceMappingURL=recaptcha-block.js.map