import{j as e,ak as l}from"./vendor-mui-core-CnXrAOs3.js";import{i as x,r as w}from"./vendor-react-Dvs43sk9.js";import{b as g}from"./vendor-hooks-CjESGRlR.js";import{I as v}from"./invitation-Bu3ivg7N.js";import{K as u}from"./landing-page-sUHYSREd.js";import{V as I,y as k}from"./vendor-ux-IiQnod3w.js";import{a as S,d as E,s as T,b as j,c as P,H as R}from"./index-sNHCLgAE.js";import{g as W}from"./get-safe-url-DpalOXcM.js";import{c as b}from"./passport-Y64u4kIS.js";import"./vendor-utils-cJEl_UEd.js";import"./index-CkOr9jjZ.js";import"./use-passport-id-B-b-_oYF.js";import"./session-BAD0lxQk.js";import"./sdk-DFkL0HsT.js";import"./wrap-locale-fIPwg8LW.js";import"./index-x4Yvq15-.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CuFtPveO.js";import"./create-passport-svg-C7Utfs-J.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};
