1import{d as e,h as t,N as a,b as s,v as l,f as o,s as i,o as n,j as r,k as u,ao as d,ap as c,c as m,l as f,aq as v,q as h,t as b,K as p,ar as w,as as x}from"./BPuzE2Iz.js";import{r as y}from"./_3rPDi-3.js";import{r as g}from"./QS0-p4u5.js";const k={class:"fixed inset-0 overflow-y-auto"},j={class:"flex min-h-full items-center justify-center p-3 sm:p-5"},_={class:"flex h-14 shrink-0 items-center gap-3 border-b border-slate-200 px-4"},I={key:0,class:"shrink-0 text-xs font-medium tabular-nums text-slate-500","aria-live":"polite"},V={class:"relative flex min-h-[60vh] flex-1 items-center justify-center overflow-auto bg-slate-100 p-3 sm:p-5"},C=["src","alt"],L=e({__name:"ImagePreviewDialog",props:{activeIndex:{default:0},items:{},modelValue:{type:Boolean}},emits:["update:activeIndex","update:modelValue"],setup(e,{emit:L}){const D=e,E=L,q=t(()=>D.items.length?Math.min(Math.max(D.activeIndex,0),D.items.length-1):0),A=t(()=>D.items[q.value]),M=t(()=>D.items.length>1);function z(e){M.value&&E("update:activeIndex",(q.value+e+D.items.length)%D.items.length)}function B(e){"ArrowLeft"===e.key?(e.preventDefault(),z(-1)):"ArrowRight"===e.key&&(e.preventDefault(),z(1))}return a(()=>D.modelValue,e=>{"undefined"!=typeof window&&(window.removeEventListener("keydown",B),e&&window.addEventListener("keydown",B))},{immediate:!0}),a([q,()=>D.items],()=>{if(!("undefined"==typeof window||D.items.length<2))for(const e of[-1,1]){const t=(q.value+e+D.items.length)%D.items.length;(new Image).src=D.items[t]?.src||""}},{deep:!0}),s(()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",B)}),(e,t)=>(n(),l(o(x),{as:"template",show:e.modelValue},{default:i(()=>[r(o(w),{class:"relative z-50",onClose:t[3]||(t[3]=e=>E("update:modelValue",!1))},{default:i(()=>[r(o(d),{as:"template",enter:"ease-out duration-200","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in duration-150","leave-from":"opacity-100","leave-to":"opacity-0"},{default:i(()=>[...t[4]||(t[4]=[u("div",{class:"fixed inset-0 bg-slate-950/75"},null,-1)])]),_:1}),u("div",k,[u("div",j,[r(o(d),{as:"template",enter:"ease-out duration-200","enter-from":"opacity-0 scale-[0.98] translate-y-2","enter-to":"opacity-100 scale-100 translate-y-0",leave:"ease-in duration-150","leave-from":"opacity-100 scale-100","leave-to":"opacity-0 scale-[0.98]"},{default:i(()=>[r(o(c),{class:"flex max-h-[94vh] w-full max-w-6xl flex-col overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-2xl"},{default:i(()=>[u("header",_,[r(o(v),{class:"min-w-0 flex-1 truncate text-sm font-semibold text-slate-950"},{default:i(()=>[h(b(A.value?.title||"å¾çé¢è§"),1)]),_:1}),M.value?(n(),m("span",I,b(q.value+1)+" / "+b(e.items.length),1)):f("",!0),u("button",{type:"button",class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-slate-200 bg-white text-slate-500 transition duration-200 hover:bg-slate-50 hover:text-slate-950 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-300","aria-label":"å
³éå¾çé¢è§",onClick:t[0]||(t[0]=e=>E("update:modelValue",!1))},[r(o(p),{class:"h-5 w-5"})])]),u("div",V,[A.value?(n(),m("img",{key:A.value.src,src:A.value.src,alt:A.value.alt||"å¾çé¢è§",class:"max-h-[calc(94vh-5.5rem)] max-w-full rounded-lg object-contain shadow-sm"},null,8,C)):f("",!0),M.value?(n(),m("button",{key:1,type:"button",class:"absolute left-3 top-1/2 flex h-11 w-11 -translate-y-1/2 items-center justify-center rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm transition duration-200 hover:bg-slate-50 hover:text-slate-950 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 sm:left-5","aria-label":"æ¥çä¸ä¸å¼ å¾ç",onClick:t[1]||(t[1]=e=>z(-1))},[r(o(y),{class:"h-6 w-6"})])):f("",!0),M.value?(n(),m("button",{key:2,type:"button",class:"absolute right-3 top-1/2 flex h-11 w-11 -translate-y-1/2 items-center justify-center rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm transition duration-200 hover:bg-slate-50 hover:text-slate-950 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 sm:right-5","aria-label":"æ¥çä¸ä¸å¼ å¾ç",onClick:t[2]||(t[2]=e=>z(1))},[r(o(g),{class:"h-6 w-6"})])):f("",!0)])]),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"]))}});
1export{L 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.