1import{r as n,j as e,B as I,C as O,z as A,A as R,a5 as L,L as B,a6 as T,m as z,c as K,i as W,F as G,R as H,M as U,a as V,u as q,d as J,a7 as Q,a8 as X}from"./index-CMfIf9m3.js";import{P as Y}from"./PageFooterRow-cP7M-1TF.js";import{u as Z,S as ee,A as se,a as te,K as ae,b as le}from"./useCarouselA11y-YJAuwdPY.js";import{b as M}from"./centerSections-BYvPu_Dt.js";import{T as ne,C as E}from"./ContactLines-NoYexyvK.js";import{L as re}from"./index-B717YEAh.js";import{C as oe}from"./CmsRichText-CPUTJk7b.js";import ie from"./OurClients-6gp4vgtr.js";import{h as ce}from"./slugLabel-G8ALJ0WS.js";import"./useAccessibleCarousel-C8Bcex-Z.js";const de=({OverseasId:t})=>{const[s,u]=n.useState(null),[o,x]=n.useState(!0),[a,m]=n.useState(0),[r,c]=n.useState(!1),p=n.useRef(null);n.useEffect(()=>{(async()=>{try{x(!0);const i=await L();console.log("ssssssssssssss",L);const w=i[t];w&&(u(w),c(w.autoplay),m(0))}catch(i){console.error("Error fetching banner data:",i)}finally{x(!1)}})()},[t]);const f=()=>{p.current&&(clearInterval(p.current),p.current=null)},j=()=>{f(),s&&s.slides.length>1&&(p.current=setInterval(()=>{m(h=>(h+1)%s.slides.length)},s.interval||3e3))};if(n.useEffect(()=>(r&&s?j():f(),f),[r,a,s]),o)return e.jsx("div",{className:"p-4 aspect-3/1 animate-pulse bg-gray-200 rounded-lg",children:"Loading..."});if(!s||!s.slides||s.slides.length===0)return null;const{slides:l}=s,y=()=>m(h=>(h+1)%l.length),v=()=>m(h=>h===0?l.length-1:h-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",onMouseEnter:f,onMouseLeave:()=>r&&j(),children:[e.jsx("a",{href:l[a].url,target:l[a].open_in_new_tab?"_blank":"_self",rel:"noopener noreferrer",className:"block h-full w-full",children:e.jsx("img",{src:l[a].image,alt:l[a].alt||`Banner ${a+1} of ${l.length}`,title:l[a].alt||`Banner ${a+1} of ${l.length}`,className:"w-full h-full object-cover transition-opacity duration-500"})}),l.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button","aria-label":"Previous slide",title:"Previous slide",onClick:v,className:"absolute top-1/2 left-3 -translate-y-1/2 bg-white/80 p-2 rounded-full shadow hover:bg-white z-10",children:e.jsx(I,{"aria-hidden":"true"})}),e.jsx("button",{type:"button","aria-label":"Next slide",title:"Next slide",onClick:y,className:"absolute top-1/2 right-3 -translate-y-1/2 bg-white/80 p-2 rounded-full shadow hover:bg-white z-10",children:e.jsx(O,{"aria-hidden":"true"})}),e.jsx("button",{type:"button","aria-label":r?"Pause slideshow":"Play slideshow",title:r?"Pause slideshow":"Play slideshow",onClick:()=>c(h=>!h),className:"absolute bottom-4 right-4 bg-white/80 p-2 rounded-full shadow hover:bg-white z-10",children:r?e.jsx(A,{"aria-hidden":"true"}):e.jsx(R,{"aria-hidden":"true"})}),e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2",children:l.map((h,i)=>e.jsx("button",{type:"button","aria-label":`Go to slide ${i+1}`,title:`Go to slide ${i+1}`,"aria-current":a===i,onClick:()=>m(i),className:`w-2 h-2 rounded-full transition-all ${a===i?"bg-red-700 scale-125":"bg-black/50"}`},i))})]})]})})})},ue=()=>typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,he=({OverseasId:t})=>{const[s,u]=n.useState({}),[o,x]=n.useState(!0),[a,m]=n.useState(0),r=n.useRef(null),[c,p]=n.useState(()=>!ue()),[f,j]=n.useState(!1),l=n.useRef(null),{syncInert:y,onSlideFocus:v,onKeyDown:h}=Z(r,l),i=d=>{const g=r.current?.autoplay;g&&(d?g.start():g.stop())},w=()=>{const d=!c;p(d),i(d)};if(n.useEffect(()=>{(async()=>{try{const g=await T();u(g)}catch(g){console.error("Failed to fetch tiles",g)}finally{x(!1)}})()},[]),n.useEffect(()=>{m(0)},[t]),o)return e.jsx("div",{className:"h-64 flex items-center justify-center",children:"Loading..."});const N=s[t];if(!N||!N.cards?.length)return e.jsx("div",{className:"h-64 flex items-center justify-center text-gray-400",children:"No tiles available"});const{cards:S,autoplayDelay:_}=N,P=Math.ceil(S.length/4);return e.jsxs("div",{className:"relative aspect-3/2 w-full",role:"region","aria-roledescription":"carousel","aria-label":"Overseas centre highlights",onFocus:()=>{i(!1),j(!0)},onBlur:d=>{d.currentTarget.contains(d.relatedTarget)||(j(!1),c&&i(!0))},onFocusCapture:v,onKeyDown:h,children:[e.jsx(ee,{direction:"vertical",slidesPerView:1,spaceBetween:2,loop:S.length>4&&!f,watchSlidesProgress:!0,autoplay:{delay:_,disableOnInteraction:!1,pauseOnMouseEnter:!0},speed:800,keyboard:{enabled:!0},modules:[se,te,ae],onSwiper:d=>{r.current=d,c||d.autoplay?.stop(),y(d)},onSlideChange:d=>{m(d.realIndex),y(d)},onSlidesUpdated:y,className:"h-full",children:Array.from({length:P}).map((d,g)=>e.jsx(le,{children:e.jsx("div",{className:"grid grid-cols-2 grid-rows-2 gap-x-4 gap-y-[10.6667px] h-full",children:S.slice(g*4,g*4+4).map(b=>{const C=b["data-open-new-tab"]==="true",D=b.url?.startsWith("http"),k="relative rounded-lg overflow-hidden group",F=e.jsxs(e.Fragment,{children:[e.jsx("img",{src:b.image,alt:b.alt_text||"",title:b.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]",children:b.title})})]});return D?e.jsx("a",{href:b.url,target:C?"_blank":"_self",rel:C?"noopener noreferrer":void 0,className:k,children:F},b.id):e.jsx(B,{to:b.url,target:C?"_blank":"_self",className:k,children:F},b.id)})})},`${t}-slide-${g}`))}),e.jsx("div",{"aria-hidden":"true",className:"absolute right-2 top-1/2 -translate-y-1/2 flex flex-col gap-2",children:Array.from({length:P}).map((d,g)=>e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${a===g?"bg-red-700 scale-125":"bg-black/40"}`},g))}),e.jsx("button",{ref:l,type:"button",onClick:w,"aria-label":c?"Pause slideshow":"Play slideshow",title:c?"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:c?e.jsx(A,{"aria-hidden":"true"}):e.jsx(R,{"aria-hidden":"true"})})]})},$=({item:t,level:s,basePath:u})=>{const o=z(),x=K(),[a,m]=n.useState(!1),r=t.submenu&&t.submenu.length>0,c=M(u,t.menu,t.url),p=x.pathname===c&&c!=="#",f=t.submenu?.some(l=>x.pathname===M(u,l.menu,l.url)),j=()=>{c&&c!=="#"&&o(c),r&&m(!a)};return e.jsxs("div",{onMouseEnter:()=>r&&m(!0),onMouseLeave:()=>r&&m(!1),className:"w-full",children:[e.jsxs("button",{type:"button",onClick:j,title:t.menu,style:{paddingLeft:`${12+s*16}px`},className:`w-full flex items-center justify-between text-left pr-3 py-3 text-sm border-b border-[#
1E6E5E5] transition-colors duration-300 cursor-pointer relative z-10 2 ${p||f?"bg-[#0B4173] text-white":"bg-[#F1F1F1] text-gray-800 hover:bg-gray-200"}`,children:[e.jsx("span",{children:t.menu}),r?e.jsx("span",{className:`transition-transform duration-300 ${a?"rotate-180":"rotate-0"}`,children:e.jsx(W,{})}):p&&e.jsx(G,{})]}),e.jsx("div",{className:`grid transition-all duration-300 ease-in-out overflow-hidden ${r&&a?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:e.jsx("div",{className:"min-h-0",children:r&&t.submenu.map(l=>e.jsx($,{item:l,level:s+1,basePath:u},l.menu))})})]})},me=({menu:t,basePath:s})=>!t||t.length===0?null:e.jsx("nav",{"aria-label":"Overseas centre section navigation",className:"border border-[#E6E5E5] rounded-lg overflow-hidden bg-[#F1F1F1] relative z-10",children:t.map(u=>e.jsx($,{item:u,level:0,basePath:s},u.menu))}),ge=({note:t})=>{const{heading:s,description:u,address:o}=t;return 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:s}),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-l rounded-r"}),e.jsx("div",{className:"h-1 w-8 md:w-24 bg-[#8799BC] rounded-r"})]}),e.jsx(oe,{html:u,className:"mt-3 text-sm"}),e.jsx("h4",{className:"text-sm sm:text-md lg:text-md font-semibold text-gray-900 my-2",children:o.title}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ne,{className:"mt-1 text-md"}),e.jsxs("span",{className:"text-sm leading-relaxed",children:[o.location.map((x,a)=>e.jsxs(H.Fragment,{children:[x,e.jsx("br",{})]},a)),o.pincode&&e.jsxs("span",{children:["PIN: ",o.pincode]})]})]}),(o.phones?.length||o.phone)&&e.jsxs("div",{className:"flex items-start gap-2 mt-1",children:[e.jsx(re,{className:"mt-0.5 text-md","aria-hidden":"true"}),e.jsx(E,{values:o.phones,fallback:o.phone,kind:"phone",className:"text-sm"})]}),(o.emails?.length||o.email)&&e.jsxs("div",{className:"flex items-start gap-2 mt-1",children:[e.jsx(U,{className:"mt-0.5 text-md","aria-hidden":"true"}),e.jsx(E,{values:o.emails,fallback:o.email,kind:"email",className:"text-sm"})]})]})},Ce=()=>{const{opId:t}=V();q([ce(t),"Overseas Centre"].filter(Boolean).join(" â "));const[s,u]=n.useState(null),[o,x]=n.useState(!0),[a,m]=n.useState(null),[r,c]=n.useState(null);return n.useEffect(()=>{(async()=>{try{const[f,j,l]=await Promise.all([J(),Q(),X(t)]);m(j),c(l);const v=f?.find(i=>i.key==="overseas")?.submenu||[],h=v.find(i=>i.path?.split("/").filter(Boolean).pop()?.toLowerCase()===t?.toLowerCase());h?u(h.key):v.length>0&&u(v[0].key)}catch(f){console.error("Layout Sync Error:",f),u("op-6")}finally{x(!1)}})()},[t]),o?e.jsx("div",{className:"p-10 text-center",children:"Loading..."}):e.jsxs(e.Fragment,{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:s&&e.jsx(de,{OverseasId:s})}),e.jsx("div",{className:"lg:col-span-1",children:s&&e.jsx(he,{OverseasId:s})})]}),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:s&&r&&r[s]&&e.jsx(me,{menu:r[s],basePath:`/overseas/${t}`})}),e.jsx("div",{className:"md:col-span-5",children:s&&a&&a[s]&&e.jsx(ge,{note:a[s]})})]}),e.jsx("div",{className:"max-w-12xl px-2 sm:px-4 md:px-18 lg:px-15",children:e.jsx(Y,{})}),e.jsx(ie,{})]})};export{Ce 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.