(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81817,e=>{"use strict";var s=e.i(43476),n=e.i(71645);e.s(["default",0,function(){let[e,l]=(0,n.useState)(null),[a,i]=(0,n.useState)(!0);(0,n.useEffect)(()=>{let e=!1;return fetch("/api/auth",{cache:"no-store"}).then(e=>e.json()).then(s=>{if(!e){if(!s.user)return void window.location.replace("/login");l(s.user),i(!1)}}).catch(()=>!e&&window.location.replace("/login")),()=>{e=!0}},[]);let t=async()=>{await fetch("/api/auth",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"logout"})}),window.location.replace("/login")};return a?(0,s.jsx)("div",{className:"login-shell",children:(0,s.jsx)("div",{className:"login-card",children:(0,s.jsx)("p",{className:"login-checking",children:"Loading your portal..."})})}):(0,s.jsxs)("div",{className:"portal-shell",children:[(0,s.jsxs)("header",{className:"portal-bar",children:[(0,s.jsxs)("div",{className:"login-brand",children:[(0,s.jsx)("span",{className:"brand-mark",children:"HO"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Student Portal"}),(0,s.jsx)("small",{children:"Hostel Operations"})]})]}),(0,s.jsx)("button",{className:"secondary compact",onClick:t,children:"Sign out"})]}),(0,s.jsx)("main",{className:"portal-body",children:(0,s.jsxs)("section",{className:"portal-card",children:[(0,s.jsx)("span",{className:"section-kicker",children:"SIGNED IN"}),(0,s.jsxs)("h1",{children:["Hello, ",e?.displayName]}),(0,s.jsxs)("p",{children:["You are signed in as a resident (",e?.email,"). The student portal is still being built — your room details, bills and maintenance requests will appear here soon."]}),(0,s.jsxs)("div",{className:"portal-note",children:[(0,s.jsx)("strong",{children:"Coming soon"}),(0,s.jsxs)("ul",{children:[(0,s.jsx)("li",{children:"Your room and tenancy details"}),(0,s.jsx)("li",{children:"Monthly bills and payment history"}),(0,s.jsx)("li",{children:"Submit and track maintenance tickets"}),(0,s.jsx)("li",{children:"Hostel announcements"})]})]})]})})]})}])}]);