1import{e as i,cH as we,j as s,t as k}from"./index-ePwWFRi3.js";import{A as P,b as R,f as ve,d as U,g as ae}from"./agpayKeywordMapping-DFDetvEU.js";import{C as Y}from"./copy_icon-Cuy11dc5.js";import{I as H}from"./InputTemplate-v8zoEUgR.js";import{T as Se}from"./TabPanel-Bk-AkiHp.js";/* empty css */import{a as A}from"./___vite-browser-external_commonjs-proxy-DwoBiO5t.js";import{S as G}from"./SelectTemplate-CwmZc9Ug.js";import{S as Ce}from"./Select-TBBud7HU.js";import{M as Ie}from"./MenuItem-2Pij2dXD.js";import{B as N}from"./Button-DVnPiWzl.js";import{W as ke}from"./WhatsApp-YN3d4FxN.js";import"./Menu-DsTeI-26.js";import"./debounce-DtXjJkxj.js";import"./Grow-DKPC3MwN.js";import"./OutlinedInput-LZ_Jpgpq.js";import"./useFormControl-CPUvMcaJ.js";import"./useControlled-DDD53nha.js";import"./createSvgIcon-DkzKZIln.js";const Le=i.forwardRef(({setOpenDepositModal:B,setLoading:o,index:Z,providersList:a,onlinePaymentOption:Pe,setOnlinePaymentOption:J,tabValue:M,depositAmount:u,setDepositAmount:S,mobileNumber:Re,setMobileNumber:Ae,loading:p,copyText:w,depositPaymentMethodsInfo:Q,setAlertMsg:x,buttonVariables:$,loggedIn:K,getAdminWhatsAppNumber:X,setShowWhatsapp:Ee,showWhatsapp:V,domainConfig:L,bonusTypes:h,selectedBonus:b,setSelectedBonus:E,getBonusTypes:z,langData:e,depositImage:C,handleCapture:g,handleClick:D,uploadImage:ee,pgProvider:v},se)=>{const _=Q[we.ZENPAY],[te,re]=i.useState([]),[y,ce]=i.useState({}),[d,ie]=i.useState(""),[oe,me]=i.useState(""),[ne,de]=i.useState(""),[j,le]=i.useState(""),[O,ue]=i.useState(""),[pe,he]=i.useState(null),[F,ye]=i.useState(""),[l,xe]=i.useState(!1),n=v==="jpcredirect";i.useEffect(()=>{(_==null?void 0:_.length)>0&&J(_[0])},[_]);const fe=async()=>{var t;try{const r=await P.get(R(v,"currencies"),{headers:{Authorization:sessionStorage.getItem("jwt_token")}});r.status===200&&re((t=r==null?void 0:r.data)==null?void 0:t.crypto_currency)}catch(r){console.log(r)}},T=async()=>{var m,c,f,I,q,W;const t={amount:u,crypto_currency:y.crypto_currency,network_id:y.network_id,cr_type:"INR",mobile_number:"9876543211"};n&&b&&(t.bonus_policy_id=b);const r=await P.post(R(v,"yuri",U.DEPOSIT),t,{headers:{Authorization:sessionStorage.getItem("jwt_token")}});return r.status===200&&(ie((m=r.data)==null?void 0:m.crypto_amount),me(ae(r.data)),de((c=r.data)==null?void 0:c.transfer_reference_id),le((f=r==null?void 0:r.data)==null?void 0:f.wallet_address),ue((I=r==null?void 0:r.data)==null?void 0:I.qr_image),he(((q=r==null?void 0:r.data)==null?void 0:q.payment_url)||null),(W=r==null?void 0:r.data)!=null&&W.payment_url&&window.open(r.data.payment_url,"_blank","noopener,noreferrer")),r},be=async t=>{var r,m;if(t.preventDefault(),Object.keys(y).length==0)return x({type:"error",message:e==null?void 0:e.select_crypto_currency}),!1;if(n&&!l){await z(Number(u),"CRYPTO_WALLET_TRANSFER"),xe(!0);return}o(!0);try{z(Number(u),"CRYPTO_WALLET_TRANSFER");const c=await T();if((c==null?void 0:c.status)!==200){o(!1);return}o(!1)}catch(c){console.log(c),x({type:"error",message:(m=(r=c==null?void 0:c.response)==null?void 0:r.data)==null?void 0:m.message}),o(!1)}},_e=async t=>{var r,m;t.preventDefault(),o(!0);try{const c=await T();if((c==null?void 0:c.status)!==200){o(!1);return}o(!1)}catch(c){console.log(c),x({type:"error",message:(m=(r=c==null?void 0:c.response)==null?void 0:r.data)==null?void 0:m.message}),o(!1)}},je=async t=>{var r,m;if(t.preventDefault(),!C)return x({type:"error",message:"Please Upload Transaction Image"}),!1;o(!0);try{const c=ve({transferReferenceId:ne,transactionHash:F,transactionId:oe,bonusPolicyId:b});let f=new FormData;f.append("paymentSlip",ee),f.append("request",JSON.stringify(c)),(await P.post(R(v,U.CONFIRM_PAYMENT),f,{headers:{Authorization:sessionStorage.getItem("jwt_token")}})).status==200&&(x({type:"success",message:e==null?void 0:e.txn_saved_success_txt}),window.location.href="/my_transactions",B(!1)),o(!1)}catch(c){x({type:"error",message:(m=(r=c==null?void 0:c.response)==null?void 0:r.data)==null?void 0:m.message}),o(!1)}};i.useEffect(()=>{fe()},[]);const Ne=(t,r)=>{!j&&!(n&&l)&&S(String(+u+ +t))};return s.jsx(Se,{value:M,index:Z,className:"zenpay-ctn",children:(a==null?void 0:a.length)>0?s.jsxs(s.Fragment,{children:[s.jsxs("form",{className:"account-inputs",onSubmit:t=>be(t),children:[s.jsxs("div",{className:"select-template",children:[s.jsx("div",{className:"st-label",children:e==null?void 0:e.select_currency}),s.jsx(Ce,{value:y,disabled:!!d||n&&l,onChange:t=>ce(t.target.value),className:"select-compo",MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},getContentAnchorEl:null},children:te.map(t=>s.jsx(Ie,{value:t,children:t.crypto_currency+" ("+t.blockchain+")"},t.crypto_currency))})]}),$.map((t,r)=>s.jsxs(N,{className:"qb-btn",disabled:n&&l,onClick:()=>Ne(t.stake),children:["+",t.label]},"qb-btn"+r)),s.jsx("div",{className:"note-msg",children:e==null?void 0:e.deposit_info_txt}),s.jsxs("div",{className:"amount-input",children:[s.jsx(H,{label:(e==null?void 0:e.enter_amount)+" (INR)",value:u,placeholder:e==null?void 0:e.enter_deposit_amount_txt,onChange:t=>S(t),disabled:!!d||n&&l,type:"number"}),s.jsx("div",{className:"clear-row",children:s.jsx("span",{className:"text b-text",onClick:()=>{!j&&!(n&&l)&&S("0")},children:e==null?void 0:e.clear})})]}),!d&&!(n&&l)&&s.jsx(N,{className:p||!u||!y?"submit-payment-btn submit-btn-disabled":"submit-payment-btn",type:"submit",disabled:!!(p||!u||!y),endIcon:p?s.jsx(k,{name:"lines-small"}):"",children:e==null?void 0:e.next})]}),n&&l&&!d&&s.jsxs("div",{className:"account-inputs",children:[h&&(h==null?void 0:h.length)>0&&s.jsx("div",{className:"bonus-type",children:s.jsx(G,{label:e==null?void 0:e.select_bonus_type,value:b,list:h.map(t=>({value:t.id,name:t.name})),onChange:t=>{E(t.target.value)},placeholder:e==null?void 0:e.bonus_type})}),s.jsx("form",{onSubmit:t=>_e(t),children:s.jsx(N,{className:p?"submit-payment-btn submit-btn-disabled":"submit-payment-btn",type:"submit",disabled:p,endIcon:p?s.jsx(k,{name:"lines-small"}):"",children:e==null?void 0:e.next})})]}),d&&!pe?s.jsxs(s.Fragment,{children:[h.length>0&&s.jsx("div",{className:"bonus-type",children:s.jsx(G,{label:e==null?void 0:e.select_bonus_type,value:b,list:h.map(t=>({value:t.id,name:t.name})),onChange:t=>{E(t.target.value)},placeholder:e==null?void 0:e.bonus_type})}),s.jsx("div",{className:"account-inputs",children:s.jsxs("div",{className:"amount-and-wallet",children:[s.jsxs("div",{className:"display-amount",children:[e==null?void 0:e.amount," : "," ",s.jsx("div",{style:{cursor:"pointer",fontSize:A?12:"medium"},className:"highlight-figure",onClick:()=>
1w(d,e==null?void 0:e.amount_copied_txt),children:" "+d+" "+y.crypto_currency}),s.jsx("button",{className:"r-copy-btn-div",onClick:()=>w(d,e==null?void 0:e.amount_copied_txt),children:s.jsx("img",{src:Y,className:"r-copy-btn",height:28})})]}),s.jsxs("div",{className:"display-amount wallet-address",children:[s.jsxs("div",{className:"wallet-address-label",children:[e==null?void 0:e.wallet_address," : "," ",s.jsx("button",{className:"r-copy-btn-div",onClick:()=>w(j,e==null?void 0:e.wallet_address_copied_txt),children:s.jsx("img",{src:Y,className:"r-copy-btn",height:28})})]}),s.jsx("div",{style:{cursor:"pointer",fontSize:A?12:"medium"},className:"highlight-figure",onClick:()=>w(j,e==null?void 0:e.wallet_address_copied_txt),children:j})]}),O&&s.jsx("div",{className:"display-amount qr-image",children:s.jsx("div",{style:{height:"auto",margin:"0px",width:"100%",display:"flex",justifyContent:"center"},children:s.jsx("div",{style:{width:"30%",height:"100%"},children:s.jsx("img",{className:"qr-code",style:{height:"auto",maxWidth:"100%",width:"100%"},src:O})})})})]})}),s.jsxs("div",{className:"account-inputs",children:[s.jsx(H,{label:e==null?void 0:e.enter_txn_hash,value:F,placeholder:e==null?void 0:e.enter_txn_hash,onChange:t=>ye(t)}),s.jsxs("div",{className:"account-input",children:[C?s.jsx(s.Fragment,{children:s.jsxs("div",{children:[s.jsx("div",{className:"zenpay-uploaded-image-title",children:"Uploaded Image"}),s.jsx("img",{src:`${C}`,className:"deposit-upload-image"})]})}):null,s.jsx("input",{accept:"image/*",style:{display:"none"},id:"raised-button-file-abcmoney",multiple:!0,hidden:!0,type:"file",ref:se,onChange:t=>g(t)}),s.jsx(N,{component:"div",className:"zenpay-upload-btn",onClick:D,children:"Upload Image"})]}),s.jsxs("div",{className:"bottom-buttons",children:[s.jsx(N,{className:"submit-payment-btn",onClick:t=>je(t),endIcon:p?s.jsx(k,{name:"lines-small"}):"",children:e==null?void 0:e.submit}),L.whatsapp&&A&&K&&V&&s.jsxs("div",{className:"submit-payment-btn whatsapp-btn floating-whatsapp-btn new-whatsapp",onClick:X,children:[s.jsx(ke,{className:"whatsapp-icon"}),s.jsx("div",{className:"whatsapp-btn-text",children:e==null?void 0:e.payment_failed_issues})]})]})]})]}):null]}):s.jsx("div",{className:"no-data-available",children:e==null?void 0:e.providers_not_found_txt})})});export{Le as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.