import{bU as e,D as t,E as r,aw as n,aE as a,ac as i,a7 as s,aJ as o,S as l,dZ as c,aY as u,aI as d,aD as g,bT as m,am as p,C as h,G as j,U as b,dq as f,ae as x,a6 as w,e4 as $,r as _,c0 as k,c1 as y,q as v}from"./index-WdfADTOW.js";import{b as C}from"./style-Bwu_nCs5.js";import{I}from"./ImageWithError-X3f_wfYd.js";import{O as E,g as M}from"./icon-BWzmfBge.js";import{I as G,u as z}from"./helper-CqLrXRm9.js";import{G as A}from"./GridItem-Cfvx-btq.js";import"./index-U4ybYyYy.js";import"./Layout-Dnkreiah.js";import"./useTitle-BZYCQV-b.js";import"./FolderTree-CfW3CiDF.js";import"./index-DOl0PLGi.js";import"./ModalInput-3A_h28-x.js";import"./index-B42M_jG_.js";import"./share-DuMdNkZH.js";import"./index-BpGVr_Gk.js";const P=h=>{const{isHide:j}=e();if(j(h.obj)||h.obj.type!==E.IMAGE)return null;const{setPathAs:b}=t(),f=r(a,{get color(){return n()},boxSize:"$12",get as(){return M(h.obj)}}),{show:x}=C({id:1}),{rawLink:w}=i(),{openWithDoubleClick:$,toggleWithClick:_,restoreSelectionCache:k}=z();return r(p.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},style:{"flex-grow":1},get children(){return r(s,{w:"$full",get classList(){return{selected:!!h.obj.selected}},class:"image-item viselect-item",get"data-index"(){return h.index},p:"$1",spacing:"$1",rounded:"$lg",transition:"all 0.3s",border:"2px solid transparent",get _hover(){return{border:`2px solid ${n()}`}},get cursor(){return $()||_()?"default":"pointer"},onMouseEnter:()=>{b(h.obj.name,h.obj.is_dir,!0)},onContextMenu:e=>{m(()=>{c(h.index,!0,!0)}),x(e,{props:h.obj})},get children(){return r(o,{w:"$full",pos:"relative",get children(){return[r(l,{get when(){return u()},get children(){return r(G,{pos:"absolute",left:"$1",top:"$1","on:mousedown":e=>{e.stopPropagation()},"on:click":e=>{e.stopPropagation()},get checked(){return h.obj.selected},onChange:e=>{c(h.index,e.target.checked)}})}}),r(I,{h:"150px",w:"$full",objectFit:"cover",rounded:"$lg",shadow:"$md",get fallback(){return r(g,{size:"lg"})},fallbackErr:f,get src(){return w(h.obj)},loading:"lazy","on:dblclick":()=>{$()&&(d.emit("gallery",h.obj.name),c(h.index,!0,!0))},"on:click":e=>{if(!$()&&!(e.ctrlKey||e.metaKey||e.shiftKey)&&k())return _()?c(h.index,!h.obj.selected):void d.emit("gallery",h.obj.name)}})]}})}})}})},S=e=>{const t=v(),n=h(()=>r(f,{w:"$full",gap:"$1",templateColumns:"repeat(auto-fill, minmax(100px,1fr))",class:"image-folders",get children(){return r(j,{get each(){return b.objs.filter(e=>e.is_dir)},children:(e,t)=>r(A,{obj:e,get index(){return t()}})})}})),{registerSelectContainer:a,captureContentMenu:i}=z();return a(),r(s,{"oncapture:contextmenu":i,class:"viselect-container",spacing:"$2",w:"$full",get children(){return[r(l,{get when(){return"visible"===_.show_count_msg},get children(){return r(x,{w:"100%",textAlign:"left",pl:"$2",get children(){return r(w,{size:"sm",color:"$neutral11",get children(){return $(E.IMAGE)}})}})}}),r(l,{get when(){return"top"===_.show_folder_in_image_view},get children(){return n()}}),r(l,{get when(){return e.images.length>0},get fallback(){return r(y,{m:"$2",get children(){return t("home.no_images")}})},get children(){return r(k,{w:"$full",gap:"$1",flexWrap:"wrap",class:"image-images",get children(){return r(j,{get each(){return b.objs},children:(e,t)=>r(P,{obj:e,get index(){return t()}})})}})}}),r(l,{get when(){return"bottom"===_.show_folder_in_image_view},get children(){return n()}})]}})};export{S as default};
