(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8374,e=>{"use strict";var r=e.i(43476),i=e.i(71645),t=e.i(18566),l=e.i(24136),o=e.i(20755);function s({children:e}){let s=(0,t.useRouter)(),{user:a,loading:n}=(0,l.useAuth)(),[d,u]=(0,i.useState)(null);return((0,i.useEffect)(()=>{!async function(){if(!n){if(!a)return s.push("/explore");try{let{data:e,error:r}=await o.supabase.from("profiles").select("role").eq("id",a.id).single();if(r||e?.role!=="admin")return void s.push("/explore");u(!0)}catch(e){console.error("Admin layout role check error:",e),s.push("/explore")}}}()},[a,n,s]),n||null===d)?(0,r.jsx)("div",{className:"Admin_loaderWrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",width:"100vw",background:"#0a0a0a",position:"fixed",top:0,left:0,zIndex:9999},children:(0,r.jsx)("div",{className:"Loader_loader__xEUdY",children:(0,r.jsx)("img",{src:"/media/loader.f7af4e13.svg",alt:"loader",width:48,height:48})})}):(0,r.jsx)(r.Fragment,{children:e})}e.s(["default",()=>s])}]);