import{ai as u,A as i,aj as l}from"./BKiFavna.js";import{u as d}from"./BZ7f31ti.js";const f=u(async e=>{let n,t;if(e.path==="/admin/login")return;const{fetchMe:r,token:o,user:a}=d();if(!o.value)return i(`/admin/login?redirect=${encodeURIComponent(e.fullPath)}`);if(a.value||([n,t]=l(()=>r()),n=await n,t()),!a.value)return i(`/admin/login?redirect=${encodeURIComponent(e.fullPath)}`);if(!["admin","editor"].includes(a.value.role))return i("/admin/login")});export{f as default};
