"use strict";const e=require("../../../common/vendor.js"),r=require("../../utils/env.js");exports.TUISearchServer=class{constructor(){e.R.registerService(e.E.TUISearch.SERVICE.NAME,this),e.R.registerExtension(e.E.TUIChat.EXTENSION.INPUT_MORE.EXT_ID,this)}onCall(r,s){switch(r){case e.E.TUISearch.SERVICE.METHOD.SEARCH_GROUP:return this.searchGroup(null==s?void 0:s.groupID);case e.E.TUISearch.SERVICE.METHOD.SEARCH_USER:return this.searchUser(null==s?void 0:s.userID);case e.E.TUISearch.SERVICE.METHOD.SEARCH_FRIEND:return this.searchFriend(null==s?void 0:s.userID);case e.E.TUISearch.SERVICE.METHOD.SEARCH_GROUP_MEMBER:return this.searchGroupMember(null==s?void 0:s.groupID,null==s?void 0:s.userID)}}onGetExtension(s){if(s===e.E.TUIChat.EXTENSION.INPUT_MORE.EXT_ID){const s=[],t={weight:3e3,text:"搜索",icon:"https://web.sdk.qcloud.com/component/TUIKit/assets/message-search.svg",data:{name:"search"},listener:{onClicked:()=>{var s;e.Jt.update(e.o.SEARCH,"isShowInConversationSearch",!0),r.isUniFrameWork&&(null==(s=e.i)||s.navigateTo({url:"/TUIKit/components/TUISearch/index"}))}}};return s.push(t),s}}async searchFriend(r){return e.ts.getFriendProfile({userIDList:[r]})}async searchUser(r){return e.Zt.getUserProfile({userIDList:[r]})}async searchGroup(r){return e.es.searchGroupByID(r)}async searchGroupMember(r,s){return e.es.getGroupMemberProfile({groupID:r,userIDList:[s]})}};
