PageSourceSearch

https://app.xlift.ai/assets/AccountsPerformancePage-BIeDhj_F.js

js xlift.ai collected 2026-10-05 13:20:26 UTC 6,767 bytes, 1 lines download raw bytes

1import{o as u,A as F,j as e,aM as $,C as L,G as i,I as C,a7 as k,$ as H,T as c,D as P,S as U,E as _,W as q,aa as K,U as Q}from"./index-dE8a1mPK.js";import{E as W}from"./ErrorState-gVNyx0--.js";import{I as J}from"./IconArrowLeft-cAVPTBNq.js";import{I as V}from"./IconChartBar-BDaV4nnQ.js";import{S as R}from"./SegmentedControl-CNEtbfTu.js";import{S as X}from"./SimpleGrid-DkEuk0DW.js";import{S as Y}from"./Select-DebRlW67.js";import{T as t}from"./Table-5ftamFSf.js";import{I as Z,a as ee}from"./IconTrendingUp-BCwZs3xF.js";import"./IconCopy-B63sUmw8.js";import"./Code-YtMEZkZ5.js";import"./get-env-uyVen0u2.js";import"./OptionsDropdown-wonErrz5.js";import"./CheckIcon-DkMc45y2.js";const re=[{value:"7d",label:"7d"},{value:"30d",label:"30d"},{value:"90d",label:"90d"}],A=[{value:"sent",label:"Outbound volume (DMs+replies)"},{value:"replies",label:"Replies received"},{value:"replyRate",label:"Reply rate"},{value:"follows",label:"Follows"},{value:"likes",label:"Likes given"},{value:"errors",label:"Errors"},{value:"errorRate",label:"Error rate"},{value:"healthScore",label:"Health score"}];function ge(){var G,I;const[o,l]=u.useState("30d"),[a,v]=u.useState("sent"),[p,m]=u.useState("desc"),[d,D]=u.useState("account"),{data:g,isLoading:N,error:B,refetch:O}=F({queryKey:["analytics-pool",o],queryFn:()=>Q.analyticsPool(o)}),E=u.useMemo(()=>{var j;const r=(g==null?void 0:g.accounts)||[];if(d==="account")return r;const x=new Map;for(const s of r){const f=(j=s.accountGroups)!=null&&j.length?s.accountGroups:["__ungrouped__"];for(const z of f){const n=x.get(z)||{group:z,accountCount:0,sent:0,replies:0,likes:0,retweets:0,posts:0,follows:0,errors:0,totalActions:0,healthSum:0};n.accountCount++,n.sent+=s.sent||0,n.replies+=s.replies||0,n.likes+=s.likes||0,n.retweets+=s.retweets||0,n.posts+=s.posts||0,n.follows+=s.follows||0,n.errors+=s.errors||0,n.totalActions+=s.totalActions||0,n.healthSum+=s.healthScore||100,x.set(z,n)}}return[...x.values()].map(s=>({...s,handle:s.group==="__ungrouped__"?"(ungrouped)":s.group,replyRate:s.sent>0?s.replies/s.sent:0,errorRate:s.totalActions>0?s.errors/s.totalActions:0,healthScore:Math.round(s.healthSum/Math.max(1,s.accountCount))}))},[g,d]),w=u.useMemo(()=>{const r=[...E];return r.sort((x,j)=>{const s=x[a]??0,f=j[a]??0;return p==="desc"?f-s:s-f}),r},[E,a,p]),T=w.filter(r=>(r.totalActions||0)>0),y=T[0],S=T[T.length-1];return N?e.jsx($,{}):B?e.jsx(W,{error:B,onRetry:O}):e.jsxs(L,{gap:"md",children:[e.jsx(i,{gap:"xs",align:"center",children:e.jsxs(C,{component:k,to:"/accounts",c:"dimmed",size:"sm",children:[e.jsx(J,{size:14,style:{verticalAlign:-2}})," Accounts"]})}),e.jsxs(i,{justify:"space-between",wrap:"wrap",gap:"sm",children:[e.jsxs(i,{gap:"xs",children:[e.jsx(V,{size:20}),e.jsx(H,{order:2,children:"Pool performance"})]}),e.jsxs(i,{gap:"xs",children:[e.jsx(R,{size:"xs",value:d,onChange:D,data:[{value:"account",label:"Per account"},{value:"group",label:"By group"}]}),e.jsx(R,{size:"xs",value:o,onChange:l,data:re})]})]}),e.jsx(c,{c:"dimmed",size:"sm",children:"Comparison view across your account pool. Sort by any column to see who's pulling weight vs. who's burning budget. Group view aggregates by your tags — useful when you've organized accounts by niche or warm-state."}),y&&S&&y!==S&&e.jsxs(X,{cols:{base:1,sm:2},spacing:"md",children:[e.jsx(M,{kind:"top",row:y,metric:a,label:(G=A.find(r=>r.value===a))==null?void 0:G.label,groupBy:d}),e.jsx(M,{kind:"bottom",row:S,metric:a,label:(I=A.find(r=>r.value===a))==null?void 0:I.label,groupBy:d})]}),e.jsxs(P,{withBorder:!0,children:[e.jsxs(i,{justify:"space-between",mb:"xs",wrap:"wrap",children:[e.jsxs(i,{gap:"xs",children:[e.jsx(c,{size:"sm",c:"dimmed",children:"Sort by"}),e.jsx(Y,{size:"xs",value:a,onChange:v,data:A,w:260}),e.jsx(R,{size:"xs",value:p,onChange:m,data:[{value:"desc",label:"▼ desc"},{value:"asc",label:"▲ asc"}]})]}),e.jsxs(c,{size:"xs",c:"dimmed",children:[w.length," rows"]})]}),e.jsx(U,{children:e.jsxs(t,{verticalSpacing:"xs",fz:"sm",highlightOnHover:!0,children:[e.jsx(t.Thead,{children:e.jsxs(t.Tr,{children:[e.jsx(t.Th,{children:d==="group"?"Group":"Account"}),d==="group"&&e.jsx(t.Th,{ta:"right",children:"Accounts"}),e.jsx(t.Th,{ta:"right",children:"Outbound"}),e.jsx(t.Th,{ta:"right",children:"Replies in"}),e.jsx(t.Th,{ta:"right",children:"Reply rate"}),e.jsx(t.Th,{ta:"right",children:"Follows"}),e.jsx(t.Th,{ta:"right",children:"Likes"}),e.jsx(t.Th,{ta:"right",children:"Errors"}),e.jsx(t.Th,{ta:"right",children:"Error rate"}),e.jsx(t.Th,{ta:"right",children:"Health"})]})}),e.jsx(t.Tbody,{children:w.map(r=>e.jsxs(t.Tr,{children:[e.jsx(t.Td,{children:d==="group"?e.jsx(c,{fw:500,children:r.handle}):e.jsxs(i,{gap:6,wrap:"nowrap",children:[e.jsxs(C,{component:k,to:`/accounts/${r.id}`,fw:500,children:["@",r.handle]}),r.warming&&e.jsx(_,{size:"xs",color:"orange",variant:"light",children:"warm"}),r.status==="needs_reauth"&&e.jsx(q,{label:"Needs re-auth",withArrow:!0,children:e.jsx(K,{size:12,color:"var(--mantine-color-red-6)"})})]})}),d==="group"&&e.jsx(t.Td,{ta:"right",children:r.accountCount}),e.jsx(t.Td,{ta:"right",children:h(r.sent)}),e.jsx(t.Td,{ta:"right",children:h(r.replies)}),e.jsx(t.Td,{ta:"right",children:b(r.replyRate)}),e.jsx(t.Td,{ta:"right",children:h(r.follows)}),e.jsx(t.Td,{ta:"right",children:h(r.likes)}),e.jsx(t.Td,{ta:"right",c:(r.errors||0)>0?"red":void 0,children:h(r.errors)}),e.jsx(t.Td,{ta:"right",c:(r.errorRate||0)>.1?"orange":void 0,children:b(r.errorRate)}),e.jsx(t.Td,{ta:"right",children:e.jsx(_,{size:"sm",color:r.healthScore>=70?"green":r.healthScore>=40?"yellow":"red",variant:"light",children:r.healthScore??100})})]},r.id||r.group))})]})})]})]})}function M({kind:o,row:l,metric:a,label:v,groupBy:p}){const m=o==="top";return e.jsx(P,{withBorder:!0,children:e.jsxs(L,{gap:4,children:[e.jsxs(i,{gap:"xs",children:[m?e.jsx(Z,{size:16,color:"var(--mantine-color-green-6)"}):e.jsx(ee,{size:16,color:"var(--mantine-color-red-6)"}),e.jsx(c,{size:"xs",c:"dimmed",tt:"uppercase",fw:600,children:m?"Top performer":"Bottom performer"})]}),e.jsx(i,{gap:"xs",children:p==="group"?e.jsx(c,{fw:700,fz:"xl",children:l.handle}):e.jsxs(C,{component:k,to:`/accounts/${l.id}`,fw:700,fz:"xl",children:["@",l.handle]})}),e.jsxs(c,{size:"xs",c:"dimmed",children:[v," · ",e.jsx("strong",{children:["replyRate","errorRate"].includes(a)?b(l[a]):h(l[a])})]}),e.jsxs(i,{gap:"md",mt:4,children:[e.jsxs(c,{size:"xs",c:"dimmed",children:[h(l.sent)," outbound"]}
1),e.jsxs(c,{size:"xs",c:"dimmed",children:[b(l.replyRate)," reply rate"]}),e.jsxs(c,{size:"xs",c:"dimmed",children:["health ",l.healthScore??100]})]})]})})}function h(o){return o==null?"0":Number(o).toLocaleString()}function b(o){return o==null||!Number.isFinite(o)?"—":o===0?"0%":o<.01?"<1%":`${Math.round(o*100)}%`}export{ge 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.