(()=>{"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.wcSettings,s=window.wp.element,n=window.wp.htmlEntities,a="mercadopago_blocks_update_cart";var c=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 i=({text:e,imgSrc:t,id:o})=>(0,c.jsxs)("div",{id:o,className:"row-image-select",children:[(0,c.jsx)("img",{src:t}),(0,c.jsx)("span",{children:e})]});var p;const d="mp_checkout_blocks",u="woo-mercado-pago-basic",l=(0,r.getSetting)("woo-mercado-pago-basic_data",{}),m=(0,n.decodeEntities)(l.title)||"Checkout Pro",_=e=>{const t=(0,n.decodeEntities)(l?.params?.fee_title||""),o=`${m} ${t}`;return(0,c.jsx)(i,{text:o,imgSrc:l.params.icon,id:"mp-checkout-pro-label"})},y=e=>((e=>{const{extensionCartUpdate:t}=wc.blocksCheckout,{eventRegistration:o,emitResponse:r}=e,{onPaymentSetup:n,onCheckoutSuccess:c,onCheckoutFail:i}=o;(0,s.useEffect)((()=>{((e,t)=>{e({namespace:a,data:{action:"add",gateway:t}})})(t,u);const e=n((()=>({type:r.responseTypes.SUCCESS,meta:{paymentMethodData:{...window.mpHiddenInputDataFromBlocksCheckout}}})));return()=>(((e,t)=>{e({namespace:a,data:{action:"remove",gateway:t}})})(t,u),e())}),[n]),(0,s.useEffect)((()=>{const e=c((async e=>{const t=e.processingResponse;return sendMetric("MP_BASIC_BLOCKS_SUCCESS",t.paymentStatus,d),{type:r.responseTypes.SUCCESS}}));return()=>e()}),[c]),(0,s.useEffect)((()=>{const e=i((e=>{"undefined"!=typeof MPCheckoutErrorDispatcher&&MPCheckoutErrorDispatcher.dispatchEventWhenBlocksCheckoutErrorOccurred(e);const t=e.processingResponse;return sendMetric("MP_BASIC_BLOCKS_ERROR",t.paymentStatus,d),{type:r.responseTypes.FAIL,messageContext:r.noticeContexts.PAYMENTS}}));return()=>e()}),[i])})(e),(0,c.jsx)("div",{dangerouslySetInnerHTML:{__html:l.params.content}})),w={name:u,label:(0,c.jsx)(_,{}),content:(0,c.jsx)(y,{}),edit:(0,c.jsx)(y,{}),canMakePayment:()=>!0,ariaLabel:m,supports:{features:null!==(p=l?.supports)&&void 0!==p?p:[]}};(0,o.registerPaymentMethod)(w)})();