"use strict";const t=require("../../../../common/vendor.js"),e={name:"UniListChat",emits:["click"],props:{title:{type:String,default:""},note:{type:String,default:""},clickable:{type:Boolean,default:!1},link:{type:[Boolean,String],default:!1},to:{type:String,default:""},badgeText:{type:[String,Number],default:""},badgePositon:{type:String,default:"right"},time:{type:String,default:""},avatarCircle:{type:Boolean,default:!1},avatar:{type:String,default:""},avatarList:{type:Array,default:()=>[]}},computed:{isSingle(){if("dot"===this.badgeText)return"uni-badge--dot";return this.badgeText.toString().length>1?"uni-badge--complex":"uni-badge--single"},computedAvatar(){return this.avatarList.length>4?(this.imageWidth=13.95,"avatarItem--3"):this.avatarList.length>1?(this.imageWidth=21.15,"avatarItem--2"):(this.imageWidth=45,"avatarItem--1")}},data:()=>({isFirstChild:!1,border:!0,imageWidth:50}),mounted(){this.list=this.getForm(),this.list&&(this.list.firstChildAppend||(this.list.firstChildAppend=!0,this.isFirstChild=!0),this.border=this.list.border)},methods:{getForm(t="uniList"){let e=this.$parent,i=e.$options.name;for(;i!==t;){if(e=e.$parent,!e)return!1;i=e.$options.name}return e},onClick(){""===this.to?(this.clickable||this.link)&&this.$emit("click",{data:{}}):this.openPage()},openPage(){-1!==["navigateTo","redirectTo","reLaunch","switchTab"].indexOf(this.link)?this.pageApi(this.link):this.pageApi("navigateTo")},pageApi(e){t.index[e]({url:this.to,success:t=>{this.$emit("click",{data:t})},fail:t=>{this.$emit("click",{data:t}),console.error(t.errMsg)}})}}};const i=t._export_sfc(e,[["render",function(e,i,a,r,n,s){return t.e({a:n.border?1:"",b:n.isFirstChild?1:"",c:a.avatarCircle||0===a.avatarList.length},a.avatarCircle||0===a.avatarList.length?{d:a.avatarCircle?1:"",e:a.avatar,f:a.avatarCircle?1:""}:{g:t.f(a.avatarList,((t,e,i)=>({a:t.url,b:e}))),h:n.imageWidth+"px",i:n.imageWidth+"px",j:t.n(s.computedAvatar),k:n.imageWidth+"px",l:n.imageWidth+"px"},{m:a.badgeText&&"left"===a.badgePositon},a.badgeText&&"left"===a.badgePositon?{n:t.t("dot"===a.badgeText?"":a.badgeText),o:t.n(s.isSingle)}:{},{p:t.t(a.title),q:t.t(a.note),r:t.t(a.time),s:a.badgeText&&"right"===a.badgePositon},a.badgeText&&"right"===a.badgePositon?{t:t.t("dot"===a.badgeText?"":a.badgeText),v:t.n(s.isSingle),w:t.n("right"===a.badgePositon?"uni-list-chat--right":"")}:{},{x:a.clickable||a.link?"uni-list-chat--hover":"",y:t.o(((...t)=>s.onClick&&s.onClick(...t)))})}]]);wx.createComponent(i);
