import{r as w,L as C,b as B,i as N,o as m,c as u,d as v,a as s,l as d,u as i,g as x,n as f,F as L}from"./app-660f986c.js";import{m as n,_}from"./ModalClose-651ba4d9.js";import{_ as p}from"./Arrow-616190ab.js";const z={key:0,class:"absolute h-50 flex items-center"},F=["aria-label"],I=["src"],M=["aria-label"],E=["aria-label"],K={__name:"LightBox",props:["currentImageIndex","images"],emits:["close"],setup(r,{emit:$}){const o=r;let e=w(o.currentImageIndex),t=w(!1),g="absolute cursor-pointer tw-scale-on-hover close-bg-transition hover:before:bg-white/10";C(()=>{n.makeHtmlBodyFixed(),t.value=!0}),B(()=>{n.initCallBack(h,b,k),n.initNavKeyEvent()}),N(()=>{n.removeHtmlBodyFixed(),n.removeNavKeyEvent()});const h=()=>{t.value=!0,o.images.length-1===e.value&&(e.value=-1),e.value=e.value+1},b=()=>{t.value=!0,e.value===0?e.value=o.images.length-1:(e.value=e.value-1,o.images.length-1===0&&(e.value=o.images.length-1))},k=()=>{$("close")},y=()=>{setTimeout(()=>{t.value=!1},300)};return(l,a)=>(m(),u("div",{class:"z-50 fixed inset-0 overflow-y-scroll w-full h-full bg-black/50 fade-in-modal",onClick:a[3]||(a[3]=d(c=>l.$emit("close"),["self"]))},[v(_,{onClick:a[0]||(a[0]=c=>l.$emit("close")),role:"button","aria-label":l.$t("lang.a11y.close_popup"),class:"w-8 h-8 fixed right-4 top-4 group tw-white-fill hover:before:bg-white/10 xs:top-2",fillClass:"fill-white",iconSize:{width:14,height:14}},null,8,["aria-label"]),s("div",{class:"h-screen flex items-center",onClick:a[2]||(a[2]=d(c=>l.$emit("close"),["self"]))},[s("div",{class:"w-4/5 mx-auto relative flex items-center justify-center",onClick:a[1]||(a[1]=d(c=>l.$emit("close"),["self"]))},[i(t)?(m(),u("div",z,[s("div",{"aria-label":l.$t("lang.a11y.circle_loader"),class:"tw-circle-loader tw-light-circle-loader w-8 h-8"},null,8,F)])):x("",!0),s("img",{src:r.images[i(e)].src,class:f([i(t)?"opacity-0":"","max-w-full mx-auto max-h-[95vh] object-cover relative z-100 xs:w-4/5"]),onLoad:y},null,42,I)]),r.images.length>1?(m(),u(L,{key:0},[s("div",{class:f(["right-6 xs:right-3",i(g)]),role:"button","aria-label":l.$t("lang.a11y.next"),tabindex:"1",onClick:h},[v(p)],10,M),s("div",{class:f(["left-6 xs:left-3",i(g)]),role:"button","aria-label":l.$t("lang.a11y.previous"),tabindex:"1",onClick:b},[v(p,{class:"transform -rotate-180"})],10,E)],64)):x("",!0)])]))}};export{K as _};
