1import{i as e}from"./rolldown-runtime-Bq0epICq.js";import{h as s,j as a,t,w as r}from"./@gravity-ui-Enuc-IwO.js";import{Mn as n,Vt as i,Xt as o,xt as l,yt as c}from"./@front-8msnzfD4.js";import{c as d,l as m}from"./hooks-BQcZuKJT.js";import{c as x}from"./dayjs-YJOiQelf.js";import{I as h,L as p}from"./@floating-ui-Ds9Lmfct.js";import{i as u}from"./@tanstack-CdU4S-75.js";import{n as j,r as f,t as g}from"./consts-70uBpbtA.js";import"./useUIConfig-BWN05qRx.js";import{W as y,d as N}from"./index-DzDVflDn.js";import{t as b}from"./ErrorBoundary-C2WhIpLL.js";import{x as v}from"./utils-D9-qRHBI.js";import{t as w}from"./EmptyState-Bbl5n53A.js";import{n as k,t as T}from"./MobileMain-BeRPBvj-.js";import{t as A}from"./MobileProfileModal-u2bVOnsB.js";import{t as S}from"./LoaderState-Cdl8q5Pk.js";var P=e(p(),1),U=new class extends j{getPayoutsHistory(e){return this.client.get(g.PAYOUTS_HISTORY,{params:e})}}(f);var C=e(x(),1),I=h(),M=({row:e})=>{const s=e.terminals?.map(e=>e.correctionReason).filter(e=>Boolean(e))??[];return(0,I.jsx)(r,{placement:"right",openDelay:300,disabled:!s.length,content:s.map(e=>(0,I.jsx)("div",{className:"flex items-center",children:(0,I.jsx)("span",{className:"text-subheader-1",children:e})},e)),children:(0,I.jsxs)("div",{className:"flex items-center justify-end h-[26px]",children:[e.correctedAmount?v((e.convertedAmount??0)-e.correctedAmount):"0"," USDT"]})})},Y=({payouts:e,isFetchingPayouts:s,onPaginationUpdate:a,params:r})=>{const{items:n=[],totalCount:i=0}=e||{},o=[{name:"paidAt",header:(0,I.jsx)("div",{className:"text-subheader-1",children:"ÐаÑа вÑплаÑÑ"}),sortable:!1,render:({row:e})=>(0,I.jsx)("div",{className:"truncate flex items-center h-[26px]",children:e.paidAt?(0,C.default)(e.paidAt).format("DD.MM.YYYY в HH:mm"):"ââ"})},{name:"terminals",header:(0,I.jsx)("div",{className:"text-subheader-1 ",children:"ТеÑминал"}),sortable:!1,render:({row:e})=>{const s=e.terminals?.map(e=>e.name).join(", ");return(0,I.jsx)("div",{className:"h-[26px] truncate flex items-center",children:s||"ââ"})}},{name:"blockchainTransactionId",header:(0,I.jsx)("div",{className:"text-subheader-1",children:"СÑÑлка на вÑплаÑÑ"}),sortable:!1,width:"50%",render:({row:e})=>{const s="TronShasta"===e.blockchainNetwork?`https://shasta.tronscan.org/#/transaction/${e.blockchainTransactionId}`:`https://tronscan.org/#/transaction/${e.blockchainTransactionId}`;return(0,I.jsx)("div",{className:"truncate flex items-center h-[26px]",children:e.blockchainTransactionId&&e.blockchainNetwork?(0,I.jsx)(l,{href:s,target:"_blank",rel:"noopener noreferrer",className:"truncate",children:s}):"ââ"})}},{name:"payoutCommission",header:(0,I.jsx)("div",{className:"text-subheader-1",children:"ÐомиÑÑÐ¸Ñ ÑеÑи"}),sortable:!1,align:"right",render:({row:e})=>(0,I.jsxs)("div",{className:"flex items-center justify-end h-[26px]",children:[e.payoutCommission?v(e.payoutCommission):"0"," USDT"]})},{name:"correctedAmount",header:(0,I.jsx)("div",{className:"text-subheader-1",children:"УдеÑжано"}),sortable:!1,align:"right",render:M},{name:"paidAmount",header:(0,I.jsx)("div",{className:"text-subheader-1",children:"СÑмма вÑплаÑÑ"}),sortable:!1,align:"right",render:({row:e})=>(0,I.jsxs)("div",{className:"flex items-center justify-end h-[26px]",children:[e.paidAmount?v(e.paidAmount):"0"," USDT"]})}];return(0,I.jsxs)("div",{className:"mt-20 relative",children:[n&&n.length>0&&(0,I.jsx)(t,{data:n??[],theme:"yandex-cloud",columns:o,settings:{displayIndices:!1,highlightRows:!0},rowClassName:(e,s,a,t)=>t?"z-10":"table-row cursor-pointer z-10"}),s&&(0,I.jsx)(S,{}),0===n?.length&&(0,I.jsx)(w,{type:"payouts"}),(i??0)>100&&(0,I.jsx)(c,{className:"mt-20",page:r.page,pageSize:100,compact:!1,onUpdate:a,showInput:!0,total:i??0})]})},D=b(({payouts:e,isFetchingPayouts:s,onPaginationUpdate:a,params:t})=>(0,I.jsxs)("div",{className:"p-20 w-full h-full",children:[(0,I.jsx)("div",{className:"flex justify-between",children:(0,I.jsx)("div",{className:"text-header-1",children:"ÐÑплаÑÑ"})}),(0,I.jsx)(i,{className:"mt-10"}),(0,I.jsx)(Y,{payouts:e,isFetchingPayouts:s,onPaginationUpdate:a,params:t})]})),F=b(({payout:e})=>{const s="TronShasta"===e.blockchainNetwork?`https://shasta.tronscan.org/#/transaction/${e.blockchainTransactionId}`:`https://tronscan.org/#/transaction/${e.blockchainTransactionId}`,a=e.terminals?.map(e=>e.name).join(", ");return(0,I.jsxs)("div",{className:"flex flex-col gap-10 w-full p-20 bg-[var(--g-color-base-background)] rounded-[24px]",children:[(0,I.jsx)("div",{className:"flex items-center justify-between gap-4",children:(0,I.jsxs)("span",{className:"text-subheader-2 flex-1 truncate",children:[e.paidAmount?v(e.paidAmount):"0"," USDT"]})}),(0,I.jsx)(i,{}),(0,I.jsxs)("div",{className:"grid grid-cols-1 gap-[8px]",children:[(0,I.jsxs)("div",{className:"flex flex-col items-start gap-4",children:[(0,I.jsx)("span",{className:"text-body-1 text-secondary",children:"ÐаÑа вÑплаÑÑ"}),(0,I.jsx)("span",{className:"text-subheader-1",children:e.paidAt?(0,C.default)(e.paidAt).format("DD.MM.YYYY в HH:mm"):"ââ"})]}),(0,I.jsxs)("div",{className:"grid grid-cols-2 gap-[8px]",children:[(0,I.jsxs)("div",{className:"flex flex-col items-start gap-4",children:[(0,I.jsx)("span",{className:"text-body-1 text-secondary",children:"ÐомиÑÑÐ¸Ñ ÑеÑи"}),(0,I.jsxs)("span",{className:"text-subheader-1",children:[e.payoutCommission?v(e.payoutCommission):"0"," USDT"]})]}),(0,I.jsxs)("div",{className:"flex flex-col items-start gap-4",children:[(0,I.jsx)("span",{className:"text-body-1 text-secondary",children:"УдеÑжано"}),(0,I.jsxs)("span",{className:"text-subheader-1",children:[e.correctedAmount?v((e.convertedAmount??0)-e.correctedAmount):"0"," ","USDT"]})]})]}),(0,I.jsxs)("div",{className:"flex flex-col items-start gap-4",children:[(0,I.jsx)("span",{className:"text-body-1 text-secondary",children:"ТеÑминал"}),(0,I.jsx)("span",{className:"text-subheader-1",children:a||"ââ"})]}),(0,I.jsxs)("div",{className:"flex flex-col items-start gap-4",children:[(0,I.jsx)("span",{className:"text-body-1 text-secondary",children:"Tronscan"}),(0,I.jsx)(l,{href:s,target:"_blank",rel:"noopener noreferrer",className:"text-subheader-1 break-all",children:s})]})]})]})}),H=({payout:e})=>(0,I.jsx)(F,{payout:e}),z=b(({payoutsList:e})=>e?.length?e.map(e=>(0,I.jsx)(H,{payout:e},e.id)):null),O=b(({payouts:e,isFetchingPayouts:t,onPaginationUpdate:r,params:i})=>{const{showModal:l}=d();return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{children:t?(0,I.jsx)(s,{className:"h-28 w-full",height:28}):(0,I.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,I.jsx)("div",{className:"text-header-1",children:"ÐÑплаÑÑ"}),(0,I.jsx)("div",{className:"flex items-center gap-8",children:(0,I.jsx)(o,{view:"flat",onClick:()=>{l(N,{content:A})},children:(0,I.jsx)(n,{data:a,size:24,className:"cursor-pointer"})})})]})}),(0,I.jsx)(T,{children:(0,I.jsxs)("div",{className:"relative flex flex-col my-4 gap-[12px]",children:[!!e?.items?.length&&(0,I.jsx)(z,{payoutsList:e?.items}),t&&(0,I.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,I.jsx)(S,{})}),0===e?.items?.length&&(0,I.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,I.jsx)(w,{})}),!!e?.totalCount&&e?.totalCount>100&&(0,I.jsx)(c,{className:"flex items-center justify-between",page:i.page,pageSize:100,compact:!0,onUpdate:r,showInput:!0,total:e.totalCount})]})})]})}),R=()=>{const{isMobileView:e}
1=m(),[s,a]=(0,P.useState)(y),{data:t,isFetching:r}=function(e){return u({queryKey:[g.PAYOUTS_HISTORY,e],queryFn:()=>U.getPayoutsHistory(e),refetchOnWindowFocus:!1,staleTime:5e3})}(s),n=e=>{a(s=>({...s,SkipCount:(e-1)*s.MaxResultCount,page:e}))};return(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(I.Fragment,{}),children:e?(0,I.jsx)(O,{payouts:t,isFetchingPayouts:r,onPaginationUpdate:n,params:s}):(0,I.jsx)(D,{payouts:t,isFetchingPayouts:r,onPaginationUpdate:n,params:s})})},L=b(R);export{R as Payouts,L 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.