PageSourceSearch

https://app.anvevoice.app/assets/ResellerBilling-BTDrvwE8.js

js anvevoice.app collected 2026-10-02 03:41:21 UTC 5,886 bytes, 1 lines download raw bytes

1import{r as R,j as e,N as B,B as u}from"./index-BKInu8Gb.js";import{u as L,R as h}from"./ResellerLayout-BXe6ZB5h.js";import{a as S}from"./useResellerTokenWallet-D2kTBYu7.js";import{M as I,T as P}from"./MasterWalletCard-BQEuAu2a.js";import{C as i,a as p,b as j,d as o}from"./card-BP0uVGrg.js";import{S as d}from"./AnnouncementBanner-DnsBLgq7.js";import{T as _,a as D,b as g,c as t,d as F,e as a}from"./table-n2Zb392B.js";import{B as c}from"./badge-kNeQxzMw.js";import{A as M}from"./arrow-right-CyjUFlGV.js";import{M as E}from"./mail-Ce9wnjTU.js";import{R as H}from"./receipt-m7kBySie.js";import{C as O}from"./circle-check-Bljibo5l.js";import{C as $}from"./clock-C42o-YdA.js";import{C as z}from"./circle-x-mFSVw0c4.js";import"./useMutation-BRPD8YYR.js";import"./anvevoice-logo-C8ZQvCP0.js";import"./BrandingContext-BRH9k_I2.js";import"./arrow-left-0nCR_9p3.js";import"./menu-d-k1676P.js";import"./index-Cuaw5peq.js";import"./layout-dashboard-D9pjzpyJ.js";import"./users-cdbo04JZ.js";import"./chart-column-CL-MSr0k.js";import"./wallet-C26ljaYp.js";import"./settings-B1GBuJyd.js";import"./dialog-ENkXqeK3.js";import"./index-Be2tF3Kx.js";import"./index-DyLHZbNU.js";import"./check-Bo92AKRy.js";import"./loader-circle-CYXtu1pc.js";import"./plus-uPmWpQSB.js";function f(s){return s>=1e6?`${(s/1e6).toFixed(s%1e6===0?0:1)}M`:s>=1e3?`${(s/1e3).toFixed(0)}K`:s.toLocaleString()}function N(s,l="INR"){try{return new Intl.NumberFormat("en-IN",{style:"currency",currency:l,maximumFractionDigits:0}).format(s)}catch{return`${l} ${s.toLocaleString()}`}}function A({status:s}){return s==="completed"?e.jsxs(c,{variant:"outline",className:"border-emerald-500/40 text-emerald-600 bg-emerald-500/10",children:[e.jsx(O,{className:"h-3 w-3 mr-1"}),"Completed"]}):s==="pending"?e.jsxs(c,{variant:"outline",className:"border-amber-500/40 text-amber-600 bg-amber-500/10",children:[e.jsx($,{className:"h-3 w-3 mr-1"}),"Pending"]}):e.jsxs(c,{variant:"outline",className:"border-destructive/40 text-destructive bg-destructive/10",children:[e.jsx(z,{className:"h-3 w-3 mr-1"}),"Failed"]})}const be=()=>{const{organization:s,isReseller:l,isLoading:b}=L(),n=(s==null?void 0:s.id)??null,{wallet:v,walletLoading:k,plans:y,plansLoading:C,purchases:m,purchasesLoading:w}=S(n),[T,x]=R.useState(!1);return b?e.jsx(h,{children:e.jsx(d,{className:"h-96"})}):l?e.jsx(h,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Token Billing"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Purchase token packs for your master wallet and allocate to clients."})]}),e.jsx(I,{organizationId:n,wallet:v,loading:k}),e.jsxs(i,{children:[e.jsx(p,{children:e.jsx(j,{className:"text-lg",children:"Token Packs"})}),e.jsx(o,{children:C?e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[1,2,3,4].map(r=>e.jsx(d,{className:"h-40"},r))}):e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[y.map(r=>e.jsx(i,{className:"border-border/60 hover:border-primary/40 transition-colors",children:e.jsxs(o,{className:"p-5 flex flex-col h-full",children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground font-medium",children:r.name}),e.jsx("div",{className:"text-3xl font-bold text-foreground mt-1",children:f(r.tokens)}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"tokens"}),e.jsx("div",{className:"mt-3 text-xl font-semibold text-foreground",children:N(r.price_inr/100)}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"one-time"}),e.jsxs(u,{className:"mt-auto pt-3 w-full",onClick:()=>x(!0),children:["Buy ",e.jsx(M,{className:"h-4 w-4 ml-1"})]})]})},r.id)),e.jsx(i,{className:"border-dashed border-primary/40 bg-primary/5",children:e.jsxs(o,{className:"p-5 flex flex-col h-full",children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-primary font-medium",children:"Enterprise"}),e.jsx("div",{className:"text-3xl font-bold text-foreground mt-1",children:"Custom"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"tokens"}),e.jsx("div",{className:"mt-3 text-xl font-semibold text-foreground",children:"Talk to us"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"volume pricing"}),e.jsx(u,{asChild:!0,variant:"outline",className:"mt-auto pt-3 w-full",children:e.jsxs("a",{href:"mailto:[email protected]?subject=Enterprise%20token%20pack",children:[e.jsx(E,{className:"h-4 w-4 mr-1.5"}),"Contact Sales"]})})]})})]})})]}),e.jsxs(i,{children:[e.jsx(p,{children:e.jsxs(j,{className:"text-lg flex items-center gap-2",children:[e.jsx(H,{className:"h-5 w-5 text-muted-foreground"}),"Purchase History"]})}),e.jsx(o,{children:w?e.jsx(d,{className:"h-40"}):m.length===0?e.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No purchases yet. Buy your first token pack above."}):e.jsxs(_,{children:[e.jsx(D,{children:e.jsxs(g,{children:[e.jsx(t,{children:"Date"}),e.jsx(t,{children:"Plan"}),e.jsx(t,{className:"text-right",children:"Tokens"}),e.jsx(t,{className:"text-right",children:"Amount"}),e.jsx(t,{children:"Status"}),e.jsx(t,{children:"Payment ID"})]})}),e.jsx(F,{children:m.map(r=>e.jsxs(g,{children:[e.jsx(a,{className:"text-sm",children:new Date(r.created_at).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}),e.jsx(a,{className:"font-medium",children:r.plan_slug}),e.jsx(a,{className:"text-right",children:f(r.tokens_purchased)}),e.jsx(a,{className:"text-right",children:N(r.amount_inr/100,r.currency)}),e.jsx(a,{children:e.jsx(A,{status:r.status})}),e.jsx(a,{className:"text-xs text-muted-foreground font-mono",children:r.razorpay_payment_id??"—"})]},r.id))})]})})]}),e.jsx(P,{open:T,onOpenChange:x,organizationId:n})]})}):e.jsx(B,{to:"/dashboard",replace:!0})};export{be 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.