PageSourceSearch

https://waterr.ai/assets/InviteAccept-ZjeOa0BZ.js

js waterr.ai collected 2026-10-05 13:51:16 UTC 4,033 bytes, 1 lines download raw bytes

1import{bd as k,a$ as C,r as o,j as e,cw as A,b2 as l,b3 as S}from"./vendor-BxD0qQMk.js";import{z,P as I}from"./index-7Ro889YK.js";import{B as j}from"./button-ffeUHgPw.js";import{p as F,o as T}from"./organizations-WCyNI2K4.js";import"./vendor-radix-DzFOfswg.js";const E=()=>{var u;const{token:i=""}=k(),m=C(),{user:r,loading:v,login:N,refreshUser:f}=z(),[t,w]=o.useState(null),[c,d]=o.useState(null),[x,h]=o.useState(!1);o.useEffect(()=>{let a=!1;return F(i).then(n=>!a&&w(n)).catch(n=>{var s,g;return!a&&d(((g=(s=n==null?void 0:n.response)==null?void 0:s.data)==null?void 0:g.error)||"This invitation link is not valid.")}),()=>{a=!0}},[i]);const p=()=>{I(`/team/join/${encodeURIComponent(i)}`),m(`/auth?return_url=${encodeURIComponent(`/team/join/${encodeURIComponent(i)}`)}`)},y=async()=>{var a,n;h(!0);try{const s=await T(i);N({...r,membership_id:s.membership_id,organization:s.organization,member_role:s.role},s.token),await f(),S.success(`Welcome to ${s.organization.name}.`),window.location.href="/home"}catch(s){d(((n=(a=s==null?void 0:s.response)==null?void 0:a.data)==null?void 0:n.error)||"Could not accept the invitation."),h(!1)}},b={accepted:"This invitation has already been used.",revoked:"This invitation was revoked. Ask an admin to send a new one.",expired:"This invitation has expired. Ask an admin to send a new one."};return e.jsx("div",{className:"min-h-screen bg-[#FAFAFA] flex items-center justify-center px-4",style:{fontFamily:"'Inter', sans-serif"},children:e.jsxs("div",{className:"w-full max-w-md rounded-xl border border-gray-200 bg-white p-6 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-[#1F2937] text-white flex items-center justify-center",children:e.jsx(A,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs text-[#737373]",children:"Organization invitation"}),e.jsx("h1",{className:"text-[1.25rem] font-medium text-[#333333] truncate",style:{letterSpacing:"-0.02em"},children:((u=t==null?void 0:t.organization)==null?void 0:u.name)||(c?"Invitation":"Loading…")})]})]}),c?e.jsx("p",{className:"text-sm text-red-600",children:c}):t?t.status!=="pending"?e.jsx("p",{className:"text-sm text-[#737373]",children:b[t.status]||"This invitation is no longer open."}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-[#333333]",children:[t.inviter_name?e.jsx("strong",{children:t.inviter_name}):"Someone"," invited you to join"," ",e.jsx("strong",{children:t.organization.name})," as ",t.role==="admin"?"an admin":"a member","."]}),e.jsx("p",{className:"text-xs text-[#737373]",children:"Joining gives you access to everything in that organization: its scenarios, agents, and past meetings with their recordings and transcripts. The people already there will be able to see your work too."}),e.jsxs("p",{className:"text-xs text-[#737373]",children:["Sent to ",e.jsx("span",{className:"font-medium text-[#333333]",children:t.email_hint}),". Sign in with that address to accept."]}),v?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-[#737373]",children:[e.jsx(l,{className:"h-4 w-4 animate-spin"})," Checking your session…"]}):r?e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{className:"w-full",onClick:y,disabled:x,children:x?e.jsx(l,{className:"h-4 w-4 animate-spin"}):`Join ${t.organization.name}`}),e.jsxs("p",{className:"text-xs text-center text-[#737373]",children:["Signed in as ",r.email,"."," ",e.jsx("button",{className:"underline hover:text-[#333333]",onClick:p,children:"Not you?"})]})]}):e.jsx(j,{className:"w-full",onClick:p,children:"Sign in to accept"})]}):e.jsxs("div",{className:"flex items-center gap-2 text-sm text-[#737373]",children:[e.jsx(l,{className:"h-4 w-4 animate-spin"})," Checking your invitation…"]}),e.jsx("p",{className:"text-xs text-[#9CA3AF] text-center",children:e.jsx("button",{className:"underline hover:text-[#333333]",onClick:()=>m("/"),children:"Back to Waterr"})})]})})};export{E as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.