"use strict";var e=Object.defineProperty,t=Object.defineProperties,o=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,s=(t,o,r)=>o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r,a=require("../../../../common/vendor.js"),c=require("../../../../store/index.js"),l=require("../../../../common/assets.js");require("../../../../store/modules.js"),require("../../../../store/modules/timStore.js");const d=a.defineComponent({name:"TUIConversation",components:{TUIConversationList:()=>"./conversation-list.js",Dialog:()=>"./components/dialog.js"},setup(e){const l=c.store.state.timStore,d=a.reactive({conversationList:a.computed$1((()=>l.conversationList)),currrentConversationID:"",open:!1,searchUserID:"",selectedList:[],searchUserList:[],step:1,showDialog:!1,item:{flow:"out",status:"success"},styleConfig:{width:"150px",padding:"16px 16px 0px",top:"8px",right:"8px"},chatList:[{imgType:"SINGLE",type:a.index.$TIM.TYPES.CONV_C2C,id:1,content:"发起会话"},{imgType:"GROUP",type:a.index.$TIM.TYPES.GRP_WORK,id:1,content:"工作群"},{imgType:"GROUP",type:a.index.$TIM.TYPES.GRP_PUBLIC,id:2,content:"社交群"},{imgType:"GROUP",type:a.index.$TIM.TYPES.GRP_MEETING,id:3,content:"会议群"}]});a.onUnload((()=>{a.index.$TUIKit.TUIConversationServer.destroyed()})),a.onNavigationBarButtonTap((()=>{d.showDialog=!d.showDialog})),a.onShow((()=>{a.index.$emit("refreshIM"),c.store.commit("timStore/setConversationID","")}));const m=e=>{var t,o;let r="";switch(e.type){case a.index.$TIM.TYPES.CONV_C2C:r=(null==e?void 0:e.userProfile.nick)||(null==(t=null==e?void 0:e.userProfile)?void 0:t.userID)||"";break;case a.index.$TIM.TYPES.CONV_GROUP:r=e.groupProfile.name||(null==(o=null==e?void 0:e.groupProfile)?void 0:o.groupID)||"";break;case a.index.$TIM.TYPES.CONV_SYSTEM:r="系统通知"}return r};return p=((e,t)=>{for(var o in t||(t={}))n.call(t,o)&&s(e,o,t[o]);if(r)for(var o of r(t))i.call(t,o)&&s(e,o,t[o]);return e})({},a.toRefs(d)),t(p,o({handleCurrrentConversation:e=>{if(null!=e.lastMessage.cloudCustomData)try{var t=JSON.parse(e.lastMessage.cloudCustomData);c.store.commit("timStore/setImType",t.imType),c.store.commit("timStore/setOrderType",t.orderType),c.store.commit("timStore/setOrderId",t.orderId),c.store.commit("timStore/setFollowId",t.followId),c.store.commit("timStore/setType",t.type)}catch(r){}d.currrentConversationID=e.conversationID,c.store.commit("timStore/setConversationID",e.conversationID),a.index.navigateTo({url:`../TUIChat/index?conversationName=${m(e)}`}),a.index.$TUIKit.TUIConversationServer.setMessageRead(e.conversationID);const o=d.conversationList.filter((t=>t.conversationID===e.conversationID));c.store.commit("timStore/setConversation",o),a.index.$TUIKit.TUIConversationServer.getConversationProfile(e.conversationID).then((e=>{c.store.commit("timStore/setConversation",e.data.conversation)}))},handleContentClick:e=>{d.showDialog=!1,a.index.navigateTo({url:`../TUIConversation/create?title=${e.content}&type=${e.type}`})},handleItemName:m,handleClose:()=>{d.showDialog=!1},handleShow:()=>{d.showDialog=!0}}));var p}});if(!Array){(a.resolveComponent("Dialog")+a.resolveComponent("TUIConversationList"))()}var m=a._export_sfc(d,[["render",function(e,t,o,r,n,i){return{a:a.f(e.chatList,((t,o,r)=>a.e({a:"SINGLE"===t.imgType},"SINGLE"===t.imgType?{b:l._imports_0}:{c:l._imports_1},{d:a.t(t.content),e:o,f:a.o((o=>e.handleContentClick(t)),o)}))),b:a.p({visible:e.showDialog,styleConfig:e.styleConfig,handleClose:e.handleClose}),c:a.o(e.handleCurrrentConversation),d:a.p({currentID:e.currrentConversationID,conversationList:e.conversationList})}}],["__scopeId","data-v-932eb736"]]);wx.createPage(m);
