PageSourceSearch

https://donate-portal.vercel.app/_next/static/chunks/pages/admin/clients-55e376e88110d384.js

js donate-portal.vercel.app collected 2026-10-03 07:15:38 UTC 2,645 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5828],{466:(e,a,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/clients",function(){return i(422)}])},422:(e,a,i)=>{"use strict";i.r(a),i.d(a,{default:()=>w});var t=i(4848),s=i(6540),n=i(7284),r=i(5026),o=i(8465),l=i.n(o),c=i(5099),d=i(3261),h=i(4505),p=i(6715),m=i(2059),u=i(8874);let g=i(6425);function f(){let[e,a]=(0,s.useState)([]),i=(0,p.useRouter)();(0,s.useEffect)(()=>{(0,u.bg)(),(async()=>{g.post("/api/User",{action:"list"}).then(e=>{if(e&&e.data){let i=[],t=1;e.data.forEach(e=>{var a,s,n,r;i.push((a=t++,s=e.type,n=e.name,r=e.email,{id:a,type:s,name:n,email:r,phone:e.phone,org:e.org,dataid:e._id}))}),a(i)}})})()},[]);let o=async e=>{await g.post("/api/User",{action:"upgradeAccount",dataid:e}),l().fire("Upgraded to Organsation !","Congrats ! You have a new client.","success"),location.reload()},d=async e=>{await g.post("/api/User",{action:"downgradeAccount",dataid:e}),l().fire("Demo Period complete","Switched to User Account","success"),location.reload()},f=(e,a)=>{(0,u.F4)(e),localStorage.clear(),a.userid=a.dataid,(0,m.setUserLocalData)(a),i.push("/user/home")},w=async i=>{(0,h.Ay)("Deleting ...");let t=[],s=[];e.map(e=>{-1!=i.indexOf(e.id)?t.push(e.dataid):s.push(e)}),await g.post("/api/User",{action:"delete",list:t}),h.Ay.dismiss(),h.Ay.success("Deleted"),a(s)};return(0,t.jsx)("div",{className:"p-50 mx-auto",children:(0,t.jsx)(c.A,{title:"Clients",headCells:[{id:"id",numeric:!0,label:"id"},{id:"name",label:"Name"},{id:"email",label:"Email",className:"hidden-sm"},{id:"phone",label:"Phone",className:"hidden-sm"},{id:"controlButtons",label:""}],rows:e,onDelete:w,rowClick:e=>{i.push("/admin/userdetail?i="+e)},renderEnd:e=>(0,t.jsxs)(n.A,{align:"right",children:["user"==e.type?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{class:"mr-20",children:"User Account"}),(0,t.jsx)(r.A,{onClick:()=>{o(e.dataid)},variant:"contained",color:"primary",style:{marginRight:10,color:"#fff !important"},children:"Switch"})]}):"org"==e.type?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{class:"mr-20",children:"Organisation"}),(0,t.jsx)(r.A,{onClick:()=>{d(e.dataid)},variant:"contained",color:"primary",style:{marginRight:10,color:"#fff !important"},children:"Switch"})]}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("span",{class:"mr-20",children:"admin"==e.type?"Admin":"demo"==e.type?"Demo Lead":""})}),(0,t.jsx)(r.A,{onClick:a=>f(a,e),children:"Login"})]})})})}let w=()=>(0,t.jsx)(d.A,{Component:f,header:!0,footer:!0})}},e=>{var a=a=>e(e.s=a);e.O(0,[3478,9906,8037,9736,6425,1021,1679,9830,1637,6938,571,2059,636,6593,8792],()=>a(466)),_N_E=e.O()}]);

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.