1import{j as e}from"./vendor-radix-875c64d9.js";import{r as s,l as t,O as a}from"./vendor-react-87e4ed35.js";import{av as i,B as l}from"./index-32609c1a.js";import{R as n}from"./RequireAuth-4c0056b4.js";import{u as o}from"./vendor-auth-52eda190.js";import"./vendor-supabase-53a323e3.js";import"./vendor-recharts-b4f8f6f6.js";import"./vendor-motion-99b4a1fb.js";function r({children:t}){const a=i(),[l,n]=s.useState({checking:!0,ok:!1,error:null});return s.useEffect(()=>{let e=!0;return(async()=>{try{if(await a.listInbox({scope:"open",page:"1",pageSize:"1"}),!e)return;n({checking:!1,ok:!0,error:null})}catch(s){if(!e)return;n({checking:!1,ok:!1,error:(null==s?void 0:s.message)||"Admin access is not enabled for this account."})}})(),()=>{e=!1}},[a]),l.checking?e.jsx("div",{className:"min-h-[50vh] flex items-center justify-center text-sm text-muted-foreground",children:"Checking admin accessâ¦"}):l.ok?e.jsx(e.Fragment,{children:t}):e.jsx("div",{className:"min-h-[50vh] flex items-center justify-center px-6",children:e.jsxs("div",{className:"max-w-lg text-center space-y-3",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Admin access required"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l.error}),e.jsx("a",{href:"/",className:"inline-block underline text-sm",children:"Return to home"})]})})}function c({children:s}){return e.jsx(n,{children:e.jsx(r,{children:s})})}const m=[{title:"People",items:[{to:"/admin/inbox",label:"Inbox"},{to:"/admin/students",label:"Students"},{to:"/admin/members",label:"Members"}]},{title:"Catalog",items:[{to:"/admin/offerings",label:"Offerings"},{to:"/admin/special-courses",label:"School courses"},{to:"/admin/schools",label:"Schools"},{to:"/admin/school-codes",label:"School codes"}]},{title:"Diploma",items:[{to:"/admin/diploma",label:"Dashboard"},{to:"/admin/courses",label:"Activities"}]},{title:"Operations",items:[{to:"/admin/tasks",label:"Team Tasks"},{to:"/admin/review",label:"Comms Review"},{to:"/admin/payments",label:"Payments"},{to:"/admin/summit",label:"Summit 2027"},{to:"/admin/staff",label:"Staff"},{to:"/admin/escalations",label:"Escalations"},{to:"https://advisor.ausa.io/staff",label:"Advisory Desk",deskHandover:!0}]}],d=({item:t})=>{const a=i(),[l,n]=s.useState(null),[o,r]=s.useState(!1);return e.jsxs("div",{children:[e.jsxs("a",{href:t.to,onClick:async e=>{if(e.preventDefault(),!o){r(!0),n(null);try{const e=await a.mintDeskAssertion();window.location.assign(`${t.to}#login/${e.assertion}`)}catch(s){n(s.code||"REQUEST_FAILED"),r(!1)}}},"aria-busy":o,className:"block rounded-md px-3 py-2 text-slate-700 hover:bg-slate-100",children:[t.label,o?"â¦":""]}),l&&e.jsxs("p",{className:"px-3 text-xs text-red-600",children:["Desk hand-over failed: ",l]})]})},x=()=>{const{logout:s}=o();return e.jsx(c,{children:e.jsxs("div",{className:"min-h-screen flex bg-slate-50",children:[e.jsxs("aside",{className:"w-56 border-r bg-white px-4 py-6 flex flex-col",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:"AUSA Admin"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Internal tools for the team."})]}),e.jsx("nav",{className:"flex-1 space-y-5 text-sm",children:m.map(s=>e.jsxs("div",{children:[e.jsx("p",{className:"px-3 mb-1 text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:s.title}),e.jsx("div",{className:"space-y-1",children:s.items.map(s=>s.deskHandover?e.jsx(d,{item:s},s.to):e.jsx(t,{to:s.to,className:({isActive:e})=>["block rounded-md px-3 py-2",e?"bg-slate-900 text-white":"text-slate-700 hover:bg-slate-100"].join(" "),children:s.label},s.to))})]},s.title))}),e.jsx(l,{variant:"outline",size:"sm",className:"mt-4",onClick:()=>{s({logoutParams:{returnTo:window.location.origin}})},children:"Log out"})]}),e.jsx("main",{className:"flex-1 p-6",children:e.jsx(a,{})})]})})};export{x as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.