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