1import{u as k,a as C,r as n,t as A,j as t,L as u,W as m,i as N,f as W,m as T}from"./index-DRYNtDfq.js";import{U as H,P as j,a as L}from"./PageLayout-BT1vZgiA.js";import{R as B}from"./refresh-cw-D2dmFQzs.js";import{C as D}from"./calendar-B5BYcSdL.js";import{C as M}from"./chevron-left-mvqxhe1t.js";import{C as P}from"./chevron-right-C0SJQso0.js";import{C as E}from"./circle-alert-CtK3RIb0.js";const p={deposit:"Nạp sá» dư",withdraw:"Yêu cầu rút tiá»n",withdrawal:"Yêu cầu rút tiá»n",withdrawal_hold:"Tạm giữ rút tiá»n",withdrawal_release:"Hoà n tiá»n rút",card_credit:"Äá»i thẻ thà nh công",card_freeze:"Äóng bÄng Äá»i thẻ",card_unfreeze:"Má» khóa Äá»i thẻ",buycard_debit:"Mua thẻ",buy_card_debit:"Mua thẻ",buycard_refund:"Hoà n tiá»n mua thẻ",buycard_admin_refund:"Hoà n tiá»n mua thẻ (admin)",topup_debit:"Nạp cưá»c",topup_refund:"Hoà n tiá»n nạp cưá»c",topup_admin_refund:"Hoà n tiá»n nạp cưá»c (admin)",manual_reconcile:"Äá»i soát thá»§ công",admin_adjust:"Admin Äiá»u chá»nh",refund:"Hoà n tiá»n",credit:"Nháºn tiá»n",debit:"Trừ tiá»n"},w={deposit:{bg:"#d1fae5",text:"#065f46"},card_credit:{bg:"#d1fae5",text:"#065f46"},refund:{bg:"#d1fae5",text:"#065f46"},credit:{bg:"#d1fae5",text:"#065f46"},buycard_refund:{bg:"#d1fae5",text:"#065f46"},buycard_admin_refund:{bg:"#d1fae5",text:"#065f46"},topup_refund:{bg:"#d1fae5",text:"#065f46"},topup_admin_refund:{bg:"#d1fae5",text:"#065f46"},withdrawal_release:{bg:"#d1fae5",text:"#065f46"},manual_reconcile:{bg:"#d1fae5",text:"#065f46"},withdraw:{bg:"#fee2e2",text:"#991b1b"},withdrawal:{bg:"#fee2e2",text:"#991b1b"},withdrawal_hold:{bg:"#fee2e2",text:"#991b1b"},topup_debit:{bg:"#fee2e2",text:"#991b1b"},buycard_debit:{bg:"#fee2e2",text:"#991b1b"},buy_card_debit:{bg:"#fee2e2",text:"#991b1b"},debit:{bg:"#fee2e2",text:"#991b1b"},card_freeze:{bg:"#fef3c7",text:"#92400e"},card_unfreeze:{bg:"#dbeafe",text:"#1e40af"},admin_adjust:{bg:"#f3e8ff",text:"#6b21a8"}};function q(){k({title:"Biến Äá»ng sá» dư",description:"Xem lá»ch sá» biến Äá»ng sá» dư vÃ, nạp tiá»n, rút tiá»n và các giao dá»ch liên quan.",breadcrumbs:[{name:"Trang chá»§",url:"/"},{name:"Lá»ch sá»",url:"/lich-su"},{name:"Biến Äá»ng sá» dư"}]});const{isAuthenticated:g}=C(),[s,a]=n.useState(0),[c,_]=n.useState(void 0),[r,y]=n.useState(""),[o,x]=n.useState(""),d=20,{data:i,refetch:S,isLoading:v}=A.wallet.getTransactions.useQuery({limit:d,offset:s*d,...c&&{type:c},...r&&{fromDate:new Date(r+"T00:00:00").getTime()},...o&&{toDate:new Date(o+"T23:59:59").getTime()}},{enabled:g}),h=Array.isArray(i)?i:i?.items||i||[],z=i?.total??h.length,l=Math.max(1,Math.ceil(z/d));return g?t.jsx(u,{"data-loc":"client/src/pages/history/WalletHistory.tsx:120",children:t.jsxs(H,{"data-loc":"client/src/pages/history/WalletHistory.tsx:121",children:[t.jsx(j,{"data-loc":"client/src/pages/history/WalletHistory.tsx:122",items:[{label:"Lá»ch sá»",href:"/lich-su"},{label:"Biến Äá»ng sá» dư"}]}),t.jsx(L,{"data-loc":"client/src/pages/history/WalletHistory.tsx:123",title:"Biến Äá»ng sá» dư",subtitle:"Xem toà n bá» lá»ch sá» biến Äá»ng sá» dư và cá»§a bạn.",icon:t.jsx(m,{"data-loc":"client/src/pages/history/WalletHistory.tsx:126",style:{width:20,height:20}})}),t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:130",className:"page-section",children:[t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:131",style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center",marginBottom:12},children:[[{key:void 0,label:"Tất cả"},{key:"deposit",label:"Nạp sá» dư"},{key:"card_credit",label:"Äá»i thẻ"},{key:"buy_card_debit",label:"Mua thẻ"},{key:"topup_debit",label:"Nạp cưá»c"},{key:"withdraw",label:"Nháºn tiá»n"},{key:"admin_adjust",label:"Äiá»u chá»nh"}].map(e=>t.jsx("button",{"data-loc":"client/src/pages/history/WalletHistory.tsx:141",className:`amount-btn${c===e.key?" is-active":""}`,style:{height:36,fontSize:13,padding:"0 16px"},onClick:()=>{_(e.key),a(0)},children:e.label},e.key??"all")),t.jsxs("button",{"data-loc":"client/src/pages/history/WalletHistory.tsx:150",onClick:()=>S(),style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:6,fontSize:13,fontWeight:600,color:"#7c3aed",background:"none",border:"none",cursor:"pointer"},children:[t.jsx(B,{"data-loc":"client/src/pages/history/WalletHistory.tsx:154",style:{width:14,height:14}})," Là m má»i"]})]}),t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:158",style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[t.jsx(D,{"data-loc":"client/src/pages/history/WalletHistory.tsx:159",style:{width:16,height:16,color:"#6b7280"}}),t.jsx("input",{"data-loc":"client/src/pages/history/WalletHistory.tsx:160",type:"date",value:r,onChange:e=>{y(e.target.value),a(0)},className:"date-filter-input",placeholder:"Từ ngà y"}),t.jsx("span",{"data-loc":"client/src/pages/history/WalletHistory.tsx:167",style:{color:"#9ca3af",fontSize:13},children:"â"}),t.jsx("input",{"data-loc":"client/src/pages/history/WalletHistory.tsx:168",type:"date",value:o,onChange:e=>{x(e.target.value),a(0)},className:"date-filter-input",placeholder:"Äến ngà y"}),(r||o)&&t.jsx("button",{"data-loc":"client/src/pages/history/WalletHistory.tsx:176",onClick:()=>{y(""),x(""),a(0)},style:{fontSize:12,color:"#ef4444",background:"none",border:"none",cursor:"pointer",fontWeight:600},children:"Xóa lá»c"})]})]}),v?t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:188",className:"ui-card page-section",style:{padding:40,textAlign:"center"},children:[t.jsx("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:189",className:"spinner",style:{margin:"0 auto 12px"}}),t.jsx("p",{"data-loc":"client/src/pages/history/WalletHistory.tsx:190",style:{fontSize:14,color:"#6b7280"},children:"Äang tải..."})]}):h.length>0?t.jsxs(t.Fragment,{children:[t.jsx("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:194",className:"ui-card page-section",style:{padding:0,overflow:"hidden"},children:t.jsx("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:195",style:{overflowX:"auto"},children:t.jsxs("table",{"data-loc":"client/src/pages/history/WalletHistory.tsx:196",style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[t.jsx("thead",{"data-loc":"client/src/pages/history/WalletHistory.tsx:197",children:t.jsxs("tr",{"data-loc":"client/src/pages/history/WalletHistory.tsx:198",style:{background:"#fafafa"},children:[t.jsx("th",{"data-loc":"client/src/pages/history/WalletHistory.tsx:199",style:{padding:"12px 14px",textAlign:"left",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Loại"}),t.jsx("th",{"data-loc":"client/src/pages/history/WalletHistory.tsx:200",style:{padding:"12px 14px",textAlign:"left",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Mô tả"}),t.jsx("th",{"data-loc":"client/src/pages/history/WalletHistory.tsx:201",style:{padding:"12px 14px",textAlign:"right",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Sá» tiá»n"}),t.jsx("th",{"data-loc":"client/src/pages/history/WalletHistory.tsx:202",style:{padding:"12px 14px",textAlign:"right",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Sá» dư sau"}),t.jsx("th",{"data-loc":"client/src/pages/history/WalletHistory.tsx:203",style:{padding:"12px 14px",textAlign:"right",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Thá»i gian"})]})}),t.jsx("tbody",{"data-loc":"client/src/pages/history/WalletHistory.tsx:206",children:h.map(e=>{const f=e.amount>0,b=w[e.description??""]||w[e.type]||{bg:"#f3f4f6",text:"#374151"};return t.jsxs("tr",{"data-loc":"client/src/pages/history/WalletHistory.tsx:211",style:{borderBottom:"1px solid #f3f4f6"},children:[t.jsx("td",{"data-loc":"client/src/pages/history/WalletHistory.tsx:212",style:{padding:"13px 14px"},children:t.jsx("span",{"data-loc":"client/src/pages/history/WalletHistory.tsx:213",style:{display:"inline-block",padding:"3px 10px",borderRadius:20,fontSize:12,fontWeight:600,background:b.bg,color:b.text,whiteSpace:"nowrap"},children:p[e.description??""]||p[e.type]||e.type})}),t.jsx("td",{"data-loc":"client/src/pages/history/WalletHistory.tsx:226",style:{padding:"13px 14px",fontSize:13,color:"#6b7280",maxWidth:220},children:t.jsx("span",{"data-loc":"client/src/pages/history/WalletHistory.tsx:227",style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p[e.description??""]?"â":e.description||"â"})}),t.jsxs("td",{"data-loc":"client/src/pages/history/WalletHistory.tsx:231",style:{padding:"13px 14px",textAlign:"right",fontWeight:700,color:f?"#059669":"#dc2626",fontSize:14},children:[f?"+":"",W(e.amount)]}),t.jsx("td",{"data-loc":"client/src/pages/history/WalletHistory.tsx:234",style:{padding:"13px 14px",textAlign:"right",fontSize:13,color:"#374151",fontWeight:600},children:e.balanceAfter!=null?W(e.balanceAfter):"â"}),t.jsx("td",{"data-loc":"client/src/pages/history/WalletHistory.tsx:237",style:{padding:"13px 14px",textAlign:"right",fontSize:13,color:"#6b7280"},children:T(e.createdAt)})]},e.id)})})]})})}),t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:249",className:"page-section",style:{display:"flex",justifyContent:"center",alignItems:"center",gap:12,flexWrap:"wrap"},children:[t.jsxs("button",{"data-loc":"client/src/pages/history/WalletHistory.tsx:250",onClick:()=>a(e=>Math.max(0,e-1)),disabled:s===0,className:"pagination-btn",style:{opacity:s===0?.4:1,cursor:s===0?"default":"pointer"},children:[t.jsx(M,{"data-loc":"client/src/pages/history/WalletHistory.tsx:256",style:{width:16,height:16}})," Trưá»c"]}),t.jsxs("span",{"data-loc":"client/src/pages/history/WalletHistory.tsx:258",style:{fontSize:13,color:"#374151",fontWeight:600},children:["Trang ",s+1," / ",l]}),t.jsxs("button",{"data-loc":"client/src/pages/history/WalletHistory.tsx:261",onClick:()=>a(e=>Math.min(l-1,e+1)),disabled:s>=l-1,className:"pagination-btn",style:{opacity:s>=l-1?.4:1,cursor:s>=l-1?"default":"pointer"},children:["Sau ",t.jsx(P,{"data-loc":"client/src/pages/history/WalletHistory.tsx:267",style:{width:16,height:16}})]})]})]}):t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:272",className:"ui-card page-section",style:{padding:40,textAlign:"center"},children:[t.jsx(E,{"data-loc":"client/src/pages/history/WalletHistory.tsx:273",style:{width:40,height:40,color:"#d1d5db",margin:"0 auto 12px"}}),t.jsx("p",{"data-loc":"client/src/pages/history/WalletHistory.tsx:274",style:{fontSize:15,fontWeight:600,color:"#374151",marginBottom:4},children:"Chưa có biến Äá»ng sá» dư"}),t.jsx("p",{"data-loc":"client/src/pages/history/WalletHistory.tsx:275",style:{fontSize:13,color:"#9ca3af"},children:"Lá»ch sá» biến Äá»ng sá» dư sẽ hiá»n thá» tại Äây"})]})]})}):t.jsx(u,{"data-loc":"client/src/pages/history/WalletHistory.tsx:104",children:t.jsxs(H,{"data-loc":"client/src/pages/history/WalletHistory.tsx:105",children:[t.jsx(j,{"data-loc":"client/src/pages/history/WalletHistory.tsx:106",items:[{label:"Lá»ch sá»",href:"/lich-su"},{label:"Biến Äá»ng sá» dư"}]}),t.jsxs("div",{"data-loc":"client/src/pages/history/WalletHistory.tsx:107",className:"ui-card page-section",style:{padding:40,textAlign:"center"},children:[t.jsx(m,{"data-loc":"client/src/pages/history/WalletHistory.tsx:108",style:{width:48,height:48,color:"#d1d5db",margin:"0 auto 16px"}}),t.jsx("p",{"data-loc":"client/src/pages/history/WalletHistory.tsx:109",style:{fontSize:16,fontWeight:600,marginBottom:8},children:"ÄÄng nháºp Äá» xem biến Äá»ng sá» dư"}),t.jsx("a",{"data-loc":"client/src/pages/history/WalletHistory.tsx:110",href:N("/l
1ich-su/vi"),className:"primary-submit-btn",style:{display:"inline-block",marginTop:12},children:"ÄÄng nháºp ngay"})]})]})})}export{q 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.