1import{D as C,N as D,k as _,l as I,w as $,G as c,V as v,q as o,bQ as z,aD as F,aa as A,F as K,r as f,j as V,h as M,aH as s,bo as q,bP as G,bx as P,bR as S,aq as j,a5 as H,Q,T as Y,U as J,n as E,B as k,a1 as W}from"#entry";import{_ as X}from"./DJmSyFDf.js";import{_ as Z}from"./DPpqwynK.js";import{u as ee,_ as te}from"./Km1DgUtp.js";import"./C3Qb2T0n.js";import"./DOMTaP9e.js";import"./BdXwPF5F.js";const ae=C({__name:"BaseUUID",props:{value:{type:String,required:!0}},setup(t){const{t:a}=D(),p=t,x=async()=>{try{await navigator.clipboard.writeText(p.value),A().add({title:a("ui.labels.copiedToClipboard"),description:a("UUID has been copied to clipboard"),color:"success"})}catch(l){console.error(a("ui.errors.failedToCopy"),l);const i=document.createElement("textarea");i.value=p.value,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i),A().add({title:a("ui.labels.copiedToClipboard"),description:a("UUID has been copied to clipboard"),color:"success"})}};return(l,i)=>{const m=F;return _(),I(m,{text:l.$t("ui.labels.clickToCopy")},{default:$(()=>[c("div",{class:"cursor-pointer transition-colors hover:text-primary hover:underline font-mono text-xs break-all",onClick:x},v(("shortenText"in l?l.shortenText:o(z))(t.value,20)),1)]),_:1},8,["text"])}}}),re=Object.assign(ae,{__name:"BaseUUID"});var n=(t=>(t[t.UNAVAILABLE=-1]="UNAVAILABLE",t[t.CREATED=1]="CREATED",t[t.COMPLETED=2]="COMPLETED",t[t.FAILED=3]="FAILED",t[t.CANCELED=4]="CANCELED",t[t.PROCESSING=6]="PROCESSING",t[t.REFUND=7]="REFUND",t[t.PARTIAL_PAID=8]="PARTIAL_PAID",t))(n||{});const oe={id:"customers"},se={class:"mb-4"},ne={class:"text-xl font-bold"},le={class:"text-sm text-muted"},ie={class:"flex items-center justify-between gap-3 border-t border-default pt-4 mt-auto"},de={class:"flex items-center gap-1.5"},ye=C({__name:"orders",setup(t){const{t:a}=D(),p=ee(),{loadings:x,orders:l,ordersTotal:i}=K(p),m=q,U=j,T=H,h=re,g=f(!1),y=f(null),L=e=>{y.value=e,g.value=!0},N=e=>{switch(Number(e)){case n.UNAVAILABLE:return{label:a("payment.status.unavailable"),color:"text-gray-500 dark:text-gray-200",class:"bg-gray-100 text-gray-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-gray-900 dark:text-gray-300",icon:"iconamoon:unavailable-thin"};case n.CREATED:return{label:a("payment.status.created"),color:"text-blue-500",class:"bg-blue-100 text-blue-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300",icon:"eos-icons:subscriptions-created-outlined"};case n.COMPLETED:return{label:a("payment.status.completed"),color:"text-green-500",class:"bg-green-100 text-green-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300",icon:"ix:success-filled"};case n.FAILED:return{label:a("payment.status.failed"),color:"text-red-500",class:"bg-red-100 text-red-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-red-900 dark:text-red-300",icon:"bx:error"};case n.CANCELED:return{label:a("payment.status.canceled"),color:"text-gray-500 dark:text-gray-300",class:"bg-gray-100 text-gray-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-gray-900 dark:text-gray-300",icon:"material-symbols:cancel-outline"};case n.PROCESSING:return{label:a("payment.status.processing"),color:"text-yellow-500 dark:text-yellow-300",class:"bg-yellow-100 text-yellow-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-yellow-900 dark:text-yellow-300",icon:"arcticons:goodtime"};case n.REFUND:return{label:a("payment.status.refund"),color:"text-gray-900 dark:text-gray-300",class:"bg-gray-100 text-gray-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-gray-900 dark:text-gray-300",icon:"gridicons:refund"};case n.PARTIAL_PAID:return{label:a("payment.status.partial_paid"),color:"text-green-500",class:"bg-green-100 text-green-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300",icon:"subway:part-of-circle-5"};default:return}},b=V("table"),R=M(()=>[{accessorKey:"uuid",header:"UUID",cell:({row:e})=>s(h,{value:e.original.uuid})},{accessorKey:"platform",header:a("Payment method"),cell:({row:e})=>s("div",{class:"flex items-center gap-3"},[s(m,{size:"lg",icon:e.original.platform==="Stripe"?"i-simple-icons-stripe":"i-cryptocurrency-color-usdt"}),s("div",void 0,[s("p",{class:"font-medium text-highlighted"},e.original.platform),s(h,{value:e.original.external_order_id})])])},{accessorKey:"date",header:a("Purchase Date"),cell:({row:e})=>G(e.original.created_at)},{accessorKey:"quantity",header:a("Credits"),cell:({row:e})=>P(e.original.paid_credit)},{accessorKey:"amount_divide_100",header:a("Payment amount"),cell:({row:e})=>S(e.original.amount_divide_100)},{accessorKey:"status",header:a("Status"),cell:({row:e})=>{const r=N(e.original.status);return r?s(U,{class:"capitalize",variant:"subtle",...r},()=>
1[s("span",void 0,r.label)]):s("span",void 0,e.original.status)}},{accessorKey:"actions",header:a("orders.invoice.actions"),cell:({row:e})=>s(T,{color:"primary",variant:"soft",size:"xs",icon:"i-lucide-file-down",label:a("orders.invoice.export"),onClick:()=>L(e.original)})}]),d=f({pageIndex:0,pageSize:10});return Q(()=>d.value.pageIndex,async e=>{await p.fetchOrders({items_per_page:d.value.pageSize,page:e+1})}),Y(async()=>{await p.fetchOrders({items_per_page:d.value.pageSize,page:d.value.pageIndex+1})}),(e,r)=>{const w=X,O=Z,B=te;return _(),J("div",oe,[c("div",se,[c("h2",ne,v(e.$t("Payment History")),1),c("p",le,v(e.$t("Your payment history will appear here once you have made a purchase.")),1)]),E(w,{ref_key:"table",ref:b,pagination:o(d),"onUpdate:pagination":r[0]||(r[0]=u=>k(d)?d.value=u:null),class:"shrink-0",data:o(l),columns:o(R),loading:o(x).fetchOrders,ui:{base:"table-fixed border-separate border-spacing-0",thead:"[&>tr]:bg-elevated/50 [&>tr]:after:content-none",tbody:"[&>tr]:last:[&>td]:border-b-0",th:"py-2 first:rounded-l-lg last:rounded-r-lg border-y border-default first:border-l last:border-r",td:"border-b border-default"}},null,8,["pagination","data","columns","loading"]),c("div",ie,[r[3]||(r[3]=c("div",null,null,-1)),c("div",de,[E(O,{"default-page":(o(b)?.tableApi?.getState().pagination.pageIndex||0)+1,"items-per-page":o(b)?.tableApi?.getState().pagination.pageSize,total:o(i),"onUpdate:page":r[1]||(r[1]=u=>o(b)?.tableApi?.setPageIndex(u-1))},null,8,["default-page","items-per-page","total"])])]),o(y)?(_(),I(B,{key:0,open:o(g),"onUpdate:open":r[2]||(r[2]=u=>k(g)?g.value=u:null),order:o(y)},null,8,["open","order"])):W("",!0)])}}});export{ye 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.