import{u as z}from"./vue-i18n-90d534a9.js";import{d as N,k as n,o as c,c as r,bl as u,bc as m,$ as d,a as t,P as l,aX as a,u as s,O as $,bj as D,_ as I,an as R}from"./@vue-cb50a1c4.js";import{o as K,t as S}from"./index-ae60edf9.js";import{e as h}from"./open-im-sdk-wasm-f19f04ec.js";import{B as O}from"./index-e4a7d928.js";const V={key:0,class:"relative mr-3"},j={class:"absolute top-0 left-0 h-5 w-5 rounded-full bg-[#c8c9cc]"},A={class:"flex w-full items-center justify-between"},F={class:"max-w-[60%] truncate"},L={key:0,class:"text-[13px] text-[#999]"},T={key:0,class:"ml-3 rounded-xl px-3 py-1 text-sub-text"},q=N({__name:"index",props:{source:null,subKey:null,iconSize:{default:42},index:null,total:null,showCheck:{type:Boolean},checked:{type:Boolean},disabled:{type:Boolean},showRemove:{type:Boolean},showRole:{type:Boolean}},emits:["remove","clickItem"],setup(e,{emit:k}){const o=e,{t:w}=z(),x=n(()=>o.index!==void 0&&o.total!==void 0?o.index===o.total-1:!1),y=n(()=>o.source.remark||o.source.nickname||o.source.groupName||o.source.showName),B=n(()=>{if(o.subKey)return o.subKey==="memberCount"?`${o.source.memberCount}${w("people")}`:o.source[o.subKey]}),g=n(()=>o.source.roleLevel===h.Admin),b=n(()=>o.source.roleLevel===h.Owner),p=()=>{k("remove",o.source)};return(i,v)=>{const f=S,C=O;return c(),r("div",{class:"flex h-[64px] items-center bg-white px-[22px]",onClick:v[0]||(v[0]=E=>i.$emit("clickItem",e.source))},[e.showCheck?(c(),r("div",V,[u(d(f,{name:"circle",color:"#979797",size:"20"},null,512),[[m,!e.checked]]),u(d(f,{name:"checked",size:"20",color:"#1D6BED"},null,512),[[m,e.checked]]),u(t("div",j,null,512),[[m,e.disabled]])])):l("",!0),d(K,{src:e.source.faceURL,size:e.iconSize,"is-group":(!!e.source.conversationID||!!e.source.groupName)&&!!e.source.groupID,desc:e.source.remark||e.source.nickname||e.source.showName},null,8,["src","size","is-group","desc"]),t("div",{class:R(["ml-4 flex h-full w-full items-center justify-between !border-0 border-b border-[#F1F1F1]",{"!border-0":s(x)}])},[t("div",A,[t("div",F,[t("div",null,a(s(y)),1),e.subKey?(c(),r("div",L,a(s(B)),1)):l("",!0)]),e.showRole&&(s(g)||s(b))?(c(),r("div",T,a(i.$t(s(b)?"groupOwner":"groupAdmin")),1)):l("",!0)]),t("div",null,[e.showRemove?(c(),$(C,{key:0,size:"small",class:"w-max !border-none",onClick:p,plain:"",type:"primary"},{default:D(()=>[I(a(i.$t("buttons.remove")),1)]),_:1})):l("",!0)])],2)])}}});export{q as _};
