(()=>{"use strict";var e={20:(e,t,o)=>{var r=o(609),s=Symbol.for("react.element"),n=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function i(e,t,o){var r,i={},p=null,d=null;for(r in void 0!==o&&(p=""+o),void 0!==t.key&&(p=""+t.key),void 0!==t.ref&&(d=t.ref),t)n.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:s,type:e,key:p,ref:d,props:i,_owner:a.current}}t.jsx=i,t.jsxs=i},609:e=>{e.exports=window.React},848:(e,t,o)=>{e.exports=o(20)}},t={};const o=window.wc.wcBlocksRegistry,r=window.wc.blocksCheckout,s=window.wc.wcSettings,n=window.wp.element,a=window.wp.htmlEntities,c="mercadopago_blocks_update_cart";var i=function o(r){var s=t[r];if(void 0!==s)return s.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}(848);const p=({text:e,imgSrc:t,id:o})=>(0,i.jsxs)("div",{id:o,className:"row-image-select",children:[(0,i.jsx)("img",{src:t}),(0,i.jsx)("span",{children:e})]});var d;const u="mp_checkout_blocks",l="woo-mercado-pago-basic",m=(0,s.getSetting)("woo-mercado-pago-basic_data",{}),_=(0,a.decodeEntities)(m.title)||"Checkout Pro",w=e=>{const t=(0,a.decodeEntities)(m?.params?.fee_title||""),o=`${_} ${t}`;return(0,i.jsx)(p,{text:o,imgSrc:m.params.icon,id:"mp-checkout-pro-label"})},y=e=>((e=>{const{eventRegistration:t,emitResponse:o}=e,{onPaymentSetup:s,onCheckoutSuccess:a,onCheckoutFail:i}=t;(0,n.useEffect)((()=>{((e,t)=>{e({namespace:c,data:{action:"add",gateway:t}})})(r.extensionCartUpdate,l);const e=s((()=>({type:o.responseTypes.SUCCESS,meta:{paymentMethodData:{...window.mpHiddenInputDataFromBlocksCheckout}}})));return()=>(((e,t)=>{e({namespace:c,data:{action:"remove",gateway:t}})})(r.extensionCartUpdate,l),e())}),[s]),(0,n.useEffect)((()=>{const e=a((async e=>{const t=e.processingResponse;return sendMetric("MP_BASIC_BLOCKS_SUCCESS",t.paymentStatus,u),{type:o.responseTypes.SUCCESS}}));return()=>e()}),[a]),(0,n.useEffect)((()=>{const e=i((e=>{"undefined"!=typeof MPCheckoutErrorDispatcher&&MPCheckoutErrorDispatcher.dispatchEventWhenBlocksCheckoutErrorOccurred(e);const t=e.processingResponse;return sendMetric("MP_BASIC_BLOCKS_ERROR",t.paymentStatus,u),{type:o.responseTypes.FAIL,messageContext:o.noticeContexts.PAYMENTS}}));return()=>e()}),[i])})(e),(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:m.params.content}})),S={name:l,label:(0,i.jsx)(w,{}),content:(0,i.jsx)(y,{}),edit:(0,i.jsx)(y,{}),canMakePayment:()=>!0,ariaLabel:_,supports:{features:null!==(d=m?.supports)&&void 0!==d?d:[]}};(0,o.registerPaymentMethod)(S)})();