1import{u as yn,a as bn,b as Nn,r as u,c as jn,d as xn,e as wn,l as In,f as kn,g as $n,j as t,P as Cn,M as An,i as Un,w as Sn,h as Rn,s as ze,I as Pn,p as qn,k as Dn,m as En,n as On,o as Wn}from"./index-BVpny5eT.js";import{P as Ve,a as Je}from"./ProfileNameTrigger-BwlTTwP1.js";import{d as Mn,I as Fn}from"./InviteContactModal-1V0C4a3t.js";import{N as Yn}from"./GemAI-D96-3JBK.js";import"./index-CryiGmSX.js";import"./Combination-Dr9KM_H-.js";import"./index-u7baw35J.js";import"./chevron-right-boUotD-7.js";import"./external-link-D8whGH5x.js";import"./IntegrationsModal-CmDwjz79.js";function Ln(o,c){return!c||c<=0||o.requestedByUserId==null||o.requestedByUserId!==c?!1:o.toUser.id!==c}function Tn(o,c,m){const d=[],y=new Set,k=[];for(const w of o){if(Ln(w,m)){d.push(w);continue}y.has(w.id)||(y.add(w.id),k.push(w))}const j=new Set,$=[];for(const w of[...c,...d])j.has(w.id)||(j.add(w.id),$.push(w));return{received:k,requested:$}}function $t(o){var m;const c=((m=o.senderUser)==null?void 0:m.id)??0;return c>0&&c===o.fromUser.id}const Bn="https://gem-agent-38ae41bd5367.herokuapp.com",Gn="(max-width: 900px)";function Hn(){const[o,c]=u.useState(!1);return u.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const m=window.matchMedia(Gn),d=()=>c(m.matches);return d(),m.addEventListener("change",d),()=>m.removeEventListener("change",d)},[]),o}async function _n(o,c,m={}){const d=(m.note||"").trim(),y=await Un(o,{email:c,...m.name?{name:m.name}:{},...d?{note:d}:{}});if(!y.ok){let k=`Failed to send invite (${y.status})`;try{const j=await y.json();typeof(j==null?void 0:j.message)=="string"?k=j.message:typeof(j==null?void 0:j.error)=="string"&&(k=j.error)}catch{}throw new Error(k)}}const Ct=["purple","green","amber","blue","red","teal"];function Kn(o){return Ct[Math.abs(o)%Ct.length]}function At(o,c){return o?"you-tone":c==="right"?"green-deep":"ink"}function Ut(o){const c=(o||"").trim();return c.includes("@")&&!c.includes(" ")}function Ie(o){const c=(o||"").replace(/\s+/g," ").trim().split(" ").filter(Boolean);return c.length>=2?(c[0][0]+c[c.length-1][0]).toUpperCase():(o||"?").slice(0,2).toUpperCase()||"?"}function Qe(o){if(!o)return null;const c=o.user??o,m=c.id??o.id??0,d=(c.fullname||o.fullname||"").trim();if(!m&&!d)return null;const y=d||(m?`User ${m}`:"Recipient"),k=c.profilePhoto??o.profilePhoto??null,j=c.email??o.email,$=c.role??o.role??0,w=o.founder??c.founder??null,re=o.investor??c.investor??null,{title:M,company:H}=qn({founder:w,investor:re,user:{title:o.title??c.title,companyRole:o.companyRole??c.companyRole??o.company_role??c.company_role,companyName:o.companyName??c.companyName??o.fundName??c.fundName}});let U="";return M||H?U=[M,H].filter(Boolean).join(" · "):m?U=$===1?"Founder":$===2?"Investor":$===3?"Scout":"Member":U=j||"Invited via email",{id:m,name:y,photo:k,email:j,role:$,subtitle:U,title:M,company:H,isAdHoc:!m}}function zn(o){const c=Qe(o.fromUser),m=Qe(o.toUser);if(!c||!m)return null;const d=Number(o.requestedByUserId??0);return{id:o.id??0,status:o.status??0,message:(o.message??o.note??"").toString(),createdAt:o.createdAt??null,fromUser:c,toUser:m,senderUser:Qe(o.senderUser??null),fromAccepted:(o.fromUserAccepted??0)===1,toAccepted:(o.toUserAccepted??0)===1,connectorApproved:o.connectorApproved??null,requestedByUserId:d>0?d:null}}function G(o){return o.type==="intro"?`intro-${o.intro.id}`:`offer-${o.offer.offerKind||"portfolio"}-${o.offer.id}`}function W(o){return o.type==="intro"?o.intro.createdAt:o.offer.createdAt}function Rt(o){const c=o.warmIntro;return c?c.status===2||c.fromAccepted&&c.toAccepted:!1}function Vn(o){return o.status===2||o.fromAccepted&&o.toAccepted}function Xe(o){return o.type==="offer"?Rt(o.offer):Vn(o.intro)}function Ze(o){var m;const c=((m=o.founder.name)==null?void 0:m.trim())||"Founder";return c.split(/\s+/)[0]||c}function Jn(o,c){if(o.offerKind==="portfolio"&&o.portcoCompanyName)return o.portcoCompanyName;const m=[o.founder.title,o.founder.companyName].filter(d=>!!(d!=null&&d.trim()));return m.length?m.join(" · "):c}function Pt(o){const c=o.warmIntro;return!c||!o.founder.id?!1:!!(c.fromUserId&&c.fromUserId===o.founder.id)}function ke(o){if(o.status==="declined")return o.declineReason==="already_in_touch"?{label:"Already in touch",cls:"closed"}:{label:"Declined",cls:"closed"};const c=o.warmIntro,m=Pt(o);if(c){if(c.status===2||c.fromAccepted&&c.toAccepted)return{label:"Successful",cls:"replied"};if(c.status===3)return{label:"Declined",cls:"closed"};
1if(o.status==="requested"||o.status==="accepted"){if(!c.connectorApproved)return{label:"Waiting connector",cls:"waiting"};if(!c.fromAccepted&&!c.toAccepted)return m?{label:`Waiting on ${c.toName}`,cls:"waiting"}:{label:"Waiting founder & target",cls:"waiting"};if(!c.fromAccepted&&!m)return{label:`Waiting on ${c.fromName}`,cls:"waiting"};if(!c.toAccepted)return{label:`Waiting on ${c.toName}`,cls:"waiting"}}}return o.status==="requested"?{label:"Intro in progress",cls:"sent"}:o.status==="accepted"?o.warmIntroId?{label:"Intro in progress",cls:"sent"}:{label:`${Ze(o)} accepted`,cls:"waiting"}:{label:`Waiting ${Ze(o).toLowerCase()}`,cls:"waiting"}}async function Z(o,c){try{const d=await(await Sn(o,c)).json().catch(()=>null);return(Array.isArray(d)?d:(d==null?void 0:d.data)??[]).map(zn).filter(k=>!!k)}catch{return[]}}function Qn(o){const c=(o||"").split(" · ").filter(Boolean);return c.length>=2?{title:c[0],company:c.slice(1).join(" · ")}:{title:o||"",company:""}}function Xn(o){const{title:c,company:m}=Qn(o);return{title:Ut(c)?"":c,company:Ut(m)?"":m}}function Zn(o){return o==="replied"||o==="booked"?"settled":o==="closed"?"muted":"pending"}function St(o,c,m=0){if(o.status===3)return{label:"Declined",cls:"closed"};if(o.status===2)return{label:"Successful",cls:"replied"};if(o.connectorApproved===0)return c==="got-requested"?{label:"Needs approval",cls:"waiting"}:{label:"Waiting connector",cls:"waiting"};if(c==="received"){const d=o.fromUser.id===m,y=o.toUser.id===m;if(d&&!o.fromAccepted||y&&!o.toAccepted)return{label:"Needs response",cls:"waiting"};if(d&&!o.toAccepted)return{label:`Waiting on ${o.toUser.name}`,cls:"waiting"};if(y&&!o.fromAccepted)return{label:"Waiting requester",cls:"waiting"}}return o.toAccepted?{label:"Pending",cls:"sent"}:{label:"Waiting on target",cls:"waiting"}}function ds(){const{user:o}=yn(),c=bn();Nn();const m=o==null?void 0:o.accessToken,d=(o==null?void 0:o.userId)??0,y=(o==null?void 0:o.fullName)||"You",k=Ie(y),[j,$]=u.useState(!0),[w,re]=u.useState(!1),[M,H]=u.useState(null);jn(!j);const[U,et]=u.useState([]),[ee,qt]=u.useState([]),[oe,Dt]=u.useState([]),[F,Et]=u.useState([]),[Y,Ot]=u.useState([]),[Wt,Mt]=u.useState(!1),[tt,Ft]=u.useState(null),[$e,Yt]=u.useState([]),[Ce,Lt]=u.useState(null),[_,nt]=u.useState("pending"),[st,rt]=u.useState({}),I=Hn(),[Ae,ae]=u.useState(null),[Ue,ot]=xn(),te=Number(Ue.get("intro")||0)||0,at=u.useRef(0),[ie,Se]=u.useState(0),[Re,ce]=u.useState({}),[it,ct]=u.useState(null),[Tt,Pe]=u.useState(!1),[lt,qe]=u.useState(null),[L,De]=u.useState(null),[le,de]=u.useState(""),[Ee,dt]=u.useState(""),[mt,ut]=u.useState(!1),[Bt,me]=u.useState({}),[Oe,ue]=u.useState({}),[Gt,pt]=u.useState({}),[P,Ht]=u.useState(null),[We,_t]=u.useState(""),K=u.useMemo(()=>We.trim()?We.trim():c.isInvestorFirm?"Investor":c.isEnterprise?"Enterprise":c.isConnector?"Connector":c.isTeamMember?"Team member":"Member",[We,c.isConnector,c.isEnterprise,c.isInvestorFirm,c.isTeamMember]),[z,Kt]=u.useState(()=>new Set),Me=u.useCallback(e=>{e&&Kt(r=>{if(r.has(e))return r;const n=new Set(r);return n.add(e),n})},[]),[pe,zt]=u.useState({});u.useEffect(()=>{if(!m)return;const e=new Set,r=s=>{!s||s.isAdHoc||!s.id||s.id<=0||(s.company||"").trim()||pe[s.id]||e.add(s.id)};for(const s of[...U,...oe,...F,...Y])r(s.fromUser),r(s.toUser),r(s.senderUser);
1if(e.size===0)return;let n=!1;return Promise.all([...e].map(s=>wn(`warm-intro-person-meta:${s}`,5*6e4,()=>Rn(m,s,Bn)).catch(()=>({title:"",company:""})).then(i=>[s,i]))).then(s=>{n||zt(i=>{let a=!1;const l={...i};for(const[h,x]of s)l[h]||(l[h]=x,a=!0);return a?l:i})}),()=>{n=!0}},[m,U,oe,F,Y,pe]);const fe=u.useCallback(e=>{const r=Xn(e.subtitle),n=e.id>0?pe[e.id]:void 0;return{title:(e.title||(n==null?void 0:n.title)||r.title||"").trim(),company:(e.company||(n==null?void 0:n.company)||r.company||"").trim()}},[pe]),q=u.useCallback(async()=>{if(!m)return;$(!0),re(!1),H(null);const e=(n,s)=>{const i=n.createdAt?Date.parse(n.createdAt):0;return(s.createdAt?Date.parse(s.createdAt):0)-i},r=n=>s=>(n(s),$(!1),s);try{const n=Z("/api/gemphere/warm-intro/made",m).then(r(v=>et([...v].sort(e)))),s=Z("/api/gemphere/warm-intro/pending-sent",m),i=Z("/api/gemphere/warm-intro/received",m),a=Z("/api/gemphere/warm-intro/pending",m),l=Z("/api/gemphere/warm-intro/requested-to-me",m).then(r(v=>Dt([...v].sort(e)))),h=Z("/api/gemphere/warm-intro/requested",m),x=(d?In(m,d).catch(()=>[]):Promise.resolve([])).then(r(v=>qt(Array.isArray(v)?v:[]))),b=kn(m,12).catch(v=>({connected:!1,notes:[],lastSyncAt:null,error:v instanceof Error?v.message:"Could not load Granola notes"})).then(r(v=>{Mt(!!v.connected),Ft(v.lastSyncAt||null),Yt(Array.isArray(v.notes)?v.notes:[]),Lt("error"in v?String(v.error||""):null)}));Promise.all([n,s]).then(([v,p])=>{const g=new Set,f=[];for(const N of[...v,...p])g.has(N.id)||(g.add(N.id),f.push(N));et(f.sort(e)),$(!1)}),Promise.all([i,a,h]).then(([v,p,g])=>{const{received:f,requested:N}=Tn([...v,...p],g,d);Ot(f.sort(e)),Et(N.sort(e)),$(!1)}),await Promise.all([n,s,i,a,l,h,x,b])}catch(n){H(n instanceof Error?n.message:"Failed to load")}finally{$(!1),re(!0)}},[m,d]);u.useEffect(()=>{q()},[q]),u.useEffect(()=>{if(!m)return;let e=!1;return(async()=>{try{const r=await $n(m);if(!r.ok)return;const n=await r.json().catch(()=>null);if(e||!n||typeof n!="object")return;const s=n.data??n;if(!s||typeof s!="object")return;const i=s.user,a={...i&&typeof i=="object"?i:{},...s},l=typeof a.profilePhoto=="string"&&a.profilePhoto||typeof a.ProfilePhoto=="string"&&a.ProfilePhoto||typeof a.photo=="string"&&a.photo||null,h=Number(a.role??0),x=h===1?"Founder":h===2?"Investor":h===3?"Scout":"",b=a.investor&&typeof a.investor=="object"?a.investor:null,v=a.founder&&typeof a.founder=="object"?a.founder:null,p=typeof a.title=="string"&&a.title||(b==null?void 0:b.title)||(v==null?void 0:v.title)||x||"",g=typeof a.fundName=="string"&&a.fundName||typeof a.companyName=="string"&&a.companyName||(b==null?void 0:b.fundName)||(v==null?void 0:v.companyName)||"",f=[p,g].filter(Boolean).join(" · ");e||(l&&Ht(l),f&&_t(f))}catch{}})(),()=>{e=!0}},[m]);const he=u.useMemo(()=>{const e=new Set;for(const s of ee)s.warmIntroId&&s.status!=="offered"&&e.add(s.warmIntroId);const r=new Set,n=[];for(const s of U)s.connectorApproved!==0&&(e.has(s.id)||r.has(s.id)||(r.add(s.id),n.push(s)));return n},[U,ee]),ft=ee,ve=u.useMemo(()=>{const e=new Map;for(const r of ee){const n=r.warmIntroId;n!=null&&n>0&&e.set(n,r)}return e},[ee]),ne=u.useCallback(e=>ve.get(e.id)??null,[ve]),Fe=u.useMemo(()=>{const e=he.map(n=>({type:"intro",intro:n,mode:"made"})),r=ft.map(n=>({type:"offer",offer:n}));return[...e,...r].sort((n,s)=>{const i=W(n)?Date.parse(W(n)):0;return(W(s)?Date.parse(W(s)):0)-i})},[he,ft]),se=u.useMemo(()=>{const e=new Set,r=[],n=U.filter(s=>s.connectorApproved===0);for(const s of[...oe,...n])e.has(s.id)||(e.add(s.id),r.push(s));return r.sort((s,i)=>{const a=s.createdAt?Date.parse(s.createdAt):0;return(i.createdAt?Date.parse(i.createdAt):0)-a})},[U,oe]),T=u.useMemo(()=>{const e=new Set,r=[],n=(s,i)=>{for(const a of s)e.has(a.id)||ve.has(a.id)||(e.add(a.id),r.push({type:"intro",intro:a,mode:i}))};for(const s of Fe){if(s.type==="offer"){r.push(s);continue}e.has(s.intro.id)||(e.add(s.intro.id),r.push(s))}return n(se,"got-requested"),n(F,"requested"),n(Y,"received"),r.sort((s,i)=>{const a=W(s)?Date.parse(W(s)):0;return(W(i)?Date.parse(W(i)):0)-a})},[Fe,se,F,Y,ve]),V=u.useMemo(()=>({successful:T.filter(Xe),pending:T.filter(e=>!Xe(e))}),[T]),Vt=[{key:"pending",label:"Pending intros",mLabel:"Pending"},{key:"successful",label:"Successful intros",mLabel:"Successful"}],Ye=V[_],J=Fe.length+se.length+F.length+Y.length,ht=u.useMemo(()=>{const e=new Set;let r=0;for(const n of[...he,...se,...F,...Y])e.has(n.id)||(e.add(n.id),(n.toAccepted||n.status===2)&&(r+=1));return r},[he,se,F,Y]),vt=J===0?0:Math.round(ht/J*100),Jt=e=>rt(r=>({...r,[e]:!r[e]})),gt=e=>{if(I){ae(G(e));return}Jt(e.type==="offer"?G(e):e.intro.id)},C=e=>{ct(e),setTimeout(()=>ct(null),3500)},Q=u.useCallback(e=>{qe({name:e.name||"",fullname:e.name||"",title:e.title||"",companyName:e.companyName||"",linkedinUrl:e.linkedinUrl||null,isNonGem:!0,source:e.linkedinUrl?"linkedin":"import"})},[]),B=u.useCallback((e,r)=>{dt(Mn(y)),de((r||"").trim()),De({name:(e||"").trim()||"This contact",email:(r||"").trim()})},[y]),Qt=u.useCallback(async()=>
1{if(!m||!L)return;const e=le.trim();if(e){ut(!0);try{await _n(m,e,{name:L.name,note:Ee}),De(null),de(""),C(`Invite sent to ${e}.`)}catch(r){C(r instanceof Error?r.message:"Failed to send invite")}finally{ut(!1)}}},[m,L,le,Ee]),ge=async(e,r)=>{if(m){ce(n=>({...n,[e.id]:!0}));try{const n=await Dn(m,{warmIntroID:e.id,response:r}),s=await n.json().catch(()=>null);!n.ok||(s==null?void 0:s.success)===!1||s!=null&&s.error?C((s==null?void 0:s.message)||(s==null?void 0:s.error)||`Action failed (${n.status})`):(C(r?"Intro accepted":"Intro declined"),await q())}catch(n){C(n instanceof Error?n.message:"Network error")}finally{ce(n=>({...n,[e.id]:!1}))}}},Le=(e,r)=>{const n="".trim();if(n)return n;const s=e.fromUser;return`Hey ${e.toUser.name.split(" ")[0]??"there"} â wanted to introduce you to ${s.name}${s.subtitle?` (${s.subtitle})`:""}. ${s.name.split(" ")[0]??"They"} is looking to connect and I think you two should chat. Cc'ing you both â feel free to take it from here.`},Xt=async e=>{var s;const r=ze(e.message||"").trim();if(r){ue(i=>({...i,[e.id]:r})),me(i=>({...i,[e.id]:!0}));return}ue(i=>({...i,[e.id]:Le(e)})),me(i=>({...i,[e.id]:!0}));const n=((s=e.fromUser)==null?void 0:s.id)||0;if(m&&n>0)try{const i=await En(m,n);if(!i)return;ue(a=>{const l=(a[e.id]||"").trim(),h=Le(e);return l&&l!==h?a:{...a,[e.id]:i}})}catch{}},Zt=e=>{me(r=>({...r,[e.id]:!1}))},en=async e=>{if(!m||!d)return;const r=(Oe[e.id]??"").trim();if(!r){C("Draft cannot be empty");return}pt(n=>({...n,[e.id]:!0}));try{const n=await On(m,{warmIntroID:e.id,viewerUserId:d,draft:r}),s=await n.json().catch(()=>null);!n.ok||s!=null&&s.error?C((s==null?void 0:s.error)||(s==null?void 0:s.message)||`Couldn't save draft (${n.status})`):(C("Draft saved"),me(i=>({...i,[e.id]:!1})),await q())}catch(n){C(n instanceof Error?n.message:"Network error")}finally{pt(n=>({...n,[e.id]:!1}))}},Te=async(e,r)=>{if(m){ce(n=>({...n,[e.id]:!0}));try{const n=await Wn(m,{warmIntroID:e.id,approve:r}),s=await n.json().catch(()=>null);!n.ok||(s==null?void 0:s.success)===!1||s!=null&&s.error?C((s==null?void 0:s.message)||(s==null?void 0:s.error)||`Action failed (${n.status})`):(C(r?"Intro approved & sent":"Intro declined"),await q())}catch(n){C(n instanceof Error?n.message:"Network error")}finally{ce(n=>({...n,[e.id]:!1}))}}},tn={id:0,name:"Gem",role:0,subtitle:"",photo:null,isAdHoc:!0},yt=(e,r)=>{let n,s,i,a,l,h;if($t(e)){const p=g=>g.id===d?{...g,photo:g.photo||P||null,subtitle:g.subtitle||K}:g;n=p(e.fromUser),s=e.fromUser.id===d?"You":"Requester",i=tn,a="Connector",l=p(e.toUser),h=e.toUser.id===d?"You":"Recipient"}else if(r==="made")n=e.fromUser,s="Recipient",i={id:d,name:y,email:o==null?void 0:o.email,photo:P,role:0,subtitle:K},a="You · Connector",l=e.toUser,h="Recipient";else if(r==="got-requested")n=e.fromUser,s="Requester",i={id:d,name:y,email:o==null?void 0:o.email,photo:P,role:0,subtitle:K},a="You · Connector",l=e.toUser,h="Recipient";else if(r==="requested")n={id:d,name:y,email:o==null?void 0:o.email,photo:P,role:0,subtitle:K},s="You",i=e.senderUser??e.fromUser,a="Connector",l=e.toUser,h="Recipient";else{const p=g=>g.id!==d?g:{...g,photo:g.photo||P||null,subtitle:g.subtitle||K};n=p(e.fromUser),s=e.fromUser.id===d?"You":"Requester",i=p(e.senderUser??e.fromUser),a="Connector",l=p(e.toUser),h=e.toUser.id===d?"You":"Recipient"}const x=(p,g,f)=>{const N=At(g,f),A=p.photo&&!z.has(p.photo)?p.photo:null,R=A?t.jsx("img",{src:A,alt:"",className:`av md ${N}`,style:{objectFit:"cover"},onError:()=>Me(A)}):t.jsx("div",{className:`av md ${N}`,children:g?k:Ie(p.name)}),S=g?y:p.name,D=p.isAdHoc||!p.id?null:g&&d||p.id,{title:E,company:O}=fe(p);return t.jsx(Ve,{userId:D,name:S,photo:A,email:p.email,role:E,companyName:O,className:"profile-popup-trigger",onOpenWebProfile:Q,onOpenInvite:B,children:R})},b=p=>p.id===d?y:p.name,v=(p,g,f,N)=>{const{title:A,company:R}=fe(p),S=f||g==="You"||g.startsWith("You ·"),D=S?"":R,E=b(p),O=p.isAdHoc||!p.id?null:f&&d||p.id,X=p.photo&&!z.has(p.photo)?p.photo:null;return t.jsxs("div",{className:"chain-person-v2",children:[x(p,f,N),t.jsx(Je,{userId:O,name:E,photo:X,className:"chain-person-name",block:!0,email:p.email,role:A,companyName:R,onOpenWebProfile:Q,onOpenInvite:B}),t.jsx("span",{className:"chain-person-role",children:S?g.startsWith("You ·")?g:"You":g}),D?t.jsx("span",{className:"chain-person-detail",children:D}):null]})};return t.jsxs("div",{className:"chain-row chain-row-v2",children:[v(n,s,n.id===d,"left"),t.jsx("span",{className:"chain-arrow-v2",children:"â"}),v(i,a,i.id===d,"mid"),t.jsx("span",{className:"chain-arrow-v2",children:"â"}),v(l,h,l.id===d,"right")]})},ye=e=>{const r={id:e.investor.id,name:e.investor.name,email:e.investor.email||void 0,photo:e.investor.id===d?P:null,role:2,subtitle:e.investor.id===d?K:e.offerKind==="portfolio"?"Investor":"Connector"},n=e.offerKind==="team_target"?"Owner":e.offerKind==="connector"?"Requester":"Founder",s=e.founder.id===d,i={id:e.founder.id,name:e.founder.name,email:e.founder.email||void 0,photo:s?P:null,role:1,subtitle:Jn(e,n)}
1,a={id:e.contact.id||0,name:e.contact.name,email:e.contact.email||void 0,photo:null,role:0,subtitle:[e.contact.role||"Target",e.targetCompanyName].filter(f=>!!(f!=null&&f.trim())).join(" · ")},l=(f,N,A)=>{const R=At(N,A),S=f.photo&&!z.has(f.photo)?f.photo:null,D=S?t.jsx("img",{src:S,alt:"",className:`av md ${R}`,style:{objectFit:"cover"},onError:()=>Me(S)}):t.jsx("div",{className:`av md ${R}`,children:N?k:Ie(f.name)}),E=f.isAdHoc||!f.id?null:N&&d||f.id,O=N?y:f.name,{title:X,company:Ke}=fe(f);return t.jsx(Ve,{userId:E,name:O,photo:S,email:f.email,role:X,companyName:Ke,className:"profile-popup-trigger",onOpenWebProfile:Q,onOpenInvite:B,children:D})},h=(f,N,A,R,S)=>{const{title:D,company:E}=fe(f),O=A||N==="You"||N.startsWith("You ·"),X=O?"":E,Ke=f.id===d?y:f.name,vn=f.photo&&!z.has(f.photo)?f.photo:null,gn=f.isAdHoc||!f.id?null:f.id;return t.jsxs("div",{className:"chain-person-v2",children:[l(f,A,R),t.jsx(Je,{userId:gn,name:Ke,photo:vn,className:"chain-person-name",block:!0,email:f.email,role:D,companyName:E,onOpenWebProfile:Q,onOpenInvite:B}),t.jsx("span",{className:"chain-person-role",children:O?N.startsWith("You ·")?N:"You":N}),X?t.jsx("span",{className:"chain-person-detail",children:X}):null]},S)},x=e.connector.isDirect?{...r,subtitle:"Connector"}:{id:e.connector.id||0,name:e.connector.name||"Connector",email:e.connector.email||void 0,photo:e.connector.id===d?P:null,role:0,subtitle:"Connector"},b=e.investor.id===d,v=e.connector.isDirect?b:e.connector.id===d,p=e.offerKind==="portfolio"?"Investor":"Offered by",g=e.connector.isDirect?b?"You · Connector":"Connector":b?`You · ${p}`:p;return t.jsxs("div",{className:"chain-row chain-row-v2 offer-chain-row",children:[h(r,g,b,"left","investor"),t.jsx("span",{className:"chain-arrow-v2",children:"â"}),h(i,s?`You · ${n}`:n,s,"mid","founder"),e.connector.isDirect?null:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"chain-arrow-v2",children:"â"}),h(x,v?"You · Connector":"Connector",v,"mid","connector")]}),t.jsx("span",{className:"chain-arrow-v2",children:"â"}),h(a,"Recipient",!1,"right","target")]})},bt=e=>{const r=e.warmIntro,n=e.connector.name||"Connector",s=Ze(e),i=Pt(e),a=[];return a.push({dotCls:"done",label:`Offer sent to ${e.founder.name}`,meta:e.createdAt?new Date(e.createdAt).toLocaleString():""}),e.status==="declined"?a.push({dotCls:"done",label:e.declineReason==="already_in_touch"?`${s} already in touch with target`:`${s} declined`}):e.status==="offered"?(a.push({dotCls:"active",label:`Waiting for ${s} decision`,meta:"Yes · Not right now · Already in touch"}),a.push({dotCls:"pending",label:"Connector + target emails",pending:!0})):(a.push({dotCls:"done",label:`${s} accepted`}),!r&&!e.warmIntroId?a.push({dotCls:"active",label:"Starting intro request",meta:"Connector email sendingâ¦"}):r?(a.push({dotCls:"done",label:`Intro request sent to ${n}`}),r.connectorApproved?a.push({dotCls:"done",label:`${n} forwarded intro`}):a.push({dotCls:"active",label:`Waiting on ${n}`,meta:"Forward · Edit · Pass"}),r.status===3?a.push({dotCls:"done",label:"Intro declined"}):Rt(e)?(i||a.push({dotCls:"done",label:`${r.fromName} accepted`}),a.push({dotCls:"done",label:`${r.toName} accepted`}),a.push({dotCls:"done",label:"Intro successful â both connected"})):r.connectorApproved&&(i||(r.fromAccepted?a.push({dotCls:"done",label:`${r.fromName} accepted`}):a.push({dotCls:"active",label:`Waiting on ${r.fromName}`,meta:"Opt-in email"})),r.toAccepted?a.push({dotCls:"done",label:`${r.toName} accepted`}):a.push({dotCls:i||r.fromAccepted?"active":"pending",label:`Waiting on ${r.toName}`,meta:"Opt-in email",pending:!i&&!r.fromAccepted}))):a.push({dotCls:"active",label:"Intro request sent",meta:"Loading latest statusâ¦"})),t.jsx("div",{className:"timeline",children:a.map((l,h)=>t.jsxs("div",{className:"tl-item",children:[t.jsx("div",{className:`tl-dot ${l.dotCls}`,children:l.dotCls==="done"?"â":""}),t.jsxs("div",{className:"tl-body",children:[t.jsx("div",{className:`tl-label ${l.pending?"pending":""}`,children:l.label}),l.meta?t.jsx("div",{className:"tl-meta",children:l.meta}):null]})]},h))})},be=(e,r=!1)=>e.investor.id===d?`Offer intro to ${e.founder.name} â ${e.contact.name}`:e.founder.id===d?r?`${e.investor.name} offered you â ${e.contact.name}`:`${e.investor.name} offered you an intro to ${e.contact.name}`:e.connector.id===d?r?`${e.investor.name} offered ${e.founder.name} â ${e.contact.name}`:`${e.investor.name} offered ${e.founder.name} an intro to ${e.contact.name}`:r?`Offer intro: ${e.investor.name} â ${e.contact.name}`:`${e.investor.name} offered intro to ${e.contact.name}
1`,Nt=(e,r,n=!1)=>{if($t(e)){const i=e.fromUser.id===d?"you":e.fromUser.name,a=e.toUser.id===d?"you":e.toUser.name;return n?`Gem: ${i} â ${a}`:`Gem introduced ${i} and ${a}`}if(r==="made")return n?`You introduced ${e.fromUser.name} â ${e.toUser.name}`:`You introduced ${e.fromUser.name} to ${e.toUser.name}`;if(r==="got-requested"){const i=e.fromUser;return n?`${i.name} asked you â ${e.toUser.name}`:`${i.name} requested an intro from you to reach out to ${e.toUser.name}`}if(r==="requested"){const i=e.senderUser??e.fromUser;return n?`Requested via ${i.name} â ${e.toUser.name}`:`You requested an intro from ${i.name} to reach out to ${e.toUser.name}`}const s=e.senderUser??e.fromUser;return e.fromUser.id===d?n?`Requested via ${s.name} â ${e.toUser.name}`:`You requested an intro from ${s.name} to reach out to ${e.toUser.name}`:e.toUser.id===d?n?`${s.name} introduced ${e.fromUser.name} â you`:`${s.name} introduced ${e.fromUser.name} to you`:n?`${s.name} introduced ${e.fromUser.name} â ${e.toUser.name}`:`${s.name} introduced ${e.fromUser.name} to ${e.toUser.name}`},nn=(e,r)=>{const n=[];if(n.push({dotCls:"done",label:"Intro request created",meta:e.createdAt?new Date(e.createdAt).toLocaleString():""}),e.connectorApproved===1?n.push({dotCls:"done",label:"Connector approved"}):e.connectorApproved===0&&n.push({dotCls:"active",label:"Waiting for connector approval"}),e.status===2)n.push({dotCls:"done",label:"Both sides accepted · intro successful"});else if(e.status===3)n.push({dotCls:"done",label:"Intro declined"});else if(e.connectorApproved===0){const s=e.requestedByUserId||0,i=s>0&&s===e.fromUser.id,a=s>0&&s===e.toUser.id;!e.fromAccepted&&!(r==="requested"&&i)&&n.push({dotCls:"pending",label:`Waiting on ${e.fromUser.name}`,pending:!0}),!e.toAccepted&&!(r==="requested"&&a)&&n.push({dotCls:"pending",label:`Waiting on ${e.toUser.name}`,pending:!0})}else{const s=e.requestedByUserId||0,i=s>0&&s===e.fromUser.id,a=s>0&&s===e.toUser.id,l=r==="received"?"pending":"active",h=(x,b)=>!(r==="requested"&&b);r==="requested"&&i||(e.fromAccepted||i?n.push({dotCls:"done",label:`${e.fromUser.name} accepted${i&&!e.fromAccepted?" (requested intro)":""}`}):h(e.fromUser,i)&&n.push({dotCls:l,label:`Waiting on ${e.fromUser.name}`,pending:!0})),r==="requested"&&a||(e.toAccepted||a?n.push({dotCls:"done",label:`${e.toUser.name} accepted${a&&!e.toAccepted?" (requested intro)":""}`}):h(e.toUser,a)&&n.push({dotCls:l,label:`Waiting on ${e.toUser.name}`,pending:!0}))}return t.jsx("div",{className:"timeline",children:n.map((s,i)=>t.jsxs("div",{className:"tl-item",children:[t.jsx("div",{className:`tl-dot ${s.dotCls}`,children:s.dotCls==="done"?"â":""}),t.jsxs("div",{className:"tl-body",children:[t.jsx("div",{className:`tl-label ${s.pending?"pending":""}`,children:s.label}),s.meta&&t.jsx("div",{className:"tl-meta",children:s.meta})]})]},i))})},sn=(e,r)=>{const n=!!Re[e.id];return r==="got-requested"&&e.connectorApproved===0?null:r==="received"&&e.status===1&&(e.fromUser.id===d&&!e.fromAccepted||e.toUser.id===d&&!e.toAccepted)?t.jsxs("div",{className:"journey-actions-top",children:[t.jsx("button",{className:"j-top-btn",disabled:n,onClick:()=>ge(e,!1),children:"Pass"}),t.jsx("button",{className:"j-top-btn primary",disabled:n,onClick:()=>ge(e,!0),children:n?"â¦":"Yes, connect us"})]}):r==="made"&&e.status===1?t.jsx("div",{className:"journey-actions-top",children:t.jsx("button",{className:"j-top-btn",disabled:n,onClick:()=>ge(e,!1),children:"Cancel intro"})}):null},rn=(e,r)=>{if(r!=="got-requested"||e.connectorApproved!==0)return null;const n=!!Re[e.id],s=!!Bt[e.id],i=!!Gt[e.id],a=e.fromUser,l=e.toUser,h=ze(e.message||"").trim()||Le(e),x=Oe[e.id]??h,b=Ie(l.name),v=Kn(l.id),p=y.split(" ")[0]||y||"there",g=a.name.split(" ")[0]||a.name||"A friend",f=l.name.split(" ")[0]||l.name||"them";return t.jsxs("div",{className:"ob-draft-card",children:[t.jsxs("div",{className:"ob-draft-head",children:[t.jsx("div",{className:"ob-draft-icon","aria-hidden":!0,children:t.jsx("span",{children:"â¦"})}),t.jsxs("div",{className:"ob-draft-head-text",children:[t.jsx("div",{className:"ob-draft-title",children:"Gem drafted this intro"}),t.jsxs("div",{className:"ob-draft-sub",children:["Review & approve to send · ",a.name.split(" ")[0]," â ",l.name.split(" ")[0]]})]}),t.jsx("span",{className:"ob-draft-status",children:"Waiting on you"})]}),t.jsxs("div",{className:"ob-draft-recipient-row",children:[t.jsx("span",{className:"ob-draft-recipient-lbl",children:"To"}),t.jsx(Ve,{userId:l.isAdHoc||!l.id?null:l.id,name:l.name,photo:l.ph
1oto&&!z.has(l.photo)?l.photo:null,email:l.email,role:l.subtitle,className:"profile-popup-trigger",onOpenWebProfile:Q,onOpenInvite:B,children:l.photo&&!z.has(l.photo)?t.jsx("img",{src:l.photo,alt:"",className:`av sm ${v}`,onError:()=>Me(l.photo)}):t.jsx("div",{className:`av sm ${v}`,children:b})}),t.jsxs("div",{className:"ob-draft-recipient-info",children:[t.jsx(Je,{userId:l.isAdHoc||!l.id?null:l.id,name:l.name,photo:l.photo,className:"ob-draft-recipient-name",block:!0,email:l.email,role:l.subtitle,onOpenWebProfile:Q,onOpenInvite:B}),l.subtitle&&t.jsx("div",{className:"ob-draft-recipient-sub",children:l.subtitle})]})]}),t.jsxs("div",{className:"ob-draft-message-wrap",children:[t.jsx("div",{className:"ob-draft-message-lbl",children:s?"Edit blurb":"Message"}),s?t.jsxs(t.Fragment,{children:[t.jsx("textarea",{className:"ob-draft-textarea",value:x,disabled:i,onChange:N=>ue(A=>({...A,[e.id]:N.target.value})),rows:5,maxLength:2e3,placeholder:`${g}'s blurb`}),t.jsxs("div",{className:"ob-draft-counter",children:[x.length,"/2000"]})]}):t.jsxs("div",{className:"ob-draft-message ob-draft-email",children:[t.jsxs("p",{children:["Hey ",p,","]}),t.jsxs("p",{children:[t.jsx("strong",{children:a.name})," would like to reach"," ",t.jsx("strong",{children:l.name})," and noticed you two are connected."]}),t.jsxs("p",{children:["Open to making the intro? Weâll handle the rest â"," ",f," gets to decide if itâs a fit before anyoneâs looped in."]}),t.jsxs("p",{className:"ob-draft-email-lead",children:["Hereâs the email weâll send to ",f," for you:"]}),t.jsx(Pn,{recipientName:l.name,connectorName:y,otherName:a.name,blurb:h,bylineName:a.name,forwardedByName:y})]})]}),t.jsx("div",{className:"ob-draft-actions",children:s?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"ob-btn ghost",disabled:i,onClick:()=>Zt(e),children:"Cancel"}),t.jsx("button",{type:"button",className:"ob-btn primary",style:{marginLeft:"auto"},disabled:i||!(Oe[e.id]??"").trim(),onClick:()=>en(e),children:i?"Savingâ¦":"Save draft"})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"ob-btn danger",disabled:n,onClick:()=>Te(e,!1),children:"Decline"}),t.jsx("button",{type:"button",className:"ob-btn ghost",disabled:n,onClick:()=>Xt(e),children:"Edit draft"}),t.jsx("button",{type:"button",className:"ob-btn primary",style:{marginLeft:"auto"},disabled:n,onClick:()=>Te(e,!0),children:n?"Sendingâ¦":"Approve & send â"})]})})]})},on=()=>{if(!Wt&&$e.length===0&&!Ce)return null;const e=n=>{if(!n)return"";const s=new Date(n);return Number.isNaN(s.getTime())?"":s.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})},r=n=>{const s=(n.attendees||[]).map(a=>a.name||a.email).filter(Boolean).slice(0,4);if(!s.length)return"No attendees captured";const i=(n.attendees||[]).length-s.length;return`${s.join(", ")}${i>0?` +${i} more`:""}`};return t.jsxs("div",{className:"intros-granola-card",children:[t.jsxs("div",{className:"intros-granola-head",children:[t.jsxs("div",{children:[t.jsx("div",{className:"intros-granola-kicker",children:"Granola notes"}),t.jsxs("div",{className:"intros-granola-desc",children:["Synced meeting notes from Granola. We show metadata and detected intro counts only, not transcripts.",tt?` Last sync ${new Date(tt).toLocaleString()}.`:""]})]}),t.jsx("button",{type:"button",className:"intros-refresh-btn",onClick:q,children:"â» Refresh"})]}),Ce?t.jsxs("div",{className:"intros-error-banner",children:[t.jsx("strong",{children:"Couldn't load Granola notes:"})," ",Ce]}):null,$e.length===0?t.jsx("div",{className:"intros-info-banner",children:"Granola is connected, but no synced notes are available yet. Run a sync from Settings â Integrations after Granola finishes generating summaries."}):t.jsx("div",{className:"intros-granola-list",children:$e.map(n=>{const s=e(n.meetingAt||n.noteCreatedAt||n.processedAt),i=n.pendingOpportunityCount>0?"pending":n.opportunityCount>0?"settled":"muted",a=n.pendingOpportunityCount>0?"Needs review":n.opportunityCount>0?"Processed":"Synced";return t.jsxs("div",{className:"intros-granola-row",children:[t.jsxs("div",{className:"intros-granola-row-main",children:[t.jsx("div",{className:"intro-row-title",children:n.title||"Untitled Granola note"}),t.jsxs("div",{className:"intro-row-sub",children:[s||"Date unknown"," · ",r(n)]}),t.jsx("div",{className:"intro-row-sub",children:n.opportunityCount>0?`${n.opportunityCount} intro mention${n.opportunityCount===1?"":"s"} detected${n.pendingOpportunityCount?` · ${n.pendingOpportunityCount} pending`:""}`:"No intro mentions detected yet"})]}),t.jsxs("div",{className:"intro-row-meta",children:[t.jsxs("span",{className:`intro-row-status intro-row-status--${i}`,children:[t.jsx("span",{className:"intro-row-status-dot","aria-hidden":!0}),a]}),n.webUrl?t.jsx("a",{href:n.webUrl,target:"_blank",rel:"noreferrer",className:"j-top-btn",onClick:l=>l.stopPropagation(),children:"Open in Granola"}):null]})]},n.externalNoteId)})})]})},an=(e,r)=>{if(r==="got-requested"&&e.connectorApproved===0)return null;const n=ze(e.message||"").trim();if(!n)return null;const s=e.requestedByUserId??(r==="made"?d:e.fromUser.id),i=s===d?y:e.fromUser.name,a=s===d?"Your note":`Note from ${i.split(" ")[0]||i}`;return t.jsxs("div",{className:"intro-note-card",children:[t.jsx("div",{className:"intro-note-label",children:a}),t.jsx("p",{className:"intro-note-body",children:n})]})},jt=e=>{const r=(e.noteToFounder||"").trim();if(!r)return null;const n=e.investor.name||"the connector";return t.jsxs("div",{className:"intro-note-card",children:[t.jsxs("div",{className:"intro-note-label",children:["Note from ",n.split(" ")[0]||n]}),t.jsx("p",{className:"intro-note-body",children:r})]})},xt=(e,r)=>{const n=Zn(r);return t.jsxs("div",{className:`intro-row-status intro-row-status--${n}`,children:[t.jsx("span",{className:"intro-row-status-dot","aria-hidden":!0}),t.jsx("span",{className:"intro-row-status-label",children:e})]})},wt=(e,r)=>t.jsxs("div",{className:"intro-row-meta",children:[r?t.jsx("button",{type:"button",className:`intro-row-action${r.primary?" primary":""}`,onClick:n=>{n.stopPropagation(),r.onClick()},children:r.label}):null,t.jsx("span",{className:"intro-row-toggle","aria-hidden":I,children:I?"âº":e?"Hide details â´":"Details â¾"})]}),It=e=>{if(e.type==="offer")return!1;const{intro:r,mode:n}=e;return n==="got-requested"&&r.connectorApproved===0||n==="received"&&r.status===1&&(r.fromUser.id===d&&!r.fromAccepted||r.toUser.id===d&&!r.toAccepted)},kt=e=>{if(e.type==="offer")return null;const{intro:r,mode:n}=e,s=!!Re[r.id];return n==="got-requested"&&r.connectorApproved===0?{label:s?"â¦":"Send the intro",onClick:()=>Te(r,!0),primary:!0}:n==="received"&&r.status===1&&(r.fromUser.id===d&&!r.fromAccepted||r.toUser.id===d&&!r.toAccepted)?{label:s?"â¦":"Yes, connect us",onClick:()=>ge(r,!0),primary:!0}:null},Ne=!j&&!M&&J===0,Be=u.useMemo(()=>Ae?T.find(e=>G(e)===Ae)??null:null,[Ae,T]),Ge=u.useCallback(()=>ae(null),[]);u.useEffect(()=>{if(!te||at.current===te)return;at.current=te,Se(te);const e=new URLSearchParams(Ue);e.delete("intro"),ot(e,{replace:!0})},[te,Ue,ot]),u.useEffect(()=>{if(!ie)return;const e=T.find(n=>n.type==="intro"?n.intro.id===ie:n.offer.warmIntroId===ie);if(!e){w&&Se(0);return}if(Se(0),nt(Xe(e)?"successful":"pending"),I){ae(G(e));return}const r=e.type==="offer"?G(e):e.intro.id;rt(n=>({...n,[r]:!0}))},[ie,T,w,I]);const He=I&&!!Be;u.useEffect(()=>{I||ae(null)},[I]),u.useEffect(()=>{if(!He)return;const e=document.body.style.overflow;document.body.style.overflow="hidden";const r=n=>{n.key==="Escape"&&Ge()};return window.addEventListener("keydown",r),()=>{document.body.style.overflow=e,window.removeEventListener("keydown",r)}},[He,Ge]);const cn=e=>{const r=hn(e);return t.jsxs("div",{className:"intros-detail",role:"dialog","aria-modal":"true","aria-label":"Intro details",children:[t.jsxs("div",{className:"intros-detail-nav",children:[t.jsx("button",{type:"button",className:"intros-detail-back",onClick:Ge,"aria-label":"Back to intros",children:"â¹"}),t.jsxs("div",{className:"intros-detail-heading",children:[t.jsx("span",{className:"intros-detail-eyebrow",children:r.label}),t.jsx("span",{className:"intros-detail-title",children:fn(e)})]})]}),t.jsxs("div",{className:"intros-detail-body",children:[t.jsx("div",{className:"intros-detail-chain",children:un(e)}),t.jsx("p",{className:"intros-detail-sentence",children:pn(e)}),t.jsx("div",{className:"intros-detail-journey",children:_e(e)})]})]})},je=V.pending.filter(It),xe=V.pending.filter(e=>!It(e)),ln=e=>{const r=e.type==="offer"?e.offer.createdAt:e.intro.createdAt;if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?null:n},dn=(()=>{const e=new Date,r=`${e.getFullYear()}-${e.getMonth()}`,n=new Map,s=[];for(const a of V.successful){const l=ln(a);if(!l){s.push(a);continue}const h=`${l.getFullYear()}-${l.getMonth()}`;n.has(h)||n.set(h,{key:h,label:h===r?"This month":l.getFullYear()===e.getFullYear()?l.toLocaleStr
1ing(void 0,{month:"long"}):l.toLocaleString(void 0,{month:"long",year:"numeric"}),rows:[]}),n.get(h).rows.push(a)}const i=[...n.values()].sort((a,l)=>{const[h,x]=a.key.split("-").map(Number),[b,v]=l.key.split("-").map(Number);return b-h||v-x});return s.length&&i.push({key:"undated",label:"Earlier",rows:s}),i})(),mn=_==="successful"?`${V.successful.length} landed · ${J===0?"â":`${vt}% wrote back`}`:`${je.length} need you · ${xe.length} in flight`,_e=e=>{if(e.type==="offer"){const i=e.offer;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"journey-head",children:t.jsxs("div",{children:[t.jsx("div",{className:"journey-title",children:"Intro journey"}),t.jsx("div",{className:"journey-context",children:i.createdAt?`Started ${new Date(i.createdAt).toLocaleDateString()}`:"Offer intro · portfolio target"})]})}),jt(i),bt(i)]})}const{intro:r,mode:n}=e,s=ne(r);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"journey-head",children:[t.jsxs("div",{children:[t.jsx("div",{className:"journey-title",children:"Intro journey"}),t.jsx("div",{className:"journey-context",children:s!=null&&s.createdAt||r.createdAt?`Started ${new Date((s==null?void 0:s.createdAt)||r.createdAt).toLocaleDateString()}`:"Start date unknown"})]}),s?null:sn(r,n)]}),s?jt(s):an(r,n),s?bt(s):nn(r,n),s?null:rn(r,n)]})},un=e=>{if(e.type==="offer")return ye(e.offer);const r=ne(e.intro);return r?ye(r):yt(e.intro,e.mode)},pn=(e,r=!1)=>{if(e.type==="offer")return be(e.offer,r);const n=ne(e.intro);return n?be(n,r):Nt(e.intro,e.mode,r)},fn=e=>e.type==="offer"?`${e.offer.founder.name} â ${e.offer.contact.name}`:`${e.intro.fromUser.name} â ${e.intro.toUser.name}`,hn=e=>{if(e.type==="offer")return ke(e.offer);const r=ne(e.intro);return r?ke(r):St(e.intro,e.mode,d)},we=e=>{if(e.type==="offer"){const l=e.offer,h=G(e),x=!!st[h],b=ke(l);return t.jsxs("div",{className:`intro-row-v2 ${x?"open":""}`,children:[t.jsxs("div",{className:"intro-row-top",onClick:()=>gt(e),children:[ye(l),t.jsxs("div",{className:"intro-row-body",children:[t.jsx("div",{className:"intro-row-title",children:be(l,I)}),xt(b.label,b.cls)]}),wt(x,kt(e))]}),t.jsx("div",{className:"intro-journey",children:I?null:_e(e)})]},h)}const r=e.intro,n=e.mode,s=ne(r),i=!!st[r.id],a=s?ke(s):St(r,n,d);return t.jsxs("div",{className:`intro-row-v2 ${i?"open":""}`,children:[t.jsxs("div",{className:"intro-row-top",onClick:()=>gt(e),children:[s?ye(s):yt(r,n),t.jsxs("div",{className:"intro-row-body",children:[t.jsx("div",{className:"intro-row-title",children:s?be(s,I):Nt(r,n,I)}),xt(a.label,a.cls)]}
1),wt(i,s?null:kt(e))]}),t.jsx("div",{className:"intro-journey",children:I?null:_e(e)})]},G(e))};return t.jsxs("div",{className:`page active page-intros ${Ne?"intros-day1":"intros-has-rows"}`,children:[t.jsxs("div",{className:"top-header intros-hero",children:[t.jsxs("div",{className:"header-left",children:[Ne?null:t.jsx("div",{className:"intros-hero-eyebrow",children:mn}),t.jsx("div",{className:"page-h",children:"Intros"}),t.jsx("div",{className:"page-sub",children:Ne?"Every intro you make, ask for, or receive â tracked here from request to outcome.":"Every intro you've made or received, with its full journey."})]}),t.jsx("div",{className:"header-right",children:t.jsxs("button",{type:"button",className:"make-intro-btn",onClick:()=>Pe(!0),children:[t.jsx("span",{"aria-hidden":!0,children:"+"}),t.jsx("span",{className:"mib-label",children:"Make an intro"}),t.jsx("span",{className:"mib-label-m intros-m-only",children:"Intro"})]})})]}),on(),Ne?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"intros-empty-state",children:[t.jsx("div",{className:"intros-empty-icon",children:"â"}),t.jsx("h2",{className:"intros-empty-title",children:"No intros yet â let's make your first one"}),t.jsx("p",{className:"intros-empty-desc",children:"Pick two people in your network who'd benefit from meeting. Gem drafts the email, tracks the response, and follows up if it goes quiet."}),t.jsx("button",{type:"button",className:"make-intro-btn intros-empty-cta",onClick:()=>Pe(!0),children:"+ Make your first intro"}),t.jsx("div",{className:"intros-empty-divider"}),t.jsxs("div",{className:"intros-empty-steps",children:[t.jsxs("div",{className:"intros-empty-step",children:[t.jsx("div",{className:"intros-empty-step-num",children:"1"}),t.jsxs("div",{children:[t.jsx("div",{className:"intros-empty-step-title",children:"You pick two people"}),t.jsx("div",{className:"intros-empty-step-sub",children:"Both must be in your gmail. Gem fills in their roles and context automatically."})]})]}),t.jsxs("div",{className:"intros-empty-step",children:[t.jsx("div",{className:"intros-empty-step-num",children:"2"}),t.jsxs("div",{children:[t.jsx("div",{className:"intros-empty-step-title",children:"Gem drafts and asks for consent"}),t.jsx("div",{className:"intros-empty-step-sub",children:"Double opt-in: we email the connector first. They approve or pass â no awkward forward."})]})]}),t.jsxs("div",{className:"intros-empty-step",children:[t.jsx("div",{className:"intros-empty-step-num",children:"3"}),t.jsxs("div",{children:[t.jsx("div",{className:"intros-empty-step-title",children:"We track the outcome"}),t.jsx("div",{className:"intros-empty-step-sub",children:"From sent â replied â met â outcome. Plus auto-nudge if it stalls past your usual cadence."})]})]})]})]}),t.jsxs("div",{className:"intros-preview-panel",children:[t.jsx("div",{className:"intros-preview-kicker",children:"What'll live here as you use Gemphere"}),t.jsxs("div",{className:"intros-preview-grid",children:[t.jsxs("div",{className:"intros-preview-card",children:[t.jsx("div",{className:"intros-preview-card-title",children:"â Intros you've made"}),t.jsx("div",{className:"intros-preview-card-sub",children:"When you connect two people in your network â tracked from sent to outcome."})]}),t.jsxs("div",{className:"intros-preview-card",children:[t.jsx("div",{className:"intros-preview-card-title",children:"ð¤ Intros others asked you for"}),t.jsx("div",{className:"intros-preview-card-sub",children:"Founders or peers asking you to connect them to someone in your network."})]}),t.jsxs("div",{className:"intros-preview-card",children:[t.jsx("div",{className:"intros-preview-card-title",children:"â Intros you requested"}),t.jsx("div",{className:"intros-preview-card-sub",children:"When you ask someone in your network to introduce you to a third party."})]}),t.jsxs("div",{className:"intros-preview-card",children:[t.jsx("div",{className:"intros-preview-card-title",children:"â Intros you received"}),t.jsx("div",{className:"intros-preview-card-sub",children:"When someone makes an intro to you â Gem auto-tags context and follow-ups."})]})]})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"intros-metrics-grid",children:[t.jsxs("div",{className:"intros-metric",children:[t.jsx("div",{className:"intros-metric-lbl",children:"Total intros"}),t.jsx("div",{className:"intros-metric-lbl-m intros-m-only",children:"Total intros"}),t.jsx("div",{className:"intros-metric-num",children:J}),t.jsx("div",{className:"intros-metric-sub",children:"Made and received all-time"})]}),t.jsxs("div",{className:"intros-metric",children:[t.jsx("div",{className:"intros-metric-lbl",children:"Reply rate"}),t.jsx("div",{className:"intros-metric-lbl-m intros-m-only",children:"Wrote back"}),t.jsx("div",{className:"intros-metric-num",children:J===0?"â":`${vt}%`}),t.jsx("div",{className:"intros-metric-sub",children:"Targets who wrote back"})]}),t.jsxs("div",{className:"intros-metric",children:[t.jsx("div",{className:"intros-metric-lbl",children:"Successful"}),t.jsx("div",{className:"intros-metric-lbl-m intros-m-only",children:"Both accepted"}),t.jsx("div",{className:"intros-metric-num intros-metric-num--green",children:ht}),t.jsx("div",{className:"intros-metric-sub",children:"Both sides accepted"})]})]}),t.jsxs("div",{className:"intros-filters",children:[Vt.map(e=>t.jsxs("button",{type:"button",className:`filt ${_===e.key?"active":""}`,onClick:()=>nt(e.key),children:[t.jsx("span",{className:"filt-lbl",children:e.label}),t.jsx("span",{className:"filt-lbl-m intros-m-only",children:e.mLabel}),t.jsx("span",{className:"cnt",children:V[e.key].length})]},e.key)),t.jsx("span",{className:"intros-filters-spacer"}),t.jsx("button",{type:"button",className:"intros-refresh-inline",onClick:q,children:"â» Refresh"})]}),M&&t.jsxs("div",{className:"intros-error-banner",children:[t.jsx("strong",{children:"Couldn't load intros:"})," ",M]}),t.jsx("div",{className:"intros-list",children:j&&Ye.length===0?t.jsx(Cn,{variant:"page",message:"Loading introsâ¦"}):Ye.length===0?t.jsx("div",{className:"intros-tab-empty",children:_==="successful"?"No finished intros yet â they land here once both people say yes.":"Nothing in progress right now."}):_==="pending"?t.jsxs(t.Fragment,{children:[je.length>0?t.jsxs("div",{className:"intros-group",children:[t.jsxs("div",{className:"intros-group-head intros-group-head--hot",children:[t.jsx("h2",{className:"intros-group-title",children:"Waiting on you"}),t.jsx("span",{className:"intros-group-flag",children:"Do this first"}),t.jsx("span",{className:"intros-group-n",children:je.length})]}),je.map(we)]}):null,xe.length>0?t.jsxs("div",{className:"intros-group",children:[t.jsxs("div",{className:"intros-group-head",children:[t.jsx("h2",{className:"intros-group-title",children:"Waiting on someone else"}),t.jsx("span",{className:"intros-group-n",children:xe.length})]}),xe.map(we)]}):null]}):I?dn.map(e=>t.jsxs("div",{className:"intros-group",children:[t.jsxs("div",{className:"intros-group-head",children:[t.jsx("h2",{className:"intros-group-title",children:e.label}),t.jsx("span",{className:"intros-group-n",children:e.rows.length})]}),e.rows.map(we)]},e.key)):t.jsx("div",{className:"intros-group",children:Ye.map(we)})}),t.jsx("p",{className:"intros-list-note intros-m-only",children:_==="successful"?"Successful means both sides accepted. Whether it turned into a meeting is tracked separately, because plenty of good intros don't need one.":"Rows appear when a path exists â from your network, your connectors, your circle, or a room you're in. Nobody posts anything here."})]}),He&&Be?cn(Be):null,t.jsx(An,{open:Tt,onClose:()=>Pe(!1),onSent:e=>{C(e),q()}}),lt&&t.jsx(Yn,{profile:lt,onClose:()=>qe(null),onInvite:(e,r)=>{qe(null),B(e,r)}}),t.jsx(Fn,{open:L!=null,name:(L==null?void 0:L.name)||"",email:le,onEmailChange:de,mode:le.trim()?"send":"no_email",inviterName:y,personalNote:Ee,onPersonalNoteChange:dt,sending:mt,onClose:()=>{mt||(De(null),de(""))},onSendInvite:Qt}),it&&t.jsx("div",{style:{position:"fixed",bottom:24,left:"50%",transform:"translateX(-50%)",background:"#2a2820",color:"#fff",padding:"12px 22px",borderRadius:10,fontSize:13,fontWeight:600,boxShadow:"0 8px 24px rgba(0,0,0,0.18)",zIndex:300},children:it})]})}
1export{ds 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.