import{d as D,r as N,x as B,O as X,c as l,h as p,f as s,e as r,w as t,j as _,F as V,i as h,Z as Y,u,N as z,D as R,a3 as j,W as d,t as y,b as A,aa as E}from"./index-CLKg64ON.js";import{p as F,m as v}from"./VCheckbox-CpTv3BhW.js";import{C as S}from"./Container-ZPskS02H.js";import{T as H}from"./Toolbar-BaIn3BvJ.js";import{e as O}from"./eventbus-D-xzWv8v.js";import{V as U}from"./VList-BvG6-yh2.js";import{V as I,a as W}from"./ItemsListing-BwjD1tmq.js";import{V as Z}from"./VCard-BaRPabiE.js";import{x as q,z as G,V as J,A as K,B as Q,w as ee}from"./VListItem-B_TSjQ1y.js";import{V as te}from"./PanelviewItemCompact-CM48-dMH.js";import{_ as oe}from"./_plugin-vue_export-helper-DlAUqK2U.js";const ae={style:{"margin-bottom":"10px"}},se=D({__name:"MediaItemImages",props:{modelValue:{}},emits:["update:modelValue"],setup(b,{emit:k}){const w=b,m=N(!1),C=k,x=function(e){window.open(e,"_blank")},f=function(e,o){const n="clientX"in e?e.clientX:e.touches[0].clientX,c="clientY"in e?e.clientY:e.touches[0].clientY;O.emit("contextmenu",{items:[{label:"image_make_primary",icon:"mdi-star-box",action:()=>{L(o)}}],posX:n,posY:c})},M=function(e,o){x(v(o))},g=function(){m.value=!m.value},L=function(e){console.log("MakeImagePrimary",e);const o=[e];o.push(...w.modelValue.filter(n=>n!=e)),C("update:modelValue",o)},P=B(()=>[{label:"tooltip.collapse_expand",icon:m.value?"mdi-chevron-up":"mdi-chevron-down",action:g,overflowAllowed:!1}]);return(e,o)=>{const n=X("hold");return l(),p("section",ae,[s(H,{title:e.$t("images"),"menu-items":P.value,onTitleClicked:g},null,8,["title","menu-items"]),s(U),m.value?(l(),r(S,{key:0},{default:t(()=>[(l(!0),p(V,null,h(u(E),c=>(l(),r(I,{key:c},{default:t(()=>[(l(!0),p(V,null,h(e.modelValue.filter(a=>a.type==c),(a,T)=>(l(),r(W,{key:a.path,cols:"12",class:Y(`col-${u(F)(e.$vuetify.display.width)}`)},{default:t(()=>[s(te,null,{default:t(({props:$})=>[z((l(),r(Z,R({ref_for:!0},$,{tile:"",hover:"",class:"panel-item",onClick:i=>{M(i,a)},onContextmenu:j(i=>{f(i,a)},["right","prevent"])}),{default:t(()=>[s(q,{src:u(v)(a,256),class:"bg-grey-lighten-2",width:"100%"},{placeholder:t(()=>[s(I,{align:"center",class:"fill-height ma-0",justify:"center"},{default:t(()=>[s(G,{color:"grey-lighten-5",indeterminate:""})]),_:1})]),_:2},1032,["src"]),s(J,{variant:"text",slim:"",tile:"",density:"compact",class:"panel-item-details"},{default:t(()=>[s(K,{width:"95%"},{default:t(()=>[d(y(e.$t("image_type")+": "+a.type),1)]),_:2},1024),s(Q,{class:"line-clamp-1",style:{"margin-right":"25px"}},{default:t(()=>{var i;return[d(y(e.$t("image_source")+": "+((i=u(A).getProvider(a.provider))==null?void 0:i.name)),1)]}),_:2},1024),T==0?(l(),r(ee,{key:0,size:"x-large",style:{position:"absolute",right:"0",bottom:"5px"},color:"orange",title:e.$t("tooltip.primary_image")},{default:t(()=>o[0]||(o[0]=[d("mdi-star-box")])),_:1},8,["title"])):_("",!0)]),_:2},1024)]),_:2},1040,["onClick","onContextmenu"])),[[n,i=>{f(i,a)}]])]),_:2},1024)]),_:2},1032,["class"]))),128))]),_:2},1024))),128))]),_:1})):_("",!0)])}}}),_e=oe(se,[["__scopeId","data-v-b900ca22"]]);export{_e as M};
