"use strict";(globalThis.webpackChunk_affine_web=globalThis.webpackChunk_affine_web||[]).push([[3397],{83397:(e,a,s)=>{s.r(a),s.d(a,{Component:()=>I,loader:()=>h});var t=s(36870),i=s(6610),n=s(93965),r=s(47387),o=s(21817),c=s(10980),l=s(61569),p=s(5863),u=s(86326),d=s(15010),k=s(42277),f=s(77846),w=s(69628),v=s(59481);let h=async e=>{let a=e.params.inviteId||"",s=await (0,r.GO)({query:o.yp,variables:{inviteId:a}}).catch(console.error);return s&&s?.getInviteInfo?(await (0,r.GO)({query:o.qp,variables:{workspaceId:s.getInviteInfo.workspace.id,inviteId:a,sendAcceptMail:!0}}).catch(console.error),{inviteId:a,inviteInfo:s.getInviteInfo}):(0,d.V2)("/404")},I=()=>{let e=(0,c.h1)(v.uR),a=(0,l.S)(e.session.isRevalidating$),s=(0,l.S)(e.session.status$);(0,u.useEffect)(()=>{e.session.revalidate()},[e]);let{jumpToSignIn:r}=(0,w.P)(),{jumpToSubPath:o}=(0,w.P)(),d=(0,p.Xr)(f.W7),{inviteInfo:h}=(0,k.LG)(),I=(0,u.useCallback)(()=>{o(h.workspace.id,n.Tk.ALL,w.Q.REPLACE)},[h.workspace.id,o]);return((0,u.useEffect)(()=>{"unauthenticated"!==s||a||r(`/workspace/${h.workspace.id}/all`,w.Q.REPLACE)},[h.workspace.id,a,r,s,I,d]),"authenticated"===s)?(0,t.jsx)(i.jE,{inviteInfo:h,onOpenWorkspace:I}):null}}}]); //# sourceMappingURL=chunk.3397.dcf16ca0.js.map