import{l as t,C as n,f as d,i as g,M as f}from"./index-Ct2E4nVG.js";async function w(s,r){try{const e=s();if(!e)return t.log("No session stored; continuing without a client"),null;t.log("Using a standalone client");const{user_id:o,device_id:l,access_token:c,passwordlessUser:a}=e,u={baseUrl:n.defaultHomeserverUrl(),accessToken:c,userId:o,deviceId:l,fallbackICEServerAllowed:d,livekitServiceURL:n.get().livekit?.livekit_service_url};try{return{widgetApi:null,client:await g(u,!0),passwordlessUser:a}}catch(i){if(i instanceof f&&i.errcode==="M_UNKNOWN_TOKEN")return t.log("The session from local store is invalid; continuing without a client"),r(),null;throw i}}catch(e){throw r(),e}}export{w as initSPA};
//# sourceMappingURL=spa-YIxTAWyQ.js.map
