import{d as a,r as t,G as e,s as n}from"./vendor-jA_NIjzi.js";import{i,b3 as l,b4 as r}from"./common-store-e_1WBubm.js";const o=new Map([[1,i.global.t("银行卡")],[2,i.global.t("支付宝")],[3,i.global.t("微信")],[4,i.global.t("数字货币")],[8,i.global.t("三方钱包")]]),c=a("withdrawal",(()=>{const a=t({bindPhone:"0",bindEmail:"0",bindKYC:"0",setRealName:"",verificationMethod:"0",verificationFrequency:"0",withdrawalCount:"0",userCheckSwitch:"",userWithdrawTime:0}),c=async()=>{const t=await l();1===t.code&&(a.value=t.data)};c();const s=t({cardInfoList:[],alreadyWithdrawTimes:0,alipayList:[],wechatList:[],userUsdtAccountInfoRespVO:[],virtualAccountInfoList:[],lastWithdrawWay:null,lastReceiptCodeType:null,lastWithdrawVirtualCurrencyAccountId:null,withdrawableAmount:"",accountBalance:"",unwithdrawableAmount:"",realName:"",neededValidBetAmount:"",checkAmountTotal:"",remainingWithdrawTimes:0,minAmount:"",maxAmount:"",usdtMinCount:0,usdtMaxCount:0,unwithdrawableStartTime:"",unwithdrawableEndTime:"",description:"",remainingFreeWithdrawalTimes:0,serviceFeeRate:"",serviceFeeMinAmount:"",serviceFeeSwitch:0,withdrawLimitSwitch:0,withdrawLimitShareUserCount:null,totalShareValidUserCount:null,lockAmount:"",usdtChainTypes:[],erc20ServiceFeeRatio:"",trc20ServiceFeeRatio:"",totalCashgift:"",isBindPhone:0,isBindEmail:0,isBindKYC:0,isSetRealName:0,isSetPaymentPassword:0,verificationMethod:0,verificationFrequency:0,withdrawalCount:"",erc20ServiceFee:"",trc20ServiceFee:"",maxAmountWithdrawalChannel:0,dayWithdrawAmount:0,dayWithdrawTimes:0,withdrawTypeConfigs:[]}),d=t([]),u=t({}),w=t(0),h=t(0),m=e((()=>d.value.map((a=>({label:o.get(a),value:a}))))),v=e((()=>{var a;return null!=(a=u.value[w.value])?a:[]})),y=e((()=>{var a;return null!=(a=v.value[h.value])?a:{}})),g=e((()=>{const{cardInfoList:a,alipayList:t,wechatList:e,virtualAccountInfoList:n,userUsdtAccountInfoRespVO:l}=s.value,r=y.value.bindCount;return{1:{title:"".concat(i.global.t("银行卡"),"(").concat(a.length,"/").concat(r,")"),ways:a,bindRoute:"/mine/addBankCard"},2:{title:"".concat(i.global.t("支付宝"),"(").concat(t.length,"/").concat(r,")"),ways:t,bindRoute:"/mine/addWithdrawalWays/2"},3:{title:"".concat(i.global.t("微信"),"(").concat(e.length,"/").concat(r,")"),ways:e,bindRoute:"/mine/addWithdrawalWays/3"},4:{title:"".concat(i.global.t("数字货币"),"(").concat(l.length,"/").concat(r,")"),ways:l,bindRoute:"/mine/addDigitalCurrency"},8:{title:"".concat(i.global.t("三方钱包"),"(").concat(null==n?void 0:n.length,"/").concat(r,")"),ways:n,bindRoute:"/mine/addThirdPartyWallet"}}})),b=t("");return{withdrawConfig:a,onRefreshWithdrawalConfig:c,userWithdrawalInfo:s,onGetUserWithdrawalInfo:async()=>{const a=await r();if(!a.success)return a.message&&n(a.message);const{data:t}=a;s.value=t;try{if(d.value=[...new Set(s.value.withdrawTypeConfigs.map((a=>a.withdrawType)))],d.value.length>0)for(const a of d.value)u.value[a]=s.value.withdrawTypeConfigs.filter((t=>t.withdrawType===a));w.value=d.value[0]}catch(e){}return a},availableWithdrawalWays:d,ways:m,selectedChannel:w,withdrawalChannel:u,selectedType:h,currentType:y,currentChannel:v,userConfig:g,amount:b}}));export{c as u};
