PageSourceSearch

https://www.icsi.edu/assets/RopageLayout-Cm935e7A.js

js icsi.edu collected 2026-10-02 03:42:44 UTC 10,040 bytes, 1 lines download raw bytes

1import{r as a,j as e,B as k,C as D,z as P,A as C,_ as E,L as M,$ as _,a0 as B,R as $,M as F,a1 as T,a as A,u as z,d as K}from"./index-CMfIf9m3.js";import{P as I}from"./PageFooterRow-cP7M-1TF.js";import{u as O,S as G,A as W,a as U,K as V,b as q}from"./useCarouselA11y-YJAuwdPY.js";import{S as H}from"./SubsiteSidebar-DJWhFrIe.js";import{T as J,C as S}from"./ContactLines-NoYexyvK.js";import{L as Q}from"./index-B717YEAh.js";import{C as X}from"./CmsRichText-CPUTJk7b.js";import Y from"./OurClients-6gp4vgtr.js";import{h as Z}from"./slugLabel-G8ALJ0WS.js";import"./centerSections-BYvPu_Dt.js";import"./useAccessibleCarousel-C8Bcex-Z.js";const ee=({roId:s})=>{const[t,f]=a.useState(null),[b,g]=a.useState(!0),[l,r]=a.useState(0),[c,y]=a.useState(!1),x=a.useRef(null);a.useEffect(()=>{(async()=>{try{const i=await E();f(i),i[s]&&y(i[s].autoplay)}catch(i){console.error("Error fetching banners:",i)}finally{g(!1)}})()},[s]);const d=t?t[s]:null;if(a.useEffect(()=>(c&&d&&d.slides.length>1?x.current=setInterval(()=>{r(h=>(h+1)%d.slides.length)},d.interval||3e3):x.current&&clearInterval(x.current),()=>{x.current&&clearInterval(x.current)}),[c,d,l]),b)return e.jsx("div",{className:"p-4 text-center",children:"Loading..."});if(!d||!d.slides||d.slides.length===0)return null;const{slides:n}=d,p=h=>{h?.preventDefault(),r(i=>(i+1)%n.length)},j=h=>{h?.preventDefault(),r(i=>i===0?n.length-1:i-1)};return e.jsx("section",{className:"p-4",children:e.jsx("div",{className:"w-full aspect-3/1 rounded-lg overflow-hidden relative shadow-lg",children:e.jsxs("div",{className:"relative h-full w-full",children:[e.jsx("a",{href:n[l].url,"data-open-new-tab":n[l].open_in_new_tab,target:n[l].open_in_new_tab?"_blank":"_self",rel:"noopener noreferrer",className:"block h-full w-full",onClick:h=>{n[l].url==="/#"&&h.preventDefault()},children:e.jsx("img",{src:n[l].image,alt:n[l].alt||`Banner ${l+1} of ${n.length}`,title:n[l].alt||`Banner ${l+1} of ${n.length}`,className:"w-full h-full object-cover transition-all duration-500"})}),n.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button","aria-label":"Previous slide",title:"Previous slide",onClick:j,className:"absolute top-1/2 left-3 -translate-y-1/2 bg-white/80 p-2 rounded-full shadow hover:bg-white z-20",children:e.jsx(k,{"aria-hidden":"true"})}),e.jsx("button",{type:"button","aria-label":"Next slide",title:"Next slide",onClick:p,className:"absolute top-1/2 right-3 -translate-y-1/2 bg-white/80 p-2 rounded-full shadow hover:bg-white z-20",children:e.jsx(D,{"aria-hidden":"true"})}),e.jsx("button",{type:"button","aria-label":c?"Pause slideshow":"Play slideshow",title:c?"Pause slideshow":"Play slideshow",onClick:()=>y(!c),className:"absolute bottom-4 right-4 bg-white/80 p-2 rounded-full shadow hover:bg-white z-20",children:c?e.jsx(P,{"aria-hidden":"true"}):e.jsx(C,{"aria-hidden":"true"})}),e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2 z-20",children:n.map((h,i)=>e.jsx("button",{type:"button","aria-label":`Go to slide ${i+1}`,title:`Go to slide ${i+1}`,"aria-current":l===i,onClick:()=>r(i),className:`w-2 h-2 rounded-full transition-all ${l===i?"bg-red-700 scale-125":"bg-black/50"}`},i))})]})]})})})},te=()=>typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,se=({roId:s})=>{const[t,f]=a.useState({}),[b,g]=a.useState(0),l=a.useRef(null),[r,c]=a.useState(()=>!te()),[y,x]=a.useState(!1),d=a.useRef(null),{syncInert:n,onSlideFocus:p,onKeyDown:j}=O(l,d),h=o=>{const u=l.current?.autoplay;u&&(o?u.start():u.stop())},i=()=>{const o=!r;c(o),h(o)};a.useEffect(()=>{(async()=>{try{const u=await _();f(u)}catch(u){console.error("Error fetching RO tiles:",u)}})()},[]);const w=t[s];if(a.useEffect(()=>{g(0)},[s]),!w||!w.cards?.length)return e.jsxs("div",{className:"h-64 flex items-center justify-center border text-gray-400",children:["No tiles available for region: ",s]});const{cards:v,autoplayDelay:L}=w,N=Math.ceil(v.length/4);return e.jsxs("div",{className:"relative aspect-3/2 w-full",role:"region","aria-roledescription":"carousel","aria-label":"Regional office highlights",onFocus:()=>{h(!1),x(!0)},onBlur:o=>{o.currentTarget.contains(o.relatedTarget)||(x(!1),r&&h(!0))},onFocusCapture:p,onKeyDown:j,children:[e.jsx(G,{direction:"vertical",slidesPerView:1,spaceBetween:2,loop:v.length>4&&!y,watchSlidesProgress:!0,autoplay:{delay:L,disableOnInteraction:!1,pauseOnMouseEnter:!0},speed:800,keyboard:{enabled:!0},modules:[W,U,V],onSwiper:o=>{l.current=o,r||o.autoplay?.stop(),n(o)},onSlideChange:o=>{g(o.realIndex),n(o)},onSlidesUpdated:n,className:"h-full",children:Array.from({length:N}).map((o,u)=>e.jsx(q,{children:e.jsx("div",{className:"grid grid-cols-2 grid-rows-2 gap-x-4 gap-y-[10.6667px] h-full",children:v.slice(u*4,u*4+4).map(m=>m["data-open-new-tab"]==="true"?e.jsxs("a",{href:m.url,target:"_blank",rel:"noopener noreferrer",className:"relative rounded-lg overflow-hidden group",children:[e.jsx("img",{src:m.image,alt:m.alt_text||"",title:m.alt_text||"",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"}),e.jsx("div",{className:"absolute bottom-0 w-full h-10 bg-[rgba(0,0,0,0.6)] flex items-center px-2",children:e.jsx("h3",{className:"text-white text-[10px] leading-tight",children:m.title})})]},m.id):e.jsxs(M,{to:m.url,className:"relative rounded-lg overflow-hidden group",children:[e.jsx("img",{src:m.image,alt:m.alt_text||"",title:m.alt_text||"",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"}),e.jsx("div",{className:"absolute bottom-0 w-full h-10 bg-[rgba(0,0,0,0.6)] flex items-center px-2",children:e.jsx("h3",{className:"text-white text-[10px] leading-tight",children:m.title})})]},m.id))})},`${s}-slide-${u}`))}),e.jsx("div",{"aria-hidden":"true",className:"absolute right-2 top-1/2 -translate-y-1/2 flex flex-col gap-2 z-40",children:Array.from({length:N}).map((o,u)=>e.jsx("span",{className:`w-1.5 h-1.5 rounded-full transition-all ${b===u?"bg-red-700 scale-125":"bg-black/40"}`},u))}),e.jsx("button",{ref:d,type:"button",onClick:i,"aria-label":r?"Pause slideshow":"Play slideshow",title:r?"Pause slideshow":"Play slideshow",className:"absolute bottom-2 right-2 z-50 bg-white p-1.5 rounded-full shadow text-[10px] hover:bg-gray-100",children:r?e.jsx(P,{"aria-hidden":"true"}):e.jsx(C,{"aria-hidden":"true"})})]})},R=s=>(s||[]).map(t=>({label:t.menu??t.title??"",path:t.url||"#",submenu:t.submenu?R(t.submenu):void 0})),ae=({roId:s,basePath:t})=>{const[f,b]=a.useState([]),[g,l]=a.useState(!0);return a.useEffect(()=>{(async()=>{try{l(!0);const c=await B(s);c&&c.ro&&c.ro[s]&&b(c.ro[s])}catch(c){console.error("Error fetching side menu:",c)}finally{l(!1)}})()},[s]),g?e.jsx("div",{className:"p-4 text-gray-500",children:"Loading menu..."}):f.length===0?e.jsxs("div",{className:"p-4 text-gray-400",children:["No menu items found for ",s,"."]}):e.jsx(H,{menu:R(f),basePath:t,ariaLabel:"Regional office section navigation"})},le=({roId:s})=>{const[t,f]=a.useState(null),[b,g]=a.useState(!0);return a.useEffect(()=>{(async()=>{try{g(!0);const r=await T();r&&r[s]&&f(r[s])}catch(r){console.error("Error fetching welcome note:",r)}finally{g(!1)}})()},[s]),b?e.jsx("p",{className:"text-sm text-gray-500",children:"Loading..."}):t?e.jsxs("section",{className:"md:col-span-5",children:[e.jsx("h4",{className:"text-lg sm:text-xl lg:text-2xl font-semibold text-gray-900",children:t.heading}),e.jsxs("div",{className:"mt-2 flex items-center",children:[e.jsx("div",{className:"h-1.5 w-12 md:w-20 bg-[#0F3479] rounded"}),e.jsx("div",{className:"h-1 w-8 md:w-24 bg-[#8799BC] rounded-r"})]}),e.jsx(X,{html:t.description,className:"mt-3 text-sm text-gray-700"}),e.jsx("h4",{className:"text-sm font-semibold text-gray-900 my-2",children:t.address.title}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(J,{className:"mt-1 text-gray-600"}),e.jsxs("span",{className:"text-sm text-gray-700",children:[t.address.location.map((l,r)=>e.jsxs($.Fragment,{children:[l,e.jsx("br",{})]},r)),t.address.pincode&&e.jsxs("span",{children:["PIN: ",t.address.pincode]})]})]}),(t.address.phones?.length||t.address.phone)&&e.jsxs("div",{className:"flex items-start gap-2 mt-1",children:[e.jsx(Q,{className:"mt-0.5 text-gray-600","aria-hidden":"true"}),e.jsx(S,{values:t.address.phones,fallback:t.address.phone,kind:"phone",className:"text-sm text-gray-700"})]}),(t.address.emails?.length||t.address.email)&&e.jsxs("div",{className:"flex items-start gap-2 mt-1",children:[e.jsx(F,{className:"mt-0.5 text-gray-600","aria-hidden":"true"}),e.jsx(S,{values:t.address.emails,fallback:t.address.email,kind:"email",className:"text-sm text-gray-700"})]})]}):null},pe=()=>{const{roId:s}=A();
1z([Z(s),"Regional Office"].filter(Boolean).join(" "));const[t,f]=a.useState(null),[b,g]=a.useState(!0),[l,r]=a.useState(!1);return a.useEffect(()=>{(async()=>{r(!0);try{const x=(await K())?.flatMap(p=>p.submenu||[])||[],d=(s||"").toLowerCase(),n=x.find(p=>p.name?.toLowerCase()===d||p.key?.toLowerCase()===d||p.path&&p.path.toLowerCase().includes(d));f(n?.key||"ro-1")}catch(y){console.error("Error fetching menu data for mapping:",y),f("ro-1")}finally{r(!1),g(!1)}})()},[s]),b&&!t?e.jsx("div",{className:"p-10 text-center text-gray-500",children:"Loading region data..."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`transition-opacity duration-500 ${l?"opacity-50":"opacity-100"}`,children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 py-2 px-4 lg:px-15",children:[e.jsx("div",{className:"lg:col-span-2",children:t&&e.jsx(ee,{roId:t})}),e.jsx("div",{className:"lg:col-span-1",children:t&&e.jsx(se,{roId:t})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-7 gap-6 py-6 px-4 lg:px-15",children:[e.jsx("div",{className:"md:col-span-2",children:t&&e.jsx(ae,{roId:t,basePath:`/ro/${s}`})}),e.jsx("div",{className:"md:col-span-5",children:t&&e.jsx(le,{roId:t})})]})]}),e.jsx("div",{className:"max-w-12xl px-2 sm:px-4 md:px-18 lg:px-15",children:e.jsx(I,{})}),e.jsx(Y,{})]})};export{pe 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.