(()=>{"use strict";var e={20:(e,t,s)=>{var o=s(609),c=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function m(e,t,s){var o,n={},m=null,l=null;for(o in void 0!==s&&(m=""+s),void 0!==t.key&&(m=""+t.key),void 0!==t.ref&&(l=t.ref),t)r.call(t,o)&&!a.hasOwnProperty(o)&&(n[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===n[o]&&(n[o]=t[o]);return{$$typeof:c,type:e,key:m,ref:l,props:n,_owner:i.current}}t.Fragment=n,t.jsx=m,t.jsxs=m},609:e=>{e.exports=window.React},848:(e,t,s)=>{e.exports=s(20)}},t={};const s=window.wc.wcBlocksRegistry,o=window.wc.wcSettings,c=window.wp.element,n=window.wp.htmlEntities,r="mercadopago_blocks_update_cart";var i=function s(o){var c=t[o];if(void 0!==c)return c.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,s),n.exports}(848);const a=({title:e,items:t,titleAlign:s="center",listMode:o="image"})=>(0,i.jsx)("checkout-benefits",{title:e,"title-align":s,items:t,"list-mode":o}),m=({text:e,src:t,alt:s})=>(0,i.jsx)("div",{className:"mp-checkout-pro-redirect",children:(0,i.jsx)("checkout-redirect-v2",{text:e,src:t,alt:s})}),l=({title:e,methods:t})=>(0,i.jsx)("div",{className:"mp-checkout-pro-payment-methods",children:(0,i.jsx)("payment-methods-v2",{title:e,methods:t})}),d=({description:e,linkText:t,linkSrc:s,checkoutClass:o="pro"})=>(0,i.jsx)("div",{className:`mp-checkout-${o}-terms-and-conditions`,children:(0,i.jsx)("terms-and-conditions",{description:e,"link-text":t,"link-src":s})}),p=({title:e,description:t,linkText:s,linkSrc:o})=>(0,i.jsx)("div",{className:"mp-test-mode-container",children:(0,i.jsx)("test-mode",{title:e,description:t,"link-text":s,"link-src":o})}),_=(e,t,s)=>{const o={name:e,message:t,target:s,plugin:{version:wc_mercadopago_custom_checkout_params.plugin_version},platform:{name:"woocommerce",uri:window.location.href,version:wc_mercadopago_custom_checkout_params.platform_version,location:`${wc_mercadopago_custom_checkout_params.location}_${wc_mercadopago_custom_checkout_params.theme}`}};navigator.sendBeacon("https://api.mercadopago.com/v1/plugins/melidata/errors",JSON.stringify(o))};var u;const h="mp_checkout_blocks",k="woo-mercado-pago-basic",x=(0,o.getSetting)("woo-mercado-pago-basic_data",{}),g=(0,n.decodeEntities)(x.title)||"Checkout Pro",f=e=>{const{PaymentMethodLabel:t}=e.components,s=(0,n.decodeEntities)(x?.params?.fee_title||""),o=`${g} ${s}`;return(0,i.jsx)(t,{text:o})},w=e=>{(e=>{const{extensionCartUpdate:t}=wc.blocksCheckout,{eventRegistration:s,emitResponse:o}=e,{onPaymentSetup:n,onCheckoutSuccess:i,onCheckoutFail:a}=s;(0,c.useEffect)((()=>{((e,t)=>{e({namespace:r,data:{action:"add",gateway:t}})})(t,k);const e=n((()=>({type:o.responseTypes.SUCCESS})));return()=>(((e,t)=>{e({namespace:r,data:{action:"remove",gateway:t}})})(t,k),e())}),[n]),(0,c.useEffect)((()=>{const e=i((async e=>{const t=e.processingResponse;return _("MP_BASIC_BLOCKS_SUCCESS",t.paymentStatus,h),{type:o.responseTypes.SUCCESS}}));return()=>e()}),[i]),(0,c.useEffect)((()=>{const e=a((e=>{const t=e.processingResponse;return _("MP_BASIC_BLOCKS_ERROR",t.paymentStatus,h),{type:o.responseTypes.FAIL,messageContext:o.noticeContexts.PAYMENTS}}));return()=>e()}),[a])})(e);const{test_mode_title:t,test_mode_description:s,test_mode_link_text:o,test_mode_link_src:n,checkout_benefits_title:u,checkout_benefits_items:g,payment_methods_title:f,payment_methods_methods:w,method:y,checkout_redirect_text:v,checkout_redirect_src:S,checkout_redirect_alt:j,terms_and_conditions_description:C,terms_and_conditions_link_text:E,terms_and_conditions_link_src:b,test_mode:N,amount:R,message_error_amount:O}=x.params;return null==R?(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("p",{className:"alert-message",children:O})}):(0,i.jsxs)("div",{className:"mp-checkout-container",children:[(0,i.jsx)("div",{className:"mp-checkout-pro-container",children:(0,i.jsxs)("div",{className:"mp-checkout-pro-content",children:[N?(0,i.jsx)(p,{title:t,description:s,"link-text":o,"link-src":n}):null,(0,i.jsx)("div",{className:"mp-checkout-pro-checkout-benefits",children:(0,i.jsx)(a,{title:u,items:g})}),(0,i.jsx)(l,{title:f,methods:w}),"redirect"===y?(0,i.jsx)(m,{text:v,src:S,alt:j}):null]})}),(0,i.jsx)(d,{description:C,linkText:E,linkSrc:b})]})},y={name:k,label:(0,i.jsx)(f,{}),content:(0,i.jsx)(w,{}),edit:(0,i.jsx)(w,{}),canMakePayment:()=>!0,ariaLabel:g,supports:{features:null!==(u=x?.supports)&&void 0!==u?u:[]}};(0,s.registerPaymentMethod)(y)})();