"use strict";const e=require("../../../common/vendor.js"),a=require("../../../common/assets.js"),t=require("../../utils/env.js");class n{constructor(){e.R.registerService(e.E.TUIGroup.SERVICE.NAME,this),e.R.registerExtension(e.E.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID,this),this.onCallParamsMap=new Map,this.onCallCallbackMap=new Map,this.constants=e.E}static getInstance(){return n.instance||(n.instance=new n),n.instance}getOnCallParams(e){return this.onCallParamsMap.get(e)}getOnCallCallback(e){return this.onCallCallbackMap.get(e)}async onCall(a,n,r){var s,o,i;switch(this.onCallParamsMap.set(a,n),this.onCallCallbackMap.set(a,r),a){case e.E.TUIGroup.SERVICE.METHOD.CREATE_GROUP:e.Jt.update(e.o.GRP,"isShowCreateComponent",!0),t.isUniFrameWork&&(null==(s=e.i)||s.reLaunch({url:"/TUIKit/components/TUIGroup/index"}));break;case e.E.TUIGroup.SERVICE.METHOD.OPEN_GROUP_MANAGEMENT:e.es.switchGroup(n.groupID),e.Jt.update(e.o.GRP,"isShowManageComponent",!0),t.isUniFrameWork&&(null==(o=e.i)||o.navigateTo({url:"/TUIKit/components/TUIGroup/index"}));break;case e.E.TUIGroup.SERVICE.METHOD.SELECT_GROUP_MEMBER:e.es.switchGroup(n.groupID),e.Jt.update(e.o.GRP,"isShowSelectComponent",!0),t.isUniFrameWork&&(null==(i=e.i)||i.navigateTo({url:"/TUIKit/components/TUIGroup/index"}))}}onGetExtension(t){const n=[];if(t===e.E.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID)n.push({weight:100,icon:a.settingSVG,text:"更多",data:{},listener:{onClicked:this.groupManage.bind(this)}});return n}groupManage(a){e.R.callService({serviceName:e.E.TUIGroup.SERVICE.NAME,method:e.E.TUIGroup.SERVICE.METHOD.OPEN_GROUP_MANAGEMENT,params:a,callback:()=>{var a;t.isUniFrameWork&&(null==(a=e.i)||a.navigateBack())}})}}exports.TUIGroupServer=n;
