PageSourceSearch

https://chat.lindy.ai/assets/usersListView-DbM2Jb9H.js

js lindy.ai collected 2026-10-02 03:37:26 UTC 8,047 bytes, 1 lines download raw bytes

1import{r as a,j as e}from"./react-vendor-BKgfKFZH.js";import{a as w}from"./pathPrefix-C6KjWwRj.js";import{a4 as q,a5 as z,a as G}from"./admin-DkKq5hJV.js";import{b as L,c as B,A as O,a as D}from"./adminControls-BcRTrq2z.js";import{A as H}from"./adminLayout-BbJWN0b2.js";import{A as K}from"./adminTable-Bo3xK5om.js";import"./entry-C8wUDEw9.js";import"./types-BQz_GrV3.js";import"./makePostHogHeaders-DBJS6Pqp.js";import"./Identity-BmVeq4PW.js";import"./billing-BoSVWj_Q.js";import"./EvalCloneMarker-DcaKrgBx.js";import"./speechToText-BwTQh1Op.js";import"./types-C1NrGZG4.js";import"./models-Q8igSjJO.js";import"./types-Cf2awXPR.js";import"./authStep-CfHaIP7H.js";import"./types-BpdjsHyx.js";import"./parsePhoneNumber-6f8GhqhW.js";import"./normalizeArguments-VsWXHrBn.js";import"./types-B3nsUNRA.js";import"./lindyTool-foG1F4ub.js";import"./hostedMcpProviders-nNFzfAVQ.js";import"./icons-BfNt_9T9.js";const A=20,$=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"short",year:"numeric"});function W(r){return r.email}function J(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T({searchTerm:r,value:m}){if(!r)return e.jsx(e.Fragment,{children:m});const l=m.split(new RegExp(`(${J(r)})`,"gi"));return e.jsx(e.Fragment,{children:l.map((o,c)=>o.toLowerCase()===r.toLowerCase()?e.jsx("mark",{className:"bg-yellow-5 text-inherit",children:o},`${o}-${c}`):e.jsx("span",{children:o},`${o}-${c}`))})}function V({stats:r}){const[m,l]=a.useState(null),o=a.useMemo(()=>{const n=Math.max(...r.map(i=>i.cumulativeCount),1);return r.map((i,p)=>{const g=r.length<=1?0:p/(r.length-1)*1e3,v=205-i.cumulativeCount/n*185;return{stat:i,x:g,y:v}})},[r]),c=o.map(({x:n,y:i})=>`${n},${i}`).join(" "),S=`0,225 ${c} 1000,225`,u=[],x=r[0],f=r[Math.floor(r.length/2)],h=r.at(-1);x&&u.push(x),f&&f!==x&&u.push(f),h&&h!==x&&h!==f&&u.push(h);const d=m===null?null:o[m],b=a.useCallback(n=>{const i=Number(n.currentTarget.dataset.index);Number.isInteger(i)&&l(i)},[]),j=a.useCallback(()=>l(null),[]);return e.jsxs("div",{className:"relative h-[225px] w-full overflow-hidden",children:[e.jsxs("svg",{viewBox:"0 0 1000 225",preserveAspectRatio:"none",className:"size-full",role:"img","aria-label":"Cumulative user signups",children:[e.jsx("desc",{children:r.map(n=>`${n._id}: ${n.cumulativeCount} cumulative users`).join("; ")}),e.jsx("defs",{children:e.jsxs("linearGradient",{id:"admin-user-count-fill",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#4f46e5",stopOpacity:"0.8"}),e.jsx("stop",{offset:"95%",stopColor:"#4f46e5",stopOpacity:"0"})]})}),[50,100,150,200].map(n=>e.jsx("line",{x1:"0",x2:"1000",y1:n,y2:n,stroke:"#94a3b8",strokeDasharray:"3 3",strokeOpacity:"0.35"},n)),e.jsx("polygon",{points:S,fill:"url(#admin-user-count-fill)"}),e.jsx("polyline",{points:c,fill:"none",stroke:"#8884d8",strokeWidth:"2"}),o.map(({stat:n,x:i,y:p},g)=>e.jsx("circle",{"data-index":g,cx:i,cy:p,r:"12",fill:"transparent",tabIndex:0,"aria-label":`${n._id}: ${n.cumulativeCount} cumulative users`,onFocus:b,onBlur:j,onMouseEnter:b,onMouseLeave:j},n._id)),d?e.jsxs("g",{pointerEvents:"none",children:[e.jsx("rect",{x:Math.min(d.x,810),y:Math.max(d.y-42,4),width:"180",height:"34",rx:"6",fill:"#181c20"}),e.jsxs("text",{x:Math.min(d.x,810)+9,y:Math.max(d.y-42,4)+22,fill:"white",fontSize:"14",children:[d.stat._id,": ",d.stat.cumulativeCount]})]}):null]}),e.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 flex justify-between px-1 text-xs text-slate-10",children:u.map(n=>e.jsx("span",{children:n._id},n._id))})]})}function ve(){const[r,m]=a.useState(0),[l,o]=a.useState(""),[c,S]=a.useState(""),[u,x]=a.useState([]),[f,h]=a.useState([]),[d,b]=a.useState([]),[j,n]=a.useState(!0),[i,p]=a.useState(null),[g,v]=a.useState(!0),[C,N]=a.useState(null),[M,E]=a.useState(!1),[k,y]=a.useState(null);a.useEffect(()=>{const t=window.setTimeout(()=>S(l),1e3);return()=>window.clearTimeout(t)},[l]),a.useEffect(()=>{let t=!1;return n(!0),p(null),w.call(q,{query:{limit:String(A),skip:String(r*A)}}).then(s=>{if(!t){if(s.error){p(s.error.message);return}x(s.data??[])}}).catch(s=>{t||p(s instanceof Error?s.message:"Error loading users")}).finally(()=>{t||n(!1)}),()=>{t=!0}},[r]),a.useEffect(()=>{let t=!1;return v(!0),N(null),w.call(z,{}).then(s=>{if(!t){if(s.error){N(s.error.message);return}b(s.data??[])}}).catch(s=>{t||N(s instanceof Error?s.message:"Error loading user statistics")}).finally(()=>{t||v(!1)}),()=>{t=!0}},[]),a.useEffect(()=>{if(!c){h([]),y(null),E(!1);return}let t=!1;return E(!0),y(null),w.call(G,{query:{limit:"100",searchTerm:c,skip:"0"}}).then(s=>{if(!t){if(s.error){y(s.error.message);return}h(s.data??[]),y(null)}}).catch(s=>{t||y(s instanceof Error?s.message:"Error searching users")}).finally(()=>{t||E(!1)}),()=>{t=!0}},[c]);const P=a.useCallback(t=>{o(t.target.value)},[]),I=a.useCallback(()=>{o(""),m(t=>Math.max(t-1,0))},[]),Q=a.useCallback(()=>{o(""),m(t=>t+1)},[]),_=a.useMemo(()=>[{colSpan:4,header:"Email",key:"email",tdClassName:"col-span-12 py-2 sm:col-span-4 sm:table-cell",thClassName:"col-span-12 sm:col-span-4 sm:table-cell",render:t=>e.jsx("a",{href:`/admin/users/${t._id}`,className:"text-indigo-400 hover:text-indigo-300",children:e.jsx(T,{searchTerm:l,value:t.email})}
1),sorter:(t,s)=>t.email.localeCompare(s.email)},{colSpan:2,header:"Name",key:"name",tdClassName:"hidden py-2 sm:table-cell",thClassName:"hidden text-center sm:table-cell",render:t=>e.jsx(T,{searchTerm:l,value:t.name}),sorter:(t,s)=>t.name.localeCompare(s.name)},{colSpan:2,header:"Joined",key:"joined",tdClassName:"hidden py-2 sm:table-cell",thClassName:"hidden text-center sm:table-cell",render:t=>e.jsx("div",{className:"flex items-center justify-center",children:$.format(new Date(t.createdAt))}),sorter:(t,s)=>new Date(t.createdAt).getTime()-new Date(s.createdAt).getTime()},{colSpan:2,header:"Queries",key:"queries",tdClassName:"hidden py-2 sm:table-cell",thClassName:"hidden text-center sm:table-cell",render:t=>e.jsx("div",{className:"flex items-center justify-center",children:t.queryCount}),sorter:(t,s)=>t.queryCount-s.queryCount},{colSpan:2,header:"Last Query",key:"last-query",tdClassName:"hidden py-2 sm:table-cell",thClassName:"hidden text-center sm:table-cell",render:t=>e.jsx("div",{className:"flex items-center justify-center",children:t.lastQueryAt?$.format(new Date(t.lastQueryAt)):"Never"}),sorter:(t,s)=>(t.lastQueryAt?new Date(t.lastQueryAt).getTime():0)-(s.lastQueryAt?new Date(s.lastQueryAt).getTime():0)}],[l]),F=l.length>0&&(M||l!==c),U=l&&l===c?f:l?[]:u,R=l.length>0||u.length<A;return e.jsxs(H,{title:"Users",className:"px-6",children:[j?e.jsx(L,{}):null,i?e.jsx(B,{message:`Error loading users: ${i}`}):null,!j&&!i?e.jsx("div",{className:"mt-4 rounded-md border border-slate-6",children:e.jsxs("div",{className:"grid grid-cols-12 p-4",children:[e.jsx("div",{className:"col-span-12 mb-4 rounded-md border border-slate-6",children:e.jsxs("div",{className:"mt-4 text-sm",children:[g?e.jsx("div",{className:"h-[225px]",children:e.jsx(L,{})}):null,C?e.jsxs("div",{role:"alert",className:"flex h-[225px] items-center justify-center text-red-11",children:["Failed to load user statistics: ",C]}):null,!g&&!C?e.jsx(V,{stats:d}):null]})}),e.jsx("div",{className:"col-span-12 pb-4",children:e.jsx(O,{autoFocus:!0,id:"input",type:"search",className:"font-medium",placeholder:"Search by name, email, phone number or ID",value:l,onChange:P})}),e.jsxs("div",{className:"col-span-12 flex items-center gap-6 pb-4 font-bold",children:[e.jsx(D,{level:"outline",size:"sm",onClick:I,disabled:r===0||l.length>0,children:"< Previous"}),e.jsx(D,{level:"outline",size:"sm",onClick:Q,disabled:R,children:"Next >"})]}),F?e.jsx("p",{className:"col-span-12 pb-3 text-sm text-slate-11","aria-live":"polite",children:"Searching…"}):null,l&&k?e.jsxs("p",{className:"col-span-12 pb-3 text-sm text-red-11",role:"alert",children:["Error searching users: ",k]}):null,e.jsx("div",{className:"col-span-12 rounded-md border border-slate-6",children:e.jsx(K,{autoWidth:!1,columns:_,data:U,rowKey:W})})]})}):null]})}export{ve as View};

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.