import{j as e,ak as l}from"./vendor-mui-core-BPQ6AEW_.js";import{i as x,r as w}from"./vendor-react-CUXIiAnY.js";import{b as g}from"./vendor-hooks-PN9SWiQm.js";import{I as v}from"./invitation-Bc44mbuq.js";import{K as u}from"./landing-page-YRQZx_TA.js";import{V as I,y as k}from"./vendor-ux-r9bApERu.js";import{a as S,d as E,s as T,b as j,c as P,H as R}from"./index-DY2wgD65.js";import{g as W}from"./get-safe-url-DqysS0i0.js";import{c as b}from"./passport-YH_G5MTs.js";import"./vendor-utils-BgSaqjGx.js";import"./index-Bkbb52cW.js";import"./use-passport-id-B-b-_oYF.js";import"./session-f4MooMkP.js";import"./sdk-pKOkxK_z.js";import"./wrap-locale-4DQEBpTB.js";import"./index-DP1F1qui.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D8WYBDYe.js";import"./create-passport-svg-CIUyZVGt.js";function J(n){const c=x(),{searchParams:s}=new URL(window.location.href),{api:m,session:p}=S(),{t:d}=I(),r=s.get("inviteId"),a=s.get("redirect"),f=w.useCallback(async()=>{const{data:t}=await E.get("invitation",{params:{inviteId:r}});return t},[r]),h=g(async(t,o=i=>i)=>{t&&(T(o(t.sessionToken)),j(o(t.refreshToken)),t.visitorId&&k(o(t.visitorId))),await p.refresh(),setTimeout(()=>{if(a){const i=decodeURIComponent(a);i.startsWith(P.WELLKNOWN_SERVICE_PATH_PREFIX)?c(i,{replace:!0}):window.location.href=W(i)}else window.location.href=window.env.pathPrefix||"/"},50)});return e.jsxs(u,{did:window.blocklet?.appPid,children:[e.jsx(R,{children:e.jsxs("title",{children:[d("pageTitle.invite")," | ",window.blocklet?.appName]})}),e.jsx(l,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:e.jsx(v,{...n,getDataFn:f,checkFn:m.get,createPassportSvg:t=>b({...t}),onLoginSuccess:h,inService:!0})})]})}export{J as default};
