PageSourceSearch

https://app.diggrowth.com/assets/ChooseAccount-BgVaBIsk.js

js diggrowth.com collected 2026-09-25 19:07:55 UTC 6,043 bytes, 2 lines download raw bytes

1import{aT as M,aU as P,r as c,aV as V,aW as z,aX as b,j as e,aY as F,aZ as H,$ as G,g as J,f as K,u as f,m as Q,G as s,y as X,O as Y,Q as Z,am as ee,V as te,T as y,ap as oe,a9 as se,W as ne,a_ as ae,A as ce}from"./index-CrrhTvkO.js";import{D as re}from"./DialogRef-Cogddku0.js";import{T as ie}from"./TooltipOnTableCells-Cck8xKYf.js";import{C as v}from"./Card-BlFuUWft.js";import"./SuperAdminEndpoints-5f42qI6i.js";function le(a){return M("MuiCardContent",a)}P("MuiCardContent",["root"]);const ue=["className","component"],de=a=>{const{classes:n}=a;return H({root:["root"]},le,n)},ge=G("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(a,n)=>n.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),T=c.forwardRef(function(n,h){const u=V({props:n,name:"MuiCardContent"}),{className:C,component:j="div"}=u,S=z(u,ue),p=b({},u,{component:j}),d=de(p);return e.jsx(ge,b({as:j,className:F(d.root,C),ownerState:p,ref:h},S))}),me={getAccountList(a){return{url:"kcauth/agency/user",headers:a.headers,data:a.request}}};function Ce(){const a=J(),n=K();let h=f.getItem("agencyAccounts")||[];const[u,C]=c.useState(f.getItem("agencyAccounts")||[]),[j,S]=Q(),p=localStorage.getItem("userData"),d=p?JSON.parse(p):null,N=d?d["access-token"]:null,[D,A]=c.useState(!0),[I,_]=c.useState(!1),g=new URLSearchParams(window.location.search),R=g==null?void 0:g.get("agencyToken");g==null||g.get("id");const k=c.useRef(),[w,L]=c.useState("");c.useEffect(()=>{L(""),A(!1)},[]),c.useEffect(()=>{A(!0),E(),setTimeout(()=>{A(!1)},2e3)},[R]);const E=async()=>{const i={headers:{"access-token":N},request:{agency:!0}};await a.get(me.getAccountList(i)).then(t=>{var l;t!=null&&t.data&&(C(t==null?void 0:t.data),((l=t==null?void 0:t.data)==null?void 0:l.length)>0&&(L(""),f.setItem("agencyAccounts",t==null?void 0:t.data)))}).catch(t=>{}).finally(()=>{})},U=o=>{const r=h.filter(t=>{var l,x;return(x=(l=t==null?void 0:t.email)==null?void 0:l.toLowerCase())==null?void 0:x.includes(o.toLowerCase())}),i=h.filter(t=>{var l,x;return!((x=(l=t==null?void 0:t.email)==null?void 0:l.toLowerCase())!=null&&x.includes(o.toLowerCase()))});C([...r,...i])},O=async()=>{let o={refresh_token:d["refresh-token"]};return await a.get(ae.logoutUser(o)).then(r=>(ce.redirectToLogin(),!0)).catch(r=>!1)},W=async()=>{if(await O()){window.location.href="/login";const r=localStorage.getItem("embeded")||!1,i=localStorage.getItem("appTheme")||"light";localStorage.clear(),localStorage.setItem("embeded",r),localStorage.setItem("appTheme",i)}},m=f.getItem("Client_data"),q=m==null?void 0:m.DSLogo,$=m==null?void 0:m.LSLogo,B=f.getItem("isClient");return e.jsxs(e.Fragment,{children:[D?e.jsxs(s,{item:!0,style:{width:"100%",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:[e.jsx(X,{size:50,style:{color:n.palette.text.tertiary,zIndex:9999}})," "]}):e.jsxs(s,{container:!0,bgcolor:n.palette.background.default,className:"chooseAccount",children:[e.jsxs(s,{xs:12,container:!0,position:"relative",margin:"auto",children:[e.jsx(s,{xs:12,textAlign:"center",margin:"auto",item:!0,className:"chooseAccount__logo",children:B?e.jsx("img",{src:n.palette.mode==="dark"?q:$,alt:"Company Logo",style:{height:"90px"}}):e.jsx("img",{src:n.palette.mode==="dark"?Y:Z,alt:"Company Logo"})}),e.jsxs(s,{position:"absolute",style:{top:"1rem",right:"2rem",display:"flex",alignItems:"center",gap:"20px"},item:!0,children:[e.jsx(ee,{outerDivStyle:{maxWidth:"200px"},name:"search-superadmin",type:"text",onChange:o=>{L(o.target.value),U(o.target.value)},label:"Search",defaultValue:w,value:w}),e.jsx(te,{btnText:"Logout",onClick:()=>{k.current.handleClickOpen()},type:"button"})]})]}),e.jsx(s,{xs:12,item:!0,className:"chooseAccount__text",children:e.jsx(y,{variant:"h5",children:"View your client Accounts"})}),e.jsx(s,{xs:12,item:!0,className:"chooseAccount__text",children:e.jsx(y,{variant:"h6",children:"Click on the profiles below to view the Reports and also Add new client by clicking on Add icon below."})}),e.jsx(s,{xs:12,item:!0,width:"100%",textAlign:"end",display:"flex",justifyContent:"flex-end",children:" "}),e.jsxs(s,{container:!0,className:"chooseAccount__profiles",gap:4,justifyContent:"center",marginTop:"100px",children:[" ",e.jsx(s,{xs:2,className:"giveHoverEffect",onClick:()=>{_(!0)},children:e.jsx(v,{sx:{minWidth:220,minHeight:190},children:e.jsxs(T,{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[e.jsx(s,{xs:12,textAlign:"center",children:e.jsx(y,{variant:"h5",children:"Add Account"})}),e.jsx(s,{xs:12,textAlign:"center",margin:"auto",children:e.jsx("div",{style:{backgroundColor:n.palette.background.default},className:"chooseAccount__profiles__addCircle",children:e.jsx(oe,{})})})]})})}),u==null?void 0:u.map((o,r)=>
1{const i=o.Name.split(" ");return e.jsx(s,{xs:2,className:"giveHoverEffect",style:{height:"fit-content"},onClick:()=>{window.open(`${o.sub_domain}account?agencyToken=${d["access-token"]}&user_type= ${o.user_type}&refresh_token=${d["refresh-token"]}`,"_blank")},children:e.jsx(v,{sx:{minWidth:220},children:e.jsxs(T,{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[e.jsx(s,{xs:12,textAlign:"center",children:e.jsx(y,{variant:"h5",style:{textTransform:"capitalize"},children:o.Name})}),e.jsx(s,{xs:12,textAlign:"center",margin:"auto",children:e.jsxs(y,{bgcolor:n.palette.primary.dark,className:"chooseAccount__profiles__circle",children:[Array.from(i[0])[0],Array.from(i[1])[0]]})}),e.jsx(s,{xs:12,textAlign:"center",children:e.jsx(ie,{title:o.email,children:o.email})})]})})},o.sub_domain)})]}),e.jsx(se,{open:I,onClose:()=>_(!1),"aria-labelledby":"add_channel",classes:{paper:"superAdmin__dialogRoot"},children:e.jsx(re,{type:"account",onCancel:(o,r)=>{_(o)}})})]}),e.jsx(c.Suspense,{fallback:"",children:e.jsx(ne,{ref:k,title:"Confirm Logout",confirm:"logout",discard:"Cancel",onConfirm:W,onDiscard:()=>{k.current.handleClose()},hideCloseButton:!0,color:"error",description:"Are you sure you want to Logout?"})})]})}export{Ce as default};
2//# sourceMappingURL=ChooseAccount-BgVaBIsk.js.map

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.