import{r as p,c as h,o as m,y as l,d as f,J as w,K as k}from"./_plugin-vue_export-helper-nhjnO_bd.js";import{R as y}from"./RestrictedAuth-DsJXicIw.js";import"./pow-2N9bxgAo.js";const _={__name:"RestrictedApi",setup(g){const o=p(null);function c(){const e=window.location.pathname.match(/\/auth\/([^/]+)$/);if(e){const r=e[1],s=r.split(".");if(s.length===5&&s.every(d=>d.length>0))return r}return null}const i=h(()=>{const e=new URLSearchParams(window.location.hash.slice(1)).get("mode");return e==="reauth"?"reauth":e==="forbidden"?"forbidden":"login"});function n(t){window.parent&&window.parent!==window&&window.parent.postMessage(t,"*")}function u(t){n({type:"auth-success",authenticated:!0,sessionToken:t.session_token})}function a(){n({type:"auth-back"})}return m(()=>{o.value=c(),n({type:"auth-ready"}),window.addEventListener("keydown",t=>{t.key==="Escape"&&a()})}),(t,e)=>(f(),l(y,{mode:i.value,"remote-auth-token":o.value,onAuthenticated:u,onBack:a},null,8,["mode","remote-auth-token"]))}};w(_).mount("#app");k();
