import{d as B,r as X,x as Y,a2 as z,c as i,h as u,f as s,e as l,w as t,j as _,F as V,i as h,K as E,u as d,ao as R,a1 as S,E as j,S as A,D as p,t as y,ai as F,b as v}from"./index-BcUYXcPq.js";import{d as I}from"./ItemContextMenu.vue_vue_type_style_index_0_scoped_85c6bb69_lang-CQtpREte.js";import{C as H}from"./Container-BixSAZes.js";import{T as K}from"./Toolbar-CtV0cu85.js";import{e as U}from"./eventbus-CGRXT3Tn.js";import{V as q}from"./VList-BKlimdrv.js";import{V as k,a as G}from"./VRow-CBTscIT0.js";import{V as J}from"./VCard-Dx-t9yLE.js";import{x as O,z as Q,V as W,A as Z,B as ee,r as te}from"./VListItem-DC0X47Q4.js";import{V as oe}from"./PanelviewItemCompact-w04R_lVh.js";import{_ as ae}from"./_plugin-vue_export-helper-DlAUqK2U.js";const se={style:{"margin-bottom":"10px"}},ie=B({__name:"MediaItemImages",props:{modelValue:{}},emits:["update:modelValue"],setup(b,{emit:w}){const C=b,m=X(!1),x=w,P=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;U.emit("contextmenu",{items:[{label:"image_make_primary",icon:"mdi-star-box",action:()=>{T(o)}}],posX:n,posY:c})},M=function(e){return v.getProvider(e)?v.getProvider(e).name:e},L=function(e,o){P(I(o))},g=function(){m.value=!m.value},T=function(e){console.log("MakeImagePrimary",e);const o=[e];o.push(...C.modelValue.filter(n=>n!=e)),x("update:modelValue",o)},$=Y(()=>[{label:"tooltip.collapse_expand",icon:m.value?"mdi-chevron-up":"mdi-chevron-down",action:g,overflowAllowed:!1}]);return(e,o)=>{const n=z("hold");return i(),u("section",se,[s(K,{title:e.$t("images"),"menu-items":$.value,onTitleClicked:g},null,8,["title","menu-items"]),s(q),m.value?(i(),l(H,{key:0},{default:t(()=>[(i(!0),u(V,null,h(d(F),c=>(i(),l(k,{key:c},{default:t(()=>[(i(!0),u(V,null,h(e.modelValue.filter(a=>a.type==c),(a,D)=>(i(),l(G,{key:a.path,cols:"12",class:E(`col-${d(R)(e.$vuetify.display.width)}`)},{default:t(()=>[s(oe,null,{default:t(({props:N})=>[S((i(),l(J,j({ref_for:!0},N,{tile:"",hover:"",class:"panel-item",onClick:r=>{L(r,a)},onContextmenu:A(r=>{f(r,a)},["right","prevent"])}),{default:t(()=>[s(O,{src:d(I)(a,256),class:"bg-grey-lighten-2",width:"100%"},{placeholder:t(()=>[s(k,{align:"center",class:"fill-height ma-0",justify:"center"},{default:t(()=>[s(Q,{color:"grey-lighten-5",indeterminate:""})]),_:1})]),_:2},1032,["src"]),s(W,{variant:"text",slim:"",tile:"",density:"compact",class:"panel-item-details"},{default:t(()=>[s(Z,{width:"95%"},{default:t(()=>[p(y(e.$t("image_type")+": "+a.type),1)]),_:2},1024),s(ee,{class:"line-clamp-1",style:{"margin-right":"25px"}},{default:t(()=>[p(y(e.$t("image_source")+": "+M(a.provider)),1)]),_:2},1024),D==0?(i(),l(te,{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]=[p("mdi-star-box")])),_:1},8,["title"])):_("",!0)]),_:2},1024)]),_:2},1040,["onClick","onContextmenu"])),[[n,r=>{f(r,a)}]])]),_:2},1024)]),_:2},1032,["class"]))),128))]),_:2},1024))),128))]),_:1})):_("",!0)])}}}),Ve=ae(ie,[["__scopeId","data-v-9e541720"]]);export{Ve as M};
