import{u as y,o as r,c as u,w as t,b as a,l as g,t as n,S as _,aj as C,C as v,E as h,ay as f,H as V,p as m,d as c,f as b,B as p,W as x,k as I,az as B,D as k}from"./index-fbd71ad2.js";import{_ as S}from"./_plugin-vue_export-helper-c27b6911.js";const w={name:"ItemCard",setup(){const{t:l}=y();return{t:l}},props:{item:{type:Object,required:!0},titleField:{type:String,default:"id"},enabledField:{type:String,default:"enable"},bglogo:{type:String,default:null},loading:{type:Boolean,default:!1},showCopyButton:{type:Boolean,default:!1}},emits:["toggle-enabled","delete","edit","copy"],methods:{getItemTitle(){return this.item[this.titleField]},getItemEnabled(){return this.item[this.enabledField]},toggleEnabled(){this.$emit("toggle-enabled",this.item)}}},E=["title"],T={key:0,class:"d-flex justify-end align-center",style:{position:"absolute",bottom:"16px",right:"16px",opacity:"0.2"}};function j(l,d,e,i,z,o){return r(),u(k,{class:"item-card hover-elevation",style:{padding:"4px"},elevation:"0"},{default:t(()=>[a(h,{class:"d-flex justify-space-between align-center pb-1 pt-3"},{default:t(()=>[g("span",{class:"text-h2 text-truncate",title:o.getItemTitle()},n(o.getItemTitle()),9,E),a(_,{location:"top"},{activator:t(({props:s})=>[a(C,v({color:"primary","hide-details":"",density:"compact","model-value":o.getItemEnabled(),loading:e.loading,disabled:e.loading},s,{"onUpdate:modelValue":o.toggleEnabled}),null,16,["model-value","loading","disabled","onUpdate:modelValue"])]),default:t(()=>[g("span",null,n(o.getItemEnabled()?i.t("core.common.itemCard.enabled"):i.t("core.common.itemCard.disabled")),1)]),_:1})]),_:1}),a(V,null,{default:t(()=>[f(l.$slots,"item-details",{item:e.item},void 0,!0)]),_:3}),a(x,{style:{margin:"8px"}},{default:t(()=>[a(m,{variant:"outlined",color:"error",size:"small",rounded:"xl",disabled:e.loading,onClick:d[0]||(d[0]=s=>l.$emit("delete",e.item))},{default:t(()=>[c(n(i.t("core.common.itemCard.delete")),1)]),_:1},8,["disabled"]),a(m,{variant:"tonal",color:"primary",size:"small",rounded:"xl",disabled:e.loading,onClick:d[1]||(d[1]=s=>l.$emit("edit",e.item))},{default:t(()=>[c(n(i.t("core.common.itemCard.edit")),1)]),_:1},8,["disabled"]),e.showCopyButton?(r(),u(m,{key:0,variant:"tonal",color:"secondary",size:"small",rounded:"xl",disabled:e.loading,onClick:d[2]||(d[2]=s=>l.$emit("copy",e.item))},{default:t(()=>[c(n(i.t("core.common.itemCard.copy")),1)]),_:1},8,["disabled"])):b("",!0),f(l.$slots,"actions",{item:e.item},void 0,!0),a(p)]),_:3}),e.bglogo?(r(),I("div",T,[a(B,{src:e.bglogo,contain:"",width:"120",height:"120"},null,8,["src"])])):b("",!0)]),_:3})}const D=S(w,[["render",j],["__scopeId","data-v-f24212f9"]]);export{D as I};
