PageSourceSearch

https://www.gemphere.com/assets/HomeDashboard-CCT0M1o7.js

js gemphere.com collected 2026-10-02 01:30:07 UTC 68,017 bytes, 17 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RoomsView-DoG0SJRA.js","assets/index-t4UNL-er.js","assets/index-C4EbsLBI.css","assets/api-DzEwHsS8.js","assets/api-CykbWEt-.js","assets/accounts-Dq7TYPam.js","assets/sf-tech-week-CWiSP6r6.js","assets/chevron-right-vNJNS7I3.js","assets/map-pin-Bs8yA5Hl.js","assets/plus-B0nFezmJ.js","assets/sf-tech-week-J27F3_Fg.css","assets/QrSheet-CzugcYO3.js","assets/QrCode-Bvvwo3ZD.js","assets/ProfilePopup-acBF9Pse.js","assets/index-BjqtNt-N.js","assets/Combination-HGhFtX4F.js","assets/briefcase-DoSn8kXa.js","assets/external-link-GaWiUDyf.js","assets/rooms-CCSfaVVF.js","assets/ProfileNameTrigger-DzNiW3JR.js","assets/rooms-BfG1r7Ij.css","assets/GemAI-OFlEoiSB.js","assets/InviteContactModal-eJvvz2_d.js","assets/index-BiHj8eX2.js","assets/IntegrationsModal-CihhAZhY.js","assets/OfferIntroModal-BsoaPZhY.js","assets/use-resolved-title-company-BlONIib3.js","assets/useConnectorOfferIntro-BJOa_3PG.js"])))=>i.map(i=>d[i]);
2import{bm as lt,bn as un,bo as Vn,u as it,r as s,bp as Xn,j as e,bq as Jn,br as Qn,as as Zn,bs as es,bt as ts,a as ns,y as ss,z as as,b as os,c as ls,d as is,bu as rs,bv as Ne,A as cs,bw as ds,bx as ms,P as nt,by as us,M as hs,bz as tn,bA as hn}from"./index-t4UNL-er.js";import{c as ps,i as pn,a as rt,b as gs}from"./team-account-paths-CUi8cX7V.js";import{n as fs,g as ys,h as xs,j as Ns,l as bs,m as js,o as ks,p as vs}from"./home-checkin-people-BVy6E0N1.js";import{P as gn,a as fn}from"./ProfileNameTrigger-DzNiW3JR.js";import{d as Is,S as ws,I as Cs}from"./InviteContactModal-eJvvz2_d.js";import{R as Ss,N as Ts}from"./GemAI-OFlEoiSB.js";import{S as Es,M as Ps}from"./MuteContactModal-D95J0zhy.js";import{I as Ms}from"./InviteTeammatesModal-B4Of1wFK.js";import{A as $s}from"./arrow-right-Bk4D0LF-.js";import{u as yn}from"./use-mobile-DyHfV21u.js";import{a as Us,F as nn,A as As}from"./AddAccountsModal-CNVwM4E2.js";import{a as Os}from"./accounts-Dq7TYPam.js";import"./index-BjqtNt-N.js";import"./Combination-HGhFtX4F.js";import"./index-BiHj8eX2.js";import"./chevron-right-vNJNS7I3.js";import"./external-link-GaWiUDyf.js";import"./IntegrationsModal-CihhAZhY.js";/**
3 * @license lucide-react v0.462.0 - ISC
4 *
5 * This source code is licensed under the ISC license.
6 * See the LICENSE file in the root directory of this source tree.
7 */const Ds=lt("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
8 * @license lucide-react v0.462.0 - ISC
9 *
10 * This source code is licensed under the ISC license.
11 * See the LICENSE file in the root directory of this source tree.
12 */const Ls=lt("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);/**
13 * @license lucide-react v0.462.0 - ISC
14 *
15 * This source code is licensed under the ISC license.
16 * See the LICENSE file in the root directory of this source tree.
17 */const Fs=lt("Shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]]),Rs=3;function qs(t){return(t.kind==="company"||t.kind==="person")&&!pn(t)&&rt(t)}async function sn(t,i){const{accounts:r}=await un(t,i),o=r.filter(qs);if(!o.length)return{metrics:{value:0,strong:0,total:0},accounts:[]};const c=new Array(o.length);let g=0;async function u(){for(;g<o.length;){const w=g++,l=o[w];try{c[w]=await Vn(t,i,l.id)}catch{c[w]=l}}}await Promise.all(Array.from({length:Math.min(Rs,o.length)},()=>u()));const{warmPaths:N,strong:x,targetAccounts:k}=ps(c);return{metrics:{value:N,strong:x,total:k},accounts:c}}function _s({open:t,introId:i,prefill:r,onClose:o,onSent:c}){var U;const{user:g}=it(),u=g==null?void 0:g.accessToken,N=g==null?void 0:g.userId,[x,k]=s.useState(!1),[w,l]=s.useState(null),[y,C]=s.useState(null),[p,S]=s.useState(""),[A,q]=s.useState(""),[D,$]=s.useState(!1),[b,M]=s.useState(null);s.useEffect(()=>{t&&(C(null),l(null),M(null),S(""),q(""))},[t,i]),s.useEffect(()=>{if(!t||!u||!N||!i)return;let h=!1;return k(!0),l(null),Xn(u,i,N).then(j=>{h||(C(j),S(j.defaults.subject),q(j.defaults.body),k(!1))}).catch(j=>{h||(l(j instanceof Error?j.message:"Couldn't load the nudge draft"),k(!1))}),()=>{h=!0}},[t,u,N,i]);const _=(y==null?void 0:y.target.name)||(r==null?void 0:r.targetName)||"this contact",K=(y==null?void 0:y.target.email)||(r==null?void 0:r.targetEmail)||null,V=((U=y==null?void 0:y.asker)==null?void 0:U.firstName)||(r==null?void 0:r.askerFirstName)||null,Y=(y==null?void 0:y.ageDays)??(r==null?void 0:r.ageDays)??null,J=(y==null?void 0:y.previousNudges.count)||0,le=(y==null?void 0:y.previousNudges.lastAt)||null,Q=s.useMemo(()=>{const h=[];return _&&h.push(`Nudging <strong>${_}</strong>`),Y!=null&&h.push(Y===0?"intro sent earlier today":Y===1?"1 day since the intro went out":`${Y} days since the intro went out`),V&&(y!=null&&y.asker)&&h.push(`via ${V}'s ask`),h.join(" · ")},[_,Y,V,y==null?void 0:y.asker]),O=()=>{D||o()},B=async(h=!1)=>
17{if(!u||!N||!i){M("Please sign in again to send a nudge.");return}if(!p.trim()){M("Subject can't be empty.");return}if(!A.trim()){M("Message can't be empty.");return}$(!0),M(null);try{const j=await Jn(u,{introId:i,viewerUserId:N,subject:p.trim(),body:A.trim(),forceMailto:h}),T=j.recipient.name||j.recipient.email;if(j.delivery==="mailto"&&j.mailto)try{const W=document.createElement("a");W.href=j.mailto,W.rel="noopener noreferrer",W.style.display="none",document.body.appendChild(W),W.click(),document.body.removeChild(W)}catch{window.open(j.mailto,"_self")}const se=j.delivery==="gemphere_smtp"?`Nudge sent to ${T}`:`Opened your mail app — finish + hit Send there to nudge ${T}`;c==null||c(se),o()}catch(j){M(j instanceof Error?j.message:"Network error")}finally{$(!1)}};if(!t)return null;const he=(y==null?void 0:y.delivery)==="no_email"||!K&&!!y,ne=D?"Sending…":"⚡ Send nudge";return e.jsx("div",{className:"modal-overlay open",onClick:O,children:e.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),style:{maxWidth:540},children:[e.jsxs("div",{className:"modal-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"mod-title",children:"Send a nudge"}),e.jsx("div",{className:"mod-sub",children:"Edit the message before sending. We only send one follow-up so it stays gentle."})]}),e.jsx("button",{className:"mod-close",onClick:O,"aria-label":"Close",children:"×"})]}),e.jsxs("div",{className:"modal-body",children:[x&&e.jsx("div",{className:"nudge-context",children:"Loading draft…"}),w&&e.jsx("div",{className:"info-banner",style:{background:"#fdecea",borderColor:"#f3c3bb",color:"#9a3a2a",marginBottom:14},children:w}),J>0&&e.jsxs("div",{className:"info-banner",style:{background:"#fff7e6",borderColor:"#ffd591",color:"#7a4a00",marginBottom:14},children:["You've already nudged this contact"," ",J===1?"once":`${J} times`,le?` (last on ${new Date(le).toLocaleDateString()})`:"",". Sending again will count as another follow-up."]}),Q&&e.jsx("div",{className:"nudge-context",dangerouslySetInnerHTML:{__html:Q}}),e.jsx("label",{className:"fld-lbl",children:"Subject"}),e.jsx("input",{className:"nudge-subject-input",type:"text",value:p,onChange:h=>S(h.target.value),disabled:x||D,placeholder:"Subject"}),e.jsx("label",{className:"fld-lbl",children:"Message (editable)"}),e.jsx("textarea",{className:"nudge-body-input",value:A,onChange:h=>q(h.target.value),disabled:x||D,rows:10}),K?e.jsxs("div",{style:{fontSize:11,color:"#888",marginTop:10,lineHeight:1.6},children:["Sending from ",e.jsx("strong",{children:"[email protected]"})," on your behalf · to"," ",e.jsx("strong",{children:K})]}):y?e.jsx("div",{className:"info-banner",style:{background:"#fdecea",borderColor:"#f3c3bb",color:"#9a3a2a",marginTop:12,marginBottom:0},children:"No email on file for this contact yet. Add their email in your CRM or invite them to Gemphere first."}):null,b&&e.jsx("div",{className:"info-banner",style:{background:"#fdecea",borderColor:"#f3c3bb",color:"#9a3a2a",marginTop:12,marginBottom:0},children:b})]}),e.jsxs("div",{className:"modal-foot",children:[e.jsx("button",{className:"btn-foot",onClick:O,disabled:D,children:"Cancel"}),e.jsx("button",{className:"btn-foot primary",onClick:()=>B(!1),disabled:D||x||!!w||he,children:ne})]})]})})}function Bs({open:t,contact:i,onClose:r,onSaved:o}){var p;const{user:c}=it(),[g,u]=s.useState(""),[N,x]=s.useState(!1),[k,w]=s.useState(null);s.useEffect(()=>{!t||!i||(u(""),x(!1),w(null))},[t,i]);const l=()=>{N||r()},y=async()=>{if(!(c!=null&&c.accessToken)||!(c!=null&&c.userId)||!i){w("Please sign in again.");return}const S=g.trim();if(!S||!S.includes("@")){w("Enter a valid email address.");return}if(!i.contactUserId&&!i.contactImportId){w("This contact cannot receive email check-ins yet.");return}x(!0),w(null);try{const A=await Qn(c.accessToken,{viewerUserId:c.userId,email:S,contactUserId:i.contactUserId??null,contactImportId:i.contactImportId??null});o(A.email),r()}catch(A){w(A instanceof Error?A.message:"Failed to save email")}finally{x(!1)}};if(!t||!i)return null;const C=((p=i.contactName)==null?void 0:p.replace(/^[^\p{L}\p{N}]+/u,"").trim())||"this contact";return e.jsx("div",{className:"modal-overlay open",onClick:l,children:e.jsxs("div",{className:"modal",onClick:S=>S.stopPropagation(),style:{maxWidth:440},children:[e.jsxs("div",{className:"modal-head",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"mod-title",children:["Add email for"," ",e.jsx("span",{style:{color:"#0F6E56"},children:C})]}),e.jsxs("div",{className:"mod-sub",children:["We need a work email to send your check-in",i.linkedinUrl?" — pulled from your LinkedIn import.":"."]})]}),e.jsx("button",{type:"button",className:"mod-close",onClick:l,"aria-label":"Close",children:"×"})]}),e.jsxs("div",{className:"modal-body",children:[e.jsxs("div",{className:"fld-row",children:[e.jsx("label",{className:"fld-lbl",htmlFor:"checkin-contact-email",children:"Work email"}),e.jsx("input",{id:"checkin-contact-email",type:"email",className:"fld-input",placeholder:"[email protected]",value:g,onChange:S=>u(S.target.value),autoFocus:!0,disabled:N})]}),k&&e.jsx("div",{className:"info-banner",style:{background:"#fdecea",borderColor:"#f3c3bb",color:"#9a3a2a",marginTop:12,marginBottom:0},children:k})]}),e.jsxs("div",{className:"modal-foot",children:[e.jsx("button",{type:"button",className:"btn-foot",onClick:l,disabled:N,children:"Cancel"}),e.jsx("button",{type:"button",className:"btn-foot primary",onClick:y,disabled:N,children:N?"Saving…":"Save & continue"})]})]})})}const xn="gp-today-deck-v1";function Ae(t=new Date){const i=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${i}-${r}-${o}`}function Ys(){const t=new Date;return t.setDate(t.getDate()-1),Ae(t)}
17function Ws(){const t=Ae(),i={lastDay:t,streak:0,decided:0};try{const r=window.localStorage.getItem(xn);if(!r)return i;const o=JSON.parse(r),c=typeof o.lastDay=="string"?o.lastDay:t,g=Number.isFinite(o.streak)?Number(o.streak):0,u=Number.isFinite(o.decided)?Number(o.decided):0;return c===t?{lastDay:c,streak:g,decided:u}:c===Ys()?{lastDay:t,streak:g,decided:0}:i}catch{return i}}function Gs(t){try{window.localStorage.setItem(xn,JSON.stringify(t))}catch{}}function X(t){const i=(t||"").replace(/\s+/g," ").trim().split(" ").filter(Boolean);return i.length>=2?(i[0][0]+i[i.length-1][0]).toUpperCase():(t||"?").slice(0,2).toUpperCase()||"?"}function Hs(t){return(t||"").trim().split(" ").filter(Boolean)[0]||t||"they"}function ot(t,i=150){const r=(t||"").replace(/\s+/g," ").trim();return r.length<=i?r:`${r.slice(0,i-1).trimEnd()}…`}const zs={"team-requests":"Doors you can open","new-warm-path":"A new way in","waiting-target":"Still waiting","intro-approved":"Good news","granola-intro-opportunity":"You said you would"},Ks={"team-requests":"Offer","new-warm-path":"Look","waiting-target":"Nudge","intro-approved":"Open","granola-intro-opportunity":"Make it"},Vs={"team-requests":"⇄","new-warm-path":"◇","waiting-target":"◔","intro-approved":"✓","granola-intro-opportunity":"✎"};function Xs(t,i,r){var k,w,l;const o=[],c=t.requests&&t.requests.length>0?t.requests[0]:null;t.type==="team-requests"&&c&&(o.push({name:"You",label:"Connector",initials:X(i),photo:r,tone:"you"}),o.push({name:c.target.name,label:"The ask",initials:X(c.target.name),tone:"mid"}),o.push({name:c.teammate.name,label:"Asking",initials:c.teammate.initials||X(c.teammate.name),photo:c.teammate.profilePhoto,tone:"gold"}));const g=t.granolaOpportunity;if(t.type==="granola-intro-opportunity"&&g){const y=g.recipient.name||g.recipient.email||"Someone",C=g.target.name||g.target.company||"their target";o.push({name:"You",label:"Connector",initials:X(i),photo:r,tone:"you"}),o.push({name:C,label:"The ask",initials:X(C),tone:"mid"}),o.push({name:y,label:"Waiting",initials:X(y),tone:"gold"})}const u=(w=(k=t.nudge)==null?void 0:k.target)==null?void 0:w.name;t.type==="waiting-target"&&u&&(o.push({name:"You",label:"Connector",initials:X(i),photo:r,tone:"you"}),o.push({name:u,label:"Hasn't replied",initials:X(u),tone:"gold"}));const N=((l=t.requests)==null?void 0:l.length)??0,x=t.type==="team-requests"&&N>1?` ${N-1} more teammate${N-1===1?"":"s"} waiting behind this one.`:"";return{eyebrow:zs[t.type]||"Needs a decision",headline:ot(t.title||"Something needs you",96),note:ot(`${t.desc||""}${x}`),passLabel:"Pass",actLabel:Ks[t.type]||"Open",chain:o,glyph:o.length?void 0:Vs[t.type]||"◇"}}function Js(t,i,r){var k;const o=Hs(t.name),c=t.daysSilent,g=[t.roleTitle,t.companyName].filter(Boolean).join(" · "),u=t.companyName||t.roleTitle||t.tag||"Gone quiet",N=c&&c>0?`You and ${o} have been quiet for ${c} days.`:`${o} is worth a hello this week.`,x=(k=t.relevance)!=null&&k.targetLabel?`Relevant to ${t.relevance.targetLabel}. `:"";return{eyebrow:"Worth a hello",headline:N,note:ot(`${x}${t.reason||g||"One message is usually enough to restart this."}`),passLabel:"Not now",actLabel:"Say hi",chain:[{name:"You",label:"You",initials:X(i),photo:r,tone:"you"},{name:t.name,label:u,initials:t.initials||X(t.name),photo:t.profilePhoto,tone:"gold"}]}}function Qs({node:t}){return e.jsxs("div",{className:`gp-today-node gp-today-node--${t.tone}`,children:[e.jsx("div",{className:"gp-today-av",children:t.photo?e.jsx("img",{src:t.photo,alt:""}):e.jsx("span",{children:t.initials})}),e.jsx("div",{className:"gp-today-node-name",children:t.name}),e.jsx("div",{className:"gp-today-node-lbl",children:t.label})]})}const Ue=92;function Zs({firstName:t,viewerName:i,viewerPhoto:r,items:o,openCount:c,askCount:g,onAct:u,onPass:N,onBrowseAll:x}){const[k,w]=s.useState(0),[l,y]=s.useState(0),[C,p]=s.useState(null),[S,A]=s.useState(()=>({lastDay:Ae(),streak:0,decided:0})),q=s.useRef(0),D=s.useRef(0),$=s.useRef("none");s.useEffect(()=>{A(Ws())},[]),s.useEffect(()=>{w(h=>h>o.length?o.length:h)},[o.length]);const b=k<o.length?o[k]:null,M=o.slice(k+1,k+3),_=o.length,K=Math.max(0,_-k),V=s.useCallback(()=>{A(h=>{const j=Ae(),T=h.lastDay!==j||h.decided===0,se={lastDay:j,streak:T?h.streak+1:h.streak,decided:(h.lastDay===j?h.decided:0)+1};return Gs(se),se})},[]),Y=s.useCallback(h=>{if(!b||C)return;p(h);const j=b;window.setTimeout(()=>{h==="right"?u(j):N(j),V(),w(T=>T+1),y(0),p(null)},220)},[b,C,u,N,V]),J=h=>{if(!C){if(h.target.closest("button")){$.current="y";return}q.current=h.clientX,D.current=h.clientY,$.current="none"}},le=h=>{if(C||$.current==="y")return;const j=h.clientX-q.current,T=h.clientY-D.current;
17if($.current==="none"){if(Math.abs(j)<8&&Math.abs(T)<8)return;if(Math.abs(j)<=Math.abs(T)){$.current="y";return}$.current="x",h.currentTarget.setPointerCapture(h.pointerId)}y(j)},Q=h=>{h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId);const j=$.current==="x";$.current="none",!(C||!j)&&(l>Ue?Y("right"):l<-Ue?Y("left"):y(0))},O=s.useMemo(()=>b?b.kind==="attention"?Xs(b.card,i,r):Js(b.person,i,r):null,[b,i,r]);if(_===0)return null;const B=C?C==="right"?520:-520:l,he=B/20,ne=Math.min(1,Math.max(0,B/Ue)),U=Math.min(1,Math.max(0,-B/Ue));return e.jsxs("section",{className:"gp-today","aria-label":"Today",children:[e.jsxs("div",{className:"gp-today-head",children:[e.jsxs("div",{className:"gp-today-head-lead",children:[e.jsx("span",{className:"gp-today-kicker",children:"Swipe to decide"}),e.jsx("h2",{className:"gp-today-title",children:"Your turn"})]}),S.streak>0?e.jsxs("div",{className:"gp-today-streak",title:"Days in a row you've cleared decisions",children:[e.jsx("span",{className:"gp-today-streak-flame","aria-hidden":!0,children:"✦"}),e.jsx("span",{className:"gp-today-streak-n",children:S.streak}),e.jsxs("span",{className:"gp-today-streak-lbl",children:["day",S.streak===1?"":"s"]})]}):null]}),e.jsxs("div",{className:"gp-today-counts",children:[c>0?e.jsxs("span",{className:"gp-today-count",children:[e.jsx("b",{children:c})," to open"]}):null,g>0?e.jsxs("span",{className:"gp-today-count",children:[e.jsx("b",{children:g})," to say hi"]}):null,e.jsx("span",{className:"gp-today-count-spacer"}),e.jsxs("span",{className:"gp-today-left",children:[K," left"]})]}),_>1?e.jsx("div",{className:"gp-today-progress","aria-hidden":!0,children:o.map((h,j)=>e.jsx("span",{className:`gp-today-pip${j<k?" done":""}${j===k?" now":""}`},h.id))}):null,b&&O?e.jsxs("div",{className:"gp-today-stage",children:[M.map((h,j)=>e.jsx("div",{className:`gp-today-card gp-today-card--behind depth-${j+1}`,"aria-hidden":!0},h.id)),e.jsxs("div",{className:`gp-today-card gp-today-card--top${C?" flying":""}`,style:{transform:`translateX(${B}px) rotate(${he}deg)`,transition:C||l===0?"transform 0.22s cubic-bezier(0.32,0.72,0,1)":"none",opacity:C?0:1},onPointerDown:J,onPointerMove:le,onPointerUp:Q,onPointerCancel:Q,children:[e.jsx("span",{className:"gp-today-stamp pass",style:{opacity:U},"aria-hidden":!0,children:"Pass"}),e.jsx("span",{className:"gp-today-stamp act",style:{opacity:ne},"aria-hidden":!0,children:O.actLabel}),e.jsx("div",{className:"gp-today-eyebrow",children:O.eyebrow}),e.jsx("h3",{className:"gp-today-headline",children:O.headline}),O.chain.length>0?e.jsx("div",{className:"gp-today-chain",children:O.chain.map((h,j)=>e.jsxs("div",{className:"gp-today-chain-cell",children:[j>0?e.jsx("span",{className:"gp-today-link","aria-hidden":!0}):null,e.jsx(Qs,{node:h})]},`${h.name}-${j}`))}):e.jsx("div",{className:"gp-today-glyph","aria-hidden":!0,children:O.glyph}),e.jsx("p",{className:"gp-today-note",children:O.note}),e.jsxs("div",{className:"gp-today-actions",children:[e.jsx("button",{type:"button",className:"gp-today-btn gp-today-btn--pass",onClick:()=>Y("left"),children:O.passLabel}),e.jsx("button",{type:"button",className:"gp-today-btn gp-today-btn--act",onClick:()=>Y("right"),children:O.actLabel})]})]})]}):e.jsxs("div",{className:"gp-today-clear",children:[e.jsx("div",{className:"gp-today-clear-medal","aria-hidden":!0,children:"✓"}),e.jsxs("div",{className:"gp-today-clear-title",children:["That's the lot, ",t,"."]}),e.jsx("div",{className:"gp-today-clear-sub",children:S.decided>0?`${S.decided} decision${S.decided===1?"":"s"} today · ${S.streak} day${S.streak===1?"":"s"} running.`:"Nothing is waiting on you right now."}),e.jsx("button",{type:"button",className:"gp-today-clear-btn",onClick:x,children:"See the rest of your network"})]})]})}function st(t){const i=(t||"").replace(/\s+/g," ").trim().split(" ").filter(Boolean);return i.length>=2?(i[0][0]+i[i.length-1][0]).toUpperCase():(t||"?").slice(0,2).toUpperCase()||"?"}function an(t){return(t||"").trim().split(" ").filter(Boolean)[0]||t||"them"}function ea({doors:t,viewerName:i,viewerPhoto:r,index:o,onShuffle:c,onAsk:g,onOpenAccounts:u,onOpenWebProfile:N,onOpenInvite:x}){const[k,w]=s.useState(0),l=t[o]??null,y=(l==null?void 0:l.key)??null;if(s.useEffect(()=>{if(!y)return;w(0);const b=[1,2,3].map(M=>window.setTimeout(()=>w(M),220+M*260));return()=>b.forEach(M=>
17window.clearTimeout(M))},[y]),!l)return null;const C=an(l.target.name),p=an(l.via.name),S=Zn(l.tier),A=[l.target.role,l.companyName].filter(Boolean).join(" · "),q=l.companyName||l.target.name,D=!!l.accountName&&l.accountName.trim().toLowerCase()!==q.trim().toLowerCase(),$=[{name:"You",label:null,initials:st(i),photo:r,userId:null,role:null,companyName:null,linkedinUrl:null,email:null,tone:"you",tappable:!1},{name:l.via.name,label:"Your connection",initials:st(l.via.name),photo:null,userId:l.via.userId,role:null,companyName:null,linkedinUrl:null,email:null,tone:"via",tappable:!0},{name:l.target.name,label:A||"At the company",initials:st(l.target.name),photo:l.target.photo,userId:l.target.userId,role:l.target.role,companyName:l.companyName,linkedinUrl:l.target.linkedinUrl,email:l.target.email,tone:"target",tappable:!0}];return e.jsxs("section",{className:"gp-door","aria-label":"Today's door",children:[e.jsxs("div",{className:"gp-door-head",children:[e.jsx("span",{className:"gp-door-kicker",children:"Today's door"}),t.length>1?e.jsxs("button",{type:"button",className:"gp-door-shuffle",onClick:c,children:[e.jsx(Fs,{size:13,strokeWidth:2}
17),"Show another"]}):null]}),e.jsxs("div",{className:"gp-door-card",children:[e.jsxs("button",{type:"button",className:"gp-door-account",onClick:u,children:[e.jsx("span",{className:"gp-door-account-lbl",children:l.accountIsMine?"Your target account":"Team target account"}),D?e.jsx("span",{className:"gp-door-account-name",children:l.accountName}):null,!l.accountIsMine&&l.accountOwnerName?e.jsxs("span",{className:"gp-door-account-owner",children:["· ",l.accountOwnerName]}):null]}),e.jsx("div",{className:"gp-door-company",children:q}),e.jsxs("p",{className:"gp-door-line",children:["You're two steps from ",e.jsx("b",{children:C}),l.target.role?e.jsxs(e.Fragment,{children:[" · ",l.target.role]}):null]}),e.jsx("ol",{className:"gp-door-steps",children:$.map((b,M)=>e.jsxs("li",{className:`gp-door-step gp-door-step--${b.tone}${k>M?" in":""}`,children:[e.jsxs("span",{className:"gp-door-rail","aria-hidden":!0,children:[e.jsx("span",{className:"gp-door-dot"}),M<$.length-1?e.jsx("span",{className:"gp-door-line-v"}):null]}),b.tappable?e.jsx(gn,{userId:b.userId,name:b.name,photo:b.photo,linkedinUrl:b.linkedinUrl,companyName:b.companyName,role:b.role,email:b.email,initials:b.initials,className:"gp-door-av-btn",avatarClassName:"gp-door-av",onOpenWebProfile:N,onOpenInvite:x}):e.jsx("span",{className:"gp-door-av","aria-hidden":!0,children:b.photo?e.jsx("img",{src:b.photo,alt:""}):e.jsx("span",{children:b.initials})}),e.jsxs("span",{className:"gp-door-who",children:[b.tappable?e.jsx(fn,{userId:b.userId,name:b.name,photo:b.photo,linkedinUrl:b.linkedinUrl,companyName:b.companyName,role:b.role,email:b.email,className:"gp-door-name gp-door-name--link",onOpenWebProfile:N,onOpenInvite:x}):e.jsx("span",{className:"gp-door-name",children:b.name}),b.label?e.jsx("span",{className:"gp-door-role",children:b.label}):null]})]},`${l.key}-${M}`))}),S?e.jsxs("div",{className:`gp-door-strength tier-${l.tier}`,children:[S," connection between ",p," and ",C]}):null,e.jsxs("div",{className:"gp-door-actions",children:[e.jsx("button",{type:"button",className:"gp-door-btn gp-door-btn--ghost",onClick:u,children:"All doors"}),e.jsxs("button",{type:"button",className:"gp-door-btn gp-door-btn--act",onClick:()=>g(l),"aria-label":`Learn more about the door through ${p}`,children:["Learn more",e.jsx($s,{size:15,strokeWidth:2})]})]})]})]})}function ta(t){const i=(t||"").replace(/\s+/g," ").trim().split(" ").filter(Boolean);return i.length>=2?(i[0][0]+i[i.length-1][0]).toUpperCase():(t||"?").slice(0,2).toUpperCase()||"?"}function na(t){const i=(t||"").toLowerCase();return/accept|repl|book|met|done|closed won/.test(i)?"good":/wait|sent|pending|open|flight/.test(i)?"waiting":"neutral"}function sa(t){var c,g,u,N,x,k,w,l;const i=t.counterpartName||((g=(c=t.chain)==null?void 0:c.to)==null?void 0:g.name)||"Someone",r=((N=(u=t.chain)==null?void 0:u.connector)==null?void 0:N.name)||null;let o;return t.role==="connector"?o=e.jsxs(e.Fragment,{children:["You introduced ",e.jsx("b",{children:((k=(x=t.chain)==null?void 0:x.from)==null?void 0:k.name)||"someone"})," to ",e.jsx("b",{children:((l=(w=t.chain)==null?void 0:w.to)==null?void 0:l.name)||i}),"."]}):t.role==="asker"?o=e.jsxs(e.Fragment,{children:["You asked ",r?e.jsx("b",{children:r}):"for an intro"," to reach ",e.jsx("b",{children:i}),"."]}):o=e.jsxs(e.Fragment,{children:[r?e.jsx("b",{children:r}):"Someone"," put you in front of ",e.jsx("b",{children:i}),"."]}),{key:`intro-${t.introId}`,initials:t.counterpartInitials||ta(i),photo:t.counterpartPhoto,tone:"intro",text:o,when:t.whenLabel||"",status:t.statusLabel||null,statusTone:na(t.statusLabel||""),href:t.introId?`/warm-intros?intro=${t.introId}`:"/warm-intros"}}function aa(t,i){return{key:`path-${i}`,initials:"◇",photo:null,tone:"path",text:e.jsx(e.Fragment,{children:t.title}),when:"New",status:"Door opened",statusTone:"good",href:t.href||"/accounts"}}const oa=6;function la({intros:t,attention:i,reciprocity:r,onOpen:o}){const c=[...i.filter(x=>x.type==="new-warm-path").map(aa),...t.map(sa)].slice(0,oa);if(c.length===0)return null;const g=(r==null?void 0:r.helpedTeammates)??0,u=(r==null?void 0:r.helpedMe)??0,N=g>0||u>0;return e.jsxs("section",{className:"gp-moved","aria-label":"What moved",children:[e.jsxs("div",{className:"gp-moved-head",children:[e.jsx("h2",{className:"gp-moved-title",children:"What moved"}),N?e.jsxs("p",{className:"gp-moved-balance",children:["You opened ",e.jsx("b",{children:g})," door",g===1?"":"s"," · ",e.jsx("b",{children:u})," opened for you"]}):e.jsx("p",{className:"gp-moved-balance",children:"Since you last looked."})]}),e.jsx("ul",{className:"gp-moved-list",children:c.map(x=>e.jsx("li",{children:e.jsxs("button",{type:"button",className:"gp-moved-row",onClick:()=>o(x.href),children:[e.jsx("span",{className:`gp-moved-av gp-moved-av--${x.tone}
17`,"aria-hidden":!0,children:x.photo?e.jsx("img",{src:x.photo,alt:""}):e.jsx("span",{children:x.initials})}),e.jsxs("span",{className:"gp-moved-body",children:[e.jsx("span",{className:"gp-moved-text",children:x.text}),e.jsxs("span",{className:"gp-moved-meta",children:[x.status?e.jsx("span",{className:`gp-moved-status ${x.statusTone}`,children:x.status}):null,x.when?e.jsx("span",{className:"gp-moved-when",children:x.when}):null]})]}),e.jsx(Ds,{size:15,strokeWidth:1.75,className:"gp-moved-go","aria-hidden":!0})]})},x.key))})]})}function ia(t){return t.source==="direct_gem"||(t.viaName||"").trim().toLowerCase()==="you"}function ra(t){const r=[{pct:t.pct,source:t.source,viaUserId:t.viaUserId,viaName:t.viaName,warmthTier:t.warmthTier},...t.altPaths||[]].filter(o=>!ia(o)&&(o.viaName||"").trim().length>0);return r.length===0?null:r.reduce((o,c)=>(c.pct??0)>(o.pct??0)?c:o)}function on(t){const i=[],r=new Set;for(const o of t)if(rt(o)&&!(o.kind!=="company"&&o.kind!=="person")&&!pn(o))for(const c of o.contacts||[]){if(!gs(c))continue;const g=ra(c);if(!g)continue;const u=c.contactUserId?`u${c.contactUserId}`:c.contactImportId?`i${c.contactImportId}`:`n${(c.name||"").trim().toLowerCase()}`,N=`${o.id}:${u}`;r.has(N)||(r.add(N),i.push({key:N,accountId:o.id,accountName:(o.companyName||"").trim(),accountKind:o.kind,accountOwnerName:o.isMine===!1&&o.ownerName||null,accountIsMine:o.isMine!==!1,companyName:(c.companyName||o.companyName||"").trim(),target:{name:(c.name||"").trim(),role:c.role||null,userId:c.contactUserId??null,importId:c.contactImportId??null,photo:c.profilePhoto??null,email:c.contactEmail??null,linkedinUrl:c.linkedinUrl??null},via:{name:(g.viaName||"").trim(),userId:g.viaUserId??null},pct:g.pct??null,tier:g.warmthTier??es(g.pct)}))}return i.sort((o,c)=>(c.pct??0)-(o.pct??0)),i}function ca(t,i,r=new Date){if(t<=0)return 0;const o=Math.floor(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate())/864e5);return Math.abs(Math.imul(o+i,2654435761))%t}const ln=[{id:"home",label:"Home",short:"Home"},{id:"rooms",label:"Events & Leagues",short:"Rooms"}];function da({value:t,onChange:i}){const r=Math.max(0,ln.findIndex(u=>u.id===t)),[o,c]=s.useState(!1),g=s.useRef(!0);return s.useEffect(()=>{if(!g.current)return;g.current=!1;const u=window.requestAnimationFrame(()=>c(!0));return()=>window.cancelAnimationFrame(u)},[]),e.jsx("div",{className:"home-viewtoggle-wrap",children:e.jsxs("div",{className:`home-viewtoggle${o?" is-ready":""}`,role:"tablist","aria-label":"Switch what home shows",children:[e.jsx("span",{className:"home-viewtoggle-pill",style:{transform:`translateX(${r*100}%)`},"aria-hidden":!0}),ln.map(u=>e.jsxs("button",{type:"button",role:"tab","aria-selected":u.id===t,className:`home-viewtoggle-btn${u.id===t?" is-on":""}`,onClick:()=>i(u.id),children:[e.jsx("span",{className:"home-viewtoggle-long",children:u.label}),e.jsx("span",{className:"home-viewtoggle-short",children:u.short})]},u.id))]})})}function Nn(t,i,r){return fetch(`${ts()}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify(i)})}function ma(t,i){return Nn("/api/gemphere/account/invite-by-email",t,i)}function ua(t,i){return Nn("/api/gemphere/warm-intro/request",t,i)}const ha=s.lazy(()=>hn(()=>import("./RoomsView-DoG0SJRA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27])));async function pa(t,i,r={}){const o=(r.note||"").trim(),c=await ma({email:i,...r.name?{name:r.name}:{},...o?{note:o}:{}},t);if(!c.ok){let g=`Failed to send invite (${c.status})`;try{const u=await c.json();typeof(u==null?void 0:u.message)=="string"?g=u.message:typeof(u==null?void 0:u.error)=="string"&&(g=u.error)}catch{}throw new Error(g)}}function rn(){const t=new Date().getHours();return t<12?"Good morning":t<18?"Good afternoon":"Good evening"}function R(t){return t==null||!Number.isFinite(t)?"—":new Intl.NumberFormat("en-US").format(Math.max(0,Math.round(t)))}const ga=10,fa=5;function at(t){return t.contactUserId&&t.contactUserId>0?`u:${t.contactUserId}`:t.contactImportId?`i:${t.contactImportId}`:`u:${t.userId}`}function cn(t,i){const r=(i.name||i.email||i.company||"").trim(),o=(i.email||"").trim();return!r&&!o?null:{key:`granola:${t}:${o||r.toLowerCase()}`,userId:0,name:r||o,rawName:r||o,role:t==="from"?"Intro recipient":"Target",title:null,companyName:i.company||null,email:o||null,photo:null,roleKind:0,kind:"contact",isGem:!1}}function dn(t){const i=cn("from",t.recipient),r=cn("to",t.target),o=[t.evidenceExcerpt?`From Granola: "${t.evidenceExcerpt}"`:"From Granola meeting notes.",t.meetingTitle?`Meeting: ${t.meetingTitle}
17`:null].filter(Boolean);return{from:i,to:r,note:o.join(" "),granolaOpportunityId:t.id}}function La(){var Wt,Gt,Ht,zt,Kt,Vt,Xt,Jt,Qt,Zt;const{user:t}=it(),{isProPlan:i}=ns(),{needsUpgrade:r}=ss(),o=as(),{openProfile:c}=os(),[g,u]=s.useState(!1),[N,x]=s.useState(!1),[k,w]=s.useState(!1),[l,y]=s.useState(null),[C,p]=s.useState(!0),[S,A]=s.useState(null),[q,D]=s.useState(null),[$,b]=s.useState(null);ls(!C||!!S);const[M,_]=s.useState([]),[K,V]=s.useState(!1),[Y,J]=s.useState([]),[le,Q]=s.useState(null),[O,B]=s.useState(!1),[he,ne]=s.useState("make"),[U,h]=s.useState(null),[j,T]=s.useState(null),[se,W]=s.useState(null),[bn,pe]=s.useState(null),[ie,jn]=s.useState(null),[re,kn]=s.useState(null),[vn,ct]=s.useState(null),[Oe,dt]=s.useState(null),[De,mt]=s.useState(null),[In,ut]=s.useState(null),[ge,wn]=s.useState("all"),[ht,Cn]=s.useState(()=>new Set),[be,Le]=s.useState(null),[pt,gt]=s.useState(null),[ft,yt]=s.useState(null),[Sn,xt]=s.useState(null),[Tn,Nt]=s.useState(!1),[bt,Fe]=s.useState(null),[ae,Re]=s.useState(null),[je,ke]=s.useState(""),[qe,jt]=s.useState(""),[kt,vt]=s.useState(!1),[_e,Be]=s.useState(new Set),[It,Ye]=s.useState(new Set),Z=yn(),[We,ve]=is(),Ie=We.get("view")==="rooms"?"rooms":"home",[oe,wt]=s.useState(Ie),[Ct,Ge]=s.useState(""),ce=s.useRef(null);s.useEffect(()=>{wt(n=>n===Ie?n:Ie)},[Ie]),s.useEffect(()=>{if(oe==="rooms")return;const n=()=>{hn(()=>import("./RoomsView-DoG0SJRA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]))},a=window.requestIdleCallback;if(a){const m=a(n,{timeout:3e3});return()=>{var I;return(I=window.cancelIdleCallback)==null?void 0:I.call(window,m)}}const d=window.setTimeout(n,1500);return()=>window.clearTimeout(d)},[oe]),s.useEffect(()=>()=>{ce.current!==null&&window.clearTimeout(ce.current)},[]);const En=s.useCallback(n=>{var m;if(n===oe)return;const a=typeof window<"u"&&((m=window.matchMedia)==null?void 0:m.call(window,"(prefers-reduced-motion: reduce)").matches),d=()=>{wt(n),Ge(a?"":"entering"),window.scrollTo({top:0,behavior:"auto"}),ve(I=>{const f=new URLSearchParams(I);return n==="rooms"?f.set("view","rooms"):f.delete("view"),f},{replace:!0}),a||(ce.current=window.setTimeout(()=>Ge(""),440))};if(ce.current!==null&&window.clearTimeout(ce.current),a){d();return}Ge("leaving"),ce.current=window.setTimeout(d,190)},[oe,ve]),[z,Pn]=s.useState(null),[ee,He]=s.useState([]),[we,St]=s.useState(null),[G,ze]=s.useState(null),[Tt,Et]=s.useState(!1),[Mn,fe]=s.useState(null),[Ke,Ce]=s.useState(!1),[Ve,Pt]=s.useState(!1),[$n,Se]=s.useState(!1),[Mt,Xe]=s.useState(null);s.useEffect(()=>{We.get("addTargets")==="1"&&(Ce(!0),Se(!0),ve(n=>{const a=new URLSearchParams(n);return a.delete("addTargets"),a},{replace:!0}))},[We,ve]),s.useEffect(()=>{if(!Ke||!(t!=null&&t.accessToken)||!(t!=null&&t.userId))return;let n=!1;return un(t.accessToken,t.userId).then(({accounts:a})=>{n||Xe(a.filter(rt).length)}).catch(()=>{n||Xe(null)}),()=>{n=!0}},[Ke,t==null?void 0:t.accessToken,t==null?void 0:t.userId]);const Un=s.useCallback(()=>{Ve||(Ce(!1),Se(!1))},[Ve]),$t=s.useCallback(()=>{Se(!1),Ce(!0)},[]),An=s.useCallback(async(n,a=[])=>{const d=t==null?void 0:t.accessToken,m=t==null?void 0:t.userId;if(!d||!m||n.length===0&&a.length===0)return;const I=f=>{T(f),setTimeout(()=>T(null),4e3)};Pt(!0);try{const f=await Os({viewerUserId:m,companies:Us(n),people:a,source:"manual"},d),E=await f.json().catch(()=>({}));if(!f.ok){if((E==null?void 0:E.code)==="free_target_account_limit_exceeded"){I(`Free Starter includes up to ${nn} target accounts. Upgrade to add more.`);return}throw new Error((E==null?void 0:E.error)||(E==null?void 0:E.message)||"Failed to add accounts")}const H=Number(E.added||0);Ce(!1),Se(!1),Xe(F=>F==null?F:F+H),I(`Added ${H} account${H===1?"":"s"} · finding warm paths…`),rs(m),sn(d,m).then(({metrics:F,accounts:L})=>{D(F),He(on(L))}).catch(()=>{})}catch(f){I(f instanceof Error?f.message:"Failed to add accounts")}finally{Pt(!1)}},[t==null?void 0:t.accessToken,t==null?void 0:t.userId]);s.useEffect(()=>{if(!(t!=null&&t.accessToken)||!(t!=null&&t.userId)){p(!1);return}let n=!1;return p(!0),A(null),Ne(t.accessToken,t.userId).then(a=>{n||(y(a),Be(new Set(a.mutedContactUserIds||[])),Ye(new Set(a.mutedContactImportIds||[])),p(!1))}).catch(a=>{n||(A(a instanceof Error?a.message:"Failed to load home"),p(!1))}),()=>{n=!0}},[t==null?void 0:t.accessToken,t==null?void 0:t.userId]),s.useEffect(()=>
17{if(!(t!=null&&t.accessToken)||!(t!=null&&t.userId))return;let n=!1;return sn(t.accessToken,t.userId).then(({metrics:a,accounts:d})=>{n||(D(a),He(on(d)))}).catch(()=>{n||(D(null),He([]))}),()=>{n=!0}},[t==null?void 0:t.accessToken,t==null?void 0:t.userId]),s.useEffect(()=>{if(!(t!=null&&t.accessToken)||!(t!=null&&t.userId))return;let n=!1;return V(!0),(async()=>{try{const a=t.accessToken,d=t.userId,[m,I,f]=await Promise.all([cs(a,d),ds(a,d),ms(a,d)]);if(n)return;const E=Array.isArray(m.connections)?m.connections:[],H=Array.isArray(m.contacts)?m.contacts:[];b(fs(E,H,d));const F=f.targets||[];J(F);const L=ys(E,H,I,m.signalTiersByEmail??{}),$e=m.goals||[],xe=F.length>0,en=xs(L,I,$e,{limit:xe?400:24,signalTiersByEmail:m.signalTiersByEmail??{}});if(Q(Ns(I)),_(en),V(!1),!xe)return;const Kn=await bs(a,d,F);if(n)return;_(js(en,Kn,$e))}catch{n||(b(null),_([]),J([]),Q(null),V(!1))}})(),()=>{n=!0}},[t==null?void 0:t.accessToken,t==null?void 0:t.userId]);const Te=((Wt=l==null?void 0:l.viewer)==null?void 0:Wt.firstName)||((t==null?void 0:t.fullName)||"there").split(" ")[0],Ut=ne
17w Date().toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"}).toUpperCase(),v=l==null?void 0:l.metrics,P=(l==null?void 0:l.networkShape)??null,At=s.useMemo(()=>{var a;const n=[$,P==null?void 0:P.totalContacts,(a=v==null?void 0:v.networkSize)==null?void 0:a.value].filter(d=>d!=null&&Number.isFinite(d)&&d>0);return n.length?Math.max(...n):0},[$,P==null?void 0:P.totalContacts,(Gt=v==null?void 0:v.networkSize)==null?void 0:Gt.value]),Je=s.useMemo(()=>{var n,a,d;return q||{value:((n=v==null?void 0:v.activeWarmPaths)==null?void 0:n.value)??0,strong:((a=v==null?void 0:v.activeWarmPaths)==null?void 0:a.strong)??0,total:((d=v==null?void 0:v.activeWarmPaths)==null?void 0:d.total)??0}},[q,v==null?void 0:v.activeWarmPaths]),On=(P==null?void 0:P.light)!=null?Number(P.light):le,ye=(l==null?void 0:l.attention)||[],Ot=(l==null?void 0:l.stayInTouch)||[];Ot.filter(n=>!_e.has(n.userId));const Dt=(l==null?void 0:l.recentIntros)||[],Lt=(l==null?void 0:l.goals)||[],de=(l==null?void 0:l.setupChecklist)||null,me=s.useMemo(()=>M.filter(n=>n.contactUserId&&_e.has(n.contactUserId)||n.contactImportId&&It.has(n.contactImportId)?!1:n.warmthTier==="light"),[M,_e,It]),Ft=s.useMemo(()=>ks(me),[me]),Ee=s.useMemo(()=>me.filter(n=>vs(n,ge)),[me,ge]),te=s.useMemo(()=>Ee.filter(n=>!ht.has(at(n))),[Ee,ht]),Rt=s.useMemo(()=>k?te:te.slice(0,ga),[te,k]),qt=Math.max(0,te.length-Rt.length);s.useEffect(()=>{if(!Z||z!==null||C||K)return;const n=[...((l==null?void 0:l.attention)||[]).map((a,d)=>({kind:"attention",id:`deck-a-${d}`,card:a})),...te.slice(0,5).map(a=>({kind:"checkin",id:`deck-c-${at(a)}`,person:a}))];n.length!==0&&Pn(n.slice(0,fa))},[Z,z,C,K,l==null?void 0:l.attention,te]),s.useEffect(()=>{we!==null||ee.length===0||!(t!=null&&t.userId)||St(ca(ee.length,t.userId))},[we,ee.length,t==null?void 0:t.userId]);const Dn=s.useCallback(()=>{St(n=>n==null?0:(n+1)%Math.max(1,ee.length))},[ee.length]),Ln=s.useCallback(async(n,a)=>{if(!(!(t!=null&&t.accessToken)||!(t!=null&&t.userId))){Et(!0),fe(null);try{const d={note:a.message2.trim()||"I'd love an intro!",blurb:a.message2,connectorMessage:a.message1.trim(),fromUserID:t.userId};a.subject1.trim()&&(d.connectorSubject=a.subject1.trim()),a.subject2.trim()&&(d.blurbSubject=a.subject2.trim()),n.via.userId&&n.via.userId>0&&(d.connectorUserID=n.via.userId),a.connectorEmail&&(d.connectorEmail=a.connectorEmail),n.target.userId&&n.target.userId>0?d.toUserID=n.target.userId:(d.toUserID=0,d.toEmail=a.targetEmail||n.target.email||"",d.toName=n.target.name);const m=await ua(d,t.accessToken),I=await m.json().catch(()=>null);if(!m.ok){fe(I&&(I.error||I.message)||`Request failed (${m.status})`);return}ze(null),T(`Intro request sent to ${n.via.name}.`),setTimeout(()=>T(null),4e3)}catch(d){fe(d instanceof Error?d.message:"Network error — please try again.")}finally{Et(!1)}}},[t==null?void 0:t.accessToken,t==null?void 0:t.userId]),Fn=s.useMemo(()=>(z||[]).filter(n=>n.kind==="attention").length,[z]),Rn=s.useMemo(()=>(z||[]).filter(n=>n.kind==="checkin").length,[z]),ue=(t==null?void 0:t.fullName)||"You",Qe=s.useCallback(n=>{Fe({name:n.name||"",fullname:n.name||"",title:n.title||"",companyName:n.companyName||"",linkedinUrl:n.linkedinUrl||null,isNonGem:!0,source:n.linkedinUrl?"linkedin":"import"})},[]),Pe=s.useCallback((n,a)=>{jt(Is(ue)),ke((a||"").trim()),Re({name:(n||"").trim()||"This contact",email:(a||"").trim()})},[ue]),qn=s.useCallback(async()=>{if(!(t!=null&&t.accessToken)||!ae)return;const n=je.trim();if(n){vt(!0);try{await pa(t.accessToken,n,{name:ae.name,note:qe}),Re(null),ke(""),T(`Invite sent to ${n}.`),setTimeout(()=>T(null),4e3)}catch(a){T(a instanceof Error?a.message:"Failed to send invite"),setTimeout(()=>T(null),4e3)}finally{vt(!1)}}},[t==null?void 0:t.accessToken,ae,je,qe]),_n=s.useCallback(n=>n.contactUserId&&n.contactUserId>0?n.contactUserId:n.userId>0?n.userId:null,[]),Me=s.useCallback(n=>{const a=at(n);Cn(d=>{if(d.has(a))return d;const m=new Set(d);return m.add(a),m})},[]),Ze=s.useCallback((n,a)=>{const d=Ee.find(m=>!!(a&&m.contactImportId===a||n&&n>0&&m.contactUserId===n||n&&n>0&&m.userId===n));d&&Me(d)},[Ee,Me]);s.useEffect(()=>{if(!N)return;const n=d=>{d.key==="Escape"&&x(!1)};document.addEventListener("keydown",n);const a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",n),document.body.style.overflow=a}},[N]),s.useEffect(()=>{ge!=="all"&&Ft[ge]===0&&wn("all")},[ge,Ft]);const et=s.useCallback((n,a)=>{ut({contactName:n.name,contactEmail:a,daysSilent:n.daysSilent,relevance:n.relevance??null}),dt(n.contactUserId&&n.contactUserId>0?n.contactUserId:null),mt(n.contactImportId??null)},[]),tt=s.useCallback(n=>{if(!n.email){Le({contactName:n.name,contactUserId:n.contactUserId&&n.contactUserId>0?n.contactUserId:null,contactImportId:n.contactImportId??null,linkedinUrl:n.linkedinUrl,daysSilent:n.daysSilent,relevance:n.relevance??null});return}et(n,n.email)},[et]),Bn=!!de&&de.totalCount>0&&de.doneCount<de.totalCount,_t=!C&&!S&&!!l&&(((Ht=v==null?void 0:v.introsMade)==null?void 0:Ht.value)??0)===0&&At===0&&Je.value===0&&(((zt=v==null?void 0:v.meetingsBooked)==null?void 0:zt.value)??0)===0&&ye.length===0&&Ot.length===0&&Dt.length===0&&Lt.length===0,Bt=(((Kt=v==null?void 0:v.introsMade)==null?void 0:Kt.value)??0)>0||(((Vt=v==null?void 0:v.meetingsBooked)==null?void 0:Vt.value)??0)>0||Je.value>0,Yn=!_t&&(((P==null?void 0:P.totalContacts)??0)>0||me.length>0||K),Yt=s.useCallback(n=>{var a;if(n.type==="granola-intro-opportunity"&&n.granolaOpportunity){h(dn(n.granolaOpportunity)),B(!0);return}if(n.type==="waiting-target"){if(n.nudge){pe({targetName:n.nudge.target.name,targetEmail:n.nudge.target.email,askerFirstName:((a=n.nudge.asker)==null?void 0:a.firstName)??null,ageDays:n.nudge.ageDays??null}),W(n.nudge.introId);return}if(n.introId){pe(null),W(n.introId);return}}n.href?o(n.href):n.type==="new-warm-path"?o("/accounts"):o("/warm-intros")},[o]),Wn=s.useCallback(n=>{n.kind==="checkin"?tt(n.person):Yt(n.card)},[tt,Yt]),Gn=s.useCallback(n=>{n.kind==="checkin"&&Me(n.person)},[Me]),Hn=s.useCallback(()=>{var n;(n=document.querySelector(".home-network-section"))==null||n.scrollIntoView({behavior:"smooth",block:"start"})},[]),zn=(n,a)=>
17{if(n.type==="granola-intro-opportunity"&&n.granolaOpportunity){const f=n.granolaOpportunity,E=()=>{y(L=>L&&{...L,attention:L.attention.filter($e=>{var xe;return((xe=$e.granolaOpportunity)==null?void 0:xe.id)!==f.id})})},H=()=>{h(dn(f)),B(!0)},F=async L=>{if(L.stopPropagation(),!(!(t!=null&&t.accessToken)||!(t!=null&&t.userId))){E();try{await tn(t.accessToken,f.id,"dismissed")}catch{Ne(t.accessToken,t.userId).then(y).catch(()=>{})}}};return e.jsxs("div",{className:`home-attention-row${n.urgent?" urgent":""}`,onClick:H,role:"button",tabIndex:0,children:[e.jsxs("div",{className:"home-attention-body",children:[e.jsxs("div",{className:"home-attention-title-row",children:[e.jsx("div",{className:"home-attention-title",children:n.title}),n.badge?e.jsx("div",{className:`home-attention-badge ${n.badgeCls}`,children:n.badge}):null]}),e.jsx("div",{className:"home-attention-desc",children:n.desc})]}),e.jsxs("div",{className:"home-attention-actions",children:[e.jsx("button",{type:"button",className:"home-attention-ghost",onClick:L=>{L.stopPropagation(),F(L)},children:"Dismiss"}),e.jsx("button",{type:"button",className:"home-attention-solid",onClick:L=>{L.stopPropagation(),H()},children:"Make intro"})]})]},`attn-${a}`)}if(n.type==="team-requests")return e.jsxs("div",{className:`home-attention-row team${g?" open":""}`,children:[e.jsxs("div",{className:"home-attention-row-main",onClick:()=>u(f=>!f),role:"button",tabIndex:0,children:[e.jsxs("div",{className:"home-attention-body",children:[e.jsxs("div",{className:"home-attention-title-row",children:[e.jsx("div",{className:"home-attention-title",children:n.title}),n.badge?e.jsx("div",{className:`home-attention-badge ${n.badgeCls}`,children:n.badge}):null]}),e.jsx("div",{className:"home-attention-desc",children:n.desc})]}),e.jsx("span",{className:"home-attention-expand",children:g?"−":"+"})]}),e.jsx("div",{className:"home-attention-expand-panel",children:(n.requests||[]).map(f=>e.jsxs("div",{className:"ep-req-item",children:[e.jsx("button",{type:"button",className:"profile-popup-trigger",onClick:E=>{E.stopPropagation(),c(f.teammate.userId,{name:f.teammate.name,photo:f.teammate.profilePhoto})},"aria-label":`View ${f.teammate.name}'s profile`,children:e.jsx("div",{className:`ep-req-av av sm ${f.teammate.cls}`,children:f.teammate.profilePhoto?e.jsx("img",{src:f.teammate.profilePhoto,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"}}):f.teammate.initials})}),e.jsxs("div",{className:"ep-req-info",children:[e.jsxs("div",{className:"ep-req-name",children:[f.teammate.name," · ",f.teammate.role]}),e.jsxs("div",{className:"ep-req-target",children:["→ ",f.target.name,f.message?` — ${f.message}`:""]})]}),e.jsx("button",{className:"ep-req-btn",onClick:E=>{E.stopPropagation(),o("/warm-intros")},children:"Review"})]},f.introId))})]},`attn-${a}`);const d=f=>{var E;pe({targetName:f.target.name,targetEmail:f.target.email,askerFirstName:((E=f.asker)==null?void 0:E.firstName)??null,ageDays:f.ageDays??null}),W(f.introId)},m=()=>{if(n.type==="waiting-target"){if(n.nudge){d(n.nudge);return}if(n.introId){pe(null),W(n.introId);return}}n.href?o(n.href):n.type==="new-warm-path"?o("/accounts"):o("/warm-intros")},I=n.type==="waiting-target";return e.jsxs("div",{className:`home-attention-row${n.urgent?" urgent":""}`,onClick:I?void 0:m,role:I?void 0:"button",tabIndex:I?void 0:0,onKeyDown:I?void 0:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),m())},children:[e.jsxs("div",{className:"home-attention-body",children:[e.jsxs("div",{className:"home-attention-title-row",children:[e.jsx("div",{className:"home-attention-title",children:n.title}),n.badge?e.jsx("div",{className:`home-attention-badge ${n.badgeCls}`,children:n.badge}):null]}),e.jsx("div",{className:"home-attention-desc",children:n.desc})]}),I?e.jsxs("div",{className:"home-attention-actions",children:[e.jsx("button",{type:"button",className:"home-attention-ghost",onClick:()=>o("/warm-intros"),children:"Let it sit"}),e.jsx("button",{type:"button",className:"home-attention-solid",onClick:()=>m(),children:"Send nudge"})]}):e.jsx("button",{type:"button",className:"home-attention-solid",onClick:m,children:"Review"})]},`attn-${a}`)};return e.jsxs("div",{className:"page active page-home",children:[e.jsx(da,{value:oe,onChange:En}
17),e.jsx("div",{className:`home-viewswap${Ct?` is-${Ct}`:""}`,"data-view":oe,children:oe==="rooms"?e.jsx(s.Suspense,{fallback:e.jsx(nt,{variant:"page",message:"Opening your rooms…"}),children:e.jsx(ha,{})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"top-header home-mobile-header",children:[e.jsxs("div",{className:"header-left",children:[e.jsx("div",{className:"date-lbl",children:Ut}),e.jsxs("div",{className:"greeting greeting--mobile",children:[rn(),", ",Te,"."]})]}),e.jsxs("div",{className:"header-right",children:[e.jsx("button",{type:"button",className:"search-anyone-btn gp-btn-ghost",onClick:()=>o("/search"),children:"Search"}),e.jsx("button",{type:"button",className:"add-targets-btn add-targets-btn--icon",onClick:$t,"aria-label":"Add target accounts",title:"Add target accounts","aria-haspopup":"dialog",children:e.jsx(Ls,{size:19,strokeWidth:2,"aria-hidden":!0})}),e.jsx("button",{type:"button",className:"make-intro-btn make-intro-btn--icon",onClick:()=>x(!0),"aria-label":"Make an intro",title:"Make an intro",children:e.jsx(us,{size:19,strokeWidth:2,"aria-hidden":!0})})]})]}),C?e.jsx(nt,{variant:"page",message:"Loading your dashboard…"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"home-topbar",children:[e.jsxs("div",{className:"home-crumb",children:[e.jsx("span",{children:"Gemphere"}),e.jsx("span",{className:"home-crumb-sep",children:"/"}),e.jsx("span",{className:"home-crumb-here",children:"Home"})]}),e.jsx("div",{className:"home-topbar-spacer"}),e.jsx("div",{className:"home-topbar-date",children:Ut}),e.jsx("button",{type:"button",className:"home-btn home-btn--ghost home-btn--sm",onClick:()=>o("/search"),children:"Search"}),e.jsx("button",{type:"button",className:"home-btn home-btn--ghost home-btn--sm",onClick:$t,"aria-haspopup":"dialog",children:"+ Target accounts"}),e.jsx("button",{type:"button",className:"home-btn home-btn--sm",onClick:()=>x(!0),"aria-haspopup":"dialog",children:"Intros++"})]}),e.jsx("div",{className:"home-page",children:_t?e.jsxs("div",{className:"home-empty-state",children:[e.jsx("div",{className:"home-empty-icon",children:"👋"}),e.jsxs("h2",{className:"home-empty-title",children:["Welcome to Gemphere, ",Te,"."]}),e.jsx("p",{className:"home-empty-desc",children:"Your dashboard is empty because we haven't seen your network yet. Start with one of the steps below — most users get useful warm paths in under five minutes."}),e.jsxs("div",{className:"home-empty-grid",children:[e.jsxs("button",{type:"button",className:"home-empty-step",onClick:()=>o("/settings"),children:[e.jsx("div",{className:"home-empty-step-title",children:"1 · Connect Google Calendar"}),e.jsx("div",{className:"home-empty-step-sub",children:"Read-only calendar access helps us map who you've met and when."})]}),e.jsxs("button",{type:"button",className:"home-empty-step",onClick:()=>o("/settings"),children:[e.jsx("div",{className:"home-empty-step-title",children:"2 · Upload LinkedIn CSV"}),e.jsx("div",{className:"home-empty-step-sub",children:"Drop your Connections.csv export — we'll keep it on file."})]}),e.jsxs("button",{type:"button",className:"home-empty-step",onClick:()=>o("/profile"),children:[e.jsx("div",{className:"home-empty-step-title",children:"3 · Write your intro blurb"}),e.jsx("div",{className:"home-empty-step-sub",children:"One paragraph — what connectors forward when someone wants an intro."})]}),e.jsxs("button",{type:"button",className:"home-empty-step home-empty-step--primary",onClick:()=>B(!0),children:[e.jsx("div",{className:"home-empty-step-title",children:"+ Make your first intro"}),e.jsx("div",{className:"home-empty-step-sub",children:"You can also start by introducing two people you know."})]})]}),e.jsx("p",{className:"home-empty-foot",children:"This card disappears as soon as we have anything to show — usually after the first sync."})]}):e.jsxs(e.Fragment,{children:[Z&&ee.length>0&&we!==null?e.jsx(ea,{doors:ee,viewerName:ue,viewerPhoto:((Xt=l==null?void 0:l.viewer)==null?void 0:Xt.profilePhoto)??null,index:we%ee.length,onShuffle:Dn,onAsk:n=>{fe(null),ze(n)},onOpenAccounts:()=>o("/accounts"),onOpenWebProfile:Qe,onOpenInvite:Pe}):null,Z&&z&&z.length>0?e.jsx(Zs,{firstName:Te,viewerName:ue,viewerPhoto:((Jt=l==null?void 0:l.viewer)==null?void 0:Jt.profilePhoto)??null,items:z,openCount:Fn,askCount:Rn,onAct:Wn,onPass:Gn,onBrowseAll:Hn}):null,e.jsxs("section",{className:"home-sec home-sec--hello",children:[e.jsxs("h1",{className:"home-greeting",children:[rn(),", ",Te,"."]}),!Z&&Bn&&de&&e.jsx(ya,{checklist:de,onOpenInviteTeammates:()=>Nt(!0),onNavigate:n=>o(n)})]}),Z?e.jsx(la,{intros:Dt,attention:ye,reciprocity:(l==null?void 0:l.reciprocity)??null,onOpen:n=>o(n)}):null,e.jsxs("section",{className:"home-sec home-network-section",children:[e.jsx("div",{className:"home-sec-head",children:e.jsxs("div",{className:"home-sec-lead",children:[e.jsx("span",{className:"home-kicker",children:"Your network"}),e.jsx("h2",{className:"home-sec-title",children:"You're in better shape than you think."}),P&&P.totalContacts>0?e.jsxs("p",{className:"home-sec-sub",children:["Gem read ",R(P.totalContacts)," contacts and ranked each one by how often you actually talk."]}):e.jsx("p",{className:"home-sec-sub",children:"Everything Gem has mapped for you so far."})]})}),e.jsxs("div",{className:"home-stats",children:[e.jsxs("div",{className:"home-stat",children:[e.jsx("span",{className:"home-kicker",children:"Network size"}),e.jsx("div",{className:"home-stat-v",children:R(At)}),e.jsx("div",{className:"home-stat-k",children:"People we've mapped for you"})]}),e.jsxs("div",{className:"home-stat",children:[e.jsx("span",{className:"home-kicker",children:"Companies in reach"}),e.jsx("div",{className:"home-stat-v",children:R((P==null?void 0:P.companiesInReach)??0)}),e.jsx("div",{className:"home-stat-k",children:"Where you already know someone strong"})]}),e.jsxs("div",{className:"home-stat",children:[e.jsx("span",{className:"home-kicker",children:"Worth knowing better"}),e.jsx("div",{className:"home-stat-v home-stat-v--gold",children:R(On??0)}),e.jsx("div",{className:"home-stat-k",children:"Light contacts · thin or dormant"})]}),Bt?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"home-stat",children:[e.jsx("span",{className:"home-kicker",children:"Intros made"}),e.jsx("div",{className:"home-stat-v",children:R(((Qt=v==null?void 0:v.introsMade)==null?void 0:Qt.value)??0)}),e.jsx("div",{className:"home-stat-k",children:"Warm intros you've sent"})]}),e.jsxs("div",{className:"home-stat",children:[e.jsx("span",{className:"home-kicker",children:"Successful intros"}),e.jsx("div",{className:"home-stat-v home-stat-v--green",children:R(((Zt=v==null?void 0:v.meetingsBooked)==null?void 0:Zt.value)??0)}),e.jsx("div",{className:"home-stat-k",children:"Intros that were accepted"})]}),e.jsxs("div",{className:"home-stat",children:[e.jsx("span",{className:"home-kicker",children:"Active warm paths"}),e.jsx("div",{className:"home-stat-v",children:R(Je.value)}),e.jsx("div",{className:"home-stat-k",children:"Live paths into target accounts"})]})]}):null]}),P&&P.totalContacts>0&&(()=>{const n=Number(P.veryStrong||0),a=Number(P.strong||0),d=Number(P.solid||0),m=Number(P.light||0),I=n+a+d+m;if(I<=0)return null;const f=E=>I>0?Math.max(E>0?2:0,E/I*100):0;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"home-tier-bar",role:"img","aria-label":"Contact strength breakdown",children:[e.jsx("div",{className:"home-tier-seg very-strong",style:{width:`${f(n)}%`}}),e.jsx("div",{className:"home-tier-seg strong",style:{width:`${f(a)}%`}}),e.jsx("div",{className:"home-tier-seg solid",style:{width:`${f(d)}%`}}),e.jsx("div",{className:"home-tier-seg light",style:{width:`${f(m)}%`}})]}),e.jsxs("div",{className:"home-tier-legend",children:[e.jsxs("div",{className:"home-tier-legend-item",children:[e.jsx("b",{className:"home-tier-legend-num very-strong",children:R(n)}),e.jsx("span",{className:"home-tier-legend-lbl",children:"Very strong"})]}),e.jsxs("div",{className:"home-tier-legend-item",children:[e.jsx("b",{className:"home-tier-legend-num strong",children:R(a)}),e.jsx("span",{className:"home-tier-legend-lbl",children:"Strong"})]}),e.jsxs("div",{className:"home-tier-legend-item",children:[e.jsx("b",{className:"home-tier-legend-num solid",children:R(d)}),e.jsx("span",{className:"home-tier-legend-lbl",children:"Solid"})]}),e.jsxs("div",{className:"home-tier-legend-item",children:[e.jsx("b",{className:"home-tier-legend-num light",children:R(m)}),e.jsx("span",{className:"home-tier-legend-lbl",children:"Light"})]})]})]})})(),Bt?null:e.jsxs("p",{className:"home-quiet",children:["No intros sent yet — so warm paths, accepted intros and active threads are all at zero. That starts with a check-in above, or"," ",e.jsx("button",{type:"button",className:"home-linkbtn home-linkbtn--ink",onClick:()=>x(!0),children:"make your first intro"}),"."]})]}),ye.length>0&&e.jsxs("section",{className:`home-sec home-attention-section${Z&&z&&z.length>0?" home-sec--deck-handled":""}`,children:[e.jsxs("div",{className:"home-sec-head",children:[e.jsxs("div",{className:"home-sec-lead",children:[e.jsx("span",{className:"home-kicker home-kicker--gold",children:"Needs your attention"}),e.jsx("h2",{className:"home-sec-title",children:"Before anything else"})]}),e.jsxs("div",{className:"home-sec-n",children:[R(ye.length),e.jsx("span",{children:"Open"})]})]}),e.jsx("div",{className:"home-attention-list",children:ye.map((n,a)=>zn(n,a))})]}),Yn&&!Z&&e.jsxs("section",{className:"home-sec home-queue-section",children:[e.jsxs("div",{className:"home-sec-head",children:[e.jsxs("div",{className:"home-sec-lead",children:[e.jsx("span",{className:"home-kicker home-kicker--gold",children:"Today's queue"}),e.jsx("h2",{className:"home-sec-title",children:"Send a check-in"}),e.jsx("p",{className:"home-sec-sub",children:Lt.length>0||Y.length>0?"Light connections who can help with your active goals.":"Light connections who can move your accounts forward."})]}),e.jsxs("div",{className:"home-sec-n",children:[R(te.length),e.jsx("span",{children:"In queue"})]})]}),K&&me.length===0?e.jsx(nt,{variant:"section",message:"Loading your light connections for check-in…"}):te.length===0?e.jsx("div",{className:"home-queue-empty",children:"No connections in your check-in queue right now."}):e.jsx("div",{className:"home-queue-list",children:Rt.map(n=>{const a=(n.roleTitle||"").trim(),d=(n.companyName||"").trim(),m=a,I=d,f=[n.name,m,I].filter(
17Boolean).join(" · "),E=_n(n);return e.jsxs("div",{className:"home-queue-row",children:[e.jsx(gn,{userId:E,name:n.name,photo:n.profilePhoto,linkedinUrl:n.linkedinUrl,companyName:n.companyName,role:n.roleTitle,email:n.email,initials:n.initials,className:"home-queue-av-btn",avatarClassName:`home-queue-av ${n.cls}`,onOpenWebProfile:Qe,onOpenInvite:Pe}),e.jsx("div",{className:"home-queue-person",children:e.jsxs("div",{className:"home-queue-meta",title:f,children:[e.jsx(fn,{userId:E,name:n.name,photo:n.profilePhoto,linkedinUrl:n.linkedinUrl,companyName:n.companyName,role:n.roleTitle,email:n.email,className:"home-queue-name-text",onOpenWebProfile:Qe,onOpenInvite:Pe,children:n.name}),m?e.jsx("span",{className:"home-queue-role-text",children:m}):null]})}),e.jsx("div",{className:"home-queue-company",children:I}),e.jsx("div",{className:"home-queue-tier-col",children:e.jsx("span",{className:"home-queue-tier",children:"Light"})}),e.jsxs("div",{className:"home-queue-actions",children:[e.jsx("button",{type:"button",className:"home-queue-muted",onClick:()=>{const H=n.contactUserId&&n.contactUserId>0?n.contactUserId:null,F=n.contactImportId&&n.contactImportId>0?n.contactImportId:null;!H&&!F||(xt({contactName:n.name}),gt(H),yt(F))},children:"Mute 30d"}),e.jsx("button",{type:"button",className:"home-queue-action",onClick:()=>tt(n),children:"Send check-in"})]})]},`checkin-${n.userId}`)})}),qt>0||k?e.jsx("div",{className:"home-queue-more",children:e.jsx("button",{type:"button",className:"home-linkbtn",onClick:()=>w(n=>!n),children:k?"Show less":`Show ${R(qt)} more`})}):null]}),i?null:e.jsxs("div",{className:"home-pro",children:[e.jsxs("div",{className:"home-pro-t",children:[e.jsx("b",{children:"Gemphere Pro"})," — unlimited target accounts, connectors and warm-intro workflows."]}),e.jsx("button",{type:"button",className:"home-linkbtn",onClick:()=>o("/pricing"),children:"See what's included"}),e.jsx("button",{type:"button",className:"home-btn home-btn--ghost home-btn--sm",onClick:()=>o("/pricing"),children:"Upgrade"})]})]})}),S&&e.jsx("div",{className:"home-error-banner",children:S})]})]})}),e.jsx("div",{className:`home-scrim${N?" open":""}`,onClick:n=>{n.target===n.currentTarget&&x(!1)},children:e.jsxs("div",{className:"home-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"home-intro-sheet-title",children:[e.jsxs("div",{className:"home-sheet-head",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"home-intro-sheet-title",children:"Start an intro"}),e.jsx("p",{children:"Three ways to do it. Pick the one that sounds like you."})]}),e.jsx("button",{type:"button",className:"home-sheet-x","aria-label":"Close",onClick:()=>x(!1),children:"✕"})]}),e.jsxs("button",{type:"button",className:"home-opt",onClick:()=>{x(!1),ne("make"),B(!0)},children:[e.jsxs("span",{className:"home-mini",children:[e.jsx("i",{}),e.jsx("s",{children:"→"}),e.jsx("i",{className:"me"}),e.jsx("s",{children:"→"}),e.jsx("i",{})]}),e.jsxs("span",{className:"home-opt-t",children:[e.jsx("span",{className:"home-opt-n",children:"Introduce two people"}),e.jsx("span",{className:"home-opt-d",children:"You know two people who should meet. You put them together."})]}),e.jsx("span",{className:"home-opt-go",children:"→"})]}),e.jsxs("button",{type:"button",className:"home-opt",onClick:()=>{x(!1),ne("request"),B(!0)},children:[e.jsxs("span",{className:"home-mini",children:[e.jsx("i",{className:"me"}),e.jsx("s",{children:"→"}),e.jsx("i",{}),e.jsx("s",{children:"→"}),e.jsx("i",{className:"them"})]}),e.jsxs("span",{className:"home-opt-t",children:[e.jsx("span",{className:"home-opt-n",children:"Ask to meet someone"}),e.jsx("span",{className:"home-opt-d",children:"You want to meet a person. Ask someone in the middle to connect you."})]}),e.jsx("span",{className:"home-opt-go",children:"→"})]}),e.jsxs("button",{type:"button",className:"home-opt",onClick:()=>{x(!1),o("/accounts")},children:[e.jsxs("span",{className:"home-mini",children:[e.jsx("i",{className:"me"}),e.jsx("s",{children:"→"}),e.jsx("i",{className:"them"})]}),e.jsxs("span",{className:"home-opt-t",children:[e.jsx("span",{className:"home-opt-n",children:"Offer to open a door"}),e.jsx("span",{className:"home-opt-d",children:"You can get someone in somewhere. Offer it before they ask."})]}),e.jsx("span",{className:"home-opt-go",children:"→"})]})]})}),G?e.jsx(Ss,{open:!0,connectorName:G.via.name,connectorUserId:G.via.userId,targetName:G.target.name,targetUserId:G.target.userId,targetEmail:G.target.email,targetRole:G.target.role,targetCompany:G.companyName,targetPhoto:G.target.photo,viewerFullName:ue,viewerEmail:(t==null?void 0:t.email)??null,viewerUserId:(t==null?void 0:t.userId)??null,viewerToken:(t==null?void 0:t.accessToken)??null,connectorTargetPct:G.pct,connectorTargetTier:G.tier,sending:Tt,error:Mn,onClose:()=>{Tt||(ze(null),fe(null))},onSend:n=>Ln(G,n)}):null,e.jsx(hs,{open:O,initialMode:he,onClose:()=>{B(!1),h(null),ne("make")},preselectedFrom:(U==null?void 0:U.from)||void 0,preselectedTo:(U==null?void 0:U.to)||void 0,prefillNote:(U==null?void 0:U.note)||"",onSent:n=>{T(n),setTimeout(()=>T(null),4e3);const a=U==null?void 0:U.granolaOpportunityId;a&&(t!=null&&t.accessToken)&&tn(t.accessToken,a,"acted").then(()=>{y(d=>d&&{...d,attention:d.attention.filter(m=>{var I;return((I=m.granolaOpportunity)==null?void 0:I.id)!==a})})}).catch(()=>{}),h(null)}}),e.jsx(_s,{open:se!=null,introId:se,prefill:bn||void 0,onClose:()=>{W(null),pe(null)},onSent:n=>{T(n),setTimeout(()=>T(null),4e3),t!=null&&t.accessToken&&(t!=null&&t.userId)&&Ne(t.accessToken,t.userId).then(a=>y(a)).catch(()=>{})}}),e.jsx(Es,{open:ie!=null||re!=null,contactUserId:ie,contactImportId:re,prefill:vn||void 0,onClose:()=>{jn(null),kn(null),ct(null)},onScheduled:n=>{Ze(ie,re),T(n),setTimeout(()=>T(null),4e3)},onEmailSaved:n=>{ct(a=>a?{...a,contactEmail:n}:{contactEmail:n}),_(a=>a.map(d=>{const m=ie&&ie>0&&d.contactUserId===ie,I=re&&re>0&&d.contactImportId===re;return!m&&!I?d:{...d,email:n}}))}}),e.jsx(ws,{open:Oe!=null||De!=null,contactUserId:Oe,contactImportId:De,prefill:In||void 0,onClose:()=>{dt(null),mt(null),ut(null)},onSent:n=>{Ze(Oe,De),T(n),setTimeout(()=>T(null),4e3)}}),e.jsx(Bs,{open:be!=null,contact:be,onClose:()=>Le(null),onSaved:n=>
17{if(!be)return;const a=be;Le(null),et({userId:a.contactUserId||-(a.contactImportId||0),name:a.contactName,email:n,daysSilent:a.daysSilent??null,contactUserId:a.contactUserId??null,contactImportId:a.contactImportId??null,linkedinUrl:a.linkedinUrl??null,relevance:a.relevance??null,initials:"",cls:"",tag:"",tagCls:"",reason:"",dot:"red",profilePhoto:null},n),_(d=>d.map(m=>{const I=a.contactUserId&&m.contactUserId===a.contactUserId,f=a.contactImportId&&m.contactImportId===a.contactImportId;return!I&&!f?m:{...m,email:n}}))}}),e.jsx(Ps,{open:pt!=null||ft!=null,contactUserId:pt,contactImportId:ft,prefill:Sn||void 0,onClose:()=>{gt(null),yt(null),xt(null)},onMuted:(n,a)=>{Ze(a.contactUserId,a.contactImportId),a.contactUserId&&Be(d=>{const m=new Set(d);return m.add(a.contactUserId),m}),a.contactImportId&&Ye(d=>{const m=new Set(d);return m.add(a.contactImportId),m}),T(n),setTimeout(()=>T(null),4e3),t!=null&&t.accessToken&&(t!=null&&t.userId)&&Ne(t.accessToken,t.userId).then(d=>{y(d),Be(new Set(d.mutedContactUserIds||[])),Ye(new Set(d.mutedContactImportIds||[]))}).catch(()=>{})}}),bt&&e.jsx(Ts,{profile:bt,onClose:()=>Fe(null),onInvite:(n,a)=>{Fe(null),Pe(n,a)}}),e.jsx(Cs,{open:ae!=null,name:(ae==null?void 0:ae.name)||"",email:je,onEmailChange:ke,mode:je.trim()?"send":"no_email",inviterName:ue,personalNote:qe,onPersonalNoteChange:jt,sending:kt,onClose:()=>{kt||(Re(null),ke(""))},onSendInvite:qn}),e.jsx(As,{open:Ke,onClose:Un,onAdd:An,busy:Ve,freeTier:r&&Mt!=null?{used:Mt,limit:nn}:null,disclaimer:$n?e.jsxs(e.Fragment,{children:[e.jsx("b",{children:"Target accounts"})," are the companies and people you want to reach. Name them and Gemphere searches your network for the warmest path to each — who you already know there, and who can introduce you. You can add more or change them any time from Accounts."]}):null}),e.jsx(Ms,{open:Tn,onClose:()=>Nt(!1),onSent:n=>{T(`Invite${n===1?"":"s"} sent to ${n} teammate${n===1?"":"s"}`),setTimeout(()=>T(null),4e3),t!=null&&t.accessToken&&(t!=null&&t.userId)&&Ne(t.accessToken,t.userId).then(a=>y(a)).catch(()=>{})}}),j&&e.jsx("div",{className:"toast-stack",id:"toast-stack",children:e.jsxs("div",{className:"toast",children:[e.jsx("span",{className:"check",children:"✓"}),e.jsx("span",{children:j})]})})]})}const mn=["gmail","blurb","teammates","linkedin","portfolio"];function ya({checklist:t,onNavigate:i,onOpenInviteTeammates:r}){const[o,c]=s.useState(!1),N=(yn()?mn.filter(p=>p!=="linkedin"):mn).map(p=>t.items.find(S=>S.key===p)).filter(p=>!!p),x=N.filter(p=>p.done).length,k=N.length,w=k>0?Math.round(x/k*100):0,l=N.find(p=>!p.done)||null,y=p=>{if(p.key==="teammates"){r();return}if(p.key==="phone_book"){window.alert("Import your phone book from the Gemphere iOS or Android app — open Home → Finish setting up Gem → Import.");return}p.href&&i(p.href)},C=p=>p.key==="portfolio"&&!p.done&&p.count!=null?`Add ${p.count>0?p.count:""}`.trim():p.ctaLabel;return e.jsxs("div",{className:"home-strip",children:[e.jsxs("div",{className:"home-strip-head",children:[e.jsxs("div",{className:"home-strip-prog",children:[e.jsx("span",{className:"home-ring",style:{background:`conic-gradient(var(--gp-green) 0 ${w*3.6}deg, var(--gp-border-solid) ${w*3.6}deg 360deg)`},children:e.jsx("i",{})}),e.jsxs("span",{className:"home-kicker",children:[x," / ",k]})]}),e.jsx("div",{className:"home-strip-copy",children:l?e.jsxs(e.Fragment,{children:["Next: ",e.jsx("b",{children:l.title.toLowerCase()})," — ",l.subTodo]}):e.jsx(e.Fragment,{children:"You're all set — every setup step is done."})}),e.jsxs("div",{className:"home-strip-actions",children:[e.jsx("button",{type:"button",className:"home-linkbtn",onClick:()=>c(p=>!p),"aria-expanded":o,children:o?"Hide steps":"All steps"}),l?e.jsx("button",{type:"button",className:"home-btn home-btn--sm",onClick:()=>y(l),children:C(l)}):null]})]}),e.jsx("div",{className:`home-steps${o?" open":""}`,children:N.map(p=>e.jsxs("div",{className:`home-step${p.done?" is-done":""}`,children:[e.jsx("span",{className:`home-dot${p.done?" done":""}`,children:p.done?"✓":""}),e.jsxs("div",{className:"home-step-txt",children:[e.jsx("div",{className:"home-step-t",children:p.title}),e.jsx("div",{className:"home-step-s",children:p.done?p.subDone:p.subTodo})]}),p.done?e.jsx("span",{className:"home-kicker",children:"Done"}):e.jsxs(e.Fragment,{children:[l&&l.key===p.key?e.jsx("span",{className:"home-step-why",children:"Do this next"}):null,e.jsx("button",{type:"button",className:"home-btn home-btn--ghost home-btn--sm",onClick:()=>y(p),children:C(p)})]})]},p.key))})]})}export{La 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.