(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ed730bf4"],{"0f7e":function(t,e,a){"use strict";a("aa66")},2173:function(t,e,a){"use strict";a("aa89")},"2b21":function(t,e,a){"use strict";(function(t){a.d(e,"a",(function(){return o}));var n=a("d225"),i=a("b0b4"),s=a("bc3a"),r=a.n(s),o=function(){function e(a){Object(n["a"])(this,e),t.browser&&this.appendPayuScript(a).then((function(){}))}return Object(i["a"])(e,[{key:"appendPayuScript",value:function(t){return new Promise((function(e){var a="https://maf.pagosonline.net/ws/fp/tags.js?id=".concat(t.session_id),n="https://maf.pagosonline.net/ws/fp/tags.js?id=".concat(t.session_id),i=0;if(!document.getElementById("payu-lib")){var s=document.createElement("script");s.setAttribute("src",a),s.setAttribute("id","payu-lib"),document.body.appendChild(s);var r=document.createElement("iframe");r.style.width="100px",r.style.height="100px",r.style.border="0",r.style.position="absolute",r.style.top="-5000px",r.setAttribute("src",n);var o=document.getElementsByTagName("noscript")[0];o.appendChild(r)}var c=setInterval((function(){i++,i>10&&clearInterval(c),window.payU&&(clearInterval(c),e())}),1e3)}))}},{key:"createToken",value:function(t){return r.a.post("payu/token?version=1",t)}},{key:"createTokenEcommerce",value:function(t){return r.a.post("v1/ecommerce/token",t)}}])}()}).call(this,a("f28c"))},"3b2b":function(t,e,a){var n=a("7726"),i=a("5dbc"),s=a("86cc").f,r=a("9093").f,o=a("aae3"),c=a("0bfb"),d=n.RegExp,l=d,u=d.prototype,p=/a/g,m=/a/g,h=new d(p)!==p;if(a("9e1e")&&(!h||a("79e5")((function(){return m[a("2b4c")("match")]=!1,d(p)!=p||d(m)==m||"/a/i"!=d(p,"i")})))){d=function(t,e){var a=this instanceof d,n=o(t),s=void 0===e;return!a&&n&&t.constructor===d&&s?t:i(h?new l(n&&!s?t.source:t,e):l((n=t instanceof d)?t.source:t,n&&s?c.call(t):e),a?this:u,d)};for(var g=function(t){t in d||s(d,t,{configurable:!0,get:function(){return l[t]},set:function(e){l[t]=e}})},_=r(l),f=0;_.length>f;)g(_[f++]);u.constructor=d,d.prototype=u,a("2aba")(n,"RegExp",d)}a("7a56")("RegExp")},"3ea1":function(t,e,a){"use strict";a("caa5")},"8f60d":function(t,e,a){"use strict";a("4917"),a("3b2b");e["a"]={detectCardType:function(t){var e=new RegExp("^4");return null!=t.match(e)?{type:"VISA",icon:"min-visa.svg"}:(e=new RegExp("^5"),null!=t.match(e)?{type:"MASTERCARD",icon:"min-mastercard.svg"}:(e=new RegExp("^3[47]"),null!=t.match(e)?{type:"AMEX",icon:"min-american-express.svg"}:(e=new RegExp("^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)"),null!=t.match(e)?{type:"DISCOVER",icon:"min-default.svg"}:(e=new RegExp("^36"),null!=t.match(e)?{type:"DINERS",icon:"min-diners-club.svg"}:(e=new RegExp("^30[0-5]"),null!=t.match(e)?{type:"DINERS",icon:"min-diners-club.svg"}:(e=new RegExp("^35(2[89]|[3-8][0-9])"),null!=t.match(e)?{type:"JCB",icon:"min-default.svg"}:(e=new RegExp("^(4026|417500|4508|4844|491(3|7))"),null!=t.match(e)?{type:"VISA_DEBIT",icon:"min-visa.svg"}:"min-default.svg")))))))},newDetectCardType:function(t){var e=new RegExp("^4");return null!=t.match(e)?{type:"VISA",items:{icon_card:"/images/cards/visa-1.svg",c_card:"/images/cards/c-gold.svg",color_card:"visa",background:"images/cards/fondos/visa.svg"}}:(e=new RegExp("^5"),null!=t.match(e)?{type:"MASTERCARD",items:{icon_card:"/images/cards/master-card-1.svg",c_card:"/images/cards/c-plate.svg",color_card:"mastercard",background:"images/cards/fondos/mastercard.svg"}}:(e=new RegExp("^3[47]"),null!=t.match(e)?{type:"AMEX",items:{icon_card:"/images/cards/american-express-1.svg",c_card:"/images/cards/c-plate.svg",color_card:"amex",background:"images/cards/fondos/american-express.svg"}}:(e=new RegExp("^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)"),null!=t.match(e)?{type:"DISCOVER",items:{icon_card:"/images/cards/discover.png",c_card:"/images/cards/c-gold.svg",color_card:"",background:"images/cards/fondos/mastercard.svg"}}:(e=new RegExp("^36"),null!=t.match(e)?{type:"DINERS",items:{icon_card:"images/cards/diners-club-1.svg",c_card:"/images/cards/c-gold.svg",color_card:"dinners",background:"images/cards/fondos/diners-club.svg"}}:(e=new RegExp("^30[0-5]"),null!=t.match(e)?{type:"",items:{icon_card:"/images/cards/diners-club-1.svg",c_card:"/images/cards/c-gold.svg",color_card:"dinners",background:"/images/cards/fondos/diners-club.svg"}}:(e=new RegExp("^35(2[89]|[3-8][0-9])"),null!=t.match(e)?{type:"JCB",items:{icon_card:"/images/cards/JCB.png",c_card:"/images/cards/c-gold.svg",color_card:"",background:"/images/cards/fondos/mastercard.svg"}}:(e=new RegExp("^(4026|417500|4508|4844|491(3|7))"),null!=t.match(e)?{type:"VISA_DEBIT",items:{icon_card:"/images/cards/visa-1.svg",c_card:"/images/cards/c-gold.svg",color_card:"visa",background:"/images/cards/fondos/visa.svg"}}:{icon_card:"",c_card:"/images/cards/c-gold.svg",color_card:"",background:"/images/cards/fondos/default.svg"})))))))}}},aa66:function(t,e,a){},aa89:function(t,e,a){},caa5:function(t,e,a){},dd24:function(t,e,a){"use strict";var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ui-layout"},[e("div",{staticClass:"contain-ban"},[e("ReferCode")],1),e("BannerCampaign"),t._t("banner"),e("div",{staticClass:"ui-layout__market-header"},[e("div",[t._t("header-market")],2)]),t.hero?e("div",{staticClass:"ui-layout-hero"},[e("div",{staticClass:"ui-layout-hero__main padding-main container-main"},[t.isBreadcrumb?e("div",{staticClass:"ui-layout__header container-fluid"},[e("div",[t._t("btn-back")],2),t.right?e("div",[t._t("btn-right")],2):e("div",[e("Breadcrumb",{attrs:{links:t.links}})],1)]):t._e(),e("div",{staticClass:"ui-layout-hero__content d-md-none"},[t._t("hero-responsive")],2),e("div",{staticClass:"container-fluid"},[t._t("content")],2),e("div",{staticClass:"container-fluid ui-layout__bg-white"},[t._t("content-white")],2)]),e("div",{staticClass:"ui-layout-hero__content d-none d-lg-block"},[t._t("complement")],2)]):t._e(),e("div",{staticClass:"ui-layout__main"},[t._t("default")],2),e("div",{staticClass:"ui-layout__footer"},[t._t("footer")],2)],2)},i=[],s=a("82ce"),r=a("4aa0"),o=(a("b54a"),function(){var t=this,e=t._self._c;return e("div",{staticClass:"ui-breadcrumb"},[e("ul",t._l(t.links,(function(a,n){return e("li",{key:n,class:{active:a.active}},[e("span",[t._v(t._s(n+1)+". "+t._s(a.link))])])})),0)])}),c=[],d={props:{links:{type:Array}}},l=d,u=(a("2173"),a("2877")),p=Object(u["a"])(l,o,c,!1,null,"7cdf1c7a",null),m=p.exports,h={components:{ReferCode:s["a"],BannerCampaign:r["a"],Breadcrumb:m},props:{links:{type:Array},right:{type:Boolean,default:!1},hero:{type:Boolean,default:!0},isBreadcrumb:{type:Boolean,default:!0}}},g=h,_=(a("3ea1"),Object(u["a"])(g,n,i,!1,null,"1ae997c7",null));e["a"]=_.exports},f48a:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t._self._c;return e("LayoutUiPlans",[e("template",{slot:"btn-back"},[e("a",{staticClass:"text-decoration-none mr-3",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.back.apply(null,arguments)}}},[e("img",{staticClass:"mt-1",attrs:{src:"/images/ui-plans/icons/icon-back.svg",alt:"icon-back"}})])]),e("section",{staticClass:"content-pay"},[e("div",{staticClass:"container-fluid"},[e("div",{staticClass:"ui-layout__txt-objetive"},[t._v("Pago")]),e("div",{staticClass:"card-transfer-title"},[t._v("\n        Ya hemos registrado tu pedido 😋. "),e("br"),t._v("Solo faltaría continuar con tu\n        pago\n      ")]),e("div",{staticClass:"content-card-transfer"},[e("div",{staticClass:"card-transfer"},[e("div",{staticClass:"card-transfer__text"},[e("strong",[t._v("¿Cómo realizar tu compra a través de Transferencia?")])]),1===t.getProfile.country_id?e("div",{},[e("div",{staticClass:"card-transfer__text"},[t._v("\n              1. Desde la app BCP, encuéntranos en\n              "),e("b",[t._v("PAGO DE SERVICIOS")]),t._v(" como\n              "),e("b",[t._v("MANZANA VERDE / PLAN Manzana verde /")]),t._v(" ingresa el monto de\n              tu plan.\n            ")]),e("div",{staticClass:"card-transfer__text"},[t._v("\n              2. Transferencia interbancaria:\n              "),e("b",[t._v("CCI 002-47500250126700121 / RUC 20602661513 ")]),t._v("- Corporación\n              de Alimentos Balanceados SAC\n            ")]),e("div",{staticClass:"card-transfer__text"},[t._v("\n              3. Envía tu comprobante de pago por whatsapp al\n              "),e("b",[t._v(t._s(t.getPhoneNumber))]),t._v(" indicando tu correo electrónico con\n              el que te registraste.\n            ")])]):e("div",{},[e("div",{staticClass:"card-transfer__text"},[t._v("\n              1. Transferencia interbancaria:\n\n              "),e("p",[t._v("\n                Razón Social: Manzana Verde Technologies Sapi de CV / Banco:\n                BANAMEX /\n                "),e("b",[t._v("Cuenta 3058946 / Clabe 002180701430589460 ")]),t._v(" / En\n                concepto de pago ingresa tu nombre.\n              ")])]),e("div",{staticClass:"card-transfer__text"},[t._v("\n              2. Envía tu comprobante de pago por whatsapp al\n              "),e("b",[t._v(t._s(t.getPhoneNumber))]),t._v("\n              indicando tu correo electrónico con el que te registraste.\n            ")])])]),e("div",{staticClass:"card-transfer-img d-none d-sm-none d-md-block"},[e("img",{attrs:{src:"/images/mexico/plate-transfer.png",alt:""}})])]),e("br"),e("br")])]),e("template",{slot:"footer"},[e("div",{staticClass:"pay-footer"},[e("div",{staticClass:"p-items-footer"},[e("div",{staticClass:"pp-items-footer__text"}),e("div",{staticClass:"p-items-footer__btn"},[e("a",{staticClass:"btn btn-sm btn-block btn-register-white",attrs:{target:"_blank",href:t.getURLWhatsapp()},on:{click:t.sendVaucher}},[e("div",{staticClass:"btn-register-white__txt"},[t._v("\n              Enviar comprobante\n            ")]),e("img",{staticClass:"btn-register-white__icon img-fluid",attrs:{src:"/images//ui-plans/icons/icon-next-black.svg",alt:"siguiente"}})])])])])])],2)},i=[],s=(a("8e6e"),a("ac6a"),a("456d"),a("bd86")),r=a("dd24"),o=a("2f62"),c=(a("96cf"),a("3b8d")),d=(a("7f7f"),a("c5f6"),a("a481"),a("bc3a")),l=a.n(d),u=a("a78e"),p=a.n(u),m=a("2b21"),h=a("8f60d"),g=a("272c"),_=void 0;function f(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function v(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?f(Object(a),!0).forEach((function(e){Object(s["a"])(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):f(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}var y={data:function(){return{modalFirstResponse:!1,modalSecondResponse:!1,modalPending:!1,messageWhat:"Hola, acabo de realizar un pago de un plan Manzana Verde, adjunto mi comprobante y el correo electrónico con que me registré es: ",coupon:"",showCoupon:!1,showCouponReferer:!1,showCouponDiscount:!1,priceDiscount:0,idReferralCode:"",applyCoupon:!1,typePayment:0,isLoading:!1,fullPage:!0,chooseActiveSubscription:!0,modalSubscription:!1,isSuscriptionActive:!1,lastAmount:0,loadingPayment:!1,message:"",card:{token_id:null,email:"",client:"",number:"",expire_date:"",cvc:"",amount:0,type:"",dni:""},cardType:"/images/cards/credit-card.svg",itemsCardType:{icon_card:"",c_card:"/images/cards/c-gold.svg",color_card:""},messageInValidTitular:"",messageInValidCard:"",messageInValidDate:"",messageInValidCvv:"",messageInValidEmail:"",messageInValidGeneral:"",error:{status:!1,msg:""},hasError:{status:!1,message:""},payu:null,cardResponse:{},errorPayment:null,modalErrorTransaction:!1,modalSuccessTransaction:!1,messageErrorCoupon:"",value:"",methodPayment:!0,nameCupon:"por código de referido",type_code:"",cuponFreeDay:!0,modalCard:!1,isFocusCvc:!1}},created:function(){"/crear-plan"!=this.$route.path&&"/try-one-day"!=this.$route.path&&(void 0!==this.amount&&0!==this.amount||this.$router.push("/crear-plan")),this.GET_FIRST_PROMO(),this.getSessionId()},mounted:function(){this.promo&&!this.showReferer&&(this.showCoupon=!0,this.coupon=this.promo.utm_term,this.applyCoupon=!0),this.lastAmount=this.amount,this.card.email=this.getProfile.email,this.GET_CARDS(),this.saveEvent()},mixins:[g["a"]],computed:v(v(v(v(v(v(v(v(v(v({},Object(o["c"])("user",["getPlan","getCountry","getCurrency","getProfile"])),Object(o["c"])("plan",["getPromoTrimensual"])),Object(o["e"])("user",["credits"])),Object(o["e"])("marketing",["promo"])),Object(o["e"])("plan",["showReferer","showDiscount","promotion","firstTime","usePoints","validatingPoints","discountPoints","days","isCuponActive","referUsed","nameRefer","referer","fromClient","firstPromo"])),Object(o["c"])("plan",["getPlanData","getUsePoints"])),Object(o["c"])("cards",["getCards","getCardSelectedPay","getFirstCard"])),Object(o["c"])("payment",["getPaymentMethod","getDNI","getAttempt"])),Object(o["c"])("phones",["getSales","getSupport","getSalesAdditional"])),{},{isActiveBtnPay:function(){return this.card.client.length>0&&this.card.number.length>0&&this.card.expire_date.length>0&&this.card.cvc.length>0},getPointsComputed:function(){var t=0,e=this.getProfile.exchange_rate;return t=1==this.getCountry?this.amount/100*2:this.amount/500*2,this.getCurrency+" "+parseInt(t*e)},getCardNumber:function(){return void 0===this.getCardSelectedPay?0:this.getCardSelectedPay.card_number},card_number:{get:function(){if(this.card.number)return this.card.number.replace(/[^0-9]/g,"")},set:function(t){_.card.number=t}},exp_month:function(){return this.card.expire_date?this.card.expire_date.slice(0,this.card.expire_date.indexOf("/")):""},exp_year:function(){return this.card.expire_date?"20"+this.card.expire_date.slice(this.card.expire_date.lastIndexOf("/")+1):""},amount:function(){return this.getPlanData.amount},creditsCount:function(){return"mensual"===this.getPlanData.type?20:"semanal"===this.getPlanData.type?5:1},getPlanDataMeals:function(){return this.getPlanData.meals.filter((function(t){return 1===t.active}))},getPlanDataPrices:function(){return this.getPlanData.hasOwnProperty("prices")?this.getPlanData.prices.filter((function(t){return 1===t.active})):[]},getPlanDataAdditionals:function(){return this.getPlanData.hasOwnProperty("additionals")?this.getPlanData.additionals.filter((function(t){return 1===t.active})):[]},checkOptionSubscriptionAutomatic:function(){return!this.getProfile.subscription_active&&("mensual"===this.getPlanData.type||"bimensual"===this.getPlanData.type||"trimensual"===this.getPlanData.type)},btnDisabledPaymentCash:function(){var t=this.getPaymentMethod;return 1===this.getProfile.country_id&&t?!(8===this.getDNI.length):!(2===this.getProfile.country_id&&t)}}),watch:{getProfile:function(t){this.card.email=t.email}},methods:v(v(v(v(v(v(v(v(v({},Object(o["d"])("plan",["SET_AMOUNT_PLAN","SET_DISCOUNT_POINT","SET_USE_POINTS","SET_FIRST_TIME","SET_VALIDATE_POINTS","SET_PROMOTION","SET_SHOW_REFER","SET_SHOW_REFER_TRUE","SET_DISCOUNT","SET_CUPON_ACTIVE","SET_PROMOTION_USED","SET_PLAN_CREDITS","SET_AMOUNT_FINISH","SET_MEMBERSHIP_CHARGE","setPlanData","SET_PROMOTRIMENSUAL_ACTIVE"])),Object(o["b"])("plan",["GET_FIRST_PROMO"])),Object(o["d"])("cards",["ADD_CARD","SET_CARD_PAY"])),Object(o["d"])("user",["SET_CREDITS","SET_PROFILE","SET_EXISTS_CARD"])),Object(o["d"])("marketing",["SET_RESET_PROMO"])),Object(o["b"])("cards",["GET_CARDS"])),Object(o["d"])("payment",["SET_TYPE_METHOD"])),Object(o["d"])("payment",["SET_ATTEMPT"])),{},{validAmount:function(){var t=this.getPlanData.amount-this.priceDiscount;t>0?(this.methodPayment=!0,this.SET_AMOUNT_PLAN(t)):(this.methodPayment=!1,this.priceDiscount=this.getPlanData.amount,this.typePayment=3,this.SET_AMOUNT_PLAN(0))},validateCoupon:function(){var t=this;if(this.messageErrorCoupon="",this.value.length<4)return this.messageErrorCoupon="Código invalido",!1;this.$gtm.trackEvent({event:"cupon_diario",category:"cupon",action:"click",label:"cupon_diario",value:1}),l.a.get("referred/missions/validate_code/"+this.value).then((function(e){if(e.data.code)t.methodPayment=!1,t.showCouponReferer=!1,t.showCouponDiscount=!0,t.priceDiscount=t.amount,t.typePayment=3,t.idReferralCode=e.data.customer_id,t.type_code="referred",t.validAmount(),t.notification();else{var a=Number(localStorage.getItem("count_show_fday"));a>=2&&(t.cuponFreeDay=!1),"PRUEBAGRATIS"!=t.value||t.cuponFreeDay?l.a.get("/promotion/diary/validate/"+t.value).then((function(e){if(200!=e.status)return t.messageErrorCoupon=e.data,null;var a=e.data.abbreviation;if("dpd"!==a&&"mfpd"!==a)return t.messageErrorCoupon="Código invalido",!1;t.methodPayment=!0,t.showCouponReferer=!1,t.showCouponDiscount=!0,t.nameCupon=e.data.name,t.type_code="promotion","dpd"===a?(t.priceDiscount=t.amount*e.data.type_quantity/100,t.validAmount()):"mfpd"===a&&(t.priceDiscount=100*e.data.type_quantity,t.validAmount());var n={user:!0,type_quantity:e.data.type_quantity,id:e.data.id,amount_type:t.priceDiscount,type:e.data.type_id,abbr:a};t.SET_PROMOTION(n),t.notification()})):t.messageErrorCoupon="El código ha expirado"}}))},notification:function(){this.$notify({group:"foo",title:"Código validado con exito",text:"Ya puedes seguir el proceso",type:"success",position:"bottom center"})},paymentReferer:function(){var t=this;this.isLoading=!0,l.a.post("referred/missions/pay_with_code",{idReferralCode:this.idReferralCode,email:this.getProfile.email,phone:this.getProfile.phone,name:this.getProfile.firstname+" "+this.getProfile.lastname,code:this.value,meals:this.getPlanData.meals,type_code:this.type_code,promotion:this.promotion}).then((function(e){t.SET_CREDITS(e.data.credits);var a=JSON.parse(JSON.stringify(t.getProfile));t.SET_PROFILE(a),t.$router.push("/purchase-confirmation"),t.isLoading=!1}))},paymentFreeDay:function(){var t=this;this.loadPromo=!0,l.a.post("/free-day-mx",{promotion:this.promotion}).then((function(e){if(201===e.status){localStorage.setItem("freeDay",1),localStorage.setItem("hasFreeDay",1),t.$notify({group:"foo",title:"Disfruta de tu primera comida :)",text:"",type:"success",position:"bottom center"}),t.SET_MEMBERSHIP_CHARGE(e.data.membership_charge_id),t.SET_CREDITS(e.data.credits);var a=JSON.parse(JSON.stringify(t.getProfile));t.SET_PROFILE(a),t.$router.push("/purchase-confirmation"),t.isLoading=!1}})).catch((function(t){console.log(t)}))},sendVaucher:function(){},saveEvent:function(){l.a.post("active/save",{page:"primera_tarjeta"}).then((function(){}))},getSessionId:function(){var t=this;l.a.get("session/get").then((function(e){t.session=e.data,t.payu=new m["a"](t.session)}))},changeTypePayment:function(t){this.typePayment=t},searchIcon:function(t){return t},changeNumber:function(){var t=h["a"].detectCardType(this.card.number),e=t.icon,a=t.type;e?(this.cardType="images/cards/"+e,this.card.type=a):(this.card.type="",this.messageInValidCard="",this.cardType="images/cards/credit-card.svg");var n=h["a"].newDetectCardType(this.card.number),i=n.items;this.itemsCardType=i||{icon_card:"",c_card:"/images/cards/c-gold.svg",color_card:""}},chooseIconCard:function(t){if(void 0!==t){var e=h["a"].detectCardType(t.card_number),a=e.icon;return"/images/cards/"+a}},isEmailValid:function(t){var e=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,24}))$/;return this.regexValidate(t,e)},regexValidate:function(t,e){return""!==t&&!!e.test(t)},initPayment:function(){var t=Object(c["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:this.getFirstCard?this.processPayment():this.saveCard();case 1:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),saveCard:function(){var t=this;return this.errorPayment="",this.messageInValidTitular="",this.messageInValidCard="",this.messageInValidDate="",this.messageInValidCvv="",this.messageInValidEmail="",this.messageInValidGeneral="",this.card.client.length<3?(this.messageInValidTitular="Por favor, ingrese un nombre de propietario válido.",null):void 0===this.card_number||this.card_number.length<=12?(this.messageInValidCard="Por favor, ingrese un nombre de tarjeta válido",null):void 0===this.exp_month||this.exp_month.length<2||void 0===this.exp_year||this.exp_year<4?(this.messageInValidDate="Por favor, ingrese una fecha de vencimiento válida",null):this.card.cvc.length<3?(this.messageInValidCvv="Por favor, ingrese un número CVV válido",null):this.isEmailValid(this.card.email)?void(this.wait||(this.wait=!0,setTimeout((function(){return t.wait=!1}),1e3),this.isLoading=!0,this.card.date=this.exp_year+"/"+this.exp_month,this.payu.createToken(this.card).then((function(e){t.cardResponse=e.data,t.$gtm.trackEvent({event:"registrar_tarjeta_exitoso",category:"compra",action:"operacion_asincrona",label:"registrar_tarjeta",value:"exitoso"}),t.leadPoints(86).then((function(t){return t})),t.eventPaymentMethodUpdate(parseInt(t.getPlan.real_calories),t.getPlanData.amount/100,t.showDiscount+t.discountPoints/100,"tarjeta_credito","tarjeta_credito"),t.ADD_CARD(e.data),t.SET_EXISTS_CARD(!0),t.getFirstCard?(t.SET_TYPE_METHOD(1),t.modalCard=!1,t.leadPoints(25).then((function(t){return t})),t.$router.push({path:"/resume"})):0===t.getPlanData.amount?(t.modalCard=!1,t.$router.push({path:"/cards"})):(t.SET_TYPE_METHOD(1),t.SET_CARD_PAY(e.data),t.modalCard=!1,t.$router.push({path:"/resume"})),t.isLoading=!1})).catch((function(e){t.isLoading=!1,t.errorPayment=e.response.data,t.$gtm.trackEvent({event:"registrar_tarjeta_fallo",category:"compra",action:"operacion_asincrona",label:"registrar_tarjeta",value:"fallido"}),t.$gtm.trackEvent({event:"registro_tarjeta",category:"registro_tarjeta",action:"click",label:"registro_tarjeta",value:1})})))):(this.messageInValidEmail="Por favor ingresa un email válido.",null)},processPayment:function(){var t=Object(c["a"])(regeneratorRuntime.mark((function t(){var e,a,n,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.leadPoints(9).then((function(t){return t})),this.$gtm.trackEvent({event:"procesar_pago",category:"compra",action:"click",label:"boton_de_comprar",value:1}),this.loadingPayment=!0,this.isLoading=!0,this.hasError.status=!1,e={card_id:Object.keys(this.cardResponse).length?this.cardResponse.id:this.getCardSelectedPay.id,amount:this.amount,type:this.getPlanData.type,meals:this.getPlanData.meals,prices:this.getPlanData.prices,additionals:this.getPlanData.additionals,promotion:this.promotion,subscription_active:this.isSuscriptionActive,amount_base:0===this.lastAmount?this.amount:this.lastAmount,pointsDiscount:this.discountPoints,points:this.getProfile.points,referer:this.referer,session:this.session,token_id:Object.keys(this.cardResponse).length?this.cardResponse:this.getCardSelectedPay,cvv:this.card.cvc,costo_envio:this.getPlanData.costoDelivery,giftPlan:this.getPlanData.gift},t.next=9,l.a.post("checkout/card",e);case 9:a=t.sent,this.$gtm.trackEvent({event:"pago_exitoso",category:"compra",action:"operacion_asincrona",label:"comprar_plan",value:this.amount}),n=this.isSuscriptionActive?"comprar_plan_con_suscripcion":"comprar_plan_sin_suscripcion",this.$gtm.trackEvent({event:"pago_exitoso",category:"compra",action:"operacion_asincrona",label:n,value:this.amount}),this.eventPurchased(parseInt(this.getPlan.real_calories),this.amount/100,this.priceDiscount/100,this.getPaymentMethod,a.data.membership_charge_id),this.SET_AMOUNT_FINISH(this.amount),this.SET_MEMBERSHIP_CHARGE(a.data.membership_charge_id),this.SET_CREDITS(a.data.credits),sessionStorage.removeItem("route_origin"),sessionStorage.removeItem("type_flow"),p.a.remove("utm_cta"),this.SET_RESET_PROMO(null),i=JSON.parse(JSON.stringify(this.getProfile)),i.subscription_active=this.isSuscriptionActive?1:0,null==this.usePoints&&(i.points=0,i.point_value=0),this.SET_PROFILE(i),this.eventPaymentSucceed(parseInt(this.getPlan.real_calories),this.amount/100,this.priceDiscount/100,this.getPaymentMethod),this.setPlanData({amount:0,meals:[]}),this.modalSuccessTransaction=!0,t.next=38;break;case 30:t.prev=30,t.t0=t["catch"](0),console.log("e response :"+t.t0.response),t.t0.response.data.state&&"PENDING"===t.t0.response.data.state?(this.loadingPayment="PENDING"===t.t0.response.data.state,this.modalPending=!0):(this.SET_ATTEMPT(this.getAttempt+1),this.loadingPayment=!1,this.getAttempt<=1?this.modalFirstResponse=!0:this.modalSecondResponse=!0),this.$gtm.trackEvent({event:"pago_fallido",category:"compra",action:"operacion_asincrona",label:"comprar_plan",value:t.t0}),this.eventPaymentFailed(parseInt(this.getPlan.real_calories),this.amount/100,this.priceDiscount/100,this.getPaymentMethod,t.t0.response.data.message),this.hasError.status=!0,this.isLoading=!1;case 38:case"end":return t.stop()}}),t,this,[[0,30]])})));function e(){return t.apply(this,arguments)}return e}(),type_premium:function(t){return"mensual"===t?2:"diario"===t?1:0},isJson:function(t){try{return JSON.parse(t)&&!!t}catch(e){return!1}},showMessage:function(t,e){this.$notify({group:"foo",title:t,type:e,position:"bottom center"})},paymentCash:function(){var t=Object(c["a"])(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.isLoading=!0,t.next=4,l.a.post("payu/payment/cash",{amount:this.amount,type:this.getPlanData.type,payment_method:this.getPaymentMethod,amount_base:0===this.lastAmount?this.amount:this.lastAmount,promotion:this.promotion,meals:this.getPlanData.meals,prices:this.getPlanData.prices,additionals:this.getPlanData.additionals});case 4:if(e=t.sent,this.isLoading=!1,!e.data.redirect){t.next=10;break}window.location.href=e.data.redirect,t.next=11;break;case 10:throw new Error("Lo sentimos aun no soportamos este metodo de pago!");case 11:t.next=19;break;case 13:t.prev=13,t.t0=t["catch"](0),this.isLoading=!1,this.errorPayment=t.t0.response.data.message||t.t0.message,this.showModal=!0,console.log(t.t0);case 19:case"end":return t.stop()}}),t,this,[[0,13]])})));function e(){return t.apply(this,arguments)}return e}(),getWhatsappLink:function(){return 1===this.getProfile.country_id?"https://wa.link/h4q3xb":"https://wa.link/ek4ied"}})};function b(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function P(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?b(Object(a),!0).forEach((function(e){Object(s["a"])(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):b(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}var E={components:{LayoutUiPlans:r["a"]},mixins:[y],computed:P(P(P({},Object(o["c"])("phones",["getSupport","getSales","getSalesAdditional"])),Object(o["c"])("phones",["getSales","getSupport","getSalesAdditional"])),{},{getPhoneNumber:function(){return"diario"===this.getPlanData.type?this.getSalesAdditional:this.getSupport}}),methods:{getURLWhatsapp:function(){var t="hola, quiero activar mi plan diario de prueba, este es mi comprobante de pago:";return"diario"===this.getPlanData.type?"https://api.whatsapp.com/send?phone=".concat(this.getSalesAdditional,"&text=").concat(t):"https://api.whatsapp.com/send?phone=".concat(this.getSupport,"&text=Hola%2C%20acabo%20de%20realizar%20un%20pago%20de%20un%20plan%20Manzana%20Verde%2C%20adjunto%20mi%20comprobante%20y%20el%20correo%20electr%C3%B3nico%20con%20que%20me%20registr%C3%A9%20es%3A%20")},back:function(){this.$router.go(-1)}}},C=E,S=(a("0f7e"),a("2877")),O=Object(S["a"])(C,n,i,!1,null,null,null);e["default"]=O.exports}}]);