PageSourceSearch

https://apexmob.life/assets/team-progress-BYQbLfeM.js

js apexmob.life collected 2026-10-02 02:00:00 UTC 30,297 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/account-mirrors-DeJBN0Fy.js","assets/index-CX8MQMhI.js"])))=>i.map(i=>d[i]);
2import{e as ot,k as rt,r as d,s as j,_ as ct,l as dt,j as t,v as be,w as ut,x as pt,y as mt,z as gt,A as xt,E as _,B as I,C as ae,P as je,D as ht}from"./index-CX8MQMhI.js";import{TOTAL_ONBOARDING_ITEMS as B,countChecked as de,ONBOARDING_SECTIONS as Ie}from"./OnboardingProgressDialog-CypD79U9.js";import"./EappQuizDialog-Cg5ExQF5.js";const O=g=>(g??"").trim().toLowerCase(),Re={active_high:"Active — High Priority",active_low:"Active — Low Priority",active_ao_intel:"Active AO Intel",inactive:"Inactive"},ft=g=>{const h=(g??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return h==="no_longer_active"?Re.inactive:Re[h]??null},yt=g=>{const h=g==null?"":String(g);return/[",\n]/.test(h)?`"${h.replace(/"/g,'""')}"`:h};function _t(g,h,F,q){const K=[["agent","email","title","section","section_slug","media_type","clicks","last_click"].join(",")];for(const $ of q)K.push([g,h,$.title,$.category_title||$.category_slug,$.category_slug,$.media_type==="youtube"||!$.media_type?"video":$.media_type,$.clicks,$.last_click?new Date($.last_click).toISOString():""].map(yt).join(","));const J=new Blob([K.join(`
3`)],{type:"text/csv;charset=utf-8;"}),se=URL.createObjectURL(J),T=document.createElement("a");T.href=se,T.download=`mindset-engagement-${(g||h||"agent").replace(/[^a-z0-9]+/gi,"-").toLowerCase()}-${F}d.csv`,document.body.appendChild(T),T.click(),T.remove(),URL.revokeObjectURL(se)}const vt={active:"Active",unsure:"Unsure",inactive:"Inactive"},bt={active:"var(--ax-success)",unsure:"var(--ax-warn)",inactive:"var(--ax-danger)"},jt=g=>{const h=(g??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return h?h==="inactive"||h==="no_longer_active"?"inactive":h.startsWith("active")?"active":null:null},Oe=g=>{const h=String(g??"").trim().toLowerCase();return h==="active"||h==="unsure"||h==="inactive"?h:null};function Ct(){const{user:g,loading:h,signOut:F}=ot(),q=rt(),[M,K]=d.useState(null),[J,se]=d.useState([]),[T,$]=d.useState([]),[pe,Te]=d.useState([]),[H,Be]=d.useState(new Map),[S,me]=d.useState(null),[ge,De]=d.useState(!1),[xe,Ne]=d.useState(!1),[We,we]=d.useState(null),[N,ne]=d.useState(new Set),[Z,Se]=d.useState(!1),[Pe,qe]=d.useState([]),[Ue,Ge]=d.useState([]),[Fe,Ke]=d.useState([]),[He,Ve]=d.useState([]),[Ye,Qe]=d.useState(new Map),[ke,Ce]=d.useState(new Set),[Xe,ze]=d.useState(new Map),[Je,Ze]=d.useState(new Map),[Ae,et]=d.useState(new Map),W=d.useMemo(()=>e=>{const s=(e??"").trim().toLowerCase();return Ae.get(s)??s},[Ae]),[V,Me]=d.useState("all"),[ie,$e]=d.useState(""),[P,Ee]=d.useState("all"),[he,tt]=d.useState(new Map),[L,at]=d.useState(30),[st,Le]=d.useState(!1);d.useEffect(()=>{g&&(async()=>{const[{data:e},{data:s},{data:o}]=await Promise.all([j.rpc("current_agent_name"),j.rpc("is_admin"),j.rpc("current_agent_self")]),p=Array.isArray(o)?o[0]:o;let y=e??null;if(p?.id){const{resolveMirroredManagerName:v}=await ct(async()=>{const{resolveMirroredManagerName:k}=await import("./account-mirrors-DeJBN0Fy.js");return{resolveMirroredManagerName:k}},__vite__mapDeps([0,1])),f=await v(p.id,p.role,y);f&&(y=f)}K(y),De(!!s)})()},[g]);const fe=async()=>{const[{data:e},{data:s},{data:o},{data:p}]=await Promise.all([j.from("onboarding_progress").select("user_id,email,items,states,ao_writing_number,completed_at,updated_at,eapp_quiz").limit(5e3),j.from("onboarding").select("id,email,first_name,last_name,recommended_sa,recommended_ga,stage,submitted_at").limit(5e3),(async()=>{const i=await j.rpc("get_team_onboarding_directory");return!i.error&&Array.isArray(i.data)&&i.data.length?i:j.rpc("get_agents_directory")})(),j.from("onboarding_exclusions").select("email,status").limit(5e3)]),[{data:y},{data:v},{data:f},{data:k},{data:n}]=await Promise.all([j.from("items").select("slug,title,position").limit(2e3),j.rpc("get_team_resource_progress"),j.rpc("get_team_mindset_engagement",{days:L}),j.rpc("get_team_market_training"),j.rpc("get_team_email_aliases")]),c=new Map;for(const i of n??[]){const l=(i.alias||"").trim().toLowerCase(),a=(i.primary_email||"").trim().toLowerCase();l&&a&&l!==a&&c.set(l,a)}et(c);const m=i=>{const l=(i??"").trim().toLowerCase();return c.get(l)??l},r=new Map;for(const i of f??[]){const l=m(i.email);l&&(r.has(l)||r.set(l,[]),r.get(l).push(i))}r.forEach(i=>
3i.sort((l,a)=>a.clicks-l.clicks||l.title.localeCompare(a.title))),ze(r);const x=new Map;for(const i of k??[]){const l=m(i.email);l&&(x.has(l)||x.set(l,[]),x.get(l).push(i))}x.forEach(i=>i.sort((l,a)=>(a.completed_at??"").localeCompare(l.completed_at??""))),Ze(x);const z=(y??[])||[],A=i=>z.filter(l=>l.slug.startsWith(i)).sort((l,a)=>(l.position??0)-(a.position??0)||l.title.localeCompare(a.title)).map(l=>({slug:l.slug,title:l.title}));qe(A("res-").sort((i,l)=>i.title.localeCompare(l.title))),Ge(A("vtv-")),Ke(A("mtv-")),Ve(A("mh-"));const C=new Map;for(const i of v??[]){const l=m(i.email);if(!l)continue;C.has(l)||C.set(l,new Map);const a=C.get(l),u=a.get(i.slug);(!u||u.status!=="completed"&&i.status==="completed"||!u.completed_at&&i.completed_at)&&a.set(i.slug,{status:i.status,first_opened_at:u?.first_opened_at&&i.first_opened_at?u.first_opened_at<i.first_opened_at?u.first_opened_at:i.first_opened_at:i.first_opened_at??u?.first_opened_at??null,completed_at:i.completed_at??u?.completed_at??null})}Qe(C),se(e??[]),$(s??[]),Te(o??[]);const Y=new Map;for(const i of p??[])i.email&&Y.set(i.email.toLowerCase(),i.status);Be(Y);const{data:Q}=await j.from("priority_ranking_items").select("agent_name,status,ga_override_status,updated_at,created_at").limit(5e3),U=new Map;for(const i of Q??[]){const l=O(i.agent_name);if(!l)continue;const a=Oe(i.ga_override_status)??Oe(i.status);if(!a)continue;const u=new Date(i.updated_at||i.created_at||0).getTime(),w=U.get(l);(!w||u>=w.at)&&U.set(l,{st:a,at:u})}tt(new Map(Array.from(U,([i,l])=>[i,l.st])))};d.useEffect(()=>{g&&fe()},[g]),d.useEffect(()=>{if(!g)return;let e=!1;return(async()=>{Le(!0);const{data:s}=await j.rpc("get_team_mindset_engagement",{days:L});if(e)return;const o=new Map;for(const p of s??[]){const y=W(p.email);y&&(o.has(y)||o.set(y,[]),o.get(y).push(p))}o.forEach(p=>p.sort((y,v)=>v.clicks-y.clicks||y.title.localeCompare(v.title))),ze(o),Le(!1)})(),()=>{e=!0}},[g,L]);const le=async(e,s)=>{if(!e)return;const o=e.toLowerCase();we(o);try{if(s===null){const{error:p}=await j.from("onboarding_exclusions").delete().eq("email",o);if(p)throw p}else{const{error:p}=await j.from("onboarding_exclusions").upsert({email:o,status:s,set_by:g?.email??null},{onConflict:"email"});if(p)throw p}await fe()}catch(p){alert(`Update failed: ${p?.message||p}`)}finally{we(null)}},ye=e=>e.email?e.email.toLowerCase():`name:${e.name.toLowerCase()}`,nt=e=>{ne(s=>{const o=new Set(s);return o.has(e)?o.delete(e):o.add(e),o})},oe=async e=>{if(N.size!==0&&!(e==="removed"&&!confirm(`Remove ${N.size} agent(s) from onboarding? This also hides their home-page Onboarding Progress button.`))){Se(!0);try{const s=Array.from(N);if(e===null){const{error:o}=await j.from("onboarding_exclusions").delete().in("email",s);if(o)throw o}else{const o=s.map(y=>({email:y,status:e,set_by:g?.email??null})),{error:p}=await j.from("onboarding_exclusions").upsert(o,{onConflict:"email"});if(p)throw p}ne(new Set),await fe()}catch(s){alert(`Bulk update failed: ${s?.message||s}`)}finally{Se(!1)}}},b=d.useMemo(()=>{if(!M&&!ge)return[];const e=M?dt(pe,M):new Set,s=O(M??""),o=s==="spencer mayo",p=(n,c,m)=>{const r=O(n),x=O(c),z=O(m);return s&&r===s?!1:o?!0:e.has(r)||e.has(x)||x===s||z===s},y=new Map;for(const n of J){if(!n.email)continue;const c=W(n.email),m=y.get(c),r=x=>x.completed_at?1e6:de(x.items??null);(!m||r(n)>r(m))&&y.set(c,n)}const v=new Map,f=new Set,k=[];for(const n of pe){const c=`${n.first_name??""} ${n.last_name??""}`.trim()||n.name||"";if(!c||!p(c,n.sa_name,n.ga_name))continue;const m=W(n.email||n.professional_email||""),r=m?y.get(m):void 0,x=r?.completed_at?B:de(r?.items??null),z=r?.states?Object.values(r.states).filter(C=>C&&C!=="").length:0,A=T.some(C=>C.email&&C.email.toLowerCase()===m);m&&f.add(m),m&&v.set(m,n),k.push({key:`agent-${n.id??c}`,name:c,email:m,sa_name:n.sa_name??null,ga_name:n.ga_name??null,role:n.role??null,in_roster:!0,in_onboarding_tab:A,checked:x,total:B,percent:Math.round(x/B*100),ao_writing_number:r?.ao_writing_number??null,states_licensed:z,completed_at:r?.completed_at??null,updated_at:r?.updated_at??null,items:r?.items??null,stage:null,eapp_quiz:r?.eapp_quiz??null,exclusion:H.get(m)??H.get(`name:${c.toLowerCase()}`)??null,auto_excluded:ft(n.status),web_status:n.status??null})}for(const n of T){const c=W(n.email);if(!c||f.has(c))continue;const m=`${n.first_name??""} ${n.last_name??""}`.trim()||c;if(!p(m,n.recommended_sa,n.recommended_ga))continue;const r=y.get(c),x=r?.completed_at?B:de(r?.items??null),z=r?.states?Object.values(r.states).filter(A=>A&&A!=="").length:0;k.push({key:`onb-${n.id}`,name:m,email:c,sa_name:n.recommended_sa,ga_name:n.recommended_ga,role:null,in_roster:!1,in_onboarding_tab:!0,checked:x,total:B,percent:Math.round(x/B*100),ao_writing_number:r?.ao_writing_number??null,states_licensed:z,completed_at:r?.completed_at??null,updated_at:r?.updated_at??null,items:r?.items??null,stage:n.stage??null,eapp_quiz:r?.eapp_quiz??null,exclusion:H.get(c)??H.get(`name:${m.toLowerCase()}`)??null,auto_excluded:null,web_status:null})}if(o)for(const n of J){const c=(n.email||"").toLowerCase();if(!c||f.has(c)||k.some(x=>x.email===c))continue;const m=n.completed_at?B:de(n.items??null),r=n.states?Object.values(n.states).filter(x=>x&&x!=="").length:0;k.push({key:`prog-${c}`,name:c,email:c,sa_name:null,ga_name:null,role:null,in_roster:!1,in_onboarding_tab:!1,checked:m,total:B,percent:Math.round(m/B*100),ao_writing_number:n.ao_writing_number??null,states_licensed:r,completed_at:n.completed_at??null,updated_at:n.updated_at??null,items:n.items??null,stage:null,eapp_quiz:n.eapp_quiz??null,exclusion:H.get(c)??null,auto_excluded:null,web_status:null})}return k.sort((n,c)=>{const m=z=>z.checked===0?2:z.checked>
3=z.total?1:0,r=m(n),x=m(c);return r!==x?r-x:c.percent-n.percent||n.name.localeCompare(c.name)}),k},[J,T,pe,M,ge,H,W]),it=d.useMemo(()=>{const e=new Set;for(const s of b)s.sa_name&&s.sa_name.trim()&&e.add(s.sa_name.trim());return Array.from(e).sort((s,o)=>s.localeCompare(o))},[b]),lt=d.useMemo(()=>b.some(e=>!e.sa_name||!e.sa_name.trim()),[b]),_e=e=>jt(e.web_status)??he.get(O(e.name))??null,re=d.useMemo(()=>{const e={active:0,unsure:0,inactive:0,none:0};for(const s of b){const o=_e(s);o?e[o]+=1:e.none+=1}return e},[b,he]),ee=d.useMemo(()=>{const e=ie.trim().toLowerCase();return b.filter(s=>{if(!xe&&(s.exclusion!==null||s.auto_excluded!==null))return!1;if(V==="none"){if(s.sa_name&&s.sa_name.trim())return!1}else if(V!=="all"&&O(s.sa_name)!==O(V))return!1;return!(P!=="all"&&_e(s)!==P||e&&!`${s.name} ${s.email??""}`.toLowerCase().includes(e))})},[b,xe,V,ie,P,he]),ve=d.useMemo(()=>b.filter(e=>e.exclusion!==null||e.auto_excluded!==null).length,[b]),te=d.useMemo(()=>{const e=b.filter(v=>v.exclusion===null&&v.auto_excluded===null),s=e.length,o=e.filter(v=>v.checked>0).length,p=e.filter(v=>v.checked>=v.total).length,y=s?Math.round(e.reduce((v,f)=>v+f.percent,0)/s):0;return{total:s,started:o,complete:p,avg:y}},[b]);return h?t.jsx("div",{style:be,children:"Loading…"}):g?t.jsx("div",{style:be,children:t.jsxs("div",{style:pt,children:[t.jsxs("header",{style:mt,children:[t.jsxs("div",{children:[t.jsx("div",{style:gt,children:"APEX MOB · MY TEAM"}),t.jsx("h1",{style:xt,children:"Onboarding Progress"}),M&&t.jsxs("div",{style:{..._,marginTop:6},children:["Showing agents under ",M]})]}),t.jsxs("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[t.jsx("button",{onClick:()=>q({to:"/dashboard"}),style:I,children:"← Dashboard"}),t.jsx("button",{onClick:()=>F().then(()=>q({to:"/"})),style:I,children:"Sign Out"})]})]}),!M&&t.jsx("div",{style:{...ae,textAlign:"center",color:"var(--ax-muted)"},children:"We couldn't find your manager record. Ask an admin to link your account to your roster row."}),M&&b.length===0&&t.jsx("div",{style:{...ae,textAlign:"center",color:"var(--ax-muted)"},children:"No one on your team has any onboarding activity yet."}),b.length>0&&t.jsxs("div",{style:{...ae,marginBottom:16},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(90px, 1fr))",gap:12},children:[t.jsx(ue,{label:"Team Size",value:String(te.total)}),t.jsx(ue,{label:"Started",value:String(te.started)}),t.jsx(ue,{label:"Complete",value:String(te.complete)}),t.jsx(ue,{label:"Avg %",value:`${te.avg}%`})]}),t.jsx("div",{style:{marginTop:12},children:t.jsx(je,{percent:te.avg})})]}),b.length>0&&t.jsxs("div",{style:{...ae,marginBottom:12,display:"flex",gap:10,flexWrap:"wrap",alignItems:"center"},children:[t.jsx("label",{style:{..._,fontSize:12,letterSpacing:"0.08em"},children:"SA TEAM"}),t.jsxs("select",{value:V,onChange:e=>Me(e.target.value),style:{background:"var(--ax-card)",color:"var(--ax-text)",border:"1px solid rgba(217,173,92,0.35)",borderRadius:8,padding:"8px 10px",fontSize:13,minWidth:0,width:"100%",maxWidth:260},children:[t.jsxs("option",{value:"all",children:["All SA teams (",b.length,")"]}),it.map(e=>t.jsxs("option",{value:e,children:[e," (",b.filter(s=>O(s.sa_name)===O(e)).length,")"]},e)),lt&&t.jsxs("option",{value:"none",children:["No SA (direct to GA) (",b.filter(e=>!e.sa_name||!e.sa_name.trim()).length,")"]})]}),t.jsx("input",{value:ie,onChange:e=>$e(e.target.value),placeholder:"Search any agent by name or email…",style:{flex:"1 1 240px",background:"var(--ax-card)",color:"var(--ax-text)",border:"1px solid rgba(217,173,92,0.35)",borderRadius:8,padding:"8px 10px",fontSize:13}}),t.jsx("label",{style:{..._,fontSize:12,letterSpacing:"0.08em"},children:"ENGAGEMENT RANGE"}),t.jsx("div",{style:{display:"inline-flex",gap:4},children:[7,30,90].map(e=>t.jsxs("button",{onClick:()=>at(e),"aria-pressed":L===e,style:{...I,padding:"6px 10px",fontSize:12,borderColor:L===e?"var(--ax-gold)":void 0,color:L===e?"var(--ax-gold)":void 0,background:L===e?"rgba(217,173,92,0.12)":void 0},children:[e,"d"]},e))}),st&&t.jsx("span",{style:{..._,fontSize:12},children:"updating…"}),t.jsx("div",{style:{flexBasis:"100%",height:0}}),t.jsx("label",{style:{..._,fontSize:12,letterSpacing:"0.08em"},children:"PRIORITY STATUS"}),t.jsx("div",{style:{display:"inline-flex",gap:4,flexWrap:"wrap"},children:[["all",`All (${b.length})`],["active",`Active (${re.active})`],["unsure",`Unsure (${re.unsure})`],["inactive",`Inactive (${re.inactive})`]].map(([e,s])=>t.jsx("button",{onClick:()=>Ee(e),"aria-pressed":P===e,style:{...I,padding:"6px 10px",fontSize:12,borderColor:P===e?"var(--ax-gold)":void 0,color:P===e?"var(--ax-gold)":void 0,background:P===e?"rgba(217,173,92,0.12)":void 0},children:s},e))}),t.jsxs("span",{style:{..._,fontSize:11},children:["from priority confirmations · ",re.none," not ranked"]}),(V!=="all"||ie.trim()||P!=="all")&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{style:{..._,fontSize:12},children:[ee.length," shown"]}),t.jsx("button",{onClick:()=>{Me("all"),$e(""),Ee("all")},style:I,children:"Clear filters"})]})]}),t.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[t.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[t.jsx("button",{onClick:()=>{const e=ee.map(ye),s=e.length>0&&e.every(o=>N.has(o));ne(s?new Set:new Set(e))},style:I,children:ee.length>0&&ee.every(e=>N.has(ye(e)))?"Clear all":"Select all"}),N.size>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{style:{..._,fontSize:12},children:[N.size," selected"]}),t.jsx(D,{onClick:()=>oe("completed"),disabled:Z,color:"var(--ax-success)",children:"Completed"}),t.jsx(D,{onClick:()=>oe("lost"),disabled:Z,color:"var(--ax-danger)",children:"Lost in onboarding"}),t.jsx(D,{onClick:()=>oe("stagnate"),disabled:Z,color:"var(--ax-warn)",children:"Stagnate"}),t.jsx(D,{onClick:()=>oe(null),disabled:Z,color:"var(--ax-info)",children:"Clear status"}),t.jsx(D,{onClick:()=>ne(new Set),disabled:Z,children:"Deselect"})]})]}),ve>0&&t.jsx("button",{onClick:()=>Ne(e=>!e),style:I,children:xe?`Hide removed / inactive (${ve})`:`Show removed / inactive (${ve})`})]}),t.jsx("section",{style:ht,children:t.jsx("div",{style:{display:"grid",gap:8},children:ee.map(e=>{const s=e.checked>
3=e.total,o=e.exclusion!==null||e.auto_excluded!==null,p=We===(e.email?e.email.toLowerCase():`name:${e.name.toLowerCase()}`),y=ye(e),v=N.has(y);return t.jsxs("div",{style:{...ae,color:"var(--ax-text)",opacity:o?.55:1,display:"flex",gap:12,alignItems:"flex-start",minWidth:0,maxWidth:"100%"},children:[t.jsx("input",{type:"checkbox",checked:v,onChange:()=>nt(y),onClick:f=>f.stopPropagation(),style:{marginTop:6,cursor:"pointer",accentColor:"var(--ax-gold-text)"},"aria-label":`Select ${e.name}`}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("button",{onClick:()=>me(e),style:{display:"block",width:"100%",textAlign:"left",background:"transparent",border:"none",padding:0,color:"inherit",cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,marginBottom:8},children:[t.jsxs("div",{style:{minWidth:0},children:[t.jsxs("div",{style:{color:"var(--ax-gold-text)",fontWeight:600,display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("span",{children:e.name}),!e.in_roster&&t.jsx(E,{color:"var(--ax-warn)",label:"From Onboarding Tab"}),e.in_roster&&e.in_onboarding_tab&&t.jsx(E,{color:"var(--ax-gold-text)",label:"New Recruit"}),s&&t.jsx(E,{color:"var(--ax-success)",label:"✓ Complete"}),e.eapp_quiz?.passed&&t.jsx(E,{color:"var(--ax-success)",label:`eApp Quiz ${e.eapp_quiz.score}/${e.eapp_quiz.total}`}),e.eapp_quiz&&!e.eapp_quiz.passed&&t.jsx(E,{color:"var(--ax-warn)",label:`eApp Quiz ${e.eapp_quiz.score}/${e.eapp_quiz.total} — not passed`}),(()=>{const f=_e(e);return f?t.jsx(E,{color:bt[f],label:`Priority: ${vt[f]}`}):null})(),e.auto_excluded&&t.jsx(E,{color:"var(--ax-info)",label:`Off onboarding — ${e.auto_excluded}`}),e.exclusion==="inactive"&&t.jsx(E,{color:"var(--ax-info)",label:"Not Active"}),e.exclusion==="completed"&&t.jsx(E,{color:"var(--ax-success)",label:"Completed"}),e.exclusion==="lost"&&t.jsx(E,{color:"var(--ax-danger)",label:"Lost in Onboarding"}),e.exclusion==="stagnate"&&t.jsx(E,{color:"var(--ax-warn)",label:"Stagnate"}),e.exclusion==="removed"&&t.jsx(E,{color:"var(--ax-danger)",label:"Removed"})]}),t.jsxs("div",{style:{..._,overflowWrap:"anywhere"},children:[e.email||"—",e.sa_name?` · SA: ${e.sa_name}`:"",e.ga_name?` · GA: ${e.ga_name}`:""]})]}),t.jsxs("div",{style:{textAlign:"right"},children:[t.jsxs("div",{style:{color:"var(--ax-gold-text)",fontWeight:700},children:[e.percent,"%"]}),t.jsxs("div",{style:{..._,fontSize:11},children:[e.checked,"/",e.total," items"]})]})]}),t.jsx(je,{percent:e.percent}),t.jsxs("div",{style:{..._,marginTop:6,display:"flex",gap:14,flexWrap:"wrap",fontSize:12},children:[t.jsxs("span",{children:["Licensed states: ",e.states_licensed]}),e.ao_writing_number&&t.jsxs("span",{children:["Writing #: ",e.ao_writing_number]}),e.stage&&t.jsxs("span",{children:["Stage: ",e.stage]}),e.eapp_quiz&&t.jsxs("span",{children:["eApp quiz attempts: ",e.eapp_quiz.attempts,e.eapp_quiz.last_attempt_at?` · last ${new Date(e.eapp_quiz.last_attempt_at).toLocaleDateString()}`:""]}),e.updated_at&&t.jsxs("span",{children:["Updated: ",new Date(e.updated_at).toLocaleDateString()]}),!e.updated_at&&!e.completed_at&&t.jsx("span",{children:"Not started"})]})]}),(()=>{const f=Ye.get(W(e.email))??new Map,k=[{id:"res",label:"Resources & Support",items:Pe,empty:"No resource topics found."},{id:"vtv",label:"Under Writing & Post Sale",items:Ue,empty:"No training videos found."},{id:"mtv",label:"Morning Meeting Vault",items:Fe,empty:"No morning training videos found."},{id:"mh",label:"How to Build",items:He,empty:"No how to build topics found."}],n=Xe.get(W(e.email))??[],c=Je.get(W(e.email))??[],m=n.reduce((a,u)=>a+Number(u.clicks||0),0),r=k.reduce((a,u)=>a+u.items.length,0),x=k.reduce((a,u)=>a+u.items.filter(w=>f.get(w.slug)?.status==="completed").length,0),z=k.reduce((a,u)=>a+u.items.filter(w=>f.has(w.slug)).length,0),A=r?Math.round(x/r*100):0,C=`${e.key}|activity`,Y=ke.has(C),Q=`${e.key}|form`,U=ke.has(Q),i=e.items??{},l=Math.round(e.checked/e.total*100);return t.jsxs("div",{style:{marginTop:10,display:"grid",gap:8},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[t.jsxs("button",{onClick:()=>Ce(a=>
3{const u=new Set(a);return u.has(Q)?u.delete(Q):u.add(Q),u}),style:{...I,padding:"8px 12px",fontSize:12,display:"inline-flex",alignItems:"center",gap:8,borderColor:e.checked>0?"var(--ax-success)":void 0,color:e.checked>0?"var(--ax-success)":void 0},"aria-expanded":U,children:[t.jsx("span",{style:{transform:U?"rotate(90deg)":"none",transition:"transform .15s"},children:"▶"}),"Onboarding Form · ",e.checked,"/",e.total," checked off (",l,"%)"]}),t.jsx("span",{style:{flex:1,minWidth:80,height:6,borderRadius:999,background:"rgba(243,240,234,0.12)",overflow:"hidden"},children:t.jsx("span",{style:{display:"block",width:`${l}%`,height:"100%",background:l===100?"var(--ax-success)":"var(--ax-gold)"}})})]}),U&&t.jsxs("div",{style:{display:"grid",gap:14,background:"rgba(217,173,92,0.05)",border:"1px solid var(--ax-line)",borderRadius:8,padding:12},children:[e.checked===0&&t.jsxs("span",{style:{..._,fontSize:12},children:[e.name," hasn't checked off anything on their onboarding form yet."]}),Ie.map(a=>{const u=a.items.filter(w=>i[w.key]).length;return t.jsxs("div",{children:[t.jsxs("div",{style:{..._,fontSize:11,letterSpacing:"0.12em",marginBottom:6},children:[a.title.toUpperCase()," · ",u,"/",a.items.length]}),t.jsx("div",{style:{display:"grid",gap:4},children:a.items.map(w=>{const R=!!i[w.key];return t.jsxs("div",{style:{display:"flex",gap:8,fontSize:12,color:R?"var(--ax-success)":"var(--ax-muted)"},children:[t.jsx("span",{children:R?"✓":"○"}),t.jsx("span",{children:w.label})]},w.key)})})]},a.key)})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[t.jsxs("button",{onClick:()=>Ce(a=>{const u=new Set(a);return u.has(C)?u.delete(C):u.add(C),u}),style:{...I,padding:"8px 12px",fontSize:12,display:"inline-flex",alignItems:"center",gap:8,borderColor:x>0?"var(--ax-success)":void 0,color:x>0?"var(--ax-success)":void 0},"aria-expanded":Y,children:[t.jsx("span",{style:{transform:Y?"rotate(90deg)":"none",transition:"transform .15s"},children:"▶"}),"All Activity · ",x,"/",r," complete (",A,"%) · ",z," opened · ",c.length," market videos · ",m," mindset clicks"]}),t.jsx("span",{style:{flex:1,minWidth:80,height:6,borderRadius:999,background:"rgba(243,240,234,0.12)",overflow:"hidden"},children:t.jsx("span",{style:{display:"block",width:`${A}%`,height:"100%",background:A===100?"var(--ax-success)":"var(--ax-gold)"}})}),ge&&n.length>0&&t.jsx("button",{onClick:()=>_t(e.name,e.email,L,n),style:{...I,padding:"6px 10px",fontSize:12},title:`Download ${L}-day card/section opens for ${e.name}`,children:"⤓ Export CSV"})]}),Y&&t.jsxs("div",{style:{display:"grid",gap:14,background:"rgba(217,173,92,0.05)",border:"1px solid var(--ax-line)",borderRadius:8,padding:12},children:[t.jsxs("div",{children:[t.jsxs("div",{style:{..._,fontSize:11,letterSpacing:"0.12em",marginBottom:6},children:["MARKET TRAINING · ",c.length," ",c.length===1?"VIDEO":"VIDEOS"," WATCHED"]}),c.length===0&&t.jsx("span",{style:{..._,fontSize:12},children:"No Market Training videos watched yet."}),t.jsx("div",{style:{display:"grid",gap:4},children:c.map(a=>t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:10,fontSize:12,color:"var(--ax-success)"},children:[t.jsxs("span",{children:["✓ ",a.title||"Untitled video",a.course_slug?t.jsxs("span",{style:{..._},children:[" · ",a.course_slug]}):null]}),t.jsx("span",{style:{..._,whiteSpace:"nowrap"},children:a.completed_at?new Date(a.completed_at).toLocaleDateString():""})]},a.video_id))})]}),t.jsxs("div",{children:[t.jsxs("div",{style:{..._,fontSize:11,letterSpacing:"0.12em",marginBottom:6},children:["MINDSET ENGAGEMENT (",L,"D) · ",m," ",m===1?"CLICK":"CLICKS"," · ",n.length," CARDS"]}),n.length===0&&t.jsxs("span",{style:{..._,fontSize:12},children:["No video or podcast cards clicked in the last ",L," days."]}),t.jsx("div",{style:{display:"grid",gap:4},children:n.map((a,u)=>t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"baseline",fontSize:12,color:"var(--ax-text)"},children:[t.jsxs("span",{style:{color:"var(--ax-gold-text)",minWidth:28},children:[a.clicks,"×"]}),t.jsx("span",{style:{flex:1,minWidth:0},children:a.title}),t.jsxs("span",{style:{..._,fontSize:11,whiteSpace:"nowrap"},children:[a.category_title||a.category_slug,a.media_type&&a.media_type!=="youtube"?" · podcast":"",a.last_click?` · ${new Date(a.last_click).toLocaleDateString()}`:""]})]},`${a.title}-${a.category_slug}-${u}`))})]}),k.map(a=>{const u=a.items.filter(R=>f.has(R.slug)).length,w=a.items.filter(R=>f.get(R.slug)?.status==="completed").length;return t.jsxs("div",{children:[t.jsxs("div",{style:{..._,fontSize:11,letterSpacing:"0.12em",marginBottom:6},children:[a.label.toUpperCase()," ·"," ",t.jsxs("span",{style:{color:w>0?"var(--ax-success)":void 0},children:[w,"/",a.items.length," COMPLETE"]})," ","· ",u," OPENED"]}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))",gap:6},children:[a.items.length===0&&t.jsx("div",{style:{..._,fontSize:12},children:a.empty}),a.items.map(R=>{const G=f.get(R.slug),X=G?.status==="completed",ce=G?.completed_at||G?.first_opened_at;return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:X?"var(--ax-success)":G?"var(--ax-text)":"var(--ax-muted)"}
3,title:X?`Completed ${ce?new Date(ce).toLocaleString():""}`:G?`Opened ${ce?new Date(ce).toLocaleString():""} — not finished`:"Not opened yet",children:[t.jsx("span",{style:{width:14,height:14,borderRadius:"50%",flexShrink:0,border:`1px solid ${X?"var(--ax-success)":G?"var(--ax-gold)":"rgba(217,173,92,0.35)"}`,background:X?"var(--ax-success)":"transparent",color:X?"#0d1117":"var(--ax-gold)",fontSize:10,lineHeight:"12px",textAlign:"center",fontWeight:900},children:X?"✓":G?"•":""}),t.jsx("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R.title})]},R.slug)})]})]},a.id)})]})]})})(),(()=>{const f=e.email||`name:${e.name.toLowerCase()}`;return t.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginTop:10,paddingTop:10,borderTop:"1px solid var(--ax-line)"},children:[t.jsx(D,{onClick:()=>le(f,e.exclusion==="completed"?null:"completed"),disabled:p,color:"var(--ax-success)",title:"Mark this agent as finished with onboarding",children:e.exclusion==="completed"?"✓ Completed":"Completed"}),t.jsx(D,{onClick:()=>le(f,e.exclusion==="lost"?null:"lost"),disabled:p,color:"var(--ax-danger)",title:"Agent dropped out during onboarding",children:e.exclusion==="lost"?"✓ Lost in onboarding":"Lost in onboarding"}),t.jsx(D,{onClick:()=>le(f,e.exclusion==="stagnate"?null:"stagnate"),disabled:p,color:"var(--ax-warn)",title:"Agent has stalled out in onboarding",children:e.exclusion==="stagnate"?"✓ Stagnate":"Stagnate"}),e.exclusion!==null&&t.jsx(D,{onClick:()=>le(f,null),disabled:p,color:"var(--ax-info)",title:"Clear this status and put them back in active onboarding",children:"Clear status"})]})})()]})]},e.key)})})}),S&&t.jsx("div",{onClick:()=>me(null),style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.85)",display:"flex",alignItems:"center",justifyContent:"center",padding:24,zIndex:50},children:t.jsxs("div",{onClick:e=>e.stopPropagation(),style:{background:"var(--ax-card)",border:"1px solid rgba(217,173,92,0.4)",padding:24,maxWidth:720,width:"100%",maxHeight:"85vh",overflowY:"auto",borderRadius:2},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:16},children:[t.jsxs("div",{children:[t.jsx("div",{style:{color:"var(--ax-gold-text)",fontFamily:"'Cinzel',serif",fontSize:18},children:S.name}),t.jsxs("div",{style:_,children:[S.email||"—",S.sa_name?` · SA: ${S.sa_name}`:"",S.ga_name?` · GA: ${S.ga_name}`:""]})]}),t.jsx("button",{onClick:()=>me(null),style:I,children:"✕"})]}),t.jsx(je,{percent:S.percent}),t.jsxs("div",{style:{..._,marginTop:8,marginBottom:16,fontSize:12},children:[S.percent,"% · ",S.checked,"/",S.total," items",S.ao_writing_number?` · Writing #: ${S.ao_writing_number}`:"",` · Licensed states: ${S.states_licensed}`]}),Ie.map(e=>t.jsxs("div",{style:{marginBottom:12},children:[t.jsx("div",{style:{color:"var(--ax-gold-text)",fontFamily:"'Cinzel',serif",fontSize:13,letterSpacing:"0.1em",marginBottom:6},children:e.title}),t.jsx("div",{style:{display:"grid",gap:4},children:e.items.map(s=>{const o=!!S.items?.[s.key];return t.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",fontSize:13,color:o?"var(--ax-body)":"var(--ax-muted)"},children:[t.jsx("span",{style:{color:o?"var(--ax-success)":"#555"},children:o?"✓":"○"}),t.jsx("span",{children:s.label})]},s.key)})})]},e.key))]})})]})}):t.jsxs("div",{style:{...be,textAlign:"center"},children:[t.jsx("p",{children:"Please sign in first."}),t.jsx("button",{onClick:()=>q({to:"/"}),style:ut,children:"Go Home"})]})}function ue({label:g,value:h}){return t.jsxs("div",{children:[t.jsx("div",{style:{..._,fontSize:11,letterSpacing:"0.1em"},children:g.toUpperCase()}),t.jsx("div",{style:{color:"var(--ax-gold-text)",fontFamily:"'Cinzel',serif",fontSize:22,marginTop:4},children:h})]})}function D({onClick:g,disabled:h,color:F="var(--ax-gold-text)",title:q,children:M}){return t.jsx("button",{onClick:K=>{K.stopPropagation(),g()},disabled:h,title:q,style:{fontSize:11,padding:"5px 10px",borderRadius:4,border:`1px solid ${F}`,color:F,background:"transparent",cursor:h?"wait":"pointer",letterSpacing:"0.05em",fontWeight:600,opacity:h?.5:1},children:M})}function E({color:g,label:h}){return t.jsx("span",{style:{fontSize:10,padding:"2px 6px",borderRadius:999,border:`1px solid ${g}`,color:g,letterSpacing:"0.05em",fontWeight:700},children:h})}export{Ct as component};

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.