PageSourceSearch

https://chat.lindy.ai/assets/homeView-Bps0qr-P.js

js lindy.ai collected 2026-09-24 18:01:48 UTC 109,804 bytes, 12 lines download raw bytes

1import{w as At,b as pt,j as e,r as l,c as E,v as w,n as he,y as ht,d as ae,P as Ht}from"./entry-BCe1jibU.js";import{e as M}from"./graphql-4Y3Cu4kt.js";import{bJ as ft,bK as Ve,bL as Dt,bM as Ut,bN as $t,bO as zt,bP as Pt,bQ as Wt,bR as Ft,bS as Vt,bT as Kt,bU as Gt,c as Ke,bV as Bt,aj as qt,bW as Yt,bX as Zt,bY as Qt,bZ as Xt,b_ as Jt}from"./operations-Dn0xY-u2.js";import{an as es,d as je,X as xe,aS as ts,E as xt,S as Ne,bu as ss,u as ge,bv as Ge,c as fe,P as gt,br as ns,O as as,bh as Be,au as Ue,v as is,R as rs,bw as ls}from"./icons-B6i7AQrN.js";import{M as os}from"./mentionEditor-BBlMtVGI.js";import{M as cs}from"./micButton-CAEUXqUg.js";import{s as q}from"./toast-Blm9fZ-n.js";import{T as ds}from"./toolIcon-DkFE-dA4.js";import{r as ms}from"./workspace-DuK6VJcz.js";import{l as Ae,i as us}from"./appShell-CCaBeCh8.js";import{e as ps}from"./demoViews-I9nXfD3R.js";import{c as bt,t as qe,C as hs,M as fs}from"./assistantComposer-BkYp1e5C.js";import{M as xs}from"./Markdown-Chr2vSG4.js";import{s as gs}from"./subscribeAuthChanges-CgMe3gJA.js";import{a as $e,L as ze}from"./lindyAssistant-BUov6hLE.js";import{S as bs,a as ws}from"./authHelpers-TcdcUMOr.js";import{S as Oe}from"./integrationSettingsHelpers-54mhpjZc.js";import{c as re}from"./utils-DTwRz6Bg.js";import{F as wt}from"./XMarkIcon-CqPeZFAz.js";import{F as kt}from"./CheckIcon-CzLafwX6.js";import{F as Pe}from"./ChevronRightIcon-X5e-FnER.js";import{i as ks}from"./emailDomain-BoDAetK6.js";import{s as ys}from"./string-CAgiWQQB.js";import{S as js,c as yt}from"./auth-Bzq-__dq.js";import{o as z}from"./index-BTadJ-54.js";import{f as vs,h as Ye,i as Ns,P as Ss,D as Cs,j as Is,C as Ms}from"./core.esm-DRQamKQ1.js";import{s as Ts,S as _s,u as Os,a as Es}from"./sortable.esm-DNwCMT_7.js";import{b as Ls}from"./routinesModel-0q8wx0-o.js";import{R as Rs,f as As}from"./routineUi-BYz7xRu_.js";import{W as Hs}from"./membersSection-C6n1QhRy.js";import{g as Ds,C as Us,a as $s,b as zs,e as Ps,c as Ws,f as Fs,A as Vs,i as Ks}from"./composerAttachments-CIDm89cC.js";import{c as Ze}from"./taskHref-nEPmDl_1.js";import{F as Gs}from"./XMarkIcon-CDVX01SD.js";import{c as jt}from"./createLucideIcon-Br0wfJyU.js";import{S,a as Bs}from"./index-DBAwmiAf.js";import{D as qs,a as Ys,c as Zs,h as Qs,b as Xs,j as Js,M as en,f as tn,g as sn}from"./menu-bRNVZU59.js";import{F as ve}from"./inputs-P8NVmkgg.js";import{S as nn,T as vt,b as Nt,a as St}from"./NativeButton-DgYgvC9L.js";import{F as an}from"./featureFlags-DrjUGcLa.js";import{m as rn,o as I,r as $,a as te}from"./mobx.esm-B0_cIGIu.js";import{r as ln}from"./index-pNUg2pyP.js";import"./Scrollable-BvCr7Sb1.js";import"./bundle-mjs-CSqCgoPn.js";import"./FolderIcon-DXllGfWg.js";import"./ToolIconRegistry-p-nBYDMn.js";import"./deepGram-CIWuLXh2.js";import"./pathPrefix-DU8I2oCO.js";import"./types-CjJu7saM.js";import"./ids-Cfn8POY6.js";import"./index.browser-BEMxqJOT.js";import"./tooltip-BquztOjk.js";import"./InformationCircleIcon-DCmSqGbl.js";import"./nativeShell-BYp7F5OS.js";import"./shellCache-Br8NUPQk.js";import"./billing-1POuo_sH.js";import"./billing-XWNTP5pu.js";import"./EvalCloneMarker-DeoTUGFR.js";import"./speechToText-BOPKEWM6.js";import"./ExhaustiveSwitchError-Dwg2PnPx.js";import"./index-CovN8vff.js";import"./index-PPXUehgt.js";import"./index-BfQivbWu.js";import"./index-C5fIsbac.js";import"./index-tAHLmhMY.js";import"./buttons-DWoFMrEm.js";import"./buttonStyles-DgzPUjES.js";import"./sms-BxLHIHZE.js";import"./TrashCanIcon-Bww9VYI2.js";import"./Input-DpJ542X9.js";import"./ConfirmDialog-YvAQicdu.js";import"./DropdownMenu-Blck2ZPc.js";import"./ChevronIcon-BZD4A-JD.js";import"./index-DCFPOf8O.js";import"./index-Bnm1XHl9.js";import"./index-D-697TjG.js";import"./index-CeqHvuZF.js";import"./globalNodeIds-DS3fRevW.js";import"./sidebar-ZmIb1TzO.js";import"./createRealtimeChannelNew-D68-wdqB.js";import"./index-BFoJ1117.js";import"./models-DiMb92RR.js";import"./index-CwQt3Ija.js";import"./hostedMcpProviders-R1ropXKE.js";import"./lindyTool-CidTJeMk.js";import"./clsx-B-dksMZM.js";import"./triggers-HFVGib5u.js";import"./types-CcG5mtI4.js";import"./filesUi-CmxDdKBk.js";import"./plans-DBY7IhgS.js";import"./eaShared-VVNwDwbG.js";import"./agentAvatar-D0lfBDeW.js";import"./agentIcons-DUfqqt0z.js";import"./SettingsSectionCard-DRF41sRq.js";import"./SettingsSectionCardHeader-ZJe9Ry7J.js";import"./settingsFields-CBcrFKjo.js";import"./ui-lnpY3Gpn.js";import"./billingAvailabilityNotice-BG7bIF6D.js";import"./eaUpgradeModal-BQavemlL.js";import"./validTeamPlan--aSz5CNS.js";import"./Label-BS5ixDi-.js";import"./label-BX45D0a9.js";import"./Switch-C1ezZKV-.js";import"./index-DO3hEf8l.js";import"./ModalTitle-Bx4lfuCU.js";import"./ScrollViewport-BGHCf1U1.js";import"./index-CsAuUZ77.js";import"./IconButton-D9ezL2G0.js";import"./fuse-DPyu62bB.js";import"./MagnifyingGlassIcon-F8E30eWB.js";import"./ContextMenuText-cLuP20-p.js";import"./styles-Dn-pNByF.js";import"./ContextMenuWrapper-z1mzCU-h.js";import"./index-Drvcn5hI.js";import"./MultiSelect-Cw8ZZY1e.js";import"./chevron-down-DbYmfRNd.js";import"./Separator-49M3hpgh.js";import"./eventHandlers-DVpd_s_d.js";import"./Badge-DmQRKt8L.js";import"./index-B8k91cqS.js";import"./_baseIteratee-BdIvlP1b.js";import"./_baseIsEqual-Cw5zAbMO.js";import"./toString-DVABJY7q.js";import"./isSymbol-Br3Fhm6g.js";import"./isObject-C3e4t58V.js";import"./Select-sqN9JgKC.js";import"./AgentAvatar-CW8DN1RZ.js";import"./AgentIcons-TsdMrlpV.js";import"./graphql-BGATo_9y.js";
1import"./utils-De61D40x.js";import"./Checkbox-DY6v2YXb.js";import"./InfoTooltip-fSTMEvQL.js";import"./InformationCircleIcon-khhuha0d.js";import"./numbers-D0Jg2fTS.js";import"./useAutoSizeTextArea-CxKTVncl.js";import"./ChevronRightIcon-BBvocy8f.js";import"./index-B7k7stR0.js";/**
2 * @license lucide-react v0.536.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const on=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],cn=jt("book-marked",on);/**
7 * @license lucide-react v0.536.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const dn=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]],mn=jt("square-activity",dn),un=new Intl.DateTimeFormat("en-US",{weekday:"short",month:"short",day:"numeric"}),pn=s=>{const t=new Date(String(s));return Number.isNaN(t.getTime())?"":un.format(t)},hn=s=>s?.trim().split(/\s+/)[0]??null,ye="lindy.teammateMigration.resume",fn=10*60*1e3;function le(s,t){return At(s,t)}function Qe(s,t,n){const a=new URLSearchParams({workspaceId:t,provider:s==="google"?"googleAuth":"microsoftOutlookAuth",scopes:encodeURIComponent(JSON.stringify(s==="google"?$e:ze)),markLindyAssistantConnectComplete:"true"});return n&&a.set("authId",n),`${pt.apiOrigin}/api/oauth2/redirect?${a.toString()}`}function Xe(s,t=window.location.origin){if(!s)return null;if(s.startsWith("/")&&!s.startsWith("//"))try{const n=new URL(s,t);return n.origin!==t?null:{kind:"internal",path:`${n.pathname}${n.search}${n.hash}`}}catch{return null}try{const n=new URL(s);return n.protocol!=="https:"&&n.protocol!=="http:"?null:n.origin===t?{kind:"internal",path:`${n.pathname}${n.search}${n.hash}`}:{kind:"external",url:n.toString()}}catch{return null}}function xn(s,t){const n=new URL("/api/oauth/lindyAssistantSlack/install",pt.apiOrigin);return n.searchParams.set("workspaceId",s),n.searchParams.set("redirectTo",le("/home",t)),n.searchParams.set("purpose","teammate_migration"),n.toString()}function gn(s){try{sessionStorage.setItem(ye,JSON.stringify({at:Date.now(),workspaceUrl:s}))}catch{return}}function bn(s){try{const t=sessionStorage.getItem(ye);if(!t)return!1;const n=JSON.parse(t);return n.workspaceUrl!==s?!1:(sessionStorage.removeItem(ye),typeof n.at=="number"&&Date.now()-n.at<fn)}catch{return sessionStorage.removeItem(ye),!1}}function wn(){const s=new URL(window.location.href),t=s.searchParams.get("lindyAssistantSlack");if(t!=="success"&&t!=="error"&&t!=="skipped")return null;const n=s.searchParams.get("lindyAssistantSlackError")??void 0;for(const a of["lindyAssistantSlack","lindyAssistantSlackError","lindyAssistantSlackSkippedReason","lindyAssistantSlackWarning"])s.searchParams.delete(a);return window.history.replaceState(window.history.state,"",s),{status:t,errorMessage:t==="error"?kn(n):null}}function kn(s){switch(s){case"allowlist_not_configured":case"disabled":case"not_configured":case"team_allowlist_required":case"team_not_allowed":return"Slack setup isn't available for this workspace yet.";case"enterprise_not_supported":return"Organization-wide Slack installs aren't supported yet. Install Lindy in a single workspace instead.";case"install_already_connected":return"This Slack workspace is already connected to another Lindy workspace.";case"invalid_purpose":case"migration_unavailable":return"This Lindy Teammate setup isn't available anymore. Refresh and try again.";case"plan_ineligible":return"Lindy's Slack integration requires a paid Slack plan. Upgrade Slack, then connect again.";case"plan_verification_failed":return"Lindy couldn't verify your Slack plan. Try connecting Slack again in a few minutes.";default:return"We couldn't connect Slack. Try again."}}const yn="/assets/setup_google-DYCocXrC.png",jn="/assets/setup_google_chrome-CCe-C_eQ.png",vn="/assets/setup_imessage-SXkL0vh7.png",Nn="/assets/setup_invite_team-BVIiwMrd.png",Sn="/assets/setup_slack-C2rQHNDy.png",Cn={google:yn,slack:Sn,imessage:vn,"invite-team":Nn,chrome:jn};function pe({name:s}){const t=Cn[s];return e.jsx("img",{src:t,alt:"","aria-hidden":!0,width:20,height:20,className:"size-5 shrink-0",draggable:!1})}const Ct="transition-colors hover:bg-black/[0.06] active:bg-black/[0.09] dar
11k:hover:bg-white/[0.08] dark:active:bg-white/[0.12]",In="transition-colors hover:bg-slate-3 active:bg-slate-4 dark:hover:bg-white/[0.06] dark:active:bg-white/[0.10]",Se="text-base font-semibold leading-6";function Ce({children:s,className:t}){return e.jsx("div",{className:re("group/bento rounded-2xl bg-card p-4 ring-[0.5px] ring-black/[0.12]","shadow-[0_1px_4px_rgba(0,0,0,0.08)]","dark:shadow-none dark:ring-white/[0.06]",t),children:s})}function Mn({completed:s,total:t}){if(s===t&&t>0)return e.jsx("div",{className:"flex size-[18px] items-center justify-center rounded-full bg-green-9",children:e.jsx(kt,{className:"size-4 text-white"})});const n=18,a=2,i=(n-a)/2,r=2*Math.PI*i,o=t>0?s/t:0,c=r*(1-o);return e.jsxs("svg",{width:n,height:n,viewBox:`0 0 ${n} ${n}`,className:"shrink-0 -rotate-90",children:[e.jsx("circle",{cx:n/2,cy:n/2,r:i,fill:"none",stroke:"currentColor",strokeWidth:a,className:"text-black/[0.12] dark:text-white/20"}),e.jsx("circle",{cx:n/2,cy:n/2,r:i,fill:"none",stroke:"currentColor",strokeWidth:a,strokeDasharray:r,strokeDashoffset:c,strokeLinecap:"round",className:"text-blue-9 transition-[stroke-dashoffset] delay-500 duration-500 ease-out"})]})}function Tn({title:s,completedCount:t,totalCount:n,onDismiss:a,children:i}){return e.jsx(Ce,{className:"w-full overflow-hidden",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 pl-1",children:[e.jsx(Mn,{completed:t,total:n}),e.jsx("span",{className:`flex-1 text-slate-12 ${Se}`,children:s}),a&&e.jsx("button",{onClick:a,className:"flex size-5 items-center justify-center rounded-md text-slate-10 transition-colors hover:text-slate-12","aria-label":"Dismiss",children:e.jsx(wt,{className:"size-5"})})]}),e.jsx("div",{className:"flex flex-col gap-2",children:i})]})})}function _n({status:s,isLast:t=!1,disabled:n=!1,onClick:a,children:i}){const r=s==="completed",o=!!a,c="flex flex-1 items-start gap-2 rounded-lg bg-transparent py-2.5 pl-3 pr-2"+(o?` cursor-pointer ${In}`:"");return e.jsxs("div",{className:"relative flex gap-1",children:[e.jsxs("div",{className:"relative flex flex-col items-center pt-2.5",children:[r?e.jsx("div",{className:"relative z-10 flex size-[18px] animate-check-pop items-center justify-center rounded-full bg-green-9",children:e.jsx(kt,{className:"size-4 text-white"})}):e.jsx("div",{className:"relative z-10 size-[18px] rounded-full border border-black/[0.08] bg-white dark:border-0 dark:bg-white/[0.08]"}),!t&&e.jsx("div",{className:"absolute left-1/2 top-[32px] h-[calc(100%-20px)] w-px -translate-x-1/2 border-l border-black/[0.08] dark:border-white/[0.08]"})]}),o?e.jsx("button",{type:"button",disabled:n,onClick:a,className:c,children:i}):e.jsx("div",{className:c,children:i})]})}function On({children:s}){return e.jsx("div",{className:"flex min-w-0 flex-1 items-start gap-2",children:s})}function En({children:s}){return e.jsx("span",{className:"min-w-0 text-left text-sm font-medium text-slate-12 dark:text-white",children:s})}function Ln({children:s}){return e.jsx("span",{className:"shrink-0 whitespace-nowrap text-left text-sm text-slate-10 dark:text-slate-11",children:s})}function Rn({children:s}){return e.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-sm font-medium text-[#6D635B] dark:text-slate-11",children:[s,e.jsx(Pe,{className:"size-5"})]})}const An=18e4,Hn=5e3,Dn=2e3,Un=3,$n=5e3,zn=3e4,He="workflow-discovery-refresh",Pn=3e3,ue="inl
11ine-flex min-h-10 items-center justify-center rounded-full bg-slate-12 px-5 text-sm font-medium text-slate-1 transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",It="inline-flex min-h-10 items-center justify-center rounded-full border border-slate-6 bg-panel px-5 text-sm font-medium text-slate-12 transition hover:bg-slate-2 disabled:cursor-not-allowed disabled:opacity-50",Ie="inline-flex min-h-9 items-center justify-center rounded-lg px-3 text-sm font-medium text-slate-11 transition hover:bg-slate-3 hover:text-slate-12 disabled:opacity-50",Wn="https://chromewebstore.google.com/detail/lindy/fohjedcmhibnopejedjaffgmmkoflbam",Fn=[],Je={migration:null,shouldShowBanner:!1},Vn=["Slack","Knowledge","Tools","Invite","All set"],Kn=["Connect Slack so Lindy can learn how your team already works.","Review what it picked up about your company, then add your tools.","Invite the people you work with into the same workspace context."],Gn=["Lindy will use Slack context to understand projects and owners.","Connected tools let Lindy help with follow-ups, scheduling, and handoffs.","Invited teammates can onboard into the same workspace context."];function De(s){return s==="queued"||s==="connected"||s==="completed"}function Bn(s,t){const n=s.migration;return n?.status==="completed"||n?.currentStep==="all_set"?"all_set":n?.status!=="in_progress"?t==="error"?"slack":"intro":n.currentStep==="slack"&&De(n.sourceStatuses.slack.status)?"learnings":n.currentStep}function qn(s){return s==="intro"||s==="slack"?1:s==="learnings"?2:s==="tools"?3:s==="invite_team"?4:5}function Yn({data:s,workspaceUrl:t,onRefresh:n}){const a=s.me.teammateOnboardingMigration??Je,[i,r]=l.useState(a),[o,c]=l.useState(!1),[d,m]=l.useState(!1),[u,g]=l.useState(null),[T,f]=l.useState(null),y=s.me.id,C=s.workspace?.id??s.me.workspaceMembershipFor?.workspace.id??null,x=Bn(i,T?.status),j=i.migration?.status==="in_progress";l.useEffect(()=>{r(a)},[a]);const h=l.useCallback(async()=>{try{const k=n?await n():C?await M(ft,{workspaceId:C,workspaceUrl:t}):null;if(!k)return null;const _=k.me.teammateOnboardingMigration??Je;return r(_),_}catch(k){return E(k),null}},[n,C,t]);l.useEffect(()=>{const k=wn(),_=bn(t);f(k),(_||k)&&(a.migration?.status==="in_progress"||k?.status==="error")&&c(!0),k&&w(h())},[a.migration?.status,h,t]),l.useEffect(()=>{const k=_=>{_.persisted&&w(h())};return window.addEventListener("pageshow",k),()=>window.removeEventListener("pageshow",k)},[h]),l.useEffect(()=>{if(!o)return;const k=_=>{_.key==="Escape"&&c(!1)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[o]);const p=l.useCallback(async(k,_)=>{if(u)return!1;g(k);try{return r(await _()),!0}catch(U){E(U),q({id:"teammate-migration",level:"danger",label:"We couldn't update teammate setup. Try again."});const O=await h();return O&&!O.shouldShowBanner&&O.migration?.status!=="completed"&&(c(!1),m(!0)),!1}finally{g(null)}},[u,h]),L=l.useCallback(()=>p("start",async()=>(await M(Ve,{input:{identityId:y,workspaceUrl:t}})).startTeammateOnboardingMigration),[y,p,t]),V=l.useCallback(()=>{w((async()=>{await p("snooze",async()=>(await M(Dt,{input:{identityId:y,workspaceUrl:t}})).snoozeTeammateOnboardingMigration)&&m(!0)})())},[y,p,t]),v=l.useCallback(k=>p("advance",async()=>(await M(Ut,{input:{identityId:y,step:k,workspaceUrl:t}})).advanceTeammateOnboardingMigration),[y,p,t]),K=l.useCallback(()=>p("complete",async()=>(await M($t,{input:{identityId:y,workspaceUrl:t}})).completeTeammateOnboardingMigration),[y,p,t]),R=l.useCallback(()=>{!C||u||w((async()=>{try{if(i.migration?.status!=="in_progress"&&!await p("connect-slack",async()=>(await M(Ve,{input:{identityId:y,workspaceUrl:t}})).startTeammateOnboardingMigration))return;gn(t),window.location.assign(xn(C,t))}catch(k){E(k),q({id:"teammate-migration",level:"danger",label:"We couldn't connect Slack. Try again."})}})())},[y,u,p,i.migration?.status,C,t]),D=l.useCallback(k=>{k.currentTarget===k.target&&c(!1)},[]),P=l.useCallback(()=>c(!0),[]),G=l.useCallback(()=>c(!1),[]),Z=l.useCallback(()=>c(!1),[]),Q=l.useCallback(()=>w(L()),[L]),X=l.useCallback(()=>w(v("learnings")),[v]),J=l.useCallback(()=>{w((async()=>{i.migration?.currentStep==="slack"&&!await v("learnings")||await v("tools")})())},[v,i.migration?.currentStep]),W=l.useCallback(()=>w(v("invite_team")),[v]),B=l.useCallback(()=>w(K()),[K]),ie=l.useCallback(()=>v("learnings"),[v]),A=s.me.suggestedTeamInvites?.suggestions??Fn;return d||!i.shouldShowBanner&&!o?null:e.jsxs(e.Fragment,{children:[i.shouldShowBanner?e.jsxs("div",{className:"flex w-full flex-col gap-4 roun
11ded-xl border border-black/[0.12] bg-panel p-4 shadow-[0_1px_2px_rgba(0,0,0,0.05)] sm:flex-row sm:items-center dark:border-white/[0.08]","data-testid":"teammate-migration-banner",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx("div",{className:"flex size-10 items-center justify-center overflow-hidden rounded-lg border border-[#e0b44f]/60 bg-gradient-to-br from-[#fff7d8] via-[#ffe8a3] to-[#f5c45b]",children:e.jsx(es,{className:"size-6 -translate-x-px text-black"})}),e.jsx("span",{className:"absolute bottom-0 -right-1.5 flex size-6 items-center justify-center rounded-full border-[1.5px] border-panel bg-white dark:border-white/[0.08]",children:e.jsx(je,{className:"size-5"})})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"text-base font-semibold text-slate-12",children:"Meet your new teammate"}),e.jsx("p",{className:"text-sm text-slate-11",children:"Drop it a Slack message, get real work back"})]}),j?null:e.jsx("button",{type:"button",className:Ie,disabled:u!==null,onClick:V,children:"Maybe later"}),e.jsx("button",{type:"button",className:ue,disabled:u!==null,onClick:P,children:j?"Continue setup":"Get started"})]}):null,o&&C?e.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-black/45 p-0 backdrop-blur-sm sm:items-center sm:p-4","data-testid":"teammate-migration-modal",onClick:D,children:e.jsxs("div",{"aria-labelledby":"teammate-migration-title","aria-modal":"true",className:"relative flex max-h-[calc(100vh-8px)] w-full max-w-[663px] flex-col overflow-hidden rounded-t-[20px] bg-panel shadow-xl ring-[0.5px] ring-black/15 sm:rounded-[20px] dark:ring-white/10",role:"dialog",children:[e.jsx("button",{type:"button","aria-label":"Close teammate setup",className:"absolute right-4 top-4 z-10 flex size-8 items-center justify-center rounded-lg text-slate-10 hover:bg-slate-3 hover:text-slate-12",onClick:G,children:e.jsx(xe,{className:"size-5"})}),e.jsx(Zn,{screen:x}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-8 pb-8",children:[x==="intro"?e.jsx(Qn,{busy:u==="start",onStart:Q}):null,x==="slack"?e.jsx(Xn,{busy:u!==null,callback:T,onConnect:R,onSkip:X}):null,x==="learnings"?e.jsx(Jn,{busy:u!==null,currentStep:i.migration?.currentStep??null,slackStatus:i.migration?.sourceStatuses.slack.status??"not_started",workspaceId:C,workspaceUrl:t,onContinue:J,onReveal:ie}):null,x==="tools"?e.jsx(aa,{auths:s.me.auth,busy:u!==null,workspaceUrl:t,onRefresh:h,onContinue:W}):null,x==="invite_team"?e.jsx(ia,{busy:u!==null,companyDomain:s.me.suggestedTeamInvites?.companyDomain??null,suggestions:A,userEmail:s.me.email,workspaceId:C,onComplete:B}):null,x==="all_set"?e.jsx(ra,{memoryStatus:i.migration?.sourceStatuses.memoryMigration.status??"not_started",onDone:Z}):null]})]})}):null]})}function Zn({screen:s}){const t=qn(s);return e.jsx("ol",{className:"grid grid-cols-5 gap-2 px-8 pb-8 pt-8","aria-label":"Setup progress",children:Vn.map((n,a)=>{const i=a+1;return e.jsxs("li",{className:i<=t?"":"opacity-45","aria-current":i===t?"step":void 0,children:[e.jsx("div",{className:`h-0.5 ${i<=t?"bg-slate-12":"bg-slate-5"}`}),e.jsxs("span",{className:"mt-2 block truncate text-xs font-medium text-slate-10",children:[i,". ",n]})]},n)})})}function Qn({busy:s,onStart:t}){return e.jsxs("div",{className:"flex min-h-[430px] flex-col",children:[e.jsx("h2",{className:"mb-3 text-xl font-medium leading-8 text-slate-12",id:"teammate-migration-title",children:"Onboard to Lindy, teammate"}),e.jsx("p",{className:"mb-8 text-base leading-7 text-slate-11",children:"Lindy is becoming a teammate your whole company can work with. A few short steps and your workspace moves over."}),e.jsx("div",{className:"flex flex-col gap-3",children:Kn.map(n=>e.jsx("div",{className:"rounded-xl bg-slate-2 px-4 py-3 text-sm leading-5 text-slate-12",children:n},n))}),e.jsxs("button",{type:"button",className:`${ue} mt-auto self-start`,"data-testid":"teammate-migration-intro-start",disabled:s,onClick:t,children:[s?e.jsx(Ne,{className:"mr-2 size-4"}):null,"Get started"]})]})}function Xn({busy:s,callback:t,onConnect:n,onSkip:a}){const i=t?.status==="skipped"?"Slack wasn't connected. You can add it now or skip for this setup.":t?.status==="success"?"Slack is connected. Lindy will keep reading it in the background.":null;return e.jsxs("div",{className:"flex min-h-[430px] flex-col",children:[e.jsxs("div",{className:"mb-6 flex h-32 items-center justify-center gap-8 rounded-xl bg-slate-2",children:[e.jsx("span",{className:"flex size-16 items-center justify-center rounded-xl bg-panel shadow-sm",children:e.jsx(je,{className:"size-8"})}),e.jsx("span",{className:"text-2xl text-slate-8",children:"•••"}),e.jsx("span",{className:"flex size-16 items-center justify-center rounded-xl bg-panel shadow-sm",children:e.jsx("img",{className:"size-8 rounded",src:"/signup-lindy-avatar.png",alt:""})})]}),e.jsx("h2",{className:"text-xl font-medium leading-8 text-slate-12",id:"teammate-migration-title",children:"Connect Slack to get started"}),e.jsx("p",{className:"mb-6 text-base leading-7 text-slate-11",children:"Lindy Teammate needs Slack access to help your team where it works every day."}),e.jsxs("div",{className:"space-y-3 text-sm text-slate-12",children:[e.jsxs("p",{className:"flex items-center gap-3",children:[e.jsx(ss,{className:"size-5 text-slate-10"}),"Data encrypted at rest and in transit."]}),e.jsxs("p",{className:"flex items-center gap-3",children:[e.jsx(ge,{className:"size-5 text-slate-10"}),"GDPR, SOC2, and HIPAA compliant"]})]}),t?.errorMessage?e.jsx("p",{className:"mt-5 rounded-lg bg-red-3 px-3 py-2 text-sm text-red-11",role:"alert",children:t.errorMessage}):null,i?e.jsx("p",{className:"mt-5 rounded-lg bg-slate-2 px-3 py-2 text-sm text-slate-11",children:i}):null,e.jsxs("div",{className:"mt-auto flex items-center gap-3 pt-8",children:[e.jsxs("button",{type:"button",className:It,disabled:s,onClick:n,children:[e.jsx(je,{className:"mr-2 size-5"}),"Add to Slack"]}),e.jsx("button",{type:"button",className:Ie,disabled:s,onClick:a,children:"Skip for now"})]})]})}
11function Jn({busy:s,currentStep:t,slackStatus:n,workspaceId:a,workspaceUrl:i,onContinue:r,onReveal:o}){const[c,d]=l.useState(null),[m,u]=l.useState(De(n)?"loading":"degraded"),[g,T]=l.useState(!1),[f,y]=l.useState(!1),C=l.useRef(!1);l.useEffect(()=>{if(!De(n)){d(null),u("degraded");return}d(null),u("loading");let R=!1,D=!1,P=!1,G=!1,Z=!1,Q=0,X=null,J=null,W=null,B=null;const ie=Date.now(),A=(U,O=null)=>{D||R||(D=!0,d(O),u(U),U==="ready"&&window.dispatchEvent(new Event(He)))},k=async(U=!1)=>{if(R||D)return"terminal";if(!U&&document.hidden)return"pending";try{const O=await M(Ft,{workspaceId:a,workspaceUrl:i});if(R||D)return"terminal";Q=0;const ee=O.me.teammateOnboardingMigration?.migration?.sourceStatuses.slack.status;if(ee==="failed"||ee==="skipped")return A("degraded"),"terminal";const ne=O.lindyAssistantSlackFastHydrationStatus;return ne?.status==="READY"&&ea(ne)?(A("ready",ne),"terminal"):ee==="completed"?ne?.status==="RUNNING"||!G?(G=!0,"pending"):(A("degraded"),"terminal"):P?(A("degraded"),"terminal"):"pending"}catch(O){return R||D?"terminal":(Q+=1,Z||(Z=!0,E(O)),P||Q>=Un?(A("degraded"),"terminal"):"pending")}},_=async()=>{B=k();const U=await B;if(B=null,U!=="pending"||P||R||D)return;const O=Date.now()-ie<zn?Dn:$n;X=window.setTimeout(()=>w(_()),O)};return J=window.setTimeout(()=>{w((async()=>{P=!0,X!==null&&(window.clearTimeout(X),X=null);const U=B??k(!0),O=await Promise.race([U,new Promise(ee=>{W=window.setTimeout(()=>ee("timed_out"),Hn)})]);W!==null&&(window.clearTimeout(W),W=null),!(R||D)&&O!=="terminal"&&A("degraded")})())},An),w(_()),()=>{R=!0,X!==null&&window.clearTimeout(X),J!==null&&window.clearTimeout(J),W!==null&&window.clearTimeout(W)}
11},[n,a,i]),l.useEffect(()=>{m==="loading"||t!=="slack"||C.current||(C.current=!0,w(o()))},[t,o,m]),l.useEffect(()=>{if(m!=="loading"){y(!1);return}const R=window.setTimeout(()=>y(!0),Pn);return()=>window.clearTimeout(R)},[m]);const x=l.useCallback(()=>{w((async()=>{if(t==="slack"&&!C.current){if(!await o())return;C.current=!0}r()})())},[t,r,o]),j=l.useCallback(()=>T(!0),[]),h=l.useCallback(()=>T(!1),[]),p=l.useCallback(R=>{R.stopPropagation()},[]);if(m==="loading")return e.jsxs("div",{className:"flex min-h-[430px] flex-col items-center justify-center text-center",children:[e.jsx(Ne,{className:"mb-4 size-8 text-slate-10"}),e.jsx("h2",{className:"text-xl font-medium text-slate-12",id:"teammate-migration-title",children:"Lindy is learning from Slack"}),e.jsx("p",{className:"mt-2 max-w-sm text-sm text-slate-11",children:"This usually takes a moment. Keep this window open while Lindy builds a first company profile."}),e.jsx("button",{type:"button",className:`${Ie} mt-6 transition-opacity duration-200 ${f?"visible opacity-100":"invisible opacity-0"}`,"data-testid":"teammate-migration-learnings-skip",disabled:!f||s,onClick:x,children:s?"Continuing…":"Continue in background"})]});const L=n==="not_started"||n==="skipped",V=c?.shortVersion?.trim()||"Lindy pulled a first workspace profile from Slack.",v=ta(c?.workspaceName,a),K=na(c);return e.jsxs("div",{className:"flex min-h-[430px] flex-col",children:[e.jsx("h2",{className:"text-xl font-medium leading-8 text-slate-12",id:"teammate-migration-title",children:m==="ready"?"Lindy's getting to know your company.":L?"Slack setup skipped.":"We couldn't read your Slack workspace."}),e.jsx("p",{className:"mb-8 mt-1 text-base leading-7 text-slate-11",children:m==="ready"?"Lindy pulled this from your workspace and public info so it can help from day one.":"You can keep going and tell Lindy about your company any time."}),m==="ready"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-2xl bg-slate-2 p-4",children:[e.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-slate-10",children:"In short"}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-slate-12",children:V})]}),e.jsxs("button",{type:"button",className:"mt-3 flex w-full items-center gap-3 rounded-2xl border border-slate-5 p-3.5 text-left text-sm text-slate-12 transition hover:bg-slate-2",onClick:j,children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-slate-3",children:e.jsx(Ge,{className:"size-4 text-slate-11"})}),e.jsxs("span",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"truncate font-mono text-sm",children:v}),e.jsx("span",{className:"text-xs text-slate-10",children:"Read the full analysis"})]}),e.jsx(fe,{className:"ml-auto size-4 text-slate-9"})]})]}):null,e.jsx("button",{type:"button",className:`${ue} mt-auto self-start`,disabled:s,onClick:r,children:m==="ready"?"Got it":"Continue"}),g?e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/45 p-4",onClick:h,children:e.jsxs("div",{"aria-labelledby":"slack-profile-title","aria-modal":"true",className:"max-h-[85vh] w-full max-w-4xl overflow-hidden rounded-xl bg-panel shadow-xl",role:"dialog",onClick:p,children:[e.jsxs("div",{className:"flex items-start border-b border-slate-5 px-6 py-5",children:[e.jsx(Ge,{className:"mr-2 mt-0.5 size-4 shrink-0 text-slate-10"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"truncate font-mono font-medium text-slate-12",id:"slack-profile-title",children:v}),e.jsx("p",{className:"mt-1 text-sm text-slate-10",children:"Review what Lindy learned from your workspace and public info."})]}),e.jsx("button",{type:"button",className:"ml-auto rounded-lg p-1 text-slate-10 hover:bg-slate-3","aria-label":"Close analysis",onClick:h,children:e.jsx(xe,{className:"size-5"})})]}),e.jsx("div",{className:"max-h-[65vh] overflow-auto p-6",children:e.jsx("div",{className:"prose prose-slate max-w-none dark:prose-invert",children:e.jsx(xs,{bare:!0,source:K})})})]})}):null]})}function ea(s){return!!s.shortVersion?.trim()||!!s.profileMarkdown?.trim()||(s.viewerProfile?.bullets.length??0)>0}function ta(s,t){const n="-profile.md",a=`-${sa(t)}`,i=255-a.length-n.length;return`${(ys(s??"")||"company").slice(0,i)}${a}${n}`}function sa(s){let t=2166136261;for(let n=0;n<s.length;n+=1)t^=s.codePointAt(n)??0,t=Math.imul(t,16777619);return(t>>>0).toString(36)}function na(s){if(s?.profileMarkdown?.trim())return s.profileMarkdown.trim();const t=["# Slack workspace profile"];
11s?.shortVersion?.trim()&&t.push("","## In short",s.shortVersion.trim());const n=s?.viewerProfile?.bullets??[];if(n.length>0){t.push("",`## What Lindy learned about ${s?.viewerFirstName||"you"}`);for(const a of n){const i=a.body.trim(),r=a.lead.trim();r&&i?t.push(`- **${r}** ${i}`):(r||i)&&t.push(`- ${r||i}`)}}return t.join(`
12`)}function aa({auths:s,busy:t,workspaceUrl:n,onContinue:a,onRefresh:i}){const r=s.filter(d=>!!d?.isConnected&&d.viewerIsOwner),o=l.useCallback(()=>w(i()),[i]),c=bt({workspaceUrl:n,onClosed:o});return e.jsxs("div",{className:"flex min-h-[560px] flex-col",children:[e.jsx("h2",{className:"text-xl font-medium leading-8 text-slate-12",id:"teammate-migration-title",children:"Connect tools"}),e.jsx("p",{className:"mb-6 mt-1 text-base leading-7 text-slate-11",children:"Connect the apps your team uses so Lindy can help with work beyond Slack."}),r.length>0?e.jsx("ul",{className:"mb-5 grid grid-cols-2 gap-3",children:r.slice(0,6).map(d=>e.jsxs("li",{className:"flex items-center gap-3 rounded-xl border border-slate-5 p-3 text-sm text-slate-12",children:[e.jsx(ge,{className:"size-4 shrink-0 text-green-10"}),e.jsx("span",{className:"truncate",children:d.label})]},d.id))}):e.jsx("p",{className:"mb-5 rounded-xl bg-slate-2 p-4 text-sm text-slate-11",children:"No additional tools connected yet."}),e.jsxs("button",{type:"button",className:`${It} self-start`,disabled:t||c.isOpening,onClick:c.open,children:[c.isOpening?e.jsx(Ne,{className:"mr-2 size-4"}):e.jsx(gt,{className:"mr-2 size-4"}),"Add integrations"]}),c.modal,e.jsx("button",{type:"button",className:`${ue} mt-auto self-start`,disabled:t,onClick:a,children:"Continue"})]})}function ia({busy:s,companyDomain:t,suggestions:n,userEmail:a,workspaceId:i,onComplete:r}){const[o,c]=l.useState(()=>new Set(n.map(x=>x.email.trim().toLowerCase()).filter(x=>x!==a.trim().toLowerCase()&&(!t||ks(x,t))))),[d,m]=l.useState(""),[u,g]=l.useState(!1),T=l.useCallback(x=>{const j=x.currentTarget.value,h=x.currentTarget.checked;c(p=>{const L=new Set(p);return h?L.add(j):L.delete(j),L})},[]),f=l.useCallback(x=>m(x.currentTarget.value),[]),y=l.useMemo(()=>{const x=new Set(o);for(const j of d.split(/[,\s]+/)){const h=j.trim().toLowerCase();/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(h)&&h!==a.toLowerCase()&&x.add(h)}return[...x]},[d,o,a]),C=l.useCallback(()=>{y.length===0||s||u||(g(!0),w((async()=>{try{const j=(await M(Wt,{input:{emails:y,surface:"setup_checklist",workspaceId:i}})).sendTeamInvites;if(!("data"in j)){q({id:"teammate-migration-invites",level:"danger",label:"message"in j&&j.message?j.message:"We couldn't send invites. Try again."});return}const h=j.data.sentCount;q({id:"teammate-migration-invites",level:"success",label:h===0?j.data.alreadyMemberCount>0?"Everyone you picked is already in your workspace.":"There was nobody new to invite.":`We sent ${h} invite${h===1?"":"s"}.`}),r()}catch(x){E(x),q({id:"teammate-migration-invites",level:"danger",label:"We couldn't send invites. Try again."})}finally{g(!1)}})()))},[s,y,u,r,i]);return e.jsxs("div",{className:"flex min-h-[560px] flex-col",children:[e.jsx("h2",{className:"text-xl font-medium leading-8 text-slate-12",id:"teammate-migration-title",children:"Invite your team"}),e.jsxs("p",{className:"mb-6 mt-1 text-base leading-7 text-slate-11",children:["Bring teammates into the same workspace context",t?` at ${t}`:"","."]}),n.length>0?e.jsx("div",{className:"mb-5 max-h-56 space-y-2 overflow-y-auto",children:n.map(x=>{const j=x.email.trim().toLowerCase();return j===a.trim().toLowerCase()?null:e.jsxs("label",{className:"flex cursor-pointer items-center gap-3 rounded-xl border border-slate-5 p-3 hover:bg-slate-2",children:[e.jsx("input",{type:"checkbox",checked:o.has(j),className:"size-4 rounded",value:j,onChange:T}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-sm font-medium text-slate-12",children:x.fullName||j}),e.jsx("span",{className:"block truncate text-xs text-slate-10",children:j})]})]},j)})}):null,e.jsx("label",{className:"text-sm font-medium text-slate-11",htmlFor:"migration-invite-emails",children:"Add email addresses"}),e.jsx("input",{id:"migration-invite-emails",className:"mt-2 rounded-xl border border-slate-6 bg-panel px-3 py-2.5 text-sm text-slate-12 outline-none focus:border-blue-9",placeholder:"[email protected], [email protected]",value:d,onChange:f}),e.jsx("p",{className:"mt-2 text-xs text-slate-10",children:"Separate multiple addresses with commas."}),e.jsxs("div",{className:"mt-auto flex items-center gap-3 pt-8",children:[e.jsxs("button",{type:"button",className:ue,disabled:s||u||y.length===0,onClick:C,children:[s||u?e.jsx(Ne,{className:"mr-2 size-4"}):null,"Send invites"]}),e.jsx("button",{type:"button",className:Ie,disabled:s||u,onClick:r,children:"Skip for now"})]})]})}function ra({memoryStatus:s,onDone:t}){return e.jsxs("div",{className:"flex min-h-[560px] flex-col",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"mb-4 text-3xl font-semibold leading-9 text-slate-12",id:"teammate-migration-title",children:"You're all set up!"}),e.jsx("p",{className:"mx-auto mb-8 max-w-md text-base leading-6 text-slate-11",children:"Lindy now has the workspace context, connected tools, and teammate access it needs to start helping your team."})]}),e.jsx("ul",{className:"space-y-4",children:Gn.map(n=>e.jsxs("li",{className:"flex items-start gap-3 text-sm text-slate-12",children:[e.jsx(ge,{className:"mt-0.5 size-4 shrink-0"}),n]},n))}),s==="failed"?e.jsx("p",{className:"mt-8 rounded-xl bg-amber-3 p-4 text-sm text-amber-11",children:"We couldn't import your existing memories. Your original memories are still saved."}):null,e.jsx("button",{type:"button",className:`${ue} mt-auto self-start`,"data-testid":"teammate-migration-done",onClick:t,children:"Back to home"})]})}function et(s,t){const n=t==="google"?$e:ze,a=new Set((s.me.userSettings?.connections[t]??[]).map(r=>r.authId)),i=s.me.auth.filter(r=>!!r&&a.has(r.id));return i.find(r=>r.isConnected&&yt({availableScopes:r.scopes,requiredScopes:n}).hasAllScopes)??i[0]??null}function tt(s,t){return s?.isConnected?yt({availableScopes:s.scopes,requiredScopes:t==="google"?$e:ze}).hasAllScopes:!1}const la=z(function({data:t,workspaceUrl:n}){if(t.me.isOccupationDrivenSignupArm)return null;const a=Ae(n);if(a.status!=="ready")return null;const i=a.billingInfo.features?.accountLimitInfo?.totalExtraAccountCount??0;return e.jsx(oa,{data:t,totalExtraAccountCount:i,workspaceUrl:n})});function oa({data:s,totalExtraAccountCount:t,workspaceUrl:n}){const a=s.me.workspaceMembershipFor?.workspace,i=a?.id??s.workspace?.id??null,r=s.me.enabledFeatureFlags,o=et(s,"google"),c=et(s,"microsoft"),d=tt(o,"google"),m=tt(c,"microsoft"),u=d||m,g=!!s.me.phone&&s.me.phoneNumberIsVerified||s.me.flags.isAppleMessagesConnected,T=!!s.me.workspaceMembershipFor&&(!s.me.flags.isLindyAssistant||!!a?.isLindyAssistantWorksp
12ace),f=!T||s.me.workspaceMembershipFor?.hasInvitedSomeone===!0,y=r.includes("onboarding-checklist-email-accounts"),C=!y||t>=1,[x,j]=l.useState(s.me.flags.isLindyAssistantChromeExtensionCompleted),[h,p]=l.useState(!1),[L,V]=l.useState(!1),[v,K]=l.useState(void 0),[R,D]=l.useState(),[P,G]=l.useState(!1),Z=v!=null&&v.slack.state!=null&&(v.slack.state==="connected"||v.viewer.canInstallSlackIntegration===!0),[Q,X]=l.useState(!1),J=u&&g&&f&&C&&x,W=!!a?.teamLindyWorkspaceId&&!s.me.flags.dismissedSetupChecklist&&(a.canInstallSlackIntegration||!J||R===a.teamLindyWorkspaceId),B=l.useCallback(()=>a?.teamLindyWorkspaceId?M(zt,{workspaceId:a.teamLindyWorkspaceId}).then(b=>b.lindyAssistant.teamLindyReadiness):Promise.resolve(null),[a?.teamLindyWorkspaceId]);l.useEffect(()=>{K(void 0),G(!1)},[a?.teamLindyWorkspaceId]),l.useEffect(()=>{if(!W)return;D(a?.teamLindyWorkspaceId);let b=!1;return w(B().then(F=>{if(!b){if(!F){K(void 0),G(!0);return}K(F),G(!1)}}).catch(F=>{E(F),b||G(!0)}).finally(()=>{b||D(void 0)})),()=>{b=!0}},[B,W,a?.teamLindyWorkspaceId]);const ie=l.useCallback(()=>{w(B().then(b=>{if(!b){K(void 0),G(!0);return}K(b),G(!1)}).catch(b=>{E(b),G(!0)}))},[B]),A=l.useMemo(()=>new bs({buildInstallUrl:()=>{if(!a?.teamLindyWorkspaceId)return null;const b=new URL(ws({workspaceId:a.teamLindyWorkspaceId,provider:Oe,scopes:[]}));return b.searchParams.set("slackConnectionIntent",js),b.toString()},refreshReadiness:ie,refreshOnUnattributedAuthUpdate:!1,onPopupBlocked:()=>q({level:"danger",label:"Slack did not open. Allow pop-ups and try again."}),onInstallingChanged:X,onInstalled:()=>q({level:"success",label:"We installed the Lindy Slack app"})}),[ie,a?.teamLindyWorkspaceId]);l.useEffect(()=>()=>A.dispose(),[A]),l.useEffect(()=>{if(!Z||P)return;let b=!1,F;return w(gs(s.me.id,{onUpdate:({provider:Y})=>{Y===Oe&&A.handleAuthUpdate()},onError:({message:Y,provider:we})=>{we!==Oe||!A.handleAuthError()||q({level:"danger",label:Y})}}).then(Y=>{if(b){Y();return}F=Y}).catch(Y=>E(Y))),()=>{b=!0,F?.()}},[s.me.id,P,Z,A]);const k=l.useCallback(()=>A.install(),[A]),_=l.useCallback(()=>{if(!(!i||x||L)){if(!h){window.open(Wn,"_blank","noopener,noreferrer"),p(!0);return}V(!0),w(M(Pt,{input:{identityId:s.me.id,step:"chrome_extension",workspaceId:i}}).then(()=>j(!0)).catch(b=>{E(b),q({id:"setup-checklist-chrome",level:"danger",label:"We couldn't save that step. Try again."})}).finally(()=>V(!1)))}},[x,h,L,s.me.id,i]),U=l.useMemo(()=>{const b=[];if(m||b.push({href:i?Qe("google",i,o?.id):void 0,icon:e.jsx(pe,{name:"google"}),key:"google",label:"Connect your Google account",status:d?"completed":"pending",target:"_blank"}),Z&&!P&&v!==void 0){const F=v?.slack.state==="connected",Y=!F&&v?.viewer.canInstallSlackIntegration===!0;b.push({actionLabel:Y||Q?Q?"Connecting...":v?.slack.state==="needs_reinstall"?"Reinstall":"Connect":void 0,icon:e.jsx(pe,{name:"slack"}),key:"slack",label:"Connect Slack",onClick:Y&&!Q?k:void 0,status:F?"completed":"pending"})}return d||b.push({href:i?Qe("microsoft",i,c?.id):void 0,icon:e.jsx(ts,{className:"size-5"}),key:"microsoft",label:"Connect your Microsoft account",status:m?"completed":"pending",target:"_blank"}),b.push({href:s.me.flags.appleMessagesRegistrationUrl&&!g?s.me.flags.appleMessagesRegistrationUrl:le("/settings/general",n),icon:e.jsx(pe,{name:"imessage"}),key:"phone",label:s.me.flags.appleMessagesRegistrationUrl?"Connect to Apple Messages":"Share your phone number with your assistant",status:g?"completed":"pending",target:s.me.flags.appleMessagesRegistrationUrl&&!g?"_blank":void 0}),T&&b.push({actionLabel:"Invite",href:le("/settings/members",n),icon:e.jsx(pe,{name:"invite-team"}),key:"invite",label:"Invite your team",status:f?"completed":"pending"}),y&&b.push({actionLabel:"Add",href:le("/settings/connections",n),icon:e.jsx(xt,{className:"size-5 text-slate-9"}),key:"email-accounts",label:"Add your other email accounts",status:C?"completed":"pending"}),b.push({actionLabel:h?"I installed it":"Install",icon:e.jsx(pe,{name:"chrome"}),key:"chrome",label:"Install the Lindy Chrome extension",onClick:_,status:x?"completed":"pending"}),b},[x,h,s.me.flags.appleMessagesRegistrationUrl,C,y,o?.id,d,_,k,P,f,Q,c?.id,m,g,T,Z,v,i,n]),O=J&&W&&!P&&v===void 0,ee=J&&(!Z||P||v?.slack.state==="connected"),[ne,Te]=l.useState(()=>O?null:!s.me.flags.dismissedSetupChecklist&&!ee);if(l.useEffect(()=>{ne!==null||O||Te(!s.me.flags.dismissedSetupChecklist&&!ee)},[ee,s.me.flags.dismissedSetupChecklist,O,ne]),ne!==!0)return null;const _e=U.filter(b=>b.status==="completed").length;return e.jsx("section",{"data-testid":"home-setup-checklist",children:e.jsx(Tn,{title:"Complete your setup",completedCount:_e,totalCount:U.length,children:U.map((b,F)=>e.jsx(ca,{item:b,isLast:F===U.length-1,saving:b.key==="chrome"&&L},b.key))})})}function ca({isLast:s,item:t,saving:n}){const a=t.status==="pending"&&(t.onClick||t.href)?()=>{t.onClick?t.onClick():t.href&&t.target==="_blank"?window.open(t.href,"_blank","noopener,noreferrer"):t.href&&he(t.href)}:void 0;return e.jsxs(_n,{status:t.status,isLast:s,disabled:n,onClick:a,children:[e.jsxs(On,{children:[t.icon,e.jsx(En,{children:t.label}),t.secondaryLabel?e.jsx(Ln,{children:t.secondaryLabel}):null]}),a?e.jsx(Rn,{children:n?"Saving…":t.actionLabel??"Connect"}):null]})}function Mt(s){if(!s)return null;try{const t=new URL(s);return t.protocol!=="https:"&&t.protocol!=="http:"?null:(t.hash="",t.hostname=t.hostname.toLowerCase(),(t.protocol==="https:"&&t.port==="443"||t.protocol==="http:"&&t.port==="80")&&(t.port=""),t.pathname.length>1&&(t.pathname=t.pathname.replace(/\/+$/,"")),t.searchParams.sort(),t.toString())}catch{return null}}function Tt(s){const t=[],n=new Map;for(const a of s){const i=new Date(a.startTime),r=Mt(a.joinUrl);if(Number.isNaN(i.getTime())||!r){t.push(a);continue}const o=`${i.getTime()}|${r}`,c=n.get(o);if(c===void 0){n.set(o,t.length),t.push(a);continue}const d=t[c];!d.href&&a.href&&(t[c]={...d,href:a.href})}return t}function We(s,t,n=new Date){const a=new Date(s.startTime);return Number.isNaN(a.getTime())?!1:nt(a,t)===nt(n,t)}
12function da(s,t,n=new Date){const a=s.filter(ha),i=n.getTime();for(const r of a){if(new Date(r.startTime).getTime()<=i||!We(r,t,n))continue;const c=st(r.href)??st(r.joinUrl);if(c)return{meeting:r,href:c}}return null}function ma(s,t){return Me(s,t,{weekday:"long",month:"long",day:"numeric"})}function ua(s,t){const n=new Date(s);return Number.isNaN(n.getTime())?"":Me(n,t,{hour:"numeric",minute:"2-digit",hour12:!0})}function pa(s,t){const n=Number(Me(s,t,{hour:"numeric",hourCycle:"h23"}));return n<12?"Good morning":n<18?"Good afternoon":"Good evening"}function ha(s){return s.selfResponseStatus!=="declined"&&s.selfResponseStatus!=="needsAction"}function st(s){return Mt(s)?s:null}function nt(s,t){return Me(s,t,{year:"numeric",month:"2-digit",day:"2-digit"})}function Me(s,t,n){try{return at(new Intl.DateTimeFormat("en-US",{...n,...t?{timeZone:t}:{}}).format(s))}catch{return at(new Intl.DateTimeFormat("en-US",n).format(s))}}function at(s){return s.replace(/[\u00A0\u202F]/g," ")}const fa=4,xa=3,_t=3,ga=["workflowDiscovery","spellbook","setupChecklist","meetings","pastMeetings"],ba=["needToKnow","metrics","learnedPreferences","contactInfo"];function wa(s){const t=new Set,n=[];for(const a of s){const i=JSON.stringify([a.title,a.subtitle]);if(!t.has(i)&&(t.add(i),n.push(a),n.length>=fa))break}return n}function Ot(s,t,n=new Date){return Tt(s).filter(a=>We(a,t,n)).slice(0,xa)}function Et(s){return s.slice(0,_t)}function ka(s,t){if(!s)return{main:[...t.main],side:[...t.side]};const n=new Set([...t.main,...t.side]),a=new Set,i=o=>{const c=[];for(const d of o)!n.has(d)||a.has(d)||(a.add(d),c.push(d));return c},r={main:i(s.main),side:i(s.side)};for(const o of["main","side"])t[o].forEach((c,d)=>{if(a.has(c))return;a.add(c);const m=r[o];m.splice(Math.min(d,m.length),0,c)});return r}const ya="h-8 rounded-xl border-0 bg-black/[0.04] text-slate-12 outline-none transition-colors duration-150 ease-out focus-visible:ring-2 focus-visible:ring-primary-8 aria-expanded:bg-black/[0.06] data-[state=open]:bg-black/[0.06] hover:bg-black/[0.06] dark:bg-white/[0.05] dark:aria-expanded:bg-white/[0.07] dark:data-[state=open]:bg-white/[0.07] dark:hover:bg-white/[0.07]",Ee=`${ya} flex shrink-0 items-center gap-1.5 px-3 text-sm font-medium`;function it(s){if(!s||typeof s!="object")return null;const t=s;return!Array.isArray(t.main)||!Array.isArray(t.side)?null:{main:t.main,side:t.side}}function ja(s){return ka(s,{main:ga,side:ba})}function va(s,t,n){const a=rt(s,t),i=rt(s,n);if(!a||!i)return null;const r={main:[...s.main],side:[...s.side]};return a===i?(r[a]=Es(r[a],r[a].indexOf(t),r[a].indexOf(n)),r):(r[a].splice(r[a].indexOf(t),1),r[i].splice(r[i].indexOf(n),0,t),r)}function rt(s,t){return s.main.includes(t)?"main":s.side.includes(t)?"side":null}function Na({enabled:s,rendered:t,onOrderChange:n,children:a}){const i=vs(Ye(Ss,{activationConstraint:{distance:4}}),Ye(Ns,{coordinateGetter:Ts})),r=l.useCallback(c=>{const{active:d,over:m}=c;if(!m||d.id===m.id)return;const u=va(t,d.id,m.id);u&&n(u)},[n,t]),o=l.useMemo(()=>[...t.main,...t.side],[t.main,t.side]);return s?e.jsx(Cs,{sensors:i,collisionDetection:Is,onDragEnd:r,children:e.jsx(_s,{items:o,children:a})}):e.jsx(e.Fragment,{children:a})}function Sa({id:s,children:t}){const{attributes:n,listeners:a,setNodeRef:i,transform:r,transition:o,isDragging:c}=Os({id:s});return e.jsx("div",{ref:i,style:{transform:Ms.Transform.toString(r),transition:o},className:`relative cursor-grab rounded-2xl outline-dashed outline-2 outline-offset-4 outline-slate-6 ${c?"z-10 cursor-grabbing opacity-60":""}`,"data-testid":`rearrange-${s}`,...n,...a,children:t})}function Ca({isRearranging:s,onToggle:t,onReset:n}){return s?e.jsxs("div",{className:"hidden items-center gap-1 lg:flex",children:[e.jsx("button",{type:"button",onClick:n,className:Ee,children:"Reset layout"}),e.jsx("button",{type:"button",onClick:t,className:`${Ee} font-medium text-slate-12`,children:"Done"})]}):e.jsx("button",{type:"button",onClick:t,className:`${Ee} hidden lg:flex`,children:"Rearrange"})}const Ia=250;function Le({children:s,className:t,index:n}){const a=l.useMemo(()=>({animationDelay:`${n*Ia}ms`}),[n]);return e.jsx("div",{className:`animate-fade-slide-up empty:hidden motion-reduce:animate-none${t?` ${t}`:""}`,style:a,children:s})}function Fe({onDismiss:s}){return e.jsx("button",{type:"button",onClick:s,"aria-label":"Hide section",className:re("flex h-5 shrink-0 items-center justify-center overflow-hidden rounded-md text-slate-9 hover:text-slate-12 dark:text-white/50 dark:hover:text-white","-ml-2 w-0 opacity-0 transition-all","focus-visible:ml-0 focus-visible:w-5 focu
12s-visible:opacity-100","group-hover/bento:ml-0 group-hover/bento:w-5 group-hover/bento:opacity-100","hover:bg-black/[0.06] active:bg-black/[0.09] dark:hover:bg-white/[0.08] dark:active:bg-white/[0.12]"),children:e.jsx(Gs,{className:"size-[18px]"})})}function Ma({emailsTriaged:s,draftsWritten:t,timeSavedMinutes:n,timeSavedApproximationGlyph:a="≈",showHeaderIcon:i=!0,onDismiss:r}){const o=s>0||t>0;return e.jsx(Ce,{className:"w-full overflow-hidden p-4 shadow-[0_2px_6px_rgba(0,0,0,0.08)] dark:ring-0",children:e.jsxs("div",{className:re("flex w-full flex-col gap-4",o&&"dark:gap-6"),children:[e.jsxs("div",{className:"flex items-start gap-2",children:[i&&e.jsx(mn,{className:"mt-0.5 size-5 shrink-0 text-slate-11",strokeWidth:2}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsx("h3",{className:`text-[#333231] dark:text-white ${Se}`,children:"What I've been up to"}),o&&e.jsx(Ta,{minutes:n,approximationGlyph:a})]}),r&&e.jsx(Fe,{onDismiss:r})]}),o?e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(lt,{icon:e.jsx(Oa,{className:"size-5"}),value:s,label:"Emails triaged"}),e.jsx(lt,{icon:e.jsx(Ea,{className:"size-5"}),value:t,label:"Drafts written"})]}):e.jsx(_a,{})]})})}function lt({icon:s,value:t,label:n}){return e.jsxs("div",{className:"flex min-w-0 flex-col gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-[#6D635B] dark:text-slate-11",children:[s,e.jsx("span",{className:"whitespace-nowrap text-sm leading-5",children:n})]}),e.jsx("span",{className:"whitespace-nowrap text-2xl font-medium tabular-nums leading-[1.2] text-[#333231] dark:text-white",children:t.toLocaleString()})]})}function Ta({minutes:s,approximationGlyph:t}){const{value:n,unit:a}=La(s);return e.jsxs("p",{className:"text-sm leading-5 text-[#6D635B] dark:text-slate-11",children:[e.jsxs("span",{className:"tabular-nums",children:[t,n," ",a]})," ","estimated time saved"]})}function _a(){return e.jsxs("div",{className:"flex flex-col gap-1 py-1 text-sm",children:[e.jsx("span",{className:"font-medium text-slate-12",children:"Getting to know your inbox"}),e.jsx("span",{className:"text-slate-11",children:"Your stats show up here as I start triaging and drafting for you."})]})}function Oa({className:s}){return e.jsxs("svg",{"aria-hidden":"true",className:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M3 5.63623L10.7335 11.9637C11.4703 12.5664 12.5297 12.5664 13.2665 11.9637L21 5.63623",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M20.2405 16.1852L19.5436 14.3733C19.4571 14.1484 19.241 14 19 14C18.759 14 18.5429 14.1484 18.4564 14.3733L17.7595 16.1852C17.658 16.4493 17.4493 16.658 17.1852 16.7595L15.3733 17.4564C15.1484 17.5429 15 17.759 15 18C15 18.241 15.1484 18.4571 15.3733 18.5436L17.1852 19.2405C17.4493 19.342 17.658 19.5507 17.7595 19.8148L18.4564 21.6267C18.5429 21.8516 18.759 22 19 22C19.241 22 19.4571 21.8516 19.5436 21.6267L20.2405 19.8148C20.342 19.5507 20.5507 19.342 20.8148 19.2405L22.6267 18.5436C22.8516 18.4571 23 18.241 23 18C23 17.759 22.8516 17.5429 22.6267 17.4564L20.8148 16.7595C20.5507 16.658 20.342 16.4493 20.2405 16.1852Z",fill:"currentColor"}),e.jsx("path",{d:"M21.25 11.75V7.95C21.25 6.82989 21.25 6.26984 21.032 5.84202C20.8403 5.46569 20.5343 5.15973 20.158 4.96799C19.7302 4.75 19.1701 4.75 18.05 4.75H5.95C4.8299 4.75 4.26984 4.75 3.84202 4.96799C3.46569 5.15973 3.15973 5.46569 2.96799 5.84202C2.75 6.26984 2.75 6.82989 2.75 7.95V16.05C2.75 17.1701 2.75 17.7302 2.96799 18.158C3.15973 18.5343 3.46569 18.8403 3.84202 19.032C4.26984 19.25 4.82989 19.25 5.95 19.25H12.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ea({className:s}){return e.jsx("svg",{"aria-hidden":"true",className:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.75 10.9853V4.75C4.75 3.64543 5.64543 2.75 6.75 2.75H17.25C18.3546 2.75 19.25 3.64543 19.25 4.75V10.9853M9.75 7.75H14.25M12.617 13.5499L19.9415 11.1744C20.5875 10.9649 21.25 11.4465 21.25 12.1256V18.25C21.25 19.3546 20.3546 20.25 19.25 20.25H4.75C3.64543 20.25 2.75 19.3546 2.75 18.25V12.1256C2.75 11.4465 3.41249 10.9649 4.0585 11.1744L11.383 13.5499C11.784 13.68 12.216 13.68 12.617 13.5499Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function La(s){if(s<60)return{value:String(Math.round(s)),unit:"min"};const t=s/60;return{value:t>=10?String(Math.round(t)):t.toFixed(1),unit:"hrs"}}function Ra({imageUrl:s}){return e.jsx("div",{className:"flex h-full w-full items-center justify-center rounded-lg bg-gradient-to-br from-amber-50 to-amber-100 dar
12k:from-amber-950/30 dark:to-amber-900/20",children:s?e.jsx("img",{src:s,alt:"",className:"h-full w-full object-cover"}):e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"h-1.5 w-8 rounded-sm bg-white/80 dark:bg-white/20"}),e.jsx("div",{className:"h-1.5 w-8 rounded-sm bg-white/60 dark:bg-white/15"}),e.jsx("div",{className:"h-1.5 w-8 rounded-sm bg-white/40 dark:bg-white/10"})]})})}function Aa({isOpen:s,onClose:t,children:n}){return e.jsx(qs,{open:s,onClose:t,children:e.jsxs(Ys,{className:"max-w-4xl rounded-3xl border border-edge",children:[e.jsx(Zs,{className:"sr-only",children:"Suggested things your Lindy assistant can do for you."}),e.jsxs(Qs,{className:"flex flex-row items-center justify-between px-12 py-8",children:[e.jsx(Xs,{className:"flex-1 text-2xl font-semibold tracking-tight text-slate-12",children:"What Lindy can do for you"}),e.jsxs("button",{type:"button",onClick:t,className:"rounded-md p-1 text-slate-11 transition hover:bg-slate-3 hover:text-slate-12","data-testid":"spellbook-modal-close",children:[e.jsx(wt,{className:"size-6 text-slate-9"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]}),e.jsx(Js,{className:"px-12 pb-12 pt-0",children:n})]})})}function Ha({categories:s,onSelectSuggestion:t}){const n=l.useCallback(a=>()=>t(a),[t]);return e.jsx("div",{className:"flex flex-col gap-12 pb-12 pt-4",children:s.map(a=>e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h3",{className:"text-base font-semibold text-slate-12",children:a.name}),e.jsx("div",{className:"grid grid-cols-2 gap-6 sm:grid-cols-3",children:a.suggestions.map(i=>e.jsxs("button",{type:"button",onClick:n(i.prompt),className:"group flex flex-col items-start gap-4",children:[e.jsx("div",{className:"w-full transition-transform group-hover:scale-105",children:e.jsx(Ra,{imageUrl:i.imageUrl})}),e.jsx("span",{className:"px-2 text-left text-sm font-medium text-slate-12",children:i.label})]},i.label))})]},a.name))})}function Da(){return e.jsxs("div",{className:"flex flex-col gap-12",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(S,{className:"h-5 w-24"}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3",children:[e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(S,{className:"h-5 w-24"}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3",children:[e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(S,{className:"h-5 w-24"}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3",children:[e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(S,{className:"h-5 w-24"}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3",children:[e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"}),e.jsx(S,{className:"h-[139px] w-full"})]})]})]})}const Ua=[{label:"Catch me up",prompt:"Catch me up on everything that happened while I was out across Slack, email, meetings, tickets, and docs.",imageUrl:"/images/what-lindy-can-do/catch-me-up.webp"},{label:"Build your staff meeting deck",prompt:"Build my Monday staff meeting deck from CRM, support, and product usage data, including charts.",imageUrl:"/images/what-lindy-can-do/staff-meeting-deck.webp"},{label:"Track your competitors",prompt:"Track my competitors and send me a weekly roundup of launches, hires, and posts every Monday.",imageUrl:"/images/what-lindy-can-do/compet
12itor-tracking.webp"}],$a=3;function za({suggestions:s,isLoading:t,onSelectSuggestion:n,onSeeMore:a,onDismiss:i,showHeaderIcon:r=!0}){const o=s.slice(0,$a);return e.jsx(Ce,{className:"w-full",children:e.jsxs("div",{className:"flex w-full flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[r&&e.jsx(cn,{className:"size-5 shrink-0 text-slate-11 dark:text-white/70",strokeWidth:2}),e.jsx("h3",{className:"min-w-0",children:e.jsxs("button",{type:"button",onClick:a,className:re("-ml-1 flex min-w-0 items-center gap-1 rounded-lg px-1 py-0.5 text-left",Ct,ve),children:[e.jsx("span",{className:`text-slate-12 ${Se}`,children:"What Lindy can do for you"}),e.jsx(Pe,{className:"size-5 shrink-0 text-[#6D635B] dark:text-slate-11"})]})}),e.jsx("div",{className:"flex-1"}),i&&e.jsx(Fe,{onDismiss:i})]}),t?e.jsx(Wa,{}):e.jsx("div",{className:"grid grid-cols-3 gap-3",children:o.map(c=>e.jsx(Pa,{suggestion:c,onSelect:n},c.label))})]})})}function Pa({suggestion:s,onSelect:t}){const n=l.useCallback(()=>t(s.prompt),[t,s.prompt]);return e.jsxs("button",{type:"button",onClick:n,className:re("-m-1.5 flex flex-col items-start gap-2 rounded-xl p-1.5",Ct,ve),children:[e.jsx("div",{className:"relative aspect-[16/10] w-full overflow-hidden rounded-lg bg-gradient-to-br from-amber-100 to-amber-300 saturate-[0.9] dark:from-amber-400/25 dark:to-amber-700/25",children:s.imageUrl!=null?e.jsx("img",{src:s.imageUrl,alt:"",loading:"lazy",className:"absolute inset-0 size-full object-cover"}):e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(Bs,{className:"size-6 text-amber-500/70 dark:text-amber-200/70"})})}),e.jsx("span",{className:"px-1 text-left text-sm font-medium leading-snug text-slate-12",children:s.label})]})}function Wa(){return e.jsx("div",{className:"grid grid-cols-3 gap-3",children:[0,1,2].map(s=>e.jsx(S,{className:"aspect-[16/10] w-full"},s))})}function Fa({workflows:s,onSelectSuggestion:t,buildingPrompt:n,onDismiss:a}){return s.length===0?null:e.jsx(Ce,{className:"w-full",children:e.jsxs("div",{className:"flex w-full flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:`min-w-0 flex-1 px-1 text-slate-12 ${Se}`,children:"Suggestions"}),a&&e.jsx(Fe,{onDismiss:a})]}),e.jsx("ul",{className:"flex min-w-0 flex-col gap-0.5",children:s.map((i,r)=>e.jsx(Va,{workflow:i,isBuilding:i.prompt===n,isDisabled:n!=null,onSelect:t},`${i.number}-${r}`))})]})})}function Va({workflow:s,isBuilding:t,isDisabled:n,onSelect:a}){const i=l.useCallback(()=>a(s.prompt),[a,s.prompt]),r=s.skills??[];return e.jsx("li",{className:"min-w-0",children:e.jsxs("div",{className:re("flex w-full min-w-0 flex-col items-start gap-1.5 rounded-xl px-2.5 py-3 text-left transition-colors",!n&&"hover:bg-black/[0.06] dark:hover:bg-white/[0.08]"),children:[e.jsxs("button",{type:"button",onClick:i,disabled:n,className:re("flex w-full min-w-0 flex-col items-start gap-1.5 text-left",n&&!t&&"opacity-60",ve),children:[e.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-slate-12",children:s.title}),t?e.jsx(nn,{className:"size-4 shrink-0"}):e.jsx(Pe,{className:"size-5 shrink-0 text-[#6D635B] dark:text-slate-11"})]}),e.jsx("span",{className:"line-clamp-2 w-full text-sm leading-relaxed text-slate-11",children:s.description})]}),(s.tools.length>0||r.length>0)&&e.jsxs(vt,{placement:"top-start",allowClick:!0,ignoreMouseClick:!0,children:[e.jsx(Nt,{className:re("text-xs font-medium text-slate-11",ve),children:e.jsxs("span",{children:[s.tools.length>0&&e.jsxs(e.Fragment,{children:[s.tools.length," ",s.tools.length===1?"tool":"tools"]}),s.tools.length>0&&r.length>0&&" · ",r.length>0&&e.jsxs(e.Fragment,{children:[r.length," ",r.length===1?"skill":"skills"]})]})}),e.jsx(St,{showArrow:!1,className:"w-[285px] bg-transparent p-0 [&>div]:w-full",children:e.jsxs("div",{style:en,className:re(sn,tn,"mt-0 w-full gap-y-0 overflow-hidden rounded-[10px] p-1 dark:mt-0"),children:[s.tools.map((o,c)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2 py-1.5",children:[e.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center overflow-hidden rounded-full",children:o.icon}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium leading-5 text-slate-12",children:o.name})]},`${o.name}-${c}`)),r.map(o=>e.jsxs("div",{className:"flex items-center rounded-md px-2 py-1.5",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium leading-5 text-slate-12",children:o}),e.jsx("span",{className:"text-xs text-slate-11",children:"Skill"})]},o))]})})]})]})})}const ot="[email protected]",Ka=30,Ga=2e3,Ba=2e3,qa=5e3,Ya=["setupChecklist","needToKnow","meetings","pastMeetings","metrics","learnedPreferences","contactInfo","spellbook","workflowDiscovery"],Za={calendar:"Calendar",gmail:"Gmail","google calendar":"GoogleCalendar",hubspot:"Hubspot",slack:"Slack"};function Lt(s,t){return wa(s.filter(n=>!t.has(n.id)))}const de=new Map,ce=I.set(),Re=new Set,me=(s,t)=>`${s}:${t}`;function Qa(s,t){const a=(de.get(s)??Promise.resolve()).then(t),i=a.then(()=>{},()=>{});return de.set(s,i),w(i.then(()=>{de.get(s)===i&&de.delete(s)})),a}function ct(s,t){return Qa(s,()=>
12M(Jt,{input:{id:s,main:t.main,side:t.side}}))}async function Xa(){for(;de.size>0;)await Promise.all(de.values())}async function Ja(){let s;await Promise.race([Xa(),new Promise(t=>{s=window.setTimeout(t,Ba)})]),s!==void 0&&window.clearTimeout(s)}const be="group/bento w-full rounded-2xl bg-card p-4 ring-[0.5px] ring-black/[0.12] shadow-[0_1px_4px_rgba(0,0,0,0.08)] dark:shadow-none dark:ring-white/[0.06]",se="hover:bg-black/[0.06] active:bg-black/[0.09] dark:hover:bg-white/[0.08] dark:active:bg-white/[0.12]",H="focus-visible:ring-2 focus:ring-primary-8 focus:outline-none focus:ring-offset-2 transition ring-offset-slate-1",dt="group-hover:[&:not(:hover)]:bg-black/[0.03] dark:group-hover:[&:not(:hover)]:bg-white/[0.04]";function Rt(){const s=document.querySelector('[data-testid="home-composer-card"]');s&&(s.querySelector('textarea, [contenteditable="true"]')?.focus(),s.scrollIntoView?.({block:"center",behavior:"smooth"}))}function ei(){const[s,t]=l.useState(()=>new Date);return l.useEffect(()=>{const n=()=>t(new Date),a=window.setInterval(n,3e4);return window.addEventListener("focus",n),()=>{window.clearInterval(a),window.removeEventListener("focus",n)}},[]),s}function ti(s){return Tt(s.map(t=>{const n=t.attendees.length;return{id:t.id,title:t.summary??"Untitled meeting",description:n>0?`${n} ${n===1?"attendee":"attendees"}`:null,startTime:String(t.start),href:t.calendarUrl??null,joinUrl:t.conferenceUrl??null,selfResponseStatus:t.attendees.find(a=>a.self)?.status??null}}))}function si(s){if(!s)return s??null;const t=/^\+?1(\d{3})(\d{3})(\d{4})$/.exec(s.replace(/[\s().-]/g,""));return t?`+1 (${t[1]}) ${t[2]}-${t[3]}`:s}class ni{status="loading";identity=null;parityData=null;parityStatus="loading";spellbookCategories=[];agentDefinitionId=null;message="";creating=!1;createError=null;copiedKey=null;copyResetTimer;dismissedNeedToKnow=new Set;spellbookHidden=!1;workflowDiscoveryHidden=!1;homeSectionOrder=null;availableModels=qe(null);storedAgentModel=null;modelOverride=null;addIntegrationEnabled=!1;mentionsEnabled=!1;hasUsedChatMentions=!1;workspaceUrl=null;workspaceId=null;attachments=new Ds;welcomeWorkspace=null;welcomeOpen=!1;confirmedHomeSectionOrder=null;queuedHomeSectionOrder=null;homeSectionOrderSaveGeneration=0;homeSectionOrderSaveRunning=!1;markedMentionsUsed=!1;seededSuggestion=null;requestId=0;parityRequestId=0;constructor(){rn(this,{persistQueuedHomeSectionOrder:!0,flushHomeSectionOrder:!0,copyResetTimer:!1,dispose:!1,confirmedHomeSectionOrder:!1,homeSectionOrderSaveGeneration:!1,homeSectionOrderSaveRunning:!1,markMentionsUsed:!1,markedMentionsUsed:!1,queuedHomeSectionOrder:!1,requestId:!1,parityRequestId:!1,seededSuggestion:!1,attachments:!1,loadWelcome:!1,status:I.ref,identity:I.ref,parityData:I.ref,parityStatus:I.ref,spellbookCategories:I.ref,agentDefinitionId:!1,message:I.ref,creating:I.ref,createError:I.ref,copiedKey:I.ref,dismissedNeedToKnow:I,spellbookHidden:I.ref,workflowDiscoveryHidden:I.ref,homeSectionOrder:I.ref,availableModels:I.ref,storedAgentModel:I.ref,billingStatus:!0,canSelectCustomModel:!0,modelOverride:I.ref,addIntegrationEnabled:I.ref,mentionsEnabled:I.ref,hasUsedChatMentions:I.ref,workspaceUrl:I.ref,workspaceId:I.ref,welcomeWorkspace:I.ref,welcomeOpen:I.ref,load:te,createTask:te,createLearning:te,setMessage:te,seedSuggestion:te,setModelOverride:te,setHomeSectionOrder:te,dismissSection:te,dismissNeedToKnow:te,copy:te,closeWelcome:te,refreshParity:te})}get canSelectCustomModel(){const t=Ae(this.workspaceUrl);return t.status==="ready"&&t.billingInfo.features?.canSelectCustomModel===!0}get billingStatus(){return Ae(this.workspaceUrl).status}async load(t=ht()){this.persistQueuedHomeSectionOrder();const n=++this.requestId;this.homeSectionOrderSaveGeneration+=1,this.homeSectionOrderSaveRunning=!1,this.confirmedHomeSectionOrder=null,this.queuedHomeSectionOrder=null,this.status="loading",this.identity=null,this.parityData=null,this.parityStatus="loading",this.spellbookCategories=[],this.agentDefinitionId=null,this.message="",this.seededSuggestion=null,this.creating=!1,this.createError=null,this.homeSectionOrder=null,this.modelOverride=null,this.attachments.clear(),this.attachments.setUploadsEnabled(!0);try{const a=await ms(t);if(n!==this.requestId)return;if(!a)throw new Error("No workspace membership");if($(()=>{this.workspaceUrl=a.url,this.workspaceId=a.id}),new URLSearchParams(window.location.search).get("welcome")==="true"&&w(this.loadWelcome(a.url,n)),await Ja(),n!==this.requestId)return;const[i]=await Promise.all([M(Vt,{workspaceUrl:a.url}),Promise.race([this.refreshParity().catch(r=>E(r)),new Promise(r=>setTimeout(r,qa))])]);if(n!==this.requestId)return;$(()=>{this.identity=i.me,this.agentDefinitionId=i.me.chiefOfStaffAgent?.id??null,this.spellbookCategories=i.spellbookCategories;const r=i.me.flags?.homeSectionVisibility??{};r.spellbook===!1&&ce.delete(me(i.me.id,"spellbook")),r.workflowDiscovery===!1&&ce.delete(me(i.me.id,"workflowDiscovery")),this.spellbookHidden=r.spellbook===!1,this.workflowDiscoveryHidden=r.workflowDiscovery===!1;const o=it(i.me.flags?.homeSectionOrder);this.homeSectionOrder=o,this.confirmedHomeSectionOrder=o,this.availableModels=qe(i.me.chiefOfStaffAgent),this.storedAgentModel=i.me.chiefOfStaffAgent?.model??null,this.addIntegrationEnabled=i.me.enabledFeatureFlags.includes("chat-add-integration-button"),this.mentionsEnabled=i.me.enabledFeatureFlags.includes("chat-mentions"),this.hasUsedChatMentions=i.me.flags?.hasUsedChatMentions??!1,this.status="ready"})}catch(a){if(n!==this.requestId)return;E(a),$(()=>{this.status="error"})}}async refreshParity(){if(!this.workspaceUrl||!this.workspaceId)throw new Error("No active workspace");const t=this.requestId,n=++this.parityRequestId,a=this.workspaceUrl,i=this.workspaceId;this.parityStatus="loading";try{const r=await M(ft,{workspaceId:i,workspaceUrl:a});return t===this.requestId&&n===this.parityRequestId&&$(()=>{this.parityData=r,this.parityStatus="ready"}),r}catch(r){throw t===this.requestId&&n===this.parityRequestId&&$(()=>{this.parityStatus="error"}),r}}async dismissSection(t){const n=this.identity?.id;if(!n)return;const a=me(n,t);ce.add(a),Re.add(a);try{const i=await M(Kt,{input:{id:n,section:t,visible:!1}});if(i.setHomeSectionVisibility.__typename!=="MutationSetHomeSectionVisibilitySuccess")throw new Error("Home section visibility update failed",{cause:"message"in i.setHomeSectionVisibility?i.setHomeSectionVisibility.message:void 0})}catch(i){E(i,{extra:{section:t}}),$(()=>ce.delete(a)),q({id:`home-section-${t}`,level:"danger",label:"We couldn't hide that section. Try again."})}finally{Re.delete(a)}}async loadWelcome(t,n){try{const a=await M(Gt,{workspaceUrl:t});if(n!==this.requestId)return;const i=a.me.workspaceMembershipFor?.workspace;if(!i)return;$(()=>
12{this.welcomeWorkspace={name:i.name,logoUrl:i.logo?.url??null,memberCount:i.memberships.totalCount},this.welcomeOpen=!0})}catch(a){E(a)}}closeWelcome(){this.welcomeOpen=!1;const t=new URLSearchParams(window.location.search);t.delete("welcome");const n=t.toString();window.history.replaceState(null,"",window.location.pathname+(n?`?${n}`:"")+window.location.hash)}setMessage(t){this.seededSuggestion!==null&&t!==this.seededSuggestion&&(this.seededSuggestion=null),this.message=t}seedSuggestion(t){this.seededSuggestion=t,this.message=t}setModelOverride(t){this.canSelectCustomModel&&this.availableModels.some(n=>n.value===t)&&(this.modelOverride=t)}setHomeSectionOrder(t){const n=this.identity?.id;if(!n||(this.homeSectionOrder=t,this.queuedHomeSectionOrder=t,this.homeSectionOrderSaveRunning))return;this.homeSectionOrderSaveRunning=!0;const a=this.homeSectionOrderSaveGeneration;w(this.flushHomeSectionOrder(n,a))}persistQueuedHomeSectionOrder(){const t=this.identity?.id,n=this.queuedHomeSectionOrder;!t||!n||(this.queuedHomeSectionOrder=null,w(ct(t,n).then(a=>{a.setHomeSectionOrder.__typename!=="MutationSetHomeSectionOrderSuccess"&&E(new Error("Queued home layout save failed"),{extra:{message:a.setHomeSectionOrder.message}})}).catch(a=>E(a))))}async flushHomeSectionOrder(t,n){try{for(;n===this.homeSectionOrderSaveGeneration&&this.queuedHomeSectionOrder;){const a=this.queuedHomeSectionOrder;this.queuedHomeSectionOrder=null;let i=null,r=null;try{const c=await ct(t,a);if(n!==this.homeSectionOrderSaveGeneration)return;c.setHomeSectionOrder.__typename==="MutationSetHomeSectionOrderSuccess"?i=it(c.setHomeSectionOrder.data.identity.flags?.homeSectionOrder)??a:r=c.setHomeSectionOrder.message}catch(c){if(n!==this.homeSectionOrderSaveGeneration)return;E(c),r="We couldn't save your home layout. Try again."}if(n!==this.homeSectionOrderSaveGeneration)return;const o=this.queuedHomeSectionOrder!==null;$(()=>{i&&(this.confirmedHomeSectionOrder=i),o||(this.homeSectionOrder=i??this.confirmedHomeSectionOrder)}),r&&q({level:"danger",label:r})}}finally{n===this.homeSectionOrderSaveGeneration&&$(()=>{this.homeSectionOrderSaveRunning=!1})}}markMentionsUsed(){const t=this.identity?.id;this.hasUsedChatMentions||this.markedMentionsUsed||!t||(this.markedMentionsUsed=!0,$(()=>{this.hasUsedChatMentions=!0}
12),w(M(qt,{input:{id:t}})))}async createTask(){const t=this.message,n=this.message.trim();if(this.creating||!n&&this.attachments.items.length===0)return;const a=this.agentDefinitionId;if(!a){this.createError="Your assistant isn't set up yet. Finish onboarding first.";return}this.creating=!0,this.createError=null,this.attachments.setUploadsEnabled(!1);const i=this.workspaceUrl,r=this.requestId;try{if(await this.attachments.waitForUploads(),r!==this.requestId)return;const o=this.attachments.readyIds;if(!n&&o.length===0)return;ae.capture("home_chat_submitted",{had_attachment:o.length>0,used_suggestion:this.seededSuggestion===t}),this.seededSuggestion=null;const c=await M(Ke,{input:{agentDefinitionId:a,message:n,interactionPoint:"home",modelOverride:this.canSelectCustomModel?this.modelOverride:null,attachmentIds:o,workspaceUrl:i}});if(r!==this.requestId)return;$(()=>{if(c.createTaskFromUserMessage.__typename!=="MutationCreateTaskFromUserMessageSuccess"){this.createError="message"in c.createTaskFromUserMessage?c.createTaskFromUserMessage.message:"Starting the task failed.";return}this.attachments.clear(),this.modelOverride=null;const{rootSubTask:d}=c.createTaskFromUserMessage.data.task;he(Ze(d.subTaskId,d.agentDefinition??{id:a},i))})}catch{$(()=>{this.createError="Starting the task failed. Try again."})}finally{$(()=>{this.creating=!1,this.attachments.setUploadsEnabled(!0)})}}async createLearning(t){const n=/^remember\b/i.test(t)?t:`Remember to ${t}`,a=this.agentDefinitionId;if(this.creating||!a)throw new Error("Learning task is unavailable");this.creating=!0;const i=this.workspaceUrl;try{const r=await M(Ke,{input:{agentDefinitionId:a,message:n,interactionPoint:"home",modelOverride:null,attachmentIds:[],workspaceUrl:i}});if(r.createTaskFromUserMessage.__typename!=="MutationCreateTaskFromUserMessageSuccess")throw new Error("message"in r.createTaskFromUserMessage?r.createTaskFromUserMessage.message:"Saving the learning failed");const{rootSubTask:o}=r.createTaskFromUserMessage.data.task;he(Ze(o.subTaskId,o.agentDefinition??{id:a},i))}finally{$(()=>{this.creating=!1})}}dismissNeedToKnow(t){this.dismissedNeedToKnow.add(t),w((async()=>{try{const n=await M(Bt,{input:{id:t}});if(n.dismissNeedToKnowItem.__typename!=="MutationDismissNeedToKnowItemSuccess")throw new Error("Need-to-know dismissal failed",{cause:"message"in n.dismissNeedToKnowItem?n.dismissNeedToKnowItem.message:void 0})}catch(n){E(n,{extra:{needToKnowId:t}}),$(()=>this.dismissedNeedToKnow.delete(t)),q({id:`need-to-know-${t}`,level:"danger",label:"We couldn't dismiss that update. Try again."})}})())}copy(t,n){navigator.clipboard&&w(navigator.clipboard.writeText(n)),this.copiedKey=t,clearTimeout(this.copyResetTimer),this.copyResetTimer=setTimeout(()=>{$(()=>{this.copiedKey===t&&(this.copiedKey=null)})},1500)}dispose(){this.persistQueuedHomeSectionOrder();const t=this.identity?.id;t&&$(()=>{for(const n of["spellbook","workflowDiscovery"]){const a=me(t,n);Re.has(a)||ce.delete(a)}}),this.requestId+=1,this.homeSectionOrderSaveGeneration+=1,this.homeSectionOrderSaveRunning=!1,this.queuedHomeSectionOrder=null,clearTimeout(this.copyResetTimer)}}const ai=z(function({state:t,nextMeeting:n,now:a,timeZone:i,action:r}){const o=hn(t.identity?.name),c=pa(a,i),d=o?`${c}, ${o}.`:c;return e.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1",children:[e.jsx("span",{className:"col-start-1 row-start-1 flex min-h-8 items-center text-sm font-medium text-slate-11",children:ma(a,i)}),e.jsx("div",{className:"col-start-2 row-start-1 shrink-0 self-center sm:row-start-2 sm:self-end sm:pb-1",children:r}),e.jsxs("h2",{className:"col-start-1 row-start-2 max-w-[680px] font-manrope text-2xl font-bold tracking-tight text-slate-12 sm:text-3xl",children:[e.jsx("span",{className:n?"block opacity-50":void 0,children:d}),n?e.jsxs("span",{className:"block",children:["Your next meeting is"," ",e.jsx("a",{className:`underline decoration-slate-7 decoration-2 underline-offset-4 transition-colors hover:decoration-slate-12 ${H}`,href:n.href,children:n.title}),"."]}):null]})]})});function ii({rearrange:s,workspaceUrl:t}){const[n,a]=l.useState(!1),i=l.useRef(null),r=l.useCallback(()=>a(!0),[]),o=l.useCallback(()=>{a(!1),i.current?.focus()},[]);return e.jsxs(e.Fragment,{children:[s?e.jsx(Ca,{isRearranging:s.isRearranging,onReset:s.onReset,onToggle:s.onToggle}):null,t?e.jsxs("button",{ref:i,type:"button",className:`flex items-center gap-1.5 whitespace-nowrap rounded-lg bg-slate-3 px-2.5 py-1.5 text-sm font-medium text-slate-11 hover:bg-slate-4 hover:text-slate-12 active:bg-slate-5 dark:bg-white/[0.06] dark:text-white/70 dark:hover:bg-white/[0.1] dark:hover:text-white dark:active:bg-white/[0.14] ${H}`,"data-testid":"home-invite",onClick:r,children:[e.jsx(ns,{className:"size-4"})," Invite colleague"]}):null,n&&t?e.jsx(Hs,{workspaceUrl:t,onClose:o},t):null]})}const ri=z(function({state:t}){const[n,a]=l.useState(!1),i=bt({workspaceUrl:t.workspaceUrl??""}),[r,o]=l.useState(!1),c=l.useCallback(()=>w(t.createTask()),[t]),d=l.useCallback(p=>t.setMessage(p),[t]),m=l.useCallback(()=>t.markMentionsUsed(),[t]),u=l.useCallback(p=>t.setMessage(`${t.message} ${p}`.trim()),[t]),g=l.useCallback(p=>{const L=Array.from(p.clipboardData?.files??[]);L.length>0&&t.attachments.addFiles(L)},[t]),T=l.useCallback(p=>{p.preventDefault(),p.dataTransfer.types.includes("Files")&&t.attachments.uploadsEnabled&&a(!0)},[t]),f=l.useCallback(p=>{p.preventDefault(),a(!1)},[]),y=l.useCallback(p=>{p.preventDefault(),t.attachments.uploadsEnabled&&t.attachments.addFiles(p.dataTransfer.files),a(!1)},[t]),C=t.mentionsEnabled&&!t.hasUsedChatMentions?"Use @ to refer to any meetings or tools":"Ask Lindy anything...",x=t.attachments.uploading||t.attachments.readyIds.length>0,j=t.message.trim().length>0||t.attachments.items.length>0,h=r||!j&&!t.creating;return e.jsxs(Us,{className:"w-full",onSubmit:c,variant:"large","data-testid":"home-composer",children:[t.createError?e.jsx("p",{className:"text-sm text-red-9",role:"alert",children:t.createError}):null,e.jsxs("div",{className:"relative w-full",onDragOver:T,onDragLeave:f,onDrop:y,children:[e.jsxs($s,{className:"!rounded-2xl","data-testid":"home-composer-card",children:[t.mentionsEnabled&&t.workspaceUrl?e.jsx(os,{value:t.message,onChange:d,onSubmit:c,onPaste:g,placeholder:C,workspaceUrl:t.workspaceUrl,onMentionInserted:m,disabled:t.creating,className:"py-3.5"}):e.jsx(zs,{"data-testid":"home-composer-input",className:"py-3.5",rows:1,placeholder:C,value:t.message,disabled:t.status!=="ready"||!t.agentDefinitionId,onChange:d,onPaste:g}),e.jsx(Ps,{state:t.attachments}),e.jsxs(Ws,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[t.addIntegrationEnabled?e.jsx(Fs,{tooltip:"Add integration",className:"disabled:opacity-50","aria-label":"Add integration","data-testid":"add-integration",disabled:i.isOpening||!t.workspaceUrl,onClick:i.open,children:e.jsx(hs,{className:"size-4"})}):null,e.jsx(fs,{host:t,disabled:t.creating})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Vs,{state:t.attachments}),h?e.jsx(cs,{appearance:"submit",onActiveChange:o,onTranscript:u}):e.jsx("button",{type:"submit","aria-label":"Send message",className:`${H} flex size-8 items-center justify-center rounded-full border-[0.5px] border-black/[0.12] bg-slate-12 text-sm text-white transition-all hover:bg-slate-11 active:bg-slate-10 disabled:pointer-events-none disabled:opacity-50 dark:text-canvas dark:disabled:bg-white/[0.08] dark:disabled:text-white/[0.24] dark:disabled:opacity-100`,disabled:!t.message.trim()&&!x||t.creating,children:t.creating?e.jsx(As,{className:"size-4 text-current"}):e.jsx(as,{className:"block size-4 -rotate-90 text-current"})})]})]})]}),e.jsxs("div",{className:`pointer-events-none absolute inset-0 z-40 flex items-center justify-center transition-opacity duration-200 @container ${n?"opacity-100":"opacity-0"}`,children:[e.jsx("div",{className:"absolute size-full rounded-2xl bg-panel opacity-90"}),e.jsxs("div",{className:"z-50 flex w-full flex-col items-center justify-center gap-1 px-6 text-center",children:[e.jsx("div",{className:"text-base font-medium text-slate-12",children:"Drop to upload"}),e.jsxs("div",{className:"text-xs leading-4 text-slate-11",children:["Accepted types:"," ",Ks.map(p=>`.${p}
12`).join(", ")]})]})]})]}),i.modal?ln.createPortal(i.modal,document.body):null]})}),li=z(function({state:t}){const[n,a]=l.useState(!1),i=l.useCallback(()=>a(!0),[]),r=l.useCallback(()=>a(!1),[]),o=l.useCallback(()=>w(t.dismissSection("spellbook")),[t]),c=l.useCallback(d=>{ae.capture("home_spellbook_suggestion_selected",{surface:"new_home"}),t.seedSuggestion(d),a(!1),Rt()},[t]);return e.jsxs(e.Fragment,{children:[e.jsx(za,{suggestions:Ua,isLoading:!1,onSelectSuggestion:c,onSeeMore:i,onDismiss:o,showHeaderIcon:!1}),e.jsx(Aa,{isOpen:n,onClose:r,children:t.status==="loading"?e.jsx(Da,{}):e.jsx(Ha,{categories:t.spellbookCategories,onSelectSuggestion:c})})]})});function oi({state:s,workspaceUrl:t}){const[n,a]=l.useState([]),[i,r]=l.useState(!1),[o,c]=l.useState("unknown"),[d,m]=l.useState(0),u=l.useRef(0),g=l.useRef(!1),T=l.useRef(!1),{buildRoutine:f,buildingPrompt:y}=ci(s);l.useEffect(()=>{let h=!0,p;const L=()=>{u.current>=Ka||(p=window.setTimeout(()=>{u.current+=1,m(V=>V+1)},Ga))};return w(M(Yt,{workspaceUrl:t}).then(V=>{if(!h)return;const v=V.me.workflowDiscoverySuggestions;g.current=v?.pending===!0,T.current=!1,a(v?.workflows??[]),r(v?.createsRoutineOnClick===!0),c(v?.source??"unknown"),g.current&&L()}).catch(V=>{h&&(T.current||(T.current=!0,E(V)),g.current&&L())})),()=>{h=!1,p!==void 0&&window.clearTimeout(p)}},[d,t]),l.useEffect(()=>{const h=()=>{u.current=0,g.current=!0,T.current=!1,m(p=>p+1)};return window.addEventListener(He,h),()=>window.removeEventListener(He,h)},[]);const C=l.useCallback(h=>{if(ae.capture("home_workflow_discovery_suggestion_selected",{source:o,surface:"new_home"}),i){f(h);return}s.seedSuggestion(h),Rt()},[f,i,o,s]),x=l.useCallback(()=>w(s.dismissSection("workflowDiscovery")),[s]),j=l.useMemo(()=>n.map(h=>({...h,tools:h.tools.split(",").map(p=>p.replace(/\s*\([^)]*\)\s*$/,"").trim()).filter(Boolean).map(p=>({name:p,icon:e.jsx(ds,{tool:Za[p.toLowerCase()]??p,className:"size-5"})}))})),[n]);return e.jsx(Fa,{workflows:j,onSelectSuggestion:C,onDismiss:x,buildingPrompt:y})}function ci(s){const[t,n]=l.useState(null),a=l.useRef(!1);return{buildRoutine:l.useCallback(r=>{const o=s.workspaceId;if(!o||a.current)return;a.current=!0,n(r);const c=d=>{a.current=!1,n(null),q({id:"workflow-discovery-build",level:"danger",label:d})};w(M(Zt,{input:{workspaceId:o,prompt:r,suggestionOriginated:!0}}).then(d=>{const m=d.createRoutineFromPrompt;if(!("data"in m)||!m.data){c(("message"in m?m.message:null)??"We couldn't build that routine. Try again.");return}const u=m.data.routine;if(!u){c("We couldn't build that routine. Try again.");return}Ls(u.firstRun)||w(M(Qt,{input:{routineId:u.id}}));const g=new URLSearchParams({routine:u.id});u.scope==="team"&&g.set("scope","team"),he(le(`/routines?${g.toString()}`,s.workspaceUrl))}).catch(d=>{E(d),c("We couldn't build that routine. Try again.")}))},[s]),buildingPrompt:t}}const di=z(function({items:t,now:n,timeZone:a}){const i=Ot(t,a,n),r=l.useCallback(o=>{const c=o.target;if(!(c instanceof Element))return;const d=c.closest("a[data-home-meeting-action]"),m=d?.dataset.homeMeetingAction,u=Number(d?.dataset.homeMeetingPosition);m!=="open"&&m!=="join"||!Number.isInteger(u)||ae.capture("home_meeting_card_clicked",{meeting_type:"upcoming",action:m,position:u})},[]);return i.length===0?null:e.jsx("div",{className:be,children:e.jsxs("div",{className:"flex w-full flex-col gap-3",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("h3",{className:"flex-1 text-base font-semibold leading-6 text-slate-12",children:"Upcoming meetings"})}),e.jsx("ul",{className:"flex flex-col gap-2","data-testid":"home-upcoming-meetings",onClick:r,children:i.map((o,c)=>e.jsx("li",{children:e.jsxs("div",{className:"relative flex min-h-12 min-w-0 items-center gap-3 rounded-lg pl-0 pr-2",children:[o.href?e.jsx("a",{"aria-label":`Open ${o.title||"Untitled meeting"} in calendar`,className:`absolute inset-0 z-0 rounded-lg ${se} ${H}`,href:o.href,target:"_blank",rel:"noopener noreferrer","data-home-meeting-action":"open","data-home-meeting-position":c}):null,e.jsxs("div",{className:`relative z-[1] grid min-w-0 flex-1 grid-cols-[4rem_1px_minmax(0,1fr)] items-center gap-x-4 text-left ${o.href?"pointer-events-none":""}`,children:[e.jsx("span",{className:"flex shrink-0 items-center justify-end whitespace-nowrap text-right text-xs font-medium tabular-nums leading-[18px] text-slate-12",children:ua(o.startTime,a)}),e.jsx("span",{"aria-hidden":"true",className:"h-8 w-[0.5px] shrink-0 bg-black/[0.12] dark:bg-white/[0.16]"}),e.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 pl-1 text-left",children:[e.jsx("span",{className:"line-clamp-1 text-sm font-medium text-slate-12",children:o.title||"Untitled meeting"}),o.description?e.jsx("span",{className:"line-clamp-1 text-xs text-slate-11 dark:text-white/60",children:o.description}):null]})]}),o.joinUrl?e.jsxs("a",{className:`relative z-[2] flex shrink-0 items-center gap-1 rounded-lg px-2 py-1 text-sm font-medium text-slate-11 hover:text-slate-12 dark:text-white/70 dark:hover:text-white ${se} ${H}`,href:o.joinUrl,target:"_blank",rel:"noopener noreferrer","data-home-meeting-action":"join","data-home-meeting-position":c,children:[e.jsx(Ue,{className:"size-4"})," Join"]}):null]})},o.id))})]})})}),mi=z(function({meeting:t,position:n,workspaceUrl:a}){const i=l.useCallback(()=>{ae.capture("home_meeting_card_clicked",{meeting_type:"past",action:"open",position:n})},[n]);return e.jsx("div",{className:"group/card flex min-w-0 justify-center",children:e.jsx("div",{className:"relative w-full max-w-[220px]",children:e.jsxs("a",{className:`flex w-full min-w-0 flex-col items-center gap-2.5 rounded-lg text-center ${H}`,href:le(`/meetings/${encodeURIComponent(t.nodeId)}`,a),onClick:i,children:[e.jsx("div",{className:"relative aspect-video w-full overflow-hidden rounded-xl border border-black/[0.04] bg-slate-3 motion-safe:transition-transform motion-safe:group-hover/card:scale-[1.03] dark:border-white/[0.06]",children:t.thumbnail?.url?e.jsx("img",{className:"absolute inset-0 size-full object-cover dark:brightness-110",src:t.thumbnail.url,alt:"",loading:"lazy"}):e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(Ue,{className:"size-8 text-slate-11"})})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"line-clamp-1 text-sm font-medium text-slate-12",children:t.title||"Untitled meeting"}),e.jsx("span",{className:"text-xs text-slate-11",children:pn(t.createdAt)})]})]})})})}),ui=z(function({state:t,meetings:n}){const a=Et(n),i=a.length<=1?"grid-cols-1":a.length===2?"grid-cols-2":"grid-cols-2 sm:grid-cols-3";return e.jsx("div",{className:be,children:e.jsxs("div",{className:"flex w-full flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"flex-1 text-base font-semibold leading-6 text-slate-12",children:"Past meetings"}),n.length>_t?e.jsxs("a",{className:`-mr-1 flex shrink-0 items-center gap-0.5 rounded-lg px-2 py-1 text-sm font-medium text-slate-11 hover:text-slate-12 dark:text-white/80 dark:hover:text-white ${se} ${H}`,href:le("/meetings",t.workspaceUrl),children:["See more ",e.jsx(fe,{className:"size-4"})]}):null]}),a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-1 rounded-xl border border-edge bg-panel px-4 py-10 text-center",children:[e.jsx("div",{className:"mb-2 flex size-10 items-center justify-center rounded-full bg-slate-3",children:e.jsx(Ue,{className:"size-5 text-slate-11"})}),e.jsx("p",{className:"text-sm font-medium text-slate-12",children:"No meetings 
12yet"}),e.jsx("p",{className:"text-sm text-slate-11",children:"Once your assistant joins a meeting, the recap shows up here."})]}):e.jsx("div",{className:`grid gap-3 ${i}`,children:a.map((r,o)=>e.jsx(mi,{meeting:r,position:o,workspaceUrl:t.workspaceUrl},r.id))})]})})}),pi=s=>{if(s.source==="slack")return e.jsx(je,{className:"size-6"});if(s.source!=="email")return null;try{const t=s.url?new URL(s.url).hostname.toLowerCase():"";if(t==="mail.google.com")return e.jsx(rs,{className:"size-6"});if(["outlook.live.com","outlook.office.com","office.com","microsoft.com"].some(n=>t===n||t.endsWith(`.${n}`)))return e.jsx(ls,{className:"size-6 [&>rect:first-child]:fill-transparent"})}catch{}return e.jsx(xt,{className:"size-6 text-slate-11 dark:text-white/70"})},hi=z(function({state:t,item:n,position:a}){const i=Xe(n.url)!==null,r=l.useCallback(()=>{const d=Xe(n.url);d&&(ae.capture("need_to_know_item_clicked",{source:n.source,position:a,action:d.kind==="internal"?"open_internal":"open_external"}),d.kind==="internal"?he(le(d.path,t.workspaceUrl)):window.open(d.url,"_blank","noopener,noreferrer"))},[n.source,n.url,a,t.workspaceUrl]),o=l.useCallback(()=>{ae.capture("need_to_know_item_dismissed",{source:n.source,position:a}),t.dismissNeedToKnow(n.id)},[n.id,n.source,a,t]),c=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center overflow-hidden rounded-md border-[0.5px] border-black/[0.12] bg-white dark:border-0 dark:bg-white/[0.08] [&>*]:size-[14px]",children:pi(n)}),e.jsx("span",{className:"line-clamp-2 min-w-0 max-w-full flex-1 text-left text-sm font-medium leading-5 text-[#333231] dark:text-white",children:n.title})]});return e.jsxs("li",{className:"group/ntk-item relative min-w-0",children:[i?e.jsx("button",{type:"button",className:`-mx-2 flex w-[calc(100%+1rem)] min-w-0 max-w-none items-center gap-4 roun
12ded-lg px-2 py-1.5 pr-[34px] ${se} ${H}`,onClick:r,children:c}):e.jsx("div",{className:"-mx-2 flex w-[calc(100%+1rem)] min-w-0 max-w-none items-center gap-4 rounded-lg px-2 py-1.5 pr-[34px]",children:c}),i?e.jsx(fe,{className:"pointer-events-none absolute right-0 top-1/2 size-[18px] -translate-y-1/2 text-[#333231] transition-opacity group-hover/ntk-item:opacity-0 dark:text-white"}):null,e.jsx("button",{type:"button","aria-label":"Dismiss update",className:`absolute right-0 top-1/2 flex size-[18px] -translate-y-1/2 items-center justify-center rounded-md text-slate-9 opacity-0 transition-opacity hover:text-slate-12 focus-visible:opacity-100 group-hover/ntk-item:opacity-100 dark:text-white/50 dark:hover:text-white ${se}`,onClick:o,children:e.jsx(xe,{className:"size-4"})})]})}),fi=z(function({state:t,items:n}){const a=Lt(n,t.dismissedNeedToKnow);return a.length===0?null:e.jsx("div",{className:`${be} overflow-hidden shadow-[0_2px_6px_rgba(0,0,0,0.08)] dark:ring-0`,children:e.jsxs("div",{className:"flex w-full flex-col gap-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("h3",{className:"flex-1 text-base font-semibold leading-6 text-[#333231] dark:text-white",children:"Need to know"})}),e.jsx("ul",{className:"flex min-w-0 flex-col gap-3",children:a.map((i,r)=>e.jsx(hi,{state:t,item:i,position:r},i.id))})]})})}),xi=z(function({activity:t}){return e.jsx(Ma,{emailsTriaged:t?.emailsTriaged??0,draftsWritten:t?.draftsWritten??0,timeSavedMinutes:t?.timeSavedMinutes??0,timeSavedApproximationGlyph:"~",showHeaderIcon:!1})}),gi=z(function({state:t,learnings:n}){const[a,i]=l.useState(()=>new Set),r=l.useMemo(()=>n?.points.flatMap((c,d)=>{const m=`${d}:${c}`;return a.has(m)?[]:[{key:m,point:c,item:n.items[d]}]})??[],[a,n]),o=l.useCallback(c=>{const d=c.currentTarget.dataset.learningKey;d&&i(m=>new Set(m).add(d))},[]);return r.length===0?null:e.jsx("div",{className:be,children:e.jsxs("div",{className:"flex w-full flex-col gap-2",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("h3",{className:"flex-1 text-base font-semibold leading-6 text-slate-12",children:"Recent learnings"})}),e.jsx("ul",{className:"flex flex-col",children:r.map(({key:c,point:d,item:m})=>{const u=m?.text===d?m.filePath:null,g=u?le(`/files?open=${encodeURIComponent(u)}&repo=personal`,t.workspaceUrl):null;return e.jsxs("li",{className:"group/recent-learning relative -mx-3 flex items-start gap-2 rounded-xl px-3 py-2 pr-9",children:[e.jsx("span",{"aria-hidden":!0,className:"shrink-0 text-sm leading-relaxed text-slate-11",children:"•"}),g?e.jsx("a",{className:`min-w-0 flex-1 rounded text-sm leading-relaxed text-slate-11 ${H}`,href:g,children:d}):e.jsx("span",{className:"min-w-0 flex-1 text-sm leading-relaxed text-slate-11",children:d}),e.jsxs(vt,{placement:"top",children:[e.jsx(Nt,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Clear learning","data-learning-key":c,className:`absolute right-3 top-1/2 flex size-[18px] -translate-y-1/2 items-center justify-center rounded-md text-slate-9 opacity-100 transition-opacity hover:text-slate-12 focus-visible:opacity-100 sm:opacity-0 sm:group-hover/recent-learning:opacity-100 dark:text-white/50 dark:hover:text-white ${se}`,onClick:o,children:e.jsx(xe,{className:"size-4"})})}),e.jsx(St,{openDelay:.35,children:"Clear"})]})]},c)})}),t.agentDefinitionId?e.jsx(bi,{state:t}):null]})})}),bi=z(function({state:t}){const[n,a]=l.useState(!1),[i,r]=l.useState(!1),[o,c]=l.useState(""),d=l.useCallback(()=>{ae.capture("home_recent_learnings_add_started",{surface:"new_home"}),a(!0)},[]),m=l.useCallback(async()=>{const f=o.trim();if(!(!f||i)){r(!0);try{await t.createLearning(f),ae.capture("home_recent_learnings_add_submitted",{surface:"new_home"}),c(""),a(!1)}catch(y){E(y),q({id:"recent-learnings-add",level:"danger",label:"We couldn't save that learning. Try again."})}finally{r(!1)}}},[o,i,t]),u=l.useCallback(f=>c(f.currentTarget.value),[]),g=l.useCallback(f=>{f.key==="Enter"&&!f.nativeEvent.isComposing?(f.preventDefault(),w(m())):f.key==="Escape"&&(f.stopPropagation(),c(""),a(!1))},[m]),T=l.useCallback(()=>w(m()),[m]);return n?e.jsxs("div",{className:"-mx-3 flex items-center gap-2 rounded-xl bg-black/[0.04] px-3 py-1.5 dark:bg-white/[0.06]",children:[e.jsx("input",{autoFocus:!0,"aria-busy":i,"aria-label":"Add a learning",className:`min-w-0 flex-1 bg-transparent text-sm text-slate-12 outline-none placeholder:text-slate-10 dark:text-white/80 dark:placeholder:text-white/[0.5] ${i?"cursor-wait":""}`,placeholder:"Remember to…",readOnly:i,value:o,onChange:u,onKeyDown:g}),e.jsx("button",{type:"button","aria-label":"Save learning",className:`shrink-0 rounded-lg p-1 text-slate-11 transition-colors hover:bg-black/[0.06] disabled:opacity-40 disabled:hover:bg-transparent dark:text-white/70 dark:hover:bg-white/[0.08] ${H}`,disabled:!o.trim()||i,onClick:T,children:e.jsx(ge,{className:"size-4"})})]}):e.jsxs("button",{type:"button",className:`-mx-3 flex items-center gap-1.5 rounded-xl px-3 py-1.5 text-sm text-slate-10 transition-colors hover:bg-black/[0.06] hover:text-slate-11 dark:text-white/[0.5] dark:hover:bg-white/[0.08] dark:hover:text-white/70 ${H}`,onClick:d,children:[e.jsx(gt,{className:"size-4 shrink-0"}),"Add a learning"]})}),mt=z(function({state:t,copyKey:n,label:a,value:i,icon:r,href:o}){const c=l.useCallback(()=>t.copy(n,i),[t,n,i]),d=o!=null?"group-focus-within:opacity-100 [@media(hover:none)]:opacity-100":"group-focus-visible:opacity-100",m=t.copiedKey===n?e.jsx(ge,{className:"size-4 shrink-0 text-slate-11 dark:text-white/70"}):e.jsx(is,{className:`size-4 shrink-0 text-slate-9 opacity-0 transition-opacity group-hover:opacity-100 dark:text-white/[0.5] ${d}`});return o!=null?e.jsxs("div",{className:"group flex w-full items-center gap-0.5",children:[e.jsxs("a",{href:o,className:`flex min-w-0 flex-1 items-center gap-2.5 rounded-l-xl rounded-r px-2 py-2 transition-colors ${se} ${dt} ${H}`,children:[e.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center text-slate-11 dark:text-white/70",children:r}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-sm text-slate-11 dark:text-white/70",children:i})]}),e.jsx("button",{type:"button","aria-label":`Copy ${a}`,title:`Copy ${a}`,className:`flex w-8 shrink-0 self-stretch items-center justify-center rounded-l rounded-r-xl transition-colors ${se} ${dt} ${H}`,onClick:c,children:m})]}):e.jsxs("button",{type:"button","aria-label":`Copy ${a}`,className:`group flex w-full items-center gap-2.5 rounded-xl px-2 py-2 transition-colors ${se} ${H}`,onClick:c,children:[e.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center text-slate-11 dark:text-white/70",children:r}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-sm text-slate-11 dark:text-white/70",children:i}),m]})}),wi=z(function({state:t}){const n=t.identity,a=n?.phoneNumberIsVerified&&n.assignedLindyAssistantPhoneNumber?si(n.assignedLindyAssistantPhoneNumber):null,i=n?.flags?.appleMessagesRegistrationUrl??null,r=i!=null?{url:i,
12connected:!!n?.flags?.isAppleMessagesConnected}:null,o=t.parityData?.lindyAssistantSlackLaunchUrl,c=typeof o=="string"?o:null,d=l.useCallback(()=>{const m=window.open("","_blank");m&&(m.opener=null);const u=g=>{if(!g){m?.close();return}m?m.location.href=g:window.location.href=g};M(Xt).then(g=>u(g.mintAmbConnectLink.__typename==="MutationMintAmbConnectLinkSuccess"?g.mintAmbConnectLink.data.url:i)).catch(()=>u(i))},[i]);return e.jsx("div",{className:be,children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex items-center gap-2 px-2",children:e.jsx("h3",{className:"flex-1 text-base font-semibold leading-6 text-slate-12",children:"How to reach me"})}),c!=null&&e.jsx(ki,{href:c,icon:e.jsx(vi,{className:"size-4"}),label:"Slack"}),e.jsx(mt,{state:t,copyKey:"email",label:"Lindy's email address",value:ot,icon:e.jsx(yi,{className:"size-4"}),href:`mailto:${ot}`}),a?e.jsx(mt,{state:t,copyKey:"phone",label:"Lindy's phone number",value:a,icon:e.jsx(ji,{className:"size-4"})}):null,r?r.connected?e.jsxs("a",{href:r.url,target:"_blank",rel:"noopener noreferrer","data-testid":"home-apple-messages",className:`group flex w-full items-center gap-2.5 rounded-xl px-2 py-2 transition-colors ${se} ${H}`,children:[e.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center text-slate-11 dark:text-white/70",children:e.jsx(Be,{className:"size-4"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-sm text-slate-11 dark:text-white/70",children:"Apple Messages"}),e.jsx(fe,{className:"size-5 shrink-0 text-slate-9 dark:text-white/[0.5]"})]}):e.jsxs("button",{type:"button",onClick:d,"data-testid":"home-apple-messages",className:`group flex w-full items-center gap-2.5 rounded-xl px-2 py-2 transition-colors ${se} ${H}`,children:[e.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center text-slate-11 dark:text-white/70",children:e.jsx(Be,{className:"size-4"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-sm text-slate-11 dark:text-white/70",children:"Connect to Apple Messages"}),e.jsx(fe,{className:"size-5 shrink-0 text-slate-9 dark:text-white/[0.5]"})]}):null]})})});function ki({href:s,icon:t,label:n}){return e.jsxs("a",{href:s,className:`group flex w-full items-center gap-2.5 rounded-xl px-2 py-2 transition-colors ${se} ${H}`,children:[e.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center text-slate-11 dark:text-white/70",children:t}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-sm text-slate-11 dark:text-white/70",children:n})]})}function yi({className:s}){return e.jsxs("svg",{"aria-hidden":"true",className:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M20.5 6.75V17.25H22V6.75H20.5ZM19.25 18.5H4.75V20H19.25V18.5ZM3.5 17.25V6.75H2V17.25H3.5ZM4.75 5.5H19.25V4H4.75V5.5ZM3.5 6.75C3.5 6.05964 4.05964 5.5 4.75 5.5V4C3.23122 4 2 5.23122 2 6.75H3.5ZM4.75 18.5C4.05964 18.5 3.5 17.9404 3.5 17.25H2C2 18.7688 3.23122 20 4.75 20V18.5ZM20.5 17.25C20.5 17.9404 19.9404 18.5 19.25 18.5V20C20.7688 20 22 18.7688 22 17.25H20.5ZM22 6.75C22 5.23122 20.7688 4 19.25 4V5.5C19.9404 5.5 20.5 6.05964 20.5 6.75H22Z",fill:"currentColor"}),e.jsx("path",{d:"M10.7335 11.9638L10.2564 12.5425L10.2586 12.5443L10.7335 11.9638ZM13.2665 11.9638L13.7414 12.5443L13.7436 12.5425L13.2665 11.9638ZM11.2106 11.3851L3.9771 5.42132L3.0229 6.57868L10.2564 12.5425L11.2106 11.3851ZM20.0229 5.42132L12.7894 11.3851L13.7436 12.5425L20.9771 6.57868L20.0229 5.42132ZM10.2586 12.5443C11.2716 13.3731 12.7284 13.3731 13.7414 12.5443L12.7915 11.3833C12.3311 11.7601 11.6689 11.7601 11.2085 11.3833L10.2586 12.5443Z",fill:"currentColor"})]})}function ji({className:s}){return e.jsx("svg",{"aria-hidden":"true",className:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9.45904 4.85557C9.12025 4.178 8.42773 3.75 7.67018 3.75H5.75C4.64543 3.75 3.75 4.64543 3.75 5.75V5.8125C3.75 13.7861 10.2139 20.25 18.1875 20.25H18.25C19.3546 20.25 20.25 19.3546 20.25 18.25V16.3298C20.25 15.5723 19.822 14.8797 19.1444 14.541L17.1468 13.5422C16.5366 13.2371 15.7996 13.3566 15.3172 13.8391C14.8688 14.2874 14.1908 14.4356 13.6251 14.1493C11.9081 13.2803 10.7197 12.0919 9.8507 10.3749C9.56435 9.8092 9.71257 9.13118 10.1609 8.68283C10.6434 8.2004 10.7629 7.4634 10.4578 6.85317L9.45904 4.85557Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})}function vi({className:s}){return e.jsxs("svg",{"aria-hidden":"true",className:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M6.36125 14.5772C6.36125 15.7106 5.44597 16.6266 4.3135 16.6266C3.18104 16.6266 2.26576 15.7106 2.26576 14.5772C2.26576 13.4439 3.18104 12.5279 4.3135 12.5279H6.36125V14.5772ZM7.38512 14.5772C7.38512 13.4439 8.3004 12.5279 9.43286 12.5279C10.5653 12.5279 11.4806 13.4439 11.4806 14.5772V19.7006C11.4806 20.834 10.5653 21.75 9.43286 21.75C8.3004 21.75 7.38512 20.834 7.38512 19.7006V14.5772Z",fill:"currentColor"}),e.jsx("path",{d:"M9.43262 6.34872C8.30016 6.34872 7.38488 5.43272 7.38488 4.29936C7.38488 3.166 8.30016 2.25 9.43262 2.25C10.5651 2.25 11.4804 3.166 11.4804 4.29936V6.34872H9.43262ZM9.43262 7.38893C10.5651 7.38893 11.4804 8.30493 11.4804 9.43829C11.4804 10.5
12717 10.5651 11.4877 9.43262 11.4877H4.29775C3.16528 11.4877 2.25 10.5717 2.25 9.43829C2.25 8.30493 3.16528 7.38893 4.29775 7.38893H9.43262Z",fill:"currentColor"}),e.jsx("path",{d:"M17.639 9.43829C17.639 8.30493 18.5543 7.38893 19.6867 7.38893C20.8192 7.38893 21.7345 8.30493 21.7345 9.43829C21.7345 10.5717 20.8192 11.4877 19.6867 11.4877H17.639V9.43829ZM16.6151 9.43829C16.6151 10.5717 15.6998 11.4877 14.5674 11.4877C13.4349 11.4877 12.5196 10.5717 12.5196 9.43829V4.29936C12.5196 3.166 13.4349 2.25 14.5674 2.25C15.6998 2.25 16.6151 3.166 16.6151 4.29936V9.43829Z",fill:"currentColor"}),e.jsx("path",{d:"M14.5674 17.6513C15.6998 17.6513 16.6151 18.5673 16.6151 19.7006C16.6151 20.834 15.6998 21.75 14.5674 21.75C13.4349 21.75 12.5196 20.834 12.5196 19.7006V17.6513H14.5674ZM14.5674 16.6266C13.4349 16.6266 12.5196 15.7106 12.5196 14.5772C12.5196 13.4439 13.4349 12.5279 14.5674 12.5279H19.7023C20.8347 12.5279 21.75 13.4439 21.75 14.5772C21.75 15.7106 20.8347 16.6266 19.7023 16.6266H14.5674Z",fill:"currentColor"})]})}const ut=z(function({state:t}){const n=l.useRef(null),a=l.useCallback(()=>{n.current?.(),n.current=null,t.closeWelcome()},[t]),i=t.welcomeWorkspace,r=t.welcomeOpen&&i!==null;return l.useEffect(()=>{if(!r)return;const o=document.querySelector("#lindy-root"),c=document.body.style.overflow,d=o?.inert??!1;let m=!1;const u=()=>{m||(m=!0,document.body.style.overflow=c,o&&(o.inert=d))};return n.current=u,document.body.style.overflow="hidden",o&&(o.inert=!0),()=>{u(),n.current===u&&(n.current=null)}},[r]),!r||!i?null:e.jsx(Rs,{open:!0,onClose:a,size:"sm",className:"max-sm:overflow-y-auto sm:w-[480px] sm:max-w-[480px]",overlayClassName:"bg-slate-4 bg-opacity-80 backdrop-blur transition-opacity dark:bg-black dark:bg-opacity-80","aria-labelledby":"joined-workspace-title","data-testid":"joined-workspace-modal",children:e.jsxs("div",{className:"row-span-3 flex h-full select-none flex-col items-stretch justify-center gap-y-0 text-left",children:[e.jsx("div",{className:"p-1",children:e.jsxs("div",{className:"relative flex h-40 items-center justify-center rounded bg-gradient-to-l from-[#FFFBD8] to-[#FCFBF8]",children:[e.jsx("button",{type:"button",onClick:a,"aria-label":"Close",className:`absolute right-1.5 top-1.5 flex size-6 items-center justify-center rounded bg-[rgba(0,0,0,0.05)] transition-colors hover:bg-[rgba(0,0,0,0.1)] ${H}`,children:e.jsx(xe,{className:"h-4 w-4 text-slate-11"})}),e.jsxs("div",{className:"flex h-20 w-96 max-w-full items-center justify-start gap-x-3 rounded-xl border border-[#E7E7E7] bg-white p-2 shadow dark:bg-slate-2",children:[i.logoUrl?e.jsx("img",{className:"size-16 shrink-0 rounded-md object-cover",src:i.logoUrl,alt:""}):e.jsx("span",{className:"flex size-16 shrink-0 items-center justify-center rounded-md bg-slate-3 text-xl font-medium text-slate-11",children:i.name.trim().charAt(0).toUpperCase()||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-medium text-slate-12",children:i.name}),e.jsxs("div",{className:"text-base font-medium text-slate-9",children:[i.memberCount," members"]})]})]})]})}),e.jsxs("div",{className:"flex w-full flex-col gap-y-6 p-4",children:[e.jsxs("div",{id:"joined-workspace-title",className:"text-2xl font-semibold text-slate-12",children:["You've joined ",i.name,"."]}),e.jsx("button",{type:"button",className:`inline-flex select-none items-center justify-center rounded-md border border-slate-5 bg-transparent px-4 py-2.5 text-sm font-medium text-slate-12 transition hover:border-slate-6 hover:bg-slate-3 focus:outline-none active:border-slate-8 active:bg-slate-4 ${H}`,onClick:a,children:"Explore Lindy"})]})]})})}),Ni=z(function(){const[t]=l.useState(()=>new ni),[n,a]=l.useState(!1),i=l.useRef(!1),r=ei(),o=ht(),c=l.useCallback(()=>w(t.load(o)),[o,t]),d=l.useCallback(()=>t.refreshParity(),[t]),m=l.useCallback(()=>w(t.refreshParity().catch(N=>E(N))),[t]),u=l.useCallback(()=>a(N=>!N),[]),g=l.useCallback(()=>t.setHomeSectionOrder({main:[],side:[]}),[t]),T=l.useCallback(N=>t.setHomeSectionOrder(N),[t]);l.useEffect(()=>{w(t.load(o))},[o,t]),l.useEffect(()=>()=>t.dispose(),[t]);const f=t.identity,y=t.parityData,C=(f?.workspaceMembershipFor?.workspace.meetings.edges??[]).map(N=>N?.node).filter(N=>N!=null).filter(N=>N.thumbnail?.url!=null||N.title?.trim()),x=(f?.upcomingEvents.edges??[]).map(N=>N?.node).filter(N=>N!=null),j=ti(x),h=f?.timeZone??null,p=da(j,h,r),L=p?{title:p.meeting.title,href:p.href}:null,V=f?.needToKnow??[],v=Lt(V,t.dismissedNeedToKnow),K=Ot(j,h,r),R=Et(C),D=f?.assistantActivity??null,P=f?.recentLearnings??null,G=j.some(N=>We(N,h,r)),Z=v.length>0,Q=y?.me.enabledFeatureFlags.includes("teammate-billing")??!1,X=y!==null&&!y.me.flags.dismissedSetupChecklist,J=1,W=f?.enabledFeatureFlags.includes(an.HomeRearrangeSections)??!1,B=f!=null&&ce.has(me(f.id,"spellbook")),ie=f
12!=null&&ce.has(me(f.id,"workflowDiscovery")),A=Ya.filter(N=>N==="spellbook"?!t.spellbookHidden&&!B:N==="workflowDiscovery"?!t.workflowDiscoveryHidden&&!ie:!0);l.useEffect(()=>{if(i.current||!f||t.status!=="ready")return;i.current=!0;const N=D?.emailsTriaged??0,oe=D?.draftsWritten??0;ae.capture("home_viewed",{need_to_know_count:v.length,upcoming_meetings_count:K.length,recorded_meetings_count:R.length,emails_triaged:N,drafts_written:oe,is_zero_state:v.length===0&&K.length===0&&R.length===0&&N===0&&oe===0,visible_sections:A})},[D?.draftsWritten,D?.emailsTriaged,f,t.status,v,R,A,K]);const k=W?{isRearranging:n,onReset:g,onToggle:u}:void 0,_={workflowDiscovery:t.agentDefinitionId&&!t.workflowDiscoveryHidden&&!ie&&t.workspaceUrl?e.jsx(oi,{state:t,workspaceUrl:t.workspaceUrl}):null,spellbook:t.agentDefinitionId&&!t.spellbookHidden&&!B?e.jsx(li,{state:t}):null,setupChecklist:X&&t.workspaceUrl?e.jsx(la,{data:y,workspaceUrl:t.workspaceUrl}):null,meetings:G?e.jsx(di,{items:j,now:r,timeZone:h}):null,pastMeetings:e.jsx(ui,{state:t,meetings:C}),needToKnow:Z?e.jsx(fi,{state:t,items:V}):null,metrics:e.jsx(xi,{activity:D}),learnedPreferences:P?.points.length?e.jsx(gi,{state:t,learnings:P}):null,contactInfo:e.jsx(wi,{state:t})},U=ja(t.homeSectionOrder),O=N=>N.flatMap(oe=>{const ke=_[oe];return ke==null?[]:[{id:oe,node:ke}]}),ee=O(U.main),ne=O(U.side),Te=ee.map(({id:N})=>N),_e=ne.map(({id:N})=>N),b=Te.join(","),F=_e.join(","),Y=l.useMemo(()=>({main:b?b.split(","):[],side:F?F.split(","):[]}),[b,F]),we=({id:N,node:oe},ke)=>W&&n?e.jsx(Sa,{id:N,children:oe},N):e.jsx(Le,{index:ke+J,children:oe},N);return t.status==="loading"?e.jsxs("div",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden",children:[e.jsx(ut,{state:t}),e.jsx(Ht,{className:"flex-1",delayMs:300})]}):e.jsxs("div",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden",children:[e.jsx(ut,{state:t}),e.jsx("div",{className:"relative min-h-0 w-full flex-1 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:e.jsx("div",{className:"relative flex min-h-full w-full flex-col items-center px-4 pb-12 pt-8 sm:px-6 md:pt-[7.5vh] lg:px-8",children:e.jsxs("div",{className:"flex w-full max-w-[1080px] flex-col gap-6 sm:gap-8",children:[t.status==="error"?e.jsxs("p",{className:"text-sm text-red-9",role:"alert",children:["Loading failed."," ",e.jsx("button",{className:"underline",onClick:c,children:"Retry"})]}):null,e.jsx(Le,{index:0,children:e.jsx(ai,{state:t,nextMeeting:L,now:r,timeZone:h,action:e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(ii,{rearrange:k,workspaceUrl:t.workspaceUrl})})})}),t.status==="ready"&&t.parityData===null&&t.parityStatus!=="ready"?t.parityStatus==="error"?e.jsxs("p",{className:"text-sm text-red-9",role:"alert",children:["Home details didn't load."," ",e.jsx("button",{className:"underline",onClick:m,children:"Retry"})]}):e.jsx("p",{className:"text-sm text-slate-11",role:"status",children:"Loading home details…"}):null,Q&&y&&t.workspaceUrl?e.jsx(Le,{index:J,children:e.jsx(Yn,{data:y,workspaceUrl:t.workspaceUrl,onRefresh:d},t.workspaceUrl)}):null,e.jsx(Na,{enabled:W&&n,rendered:Y,onOrderChange:T,children:e.jsxs("div",{className:"grid w-full grid-cols-1 gap-4 lg:grid-cols-[minmax(0,650fr)_minmax(0,418fr)] lg:items-start lg:gap-4",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[e.jsx(ri,{state:t}),ee.map(we)]}),e.jsx("aside",{className:"flex w-full min-w-0 flex-col gap-4",children:ne.map(we)})]})})]})})})]})}),Jl=z(function(){return us()?.enabled?e.jsx(ps,{}):e.jsx(Ni,{},window.location.href)});export{ni as HomeState,Jl as View,ti as buildUpcomingMeetingItems,si as formatPhoneNumberForDisplay};

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.