import c from"./Ctk5M3hU.js";import l from"./YMgwR3Gi.js";import{u as d}from"./Bxmfm8sn.js";import y from"./CRoN-P3i.js";import f from"./CIjHryQ0.js";import{K as h,m as _,j as m,i as w,A as P,w as N,l as S,b as $,s as u,a as g}from"./BCLrUOBx.js";import"./CWalxxGV.js";import"./Bvs3L9q-.js";import"./NsFEV5ZM.js";import"./BC1gcnRu.js";import"./Dq2bRmo2.js";import"./ScxedDBk.js";import"./D7xsgz5m.js";import"./a5umXhxZ.js";const k={setup(){const e=$(),{currencyIcon:t,setting:s,paymentGateway:i}=u(e),{setToastMessage:r,setToastError:o}=e,a=g(),{profile:n}=u(a);return{currencyIcon:t,setting:s,paymentGateway:i,setToastMessage:r,setToastError:o,profile:n}},name:"PaymentPopup",data(){return{payNow:!1}},watch:{},props:{order:{type:Object,default(){return null}}},components:{PaymentGateways:c,StripePayment:f,RazorpayPayment:y,PopOver:l},computed:{userEmail(){var e,t;return((e=this.order)==null?void 0:e.userEmail)||((t=this.profile)==null?void 0:t.email)},currencyData(){var e;return((e=this.order)==null?void 0:e.currency)||this.currency},userName(){var e,t;return((e=this.order)==null?void 0:e.userName)||((t=this.profile)==null?void 0:t.name)},razorpayPaymentToken(){var e;return((e=this.order)==null?void 0:e.payment_token)||null},amount(){var e;return((e=this.order)==null?void 0:e.total_amount)||0},orderId(){var e;return((e=this.order)==null?void 0:e.id)||null}},mixins:[d],methods:{isOrderPlaced(e){e?(window.location.reload(!0),this.setToastMessage(this.$t("payButton.placedSuccess")),this.payNow=!1):this.orderPlaced("closed")},orderPlaced(e="success",t="Error"){e==="success"?(this.setToastMessage(this.$t("payButton.placedSuccess")),this.$emit("success")):e==="error"?this.setToastError(t):e==="closed"&&(this.payNow=!1)}}};function v(e,t,s,i,r,o){const a=c,n=l;return m(),_("div",null,[r.payNow?P("",!0):(m(),w(n,{key:0,title:e.$t("checkout.selectPayment"),"elem-id":"pay-now-pop-over",layer:!0,class:"rating-popup payment-popup popup-top-auto",onClose:t[2]||(t[2]=p=>e.$emit("close"))},{content:N(()=>[S(a,{page:"order",order:s.order,"total-price":parseFloat(o.amount),onOrderStatus:o.isOrderPlaced,onOrderConfirm:t[0]||(t[0]=p=>r.payNow=!0),onClose:t[1]||(t[1]=p=>e.$emit("close"))},null,8,["order","total-price","onOrderStatus"])]),_:1},8,["title"]))])}const A=h(k,[["render",v]]);export{A as default};
