import{j as i,ak as l}from"./vendor-mui-core-DnR6WYuU.js";import{u as x,r as w}from"./vendor-react-CTtPmzVP.js";import{b as g}from"./vendor-hooks-qxhUUbW5.js";import{I as v}from"./invitation-1uvZN7Wz.js";import{K as u}from"./landing-page-CNLD6T-R.js";import{V as I,a5 as k}from"./vendor-ux-DTEmWsko.js";import{u as S,o as E,a as T,d as j,c as P,H as R}from"./index-BZxsCCR_.js";import{g as W}from"./get-safe-url-D4mirsKD.js";import{c as N}from"./passport-VW2_vBcn.js";import"./vendor-utils-CxWN1dT3.js";import"./index-CrRA4U7x.js";import"./use-passport-id-B-b-_oYF.js";import"./session-DwQKgNVz.js";import"./sdk-ChA0AoUQ.js";import"./wrap-locale-BUa8dcqX.js";import"./index-DDp16vgt.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CIBaEWEy.js";import"./create-passport-svg-DXpLsb6S.js";function J(n){const c=x(),{searchParams:s}=new URL(window.location.href),{api:m,session:p}=S(),{t:d}=I(),a=s.get("inviteId"),r=s.get("redirect"),f=w.useCallback(async()=>{const{data:t}=await E.get("invitation",{params:{inviteId:a}});return t},[a]),h=g(async(t,o=e=>e)=>{t&&(T(o(t.sessionToken)),j(o(t.refreshToken)),t.visitorId&&k(o(t.visitorId))),await p.refresh(),setTimeout(()=>{if(r){const e=decodeURIComponent(r);e.startsWith(P.WELLKNOWN_SERVICE_PATH_PREFIX)?c(e,{replace:!0}):window.location.href=W(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return i.jsxs(u,{did:window.blocklet?.appPid,children:[i.jsx(R,{children:i.jsxs("title",{children:[d("pageTitle.invite")," | ",window.blocklet?.appName]})}),i.jsx(l,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:i.jsx(v,{...n,getDataFn:f,checkFn:m.get,createPassportSvg:t=>N({...t}),onLoginSuccess:h,inService:!0})})]})}export{J as default};
