1import D from"./DxUJ06tv.js";import{_ as S}from"./BCbKPXDE.js";import{_ as M}from"./Dn7tRY-D.js";import{e as V,C as F,E as O,i as t,c as l,a as i,F as P,r as U,t as g,x as d,b as m,w as z,o as s,j as a,p as A}from"./BW7pCjIS.js";const q={key:0},G={class:"grid grid-cols-4 sm:grid-cols-6 md:grid-cols-8 lg:grid-cols-10 gap-2 sm:gap-3 items-end"},K=["aria-label","onClick"],R=["src","alt"],H={class:"relative flex h-full w-full items-center justify-center bg-black"},J=["src","alt"],Q={class:"absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full bg-black/60 px-4 py-1 text-sm text-white"},ee=V({__name:"NewsGallery",props:{news:{},max:{default:1/0},showMore:{type:Boolean,default:!1}},setup(v){const c=v,w=a(()=>String(c.news.stem??"").split("/").pop()),o=a(()=>Array.isArray(c.news.images)?[...c.news.images]:[]),E=e=>`/news/${w.value}/thumb/${e}`,I=e=>`/news/${w.value}/full/${e}`,_=e=>e.replace(/\.[^.]+$/,""),h=a(()=>o.value.slice(0,c.max)),b=a(()=>o.value.length-h.value.length),u=A(!1),n=A(0),x=a(()=>n.value>0),y=a(()=>n.value<o.value.length-1);function k(e){n.value=e,u.value=!0}function C(){x.value&&(n.value-=1)}function $(){y.value&&(n.value+=1)}function p(e){e.key==="ArrowLeft"?(e.preventDefault(),C()):e.key==="ArrowRight"&&(e.preventDefault(),$())}return F(u,e=>{e?window.addEventListener("keydown",p):window.removeEventListener("keydown",p)}),O(()=>{window.removeEventListener("keydown",p)}),(e,f)=>{const j=D,L=S,B=M;return t(o).length?(s(),l("div",q,[i("div",G,[(s(!0),l(P,null,U(t(h),(r,N)=>(s(),l("button",{key:r,type:"button",class:"block aspect-square overflow-hidden rounded focus:outline-none focus-visible:ring-4 focus-visible:ring-green focus-visible:ring-offset-2","aria-label":`Open image ${N+1} of ${t(o).length}`,onClick:T=>k(N)},[i("img",{src:E(r),alt:_(r),loading:"lazy",class:"h-full w-full object-cover transition-transform duration-200 hover:scale-105"},null,8,R)],8,K))),128)),v.showMore&&t(b)>0?(s(),l("button",{key:0,type:"button",class:"col-span-3 mb-1 cursor-pointer text-left text-charcoal-light hover:text-charcoal",onClick:f[0]||(f[0]=r=>k(t(h).length))}," ...and "+g(t(b))+" more ",1)):d("",!0)]),m(B,null,{default:z(()=>[m(L,{open:t(u),"has-header":!1,"full-screen":"",title:"Image gallery",onClose:f[1]||(f[1]=r=>u.value=!1)},{default:z(()=>[i("div",H,[t(x)?(s(),l("button",{key:0,type:"button",class:"absolute left-3 z-10 flex h-11 w-11 items-center justify-center rounded-full bg-white/90 text-charcoal shadow-lg hover:bg-white","aria-label":"Previous image",onClick:C},[m(j,{name:"mdi:chevron-left",size:"28px"})])):d("",!0),t(y)?(s(),l("button",{key:1,type:"button",class:"absolute right-3 z-10 flex h-11 w-11 items-center justify-center rounded-full bg-white/90 text-charcoal shadow-lg hover:bg-white","aria-label":"Next image",onClick:$},[m(j,{name:"mdi:chevron-right",size:"28px"})])):d("",!0),i("img",{src:I(t(o)[t(n)]),alt:_(t(o)[t(n)]),class:"max-h-full max-w-full object-contain p-4 sm:p-8"},null,8,J),i("div",Q,g(t(n)+1)+" / "+g(t(o).length),1)])]),_:1},8,["open"])]),_:1})])):d("",!0)}}});export{ee as _};
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.