1import{P as ne}from"./DzoNhWPs.js";import{d as ie,f as l,a as i,b as s,F as H,I as O,B as C,g as d,t as a,v as J,l as le,ai as re,ah as ce,r,aB as c,o as ue,e as V,c as de,h as B,p as z,D as w,A as g,J as A}from"./zGN25SIG.js";import{_ as pe}from"./DFHIlB1z.js";const me={class:"mx-4 mb-4"},fe={class:"flex justify-between items-center text-sm border-b border-[#FBDEB2] border-opacity-10"},ve=["onClick"],ye={key:0,class:"tab-line absolute bottom-0 left-0 right-0 h-[3px] bg-[#FDD387]"},he=ie({__name:"HistoryFilterTab",props:{fundFilterList:{},selectedFilterType:{}},emits:["select-filter"],setup(G){return(u,E)=>(i(),l("div",me,[s("div",fe,[(i(!0),l(H,null,O(u.fundFilterList,m=>(i(),l("div",{key:m.id,class:C(["flex-1 text-center cursor-pointer pb-2 text-[#FDD387] relative",{"active-tab":m.type===u.selectedFilterType}]),onClick:j=>u.$emit("select-filter",m.name,m.type)},[s("span",{class:C({"text-[#FFF] font-bold":m.type===u.selectedFilterType})},a(m.name),3),m.type===u.selectedFilterType?(i(),l("div",ye)):d("",!0)],10,ve))),128))])]))}}),_e=Object.assign(J(he,[["__scopeId","data-v-3db0a0e6"]]),{__name:"HistoryFilterTab"}),xe={class:"bg-[#1E1E1E] nav-gap-h-full pb-[100px]"},ge={class:"mx-4 my-4 text-sm text-[#FBDEB2]"},be={key:0},De={class:"text-white/90 text-xs"},Te={key:1},ke={class:"items-center text-[#202020] text-xs"},Be={key:1,class:"flex flex-col items-center justify-center py-10"},we=["src"],Ae={class:"text-xs text-white/50"},Ce={class:"flex flex-col box-card"},Fe=["onClick"],Ee={class:"flex flex-col"},Se={class:"text-[12px] text-[#FBDEB2] opacity-80 mb-1"},Pe={class:"text-sm font-bold text-white/90 uppercase"},Ie={class:"flex flex-col items-end"},$e={class:"flex items-center mt-1"},Le=["src"],Me={key:0,class:"px-4 pb-4 pt-2 border-t border-[#FBDEB2] border-opacity-10 bg-black bg-opacity-20"},He={class:"grid grid-cols-2 gap-y-3 text-[12px]"},Oe={key:0,class:"col-span-2 flex justify-between"},je={class:"text-[#FBDEB2] opacity-60"},Re={class:"text-white/90"},We={key:1,class:"col-span-2 flex justify-between"},Ne={class:"text-[#FBDEB2] opacity-60"},Ye={class:"text-white/90"},Ue={key:2,class:"col-span-2 flex justify-between"},qe={class:"text-[#FBDEB2] opacity-60"},Ve={class:"text-white/90"},ze={key:3,class:"col-span-2 flex flex-col"},Je={class:"text-[#FBDEB2] opacity-60 mb-1"},Ge={class:"text-white/90 italic"},Ke={key:4,class:"col-span-2 flex flex-col"},Qe={class:"text-[#FBDEB2] opacity-60 mb-1"},Xe={class:"text-white/90"},Ze={key:5,class:"col-span-2 flex flex-col"},et={class:"text-[#FBDEB2] opacity-60 mb-1"},tt={class:"flex flex-col"},st={class:"text-[12px] font-bold"},ot={class:"text-[12px] font-bold text-green-400"},at={__name:"index",setup(G){const{t:u,locale:E}=le(),m=re(),j=ce(),S=r([{id:"0",name:u("menu.submenu.deposit"),isSelected:!0,type:c.DEPOSIT},{id:"1",name:u("menu.submenu.withdrawal"),isSelected:!1,type:c.WITHDRAWAL},{id:"2",name:u("menu.submenu.bonus"),isSelected:!1,type:c.BONUS}]);r([]);const f=r([]),P=r(""),v=r(""),h=r(1),I=r(1),$=r(10),R=r(1),W=r(u("info.totalPendingDepositInProgress")),y=r(!1),L=r(0),N=r(m.query.activeTab||c.DEPOSIT);function K(t){const o=u("info.totalPendingDepositInProgress");W.value=o.replace("#TOTAL#",t)}async function M(t){g.locale(E.value==="th"?"th":"en"),f.value=[];const o=await A.getPendingDepositTransaction();o.succ&&(L.value=o.data.length,K(L.value),y.value&&o.data.forEach((n,e)=>{let _=g(n.createdAt.toLocaleString()),p=0,D="Pending",T="pending";p=parseFloat(n.amount).toLocaleString("en",{minimumFractionDigits:2,maximumFractionDigits:2});let k={date:_.format("D MMM YY"),time:_.format("hh:mm A (ddd)"),confirmAt:n.confirmAt?g(n.confirmAt).format("D MMM YY hh:mm A (ddd)"):"",amount:p,status:D,statusType:T,type:n.type?n.type:t,currency:n.depositFrom.bank.currencySymbolDisplay,remark:n.remark,isExpand:e<3};f.value.push(k)}))}function Q(t,o){return t===c.DEPOSIT?o.depositCurrencySymbolDisplay.toUpperCase():t===c.WITHDRAWAL?o.currencySymbolDisplay.toUpperCase():""}async function b(t,o){g.locale(E.value==="th"?"th":"en");let n;t===c.DEPOSIT&&!y.value?(await M(t),n=await A.getDepositTransaction(o)):t===c.DEPOSIT&&y.value?await M(t):t===c.WITHDRAWAL?n=await A.getWithdrawalTransaction(o):t===c.BONUS?n=await A.getBonusTransaction(o):n=await A.getDepositTransaction(o),!y.value&&n.succ&&(f.value=[],y.value?M():(n.data.rows.forEach((e,_)=>
1{let p=g((e.date||e.createdAt).toLocaleString()),D=0,T=e.creditAmount,k=e.reqCurrencySymbolDisplay,x=e.state,F="success",Y="";t===c.WITHDRAWAL?(D=w(e.amount),T=e.reqAmount,k=e.reqCurrencySymbolDisplay,["TRANSFER_SUCCESS","FINISHED"].includes(x)?(x="Success",F="success"):["REJECT"].includes(x)?(x="Rejected",F="danger"):(x="In Progress",F="warning"),Y=e.transferToBankAccount.bank.name+" "+e.transferToBankAccount.bankAccountNumber):(D=w(e.depositAmount),T=e.creditAmount,k=e.creditCurrencySymbolDisplay);let U=e.promotionClaims&&e.promotionClaims.length>0?e.promotionClaims[0].promotion:null,q={date:p.format("D MMM YY"),time:p.format("hh:mm"),confirmAt:e.confirmAt?g(e.confirmAt).format("D MMM YY hh:mm"):"",amount:D,status:x,statusType:F,type:e.type?e.type:t,remark:e.remark,currency:Q(t,e),depositAmount:e.depositAmount?w(e.depositAmount):"",depositCurrencySymbolDisplay:e.depositCurrencySymbolDisplay||"",creditAmount:w(T),creditCurrencySymbolDisplay:k||"",tooltipsContent:Y,promotionClaims:e.promotionClaims,isExpand:n.data.page===1&&_<3};t===c.BONUS&&(q.title=U?U.name:""),f.value.push(q)}),h.value=n.data.page,$.value=n.data.pageSize,I.value=n.data.total,R.value=n.data.totalPages))}async function X(t,o){y.value=!1,P.value=t,v.value=o,h.value=1,N.value=o,j.push({query:{activeTab:o}}),await b(o,h.value)}function Z(t){f.value[t].isExpand=!f.value[t].isExpand}async function ee(t){await b(v.value,t),h.value=t,window.scrollTo({top:0,behavior:"smooth"})}function te(t){return t.statusType==="success"?"text-green-400":t.statusType==="danger"?"text-red-500":t.statusType==="pending"?"text-orange-400":(t.statusType==="warning","text-[#E3BB72]")}function se(t){return t.statusType==="success"?"bg-green-400/20 text-green-400":t.statusType==="danger"?"bg-red-500/20 text-red-500":t.statusType==="pending"?"bg-orange-400/20 text-orange-400":(t.statusType==="warning","bg-[#E3BB72]/20 text-[#E3BB72]")}function oe(){y.value=!0,b(v.value,h.value)}function ae(){y.value=!1,b(v.value,h.value)}return ue(()=>{const t=S.value.find(o=>o.type===N.value);if(t)P.value=t.name,v.value=t.type;else{const o=S.value[0];P.value=o.name,v.value=o.type}b(v.value,h.value)}),(t,o)=>{const n=ne;return i(),l("div",xe,[V(B(pe),{"active-tab":"History"}),s("div",ge,a(t.$t("menu.submenu.transactionHistory")),1),V(_e,{"fund-filter-list":S.value,"selected-filter-type":v.value,onSelectFilter:X},null,8,["fund-filter-list","selected-filter-type"]),L.value>0&&v.value===B(c).DEPOSIT?(i(),l("div",be,[y.value?(i(),l("div",Te,[s("div",{class:"pending-deposit-back-button flex items-center mx-4 mb-4",onClick:ae},[o[1]||(o[1]=s("svg",{class:"mx-4",xmlns:"http://www.w3.org/2000/svg",width:"7",height:"12",viewBox:"0 0 7 12",fill:"none"},[s("path",{d:"M5.68298 10.3659L1.00006 5.68358L5.68298 1",stroke:"#202020","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),s("div",ke,a(t.$t("btn.back")),1)])])):(i(),l("div",{key:0,class:"pending-deposit-container flex items-center mx-4 mb-4 cursor-pointer",onClick:oe},[o[0]||(o[0]=s("div",{class:"pending-deposit-loader mx-2"},null,-1)),s("span",De,a(W.value),1)]))])):d("",!0),f.value.length===0?(i(),l("div",Be,[s("img",{src:B(z)("/images/button-icon/icn-btn-history-upoint.svg"),alt:"",class:"w-16 h-16 mb-4 opacity-20"},null,8,we),s("div",Ae,a(t.$t("info.noTransactionHistory")),1)])):d("",!0),(i(!0),l(H,null,O(f.value,(e,_)=>(i(),l("div",{key:_,class:"mx-4 mb-3"},[s("div",Ce,[s("div",{class:"flex justify-between items-center px-4 py-3 cursor-pointer",onClick:p=>Z(_)},[s("div",Ee,[s("div",Se,a(e.date)+" "+a(e.time),1),s("div",Pe,a(e.title||e.type),1)]),s("div",Ie,[s("div",{class:C(["text-sm font-bold",te(e)])},a(e.amount)+" "+a(e.currency),3),s("div",$e,[s("span",{class:C(["text-[12px] uppercase px-2 py-0.5 rounded-sm font-medium",se(e)])},a(e.status),3),s("img",{class:C(["ml-2 w-[10px] transition-transform duration-300",{"rotate-180":e.isExpand}]),src:B(z)("/images/layout/icn-arrow-down.svg"),alt:""},null,10,Le)])])],8,Fe),e.isExpand?(i(),l("div",Me,[s("div",He,[e.depositAmount?(i(),l("div",Oe,[s("span",je,a(t.$t("history.depositAmount")),1),s("span",Re,a(e.depositAmount)+" "+a(e.depositCurrencySymbolDisplay),1)])):d("",!0),e.creditAmount?(i(),l("div",We,[s("span",Ne,a(t.$t("history.creditAmount")),1),s("span",Ye,a(e.creditAmount)+" "+a(e.creditCurrencySymbolDisplay),1)])):d("",!0),e.confirmAt?(i(),l("div",Ue,[s("span",qe,a(t.$t("history.confirmAt")),1),s("span",Ve,a(e.confirmAt),1)])):d("",!0),e.remark?(i(),l("div",ze,[s("span",Je,a(t.$t("history.remark")),1),s("span",Ge,a(e.remark),1)])):d("",!0),e.tooltipsContent?(i(),l("div",Ke,[s("span",Qe,a(t.$t("history.details")),1),s("span",Xe,a(e.tooltipsContent),1)])):d("",!0),e.promotionClaims&&e.promotionClaims.length>
10?(i(),l("div",Ze,[s("span",et,a(t.$t("history.promotionClaims")),1),(i(!0),l(H,null,O(e.promotionClaims,p=>(i(),l("div",{key:p._id,class:"flex justify-between items-center text-white/90 mb-1 pl-2 border-l-2 border-[#FBDEB2] border-opacity-30"},[s("div",tt,[s("span",st,a(p.promotion?.name),1)]),s("div",ot,"+ "+a(B(w)(p.bonusAmount)),1)]))),128))])):d("",!0)])])):d("",!0)])]))),128)),f.value.length>0&&I.value>$.value?(i(),de(n,{key:2,total:I.value,"max-pages":R.value,"per-page":$.value,"current-page":h.value,onChangePage:ee},null,8,["total","max-pages","per-page","current-page"])):d("",!0)])}}},rt=J(at,[["__scopeId","data-v-3b19db69"]]);export{rt 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.