1import{d as _,a3 as C,a as f,h as k,aw as w,j as e,w as n,cr as F}from"./index-CRPZpX17.js";import{F as M,k as A,l as P,m as S,n as R,y as D}from"./popover-5zndvtb5.js";import{M as $,f as q}from"./header-CqtDmtDa.js";import{F as I}from"./noPackages-DM38xhD5.js";import{n as H,b as L}from"./sb-loading-BS93ZLM4.js";import{C as B}from"./chevron-down-C7lCUKQy.js";import{C as E}from"./chevron-left-DDXlRq2t.js";import{A as z,I as G}from"./invite-code-page-xhVh6mvp.js";import"./mobile-pending-C6irSst_.js";import"./logo-B8_A0nH6.js";import"./device-status-icons-7iM_qVs6.js";import"./dapposLogo-T2t9YBIw.js";import"./incognito-BoJbb9iM.js";import"./search-BenPg9xh.js";function K({isDialog:l=!1}){const t=H("mall"),{packageApi:N,session:a}=_(),y=C(),[i,d]=f.useState(1),[c,g]=f.useState(l?2:10),{data:r,isLoading:b,isFetching:Q}=k({queryKey:["gold-credit-exchange-logs",a==null?void 0:a.address,i,c],queryFn:async()=>a!=null&&a.address?N.getGoldCreditExchangeLogs({eoaAddress:a.address,page:i,size:c}):null,enabled:!!(a!=null&&a.address),retry:1}),v=(r==null?void 0:r.dataList)??[],p=(r==null?void 0:r.total)??0,x=Math.max(1,Math.ceil(p/c)),m=i>1,o=i<x,h=v.map(s=>{const j=Number(s.goldAmount||0),u=j>=0;return{id:s.id,date:s.createdAt?w(s.createdAt):"--",redeemId:s.relatedId||String(s.id),coinsChange:Math.abs(j),isPositive:u,itemName:s.reason,quantity:s.creditAmount===0&&u?"--":s.creditAmount,status:"Success"}});return e.jsxs("div",{className:"mx-auto max-w-[800px] pb-5 sm:pb-8 lg:pb-8",children:[e.jsxs("div",{className:"sticky top-0 z-10 bg-[#f8f8f7] pt-5 sm:pt-8 px-4 md:px-0",children:[e.jsx("div",{className:"items-center hidden gap-1 px-5 py-4 md:flex",children:e.jsxs("button",{className:"flex items-center gap-1 text-[#34322d]",onClick:()=>{y.back()},children:[e.jsx(M,{className:"w-6 h-6 text-[#858481]"}),e.jsx("span",{className:"text-[16px] font-medium",children:t("history_back")})]})}),e.jsx("div",{className:"block mb-4 md:hidden",children:e.jsx($,{pageName:"mallHistory"})})]}),e.jsxs("div",{className:"p-4",children:[e.jsx("div",{className:"text-sm text-[#34322d] font-medium",children:t("redemptionHistory")}),e.jsxs("div",{className:n("mt-2 rounded-[12px] border border-[#0000000F]"),children:[e.jsxs("div",{className:"hidden md:grid grid-cols-[160px_150px_220px_160px_1fr] px-5 py-2 border-b border-[#0000000F] font-medium text-[#858481] text-[12px]",children:[e.jsx("div",{children:t("history_title_reddemDate")}),e.jsx("div",{children:t("history_title_coinsChange")}),e.jsx("div",{children:t("history_title_itemName")}),e.jsx("div",{children:t("history_title_quantity")}),e.jsx("div",{className:"text-right",children:t("history_title_status")})]}),e.jsx("div",{className:n("md:max-h-[520px] overflow-y-auto",l?"flex-1 min-h-0":""),children:b?e.jsx("div",{className:"min-h-[200px] flex items-center justify-center",children:e.jsx(L,{className:"w-6 h-6 text-[#858481] animate-spin"})}):h.length===0?e.jsxs("div",{className:"min-h-[200px] flex flex-col gap-2 items-center justify-center text-sm text-[#858481]",children:[e.jsx(I,{className:"w-6 h-6"}),t("noData")]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden px-5 md:block",children:h.map(s=>e.jsxs("div",{className:"grid grid-cols-[160px_150px_220px_160px_1fr] py-4 text-[12px] text-[#34322d]",children:[e.jsx("div",{children:s.date}),e.jsxs("div",{className:"flex items-start gap-1",children:[s.isPositive?"+":"-",e.jsx(q,{className:"w-[18px] h-[18px] block"}),s.coinsChange]}),e.jsx("div",{children:s.itemName}),e.jsx("div",{children:s.quantity}),e.jsx("div",{className:"text-right",children:s.status})]},`${s.id}-${s.redeemId}`))}),e.jsx("div",{className:"md:hidden",children:h.map(s=>e.jsxs("div",{className:"border-b border-[#0000000F] px-5 py-4 text-[12px]",children:[e.jsxs("div",{className:"flex items-center justify-between py-1",children:[e.jsx("span",{className:"text-[#858481] font-medium",children:t("history_title_reddemDate")}),e.jsx("span",{className:"text-[#34322d]",children:s.date})]}),e.jsxs("div",{className:"flex items-center justify-between py-1",children:[e.jsx("span",{className:"text-[#858481] font-medium",children:t("history_title_coinsChange")}),e.jsxs("span",{className:"text-[#34322d]",children:[s.isPositive?"+":"-",s.coinsChange]})]}),e.jsxs("div",{className:"flex items-center justify-between py-1",children:[e.jsx("span",{className:"text-[#858481] font-medium",children:t("history_title_itemName")}
1),e.jsx("span",{className:"text-[#34322d]",children:s.itemName})]}),e.jsxs("div",{className:"flex items-center justify-between py-1",children:[e.jsx("span",{className:"text-[#858481] font-medium",children:t("history_title_quantity")}),e.jsx("span",{className:"text-[#34322d]",children:s.quantity})]}),e.jsxs("div",{className:"flex items-center justify-between py-1",children:[e.jsx("span",{className:"text-[#858481] font-medium",children:t("history_title_status")}),e.jsx("span",{className:"text-[#34322d]",children:s.status})]})]},`${s.id}-${s.redeemId}`))})]})}),p>0&&e.jsxs("section",{className:"flex items-center justify-center px-5 py-4 md:justify-between",children:[e.jsxs("div",{className:"items-center hidden gap-2 md:flex",children:[e.jsx("span",{className:"text-xs text-[#34322d]",children:t("child_history_page_showRow")}),e.jsxs(A,{children:[e.jsx(P,{asChild:!0,children:e.jsxs("button",{className:"flex items-center gap-1 text-xs text-[#34322d] border border-[#0000000F] py-[6px] px-2 rounded-[6px]",children:[c,e.jsx(B,{className:"w-3 h-3"})]})}),e.jsx(S,{className:"rounded-[8px]",children:[10,20,50,100].map(s=>e.jsx(R,{onClick:()=>{g(s),d(1)},children:s},s))})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>d(1),className:n("flex items-center text-xs border border-[#0000000F] py-[6px] px-2 rounded-[6px]",m?"text-[#2aae67]":"text-[#34322d]"),children:t("child_history_page_first")}),e.jsx("button",{onClick:()=>m&&d(i-1),className:"flex items-center",children:e.jsx(E,{className:n("w-4 h-4",m?"text-[#2aae67]":"text-[#85848180]")})}),e.jsxs("div",{className:"flex items-center text-xs text-[#34322d] border border-[#0000000F] py-[6px] px-2 rounded-[6px]",children:[e.jsx("span",{children:t("child_history_page")}),e.jsx("span",{className:"ml-1",children:i}),e.jsx("span",{className:"mx-1",children:t("child_history_pageOf")}),e.jsx("span",{children:x})]}),e.jsx("button",{onClick:()=>o&&d(i+1),className:"flex items-center",children:e.jsx(D,{className:n("w-4 h-4",o?"text-[#2aae67]":"text-[#85848180]")})}),e.jsx("button",{onClick:()=>d(x),className:n("flex items-center text-xs border border-[#0000000F] py-[6px] px-2 rounded-[6px]",o?"text-[#2aae67]":"text-[#34322d]"),children:t("child_history_page_last")})]})]})]})]})]})}function O(){return e.jsx(K,{})}const de=function(){const t=F.useSearch();return e.jsx(z,{fallback:e.jsx(G,{referral:t.referral}),children:e.jsx(O,{})})};export{de as component};
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.