1import{j as e,h as G,i as T,k as A,l as _,a as B,c as R,u as D,m as H,r as x,f as M,t as O,L as I,n as z}from"./index-DJqYQI6A.js";import{P as q}from"./PageFooterRow-BoOeDSrM.js";import{C as J}from"./CmsBlocks-HJkgqF8o.js";import{E as Q}from"./ExternalNotice-BBNVfjYd.js";import{r as V}from"./resolveApi-CkL2LCWe.js";import{h as W}from"./slugLabel-G8ALJ0WS.js";import"./DocTitle-Bb3Ms0mx.js";import"./CmsRichText-DfUUL9eQ.js";import"./pageApi-DLVvI3Qb.js";import"./Pagination-RzkOtqD2.js";import"./play-DyaQz0Oc.js";const X=({category:t,activeItemKey:r,openGroupKey:a,onToggleGroup:s,onSelectItem:o})=>e.jsx("nav",{"aria-label":"Student section navigation",className:"w-full shrink-0 overflow-hidden rounded-md border border-[#E6E5E5] lg:w-[300px]",children:t.groups.map(i=>{const f=a===i.key;return e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:()=>s(i.key),title:i.label,"aria-expanded":f,className:"flex w-full items-center justify-between gap-2 bg-[#0b4173] px-4 py-3 text-left text-sm font-semibold text-white cursor-pointer",children:[e.jsx("span",{children:i.label}),f?e.jsx(G,{"aria-hidden":"true"}):e.jsx(T,{"aria-hidden":"true"})]}),f&&i.items.map(l=>{const d=l.key===r,u=`flex w-full items-start gap-2 border-b border-[#E6E5E5] px-4 py-2.5 text-left text-sm transition cursor-pointer 2 ${d?"bg-[#1e5aa8] font-medium text-white":"bg-[#eef1f5] text-gray-800 hover:bg-[#e2e7ee]"}`,m=e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",className:d?"text-white":"text-[#0b4173]",children:"â¢"}),e.jsx("span",{className:"leading-snug",children:l.label})]});return l.externalUrl?e.jsx("a",{href:l.externalUrl,"data-external":"true","data-open-new-tab":l.openInNewTab?"true":"false",title:l.label,"aria-current":d?"page":void 0,className:u,children:m},l.key):e.jsx("button",{type:"button",onClick:()=>o(l.key),title:l.label,"aria-current":d?"page":void 0,className:u,children:m},l.key)})]},i.key)})}),Y=t=>t.slug?{key:t.key,label:t.menu||"",slug:t.slug,externalUrl:_(t.path)?t.path:void 0,openInNewTab:!!t.open_in_new_tab}:null,Z=t=>({key:t.key,label:t.menu||"",slug:t.slug||"",items:(t.submenu??[]).map(Y).filter(r=>r!==null)}),ee=t=>t==="student-1"?"prospective":"existing",te=async()=>((await A()).home.find(s=>s.key==="student")?.submenu??[]).map(s=>({key:ee(s.key),label:s.menu||"",groups:(s.submenu??[]).map(Z).filter(o=>o.items.length>0)})),se=(t,r)=>{if(r)for(const a of t)for(const s of a.groups){const o=s.items.find(i=>i.key===r);if(o)return{category:a,group:s,item:o}}},ne=(t,r)=>{if(r){for(const a of t)for(const s of a.groups){const o=s.items.find(i=>i.slug===r);if(o)return{category:a,group:s,item:o}}for(const a of t)for(const s of a.groups)if(s.slug===r&&s.items.length>0)return{category:a,group:s,item:s.items[0]}}},C=()=>e.jsxs("div",{className:"space-y-3 py-2",children:[e.jsx("div",{className:"h-4 w-full animate-pulse rounded bg-gray-100"}),e.jsx("div",{className:"h-4 w-5/6 animate-pulse rounded bg-gray-100"}),e.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded bg-gray-100"})]}),ae=()=>e.jsx("div",{className:"min-h-screen bg-white",children:e.jsx("div",{className:"mx-auto max-w-[1200px] px-4 py-10",children:e.jsx(C,{})})}),ge=()=>{const{slug:t}=B(),{pathname:r}=R();D([W(t),"Students"].filter(Boolean).join(" â "));const a=H(),[s,o]=x.useState([]),[i,f]=x.useState(!0);x.useEffect(()=>{let n=!1;return te().then(c=>{n||o(c)}).catch(()=>{n||o([])}).finally(()=>{n||f(!1)}),()=>{n=!0}},[]);const l=ne(s,t),d=l?.category.key??"existing",u=s.find(n=>n.key===d)??s[1],m=l?.item??u?.groups[0]?.items[0],L=m?.key??"",y=l?.group.key??u?.groups[0]?.key??null,[P,j]=x.useState(null);x.useEffect(()=>{j(y)},[y]);const[v,N]=x.useState(null);x.useEffect(()=>{let n=!1;if(t)return V(`/students/${t}`).then(c=>{n||N({slug:t,result:c})}).catch(()=>{n||N({slug:t,result:{found:!1}})}),()=>{n=!0}},[t]);const p=t&&v?.slug===t?v.result:null,U=!!t&&p===null,h=p?.found?p.page??null:null,F=M(h?.updated_at),k=!h&&p?.found?(p.node?.url??"").trim():"",w=/^https?:\/\//i.test(k),b=w?O(k):null,S=b&&b.replace(/\/+$/,"")!==r.replace(/\/+$/,"")?b:null,$=n=>{const E=s.find(g=>g.key===n)?.groups.flatMap(g=>g.items).find(g=>!g.externalUrl);a(E?`/students/${E.slug}`:"/students")},K=n=>{const c=se(s,n);c&&a(`/students/${c.item.slug}`)};return i?e.jsx(ae,{}):!u||u.groups.length===0?e.jsx("div",{className:"min-h-screen bg-white",children:e.jsx("div",{className:"mx-auto max-w-[1200px] px-4 py-10 text-sm text-gray-600",children:"Student section is currently unavailable."})}):e.jsxs("div",{className:"min-h-screen bg-white",children:[e.jsxs("div",{className:"bg-[#dfe3e9] px-4 py-3 text-xs text-gray-700",children:[e.jsx(I,{to:"/",className:"text-[#1d3564] underline",children:"Home"}),e.jsx("span",{className:"mx-1",children:"/"}),e.jsx(I,{to:"/students",className:"text-[#1d3564] underline",children:"Student"}),m?.label&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-1",children:"/"}),e.jsx("span",{className:"font-semibold",children:m.label})]})]}),e.jsxs("div",{className:"mx-auto max-w-[1200px] px-4 py-6",children:[e.jsx("div",{className:"mb-6 flex justify-center",children:e.jsx("div",{className:"inline-flex rounded-full border border-[#0b4173] p-1",children:s.map(n=>{const c=n.key===d;return e.jsx("button",{type:"button",onClick:()=>$(n.key),className:`rounded-full px-6 py-2 text-sm font-medium transition cursor-pointer 3 ${c?"bg-[#0b4173] text-white":"text-[#0b4173] hover:bg-[#eef1f5]"}`,children:n.label},n.key)})})}),e.jsx("div",{className:"mb-6",children:e.jsx("h1",{className:"inline-block border-b-2 border-[#0b4173] pb-1 text-2xl font-bold text-gray-800",children:u.label})}),e.jsxs("div",{className:"flex flex-col gap-8 lg:flex-row",children:[e.jsx(X,{category:u,activeItemKey:L,openGroupKey:P,onToggleGroup:n=>j(c=>c===n?null:n),onSelectItem:K}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"mb-5 text-xl font-bold text-[#1d3564]",children:m?.label}),U?e.jsx(C,{}):h?e.jsx(J,{blocks:h.blocks}
3):w&&b===null?e.jsx(Q,{node:p.node}):S?e.jsx(z,{to:S,replace:!0}):e.jsx("p",{className:"text-sm text-gray-600",children:"No content has been published for this page yet."}),e.jsx(q,{lastUpdated:F})]})]})]})]})};export{ge 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.