UNPKG

@tencentcloud/lite-chat

Version:

Tencent Cloud Chat SDK for Web/Mini Program/uni-app/React Native/Donut

2 lines (1 loc) 20.3 kB
var t=new class{constructor(){this._conversationGroupMap=new Map}init(t){this._core=t}getConversationGroupMap(){return this._conversationGroupMap}getConversationGroup(t){return this._conversationGroupMap.get(t)}setConversationGroup(t,o){this._conversationGroupMap.set(t,o)}};function o(t,o,e,n){return new(e||(e=Promise))(function(r,s){function a(t){try{c(n.next(t))}catch(t){s(t)}}function i(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){var o;t.done?r(t.value):(o=t.value,o instanceof e?o:new e(function(t){t(o)})).then(a,i)}c((n=n.apply(t,o||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const e=new class{init(t){this.core=t}},n="CONV_GROUP",r=2500,s=2503,a=1,i=2,c="NOT_STARTED",u="FETCHING",p="FINISHED",d="FAILED",v=0,l=1,C=1,h=2,m=3,f=1,I=2;function G(t){const{helper:o,constants:r}=e.core;if(!o.checkBusinessCapabilityBits(n))throw new o.ChatError({functionName:t,code:r.ERROR_CODE.NO_USE,replacement1:t})}function _(){const{notificationCenter:o,OuterEvent:n}=e.core;o.emitOuterEvent(n.CONVERSATION_GROUP_LIST_UPDATED,{name:n.CONVERSATION_GROUP_LIST_UPDATED,data:[...t.getConversationGroupMap().values()]})}function g(t){const{utils:{isUndefined:o},constants:{OuterConstant:n}}=e.core,{Type:r,To_Account:s,Peer_Account:c}=t;let u="";const p=t.ToGroupId||t.GroupId;return r===a?o(c)?o(s)||(u=`${n.CONV_C2C}${s}`):u=`${n.CONV_C2C}${c}`:r===i&&(u=`${n.CONV_GROUP}${p}`),u}function D(t){const o=[],{OuterConstant:n,common:{isC2CConv:r,isGroupConv:s}}=e.core,{conversationIDList:c,failureConversationIDList:u,additionalData:p={}}=t;return c.forEach(t=>{N(t,u),r(t)?o.push(Object.assign({ContactItem:{Type:a,To_Account:t.replace(n.CONV_C2C,"")}},p)):s(t)&&o.push(Object.assign({ContactItem:{Type:i,ToGroupId:t.replace(n.CONV_GROUP,"")}},p))}),o}function N(t,o){const{appStore:{conversationStore:n},common:{isC2CConv:a,isGroupConv:i}}=e.core;n.getConversation(t)?a(t)||i(t)||o.push({conversationID:t,code:s}):o.push({conversationID:t,code:r})}function L(t){const{utils:{isString:o}}=e.core,n=[];if(!o(t))return n;const r=t.length;if(0===r)return n;for(let o=r-1;o>=0;o--)"1"===t[o]&&n.push(Math.pow(2,r-o-1));return n}function E(t){null==t||t.forEach((o,n)=>{const{appStore:r}=e.core,{conversationID:s,data:a}=o,i=n===t.length-1;r.conversationStore.updateConversation(s,a,{emit:i})})}function O(t){const{conversationInfoList:o,fromAccount:n}=t,r={From_Account:n,MarkItem:o};return e.core.common.buildAndSendPacket({servcmd:"recentcontact.mark_contact",data:r})}function S(t){const{fromAccount:o,groupName:n,conversationInfoList:r}=t,s={From_Account:o,UpdateType:1,UpdateGroup:{UpdateGroupType:I,OldGroupName:n,ContactUpdateItem:r}};return e.core.common.buildAndSendPacket({servcmd:"recentcontact.update_contact_group",data:s})}var R=new class{init(t){const{helper:{registerApi:o}}=t;this._core=t,o({apiName:"createConversationGroup",context:this})}createConversationGroup(n){return o(this,void 0,void 0,function*(){const{utils:{isPlainObject:o,isArray:r},appStore:s}=this._core;G("createConversationGroup");const{groupName:a,conversationIDList:i}=n,c=[],u=this._generateConversationInfo(i,c);if(c.length===i.length)return{code:0,data:{successConversationIDList:[],failureConversationIDList:c}};try{const n=yield function(t){const{common:{buildAndSendPacket:o,getCurrentUserID:n}}=e.core,{item:r,groupName:s}=t;return o({servcmd:"recentcontact.create_contact_group",data:{From_Account:n(),GroupContactItem:[{GroupName:s,ContactItem:r}]}})}({groupName:a,item:u});if(n){const{GroupResultItem:e=[]}=n,{GroupItem:i,ResultItem:u}=(null==e?void 0:e[0])||{},p=[];if(o(i)){const{GroupName:o,GroupId:e}=i;t.setConversationGroup(e,o),_()}if(r(u)){const t=[];u.forEach(o=>{const{ContactItem:e,ResultCode:n,ResultInfo:r}=o,i=g(e);if(0===n){const o=s.conversationStore.getConversation(i);if(o&&!o.conversationGroupList.includes(a)){const e=o.conversationGroupList.slice();e.push(a),t.push({conversationID:i,data:{conversationGroupList:e}})}}else c.push({conversationID:i,code:n,message:r})}),t.length>0&&(E(t),_())}return{code:0,data:{successConversationIDList:p,failureConversationIDList:c}}}}catch(t){const{errorCode:o,errorInfo:e}=t;throw new this._core.helper.ChatError({functionName:"createConversationGroup",code:o,message:e})}})}_generateConversationInfo(t,o,e={}){const n=[],{OuterConstant:r,common:{isC2CConv:s,isGroupConv:c}}=this._core;return t.forEach(t=>{N(t,o),s(t)?n.push(Object.assign({Type:a,To_Account:t.replace(r.CONV_C2C,"")},e)):c(t)&&n.push(Object.assign({Type:i,ToGroupId:t.replace(r.CONV_GROUP,"")},e))}),n}};var A=new class{constructor(){this._fetchConversationGroupStatus=c}init(t){const{helper:{registerApi:o,registerWorkflowStep:e},constants:{WORKFLOW_NAME:n,WORKFLOW_STEP:r}}=t;this._core=t,o({apiName:"getConversationGroupList",context:this}),e(n.SYNC_SERVER_INFO_AFTER_LOGIN,r.CONVERSATION_GROUP_LIST_SYNC,this._syncConversationGroupList,this),e(n.SYNC_SERVER_INFO_AFTER_LOGIN,r.CONVERSATION_GROUP_UPDATE,this._updateConversation,this)}getConversationGroupList(){return o(this,void 0,void 0,function*(){return G("getConversationGroupList"),this._fetchConversationGroupStatus===d&&(yield this._fetchConversationGroupList(0)),{code:0,data:[...t.getConversationGroupMap().values()]}})}_syncConversationGroupList(){return o(this,void 0,void 0,function*(){return yield this._fetchConversationGroupList(0)})}_fetchConversationGroupList(n){return o(this,arguments,void 0,function*(o,n=[]){const{common:{getCurrentUserID:r},utils:{isArray:s}}=this._core;this._fetchConversationGroupStatus=u;try{const a=r(),i=yield function(t){const{fromAccount:o,startIndex:n}=t,r={From_Account:o,StartIndex:n};return e.core.common.buildAndSendPacket({servcmd:"recentcontact.get_contact_group",data:r})}({fromAccount:a,startIndex:o});if(i){const{CompleteFlag:o,ContactItem:e=[],NextStartIndex:r=0,GroupItem:a=[]}=i;if(s(a)&&a.forEach(o=>{const{GroupName:e,GroupId:n}=o;t.setConversationGroup(n,e)}),n.push(...e),o===v)return this._fetchConversationGroupList(r);if(o===l)return this._fetchConversationGroupStatus=p,n}}catch(t){this._fetchConversationGroupStatus=d,console.error(t)}})}_updateConversation(t){var o;const{constants:{WORKFLOW_STEP:e}}=this._core,n=(null===(o=null==t?void 0:t.result)||void 0===o?void 0:o[e.CONVERSATION_GROUP_LIST_SYNC])||[];E(this._generateConversationUpdateFields(n)),_()}_generateConversationUpdateFields(o){const{utils:{isArray:e},appStore:n}=this._core,r=[];if(e(o)){let s;o.forEach(o=>{const a=[],{StandardMark:i,CustomMark:c="",ContactGroupId:u}=o;e(u)&&u.forEach(o=>{t.getConversationGroupMap().has(o)&&a.push(t.getConversationGroup(o))});const p=g(o);s=n.conversationStore.getConversation(p),s&&r.push({conversationID:p,data:{markList:L(i),customData:c,conversationGroupList:[...a]}})})}return r}reset(){this._fetchConversationGroupStatus=c}dispose(){this.reset()}};var T=new class{init(t){const{notificationCenter:o,helper:{registerApi:e},InnerEvent:{MESSAGE_PUSH:n},InnerEventSubType:{CONVERSATION_MARK_UPDATED:r,CONVERSATION_GROUP_ADD:s,CONVERSATION_GROUP_DELETED:a,CONVERSATION_GROUP_UPDATED:i}}=t;this._core=t,e({apiName:"renameConversationGroup",context:this}),e({apiName:"deleteConversationGroup",context:this}),e({apiName:"markConversation",context:this}),e({apiName:"setConversationCustomData",context:this}),e({apiName:"deleteConversationsFromGroup",context:this}),e({apiName:"addConversationsToGroup",context:this}),o.subscribeInnerEvent(n,s,this._handleConversationGroupAdd,this),o.subscribeInnerEvent(n,a,this._handleConversationGroupDeleted,this),o.subscribeInnerEvent(n,i,this._handleConversationGroupUpdated,this),o.subscribeInnerEvent(n,r,this._handleConversationMarkUpdated,this)}renameConversationGroup(n){return o(this,void 0,void 0,function*(){G("renameConversationGroup");const{common:{getCurrentUserID:o}}=this._core,{oldName:r,newName:s}=n,a=`oldName:${r} newName:${s}`;try{const n=yield function(t){const{fromAccount:o,oldName:n,newName:r}=t,s={From_Account:o,UpdateType:1,UpdateGroup:{UpdateGroupType:f,OldGroupName:n,NewGroupName:r}};return e.core.common.buildAndSendPacket({servcmd:"recentcontact.update_contact_group",data:s})}({fromAccount:o(),oldName:r,newName:s});if(n){const{UpdateGroupResult:o}=n,{GroupId:e}=o;t.setConversationGroup(e,s),_(),this._updateLocalConversationGroupName({oldName:r,newName:s})}return{successLog:{message:a}}}catch(t){const{errorCode:o,errorInfo:e}=t;throw new this._core.helper.ChatError({functionName:"renameConversationGroup",code:o,message:e,moreMessage:a})}})}deleteConversationGroup(n){return o(this,void 0,void 0,function*(){G("deleteConversationGroup");const{common:{getCurrentUserID:o}}=this._core;try{const r=yield function(t){const{fromAccount:o,groupName:n}=t,r={From_Account:o,GroupName:[n]};return e.core.common.buildAndSendPacket({servcmd:"recentcontact.del_contact_group",data:r})}({fromAccount:o(),groupName:n});if(r){const{GroupItem:o}=r;let e=!1;return null==o||o.forEach(o=>{const{GroupId:n}=o,r=t.getConversationGroupMap();r.has(n)&&(r.delete(n),e=!0)}),e&&_(),this._deleteLocalConversationGroupName([n]),{successLog:{message:`groupName:${n}`}}}}catch(t){const{errorCode:o,errorInfo:e}=t;throw new this._core.helper.ChatError({functionName:"deleteConversationGroup",code:o,message:e,moreMessage:`groupName:${n}`})}})}markConversation(t){return o(this,void 0,void 0,function*(){G("markConversation");const{utils:{isNumber:o},common:{getCurrentUserID:e},appStore:n}=this._core,{conversationIDList:r,markType:s,enableMark:a}=t,i=this._getFlagBit(s),c=[],u=[];let p,d;!0===a&&o(i)?p=[i]:d=[i];const v=D({conversationIDList:r,failureConversationIDList:c,additionalData:{SetMark:p,ClearMark:d,OptType:C}});if(c.length===r.length)return{code:0,data:{successConversationIDList:[],failureConversationIDList:c}};try{const t=yield O({conversationInfoList:v,fromAccount:e()});if(t){const{ResultItem:o}=t,e=[];o.forEach(t=>{const{ContactItem:o,ResultCode:r,ResultInfo:i}=t,p=g(o);if(0===r){u.push(p);const t=n.conversationStore.getConversation(p);if(t){const o=t.markList.indexOf(s),n=!1===a&&-1!==o;if(!0===a&&-1===o)e.push({conversationID:p,data:{markList:[...t.markList,s]}});else if(n){const n=t.markList.slice();n.splice(o,1),e.push({conversationID:p,data:{markList:n}})}}}else c.push({conversationID:p,code:r,message:i})}),E(e)}return{code:0,data:{successConversationIDList:u,failureConversationIDList:c}}}catch(t){const{errorCode:o,errorInfo:e}=t;throw new this._core.helper.ChatError({functionName:"markConversation",code:o,message:e})}})}setConversationCustomData(t){return o(this,void 0,void 0,function*(){G("setConversationCustomData");const{common:{getCurrentUserID:o},appStore:e}=this._core,{conversationIDList:n,customData:r}=t,s=[],a=[],i=D({conversationIDList:n,failureConversationIDList:s,additionalData:{CustomMark:r,OptType:h}});if(s.length===n.length)return{code:0,data:{successConversationIDList:[],failureConversationIDList:s}};try{const t=yield O({fromAccount:o(),conversationInfoList:i});if(t){const{ResultItem:o}=t,n=[];null==o||o.forEach(t=>{const{ContactItem:o,ResultCode:i,ResultInfo:c}=t;if(0===i){const t=g(o);a.push(t);const s=e.conversationStore.getConversation(t);s&&s.customData!==r&&n.push({conversationID:t,data:{customData:r}})}else s.push({conversationID:conversationID,code:i,message:c})}),E(n)}return{code:0,data:{successConversationIDList:a,failureConversationIDList:s}}}catch(t){const{errorCode:o,errorInfo:e}=t;throw new this._core.helper.ChatError({functionName:"setConversationCustomData",code:o,message:e})}})}deleteConversationsFromGroup(t){return o(this,void 0,void 0,function*(){G("deleteConversationsFromGroup");const{common:{getCurrentUserID:o},appStore:e}=this._core,{conversationIDList:n,groupName:r}=t,s=[],a=[],i=D({conversationIDList:n,failureConversationIDList:s,additionalData:{ContactOptType:2}});if(s.length===n.length)return{code:0,data:{successConversationIDList:[],failureConversationIDList:s}};try{const t=yield S({fromAccount:o(),groupName:r,conversationInfoList:i});if(t){const o=[],{UpdateGroupResult:{ContactResultItem:n}}=t;null==n||n.forEach(t=>{const n=g(t.ContactItem);if(0===t.ResultCode){const t=e.conversationStore.getConversation(n);if(t){const e=t.conversationGroupList.indexOf(r);if(-1!==e){const r=t.conversationGroupList.slice();r.splice(e,1),a.push(n),o.push({conversationID:n,data:{conversationGroupList:r}})}}}else s.push({conversationID:n,code:t.ResultCode,message:t.ResultInfo})}),o.length>0&&(_(),E(o))}return{code:0,data:{successConversationIDList:a,failureConversationIDList:s}}}catch(t){const{errorCode:o,errorInfo:e}=t;throw new this._core.helper.ChatError({functionName:"deleteConversationsFromGroup",code:o,message:e})}})}addConversationsToGroup(t){return o(this,void 0,void 0,function*(){G("deleteConversationsFromGroup");const{common:{getCurrentUserID:o},appStore:e}=this._core,{conversationIDList:n,groupName:r}=t,s=[],a=[],i=D({conversationIDList:n,failureConversationIDList:s,additionalData:{ContactOptType:1}});if(s.length===n.length)return{code:0,data:{successConversationIDList:[],failureConversationIDList:s}};try{const t=yield S({fromAccount:o(),groupName:r,conversationInfoList:i});if(t){const o=[],{UpdateGroupResult:{ContactResultItem:n}}=t;null==n||n.forEach(t=>{const n=g(t.ContactItem);if(0===t.ResultCode){const t=e.conversationStore.getConversation(n);if(t){if(-1===t.conversationGroupList.indexOf(r)){const e=t.conversationGroupList.slice();e.push(r),a.push(n),o.push({conversationID:n,data:{conversationGroupList:e}})}}}else s.push({conversationID:n,code:t.ResultCode,message:t.ResultInfo})}),o.length>0&&(_(),E(o))}return{code:0,data:{successConversationIDList:a,failureConversationIDList:s}}}catch(t){const{errorCode:o,errorInfo:e}=t;throw new this._core.helper.ChatError({functionName:"deleteConversationsFromGroup",code:o,message:e})}})}_updateLocalConversationGroupName(t){const{appStore:o}=this._core,{oldName:e,newName:n}=t;let r=[];const s=[];let a=-1;Array.from(o.conversationStore.getConversationMap().values()).forEach(t=>{if(r=t.conversationGroupList,a=r.indexOf(e),-1!==a){const o=r.slice();o.splice(a,1,n),s.push({conversationID:t.conversationID,data:{conversationGroupList:o}})}}),E(s)}_deleteLocalConversationGroupName(t){const{utils:{isEmpty:o},appStore:e}=this._core;if(o(t))return;const n=[];Array.from(e.conversationStore.getConversationMap().values()).forEach(o=>{const{conversationID:e,conversationGroupList:r}=o,s=r.filter(o=>!t.includes(o));s.length<r.length&&n.push({conversationID:e,data:{conversationGroupList:s}})}),E(n)}_getFlagBit(t){const o=t.toString(2),e=o.length;for(let t=e-1;t>=0;t--)if("1"===o[t])return e-t-1}_handleConversationGroupAdd(o){var e;const{utils:{isArray:n},appStore:r}=this._core;null===(e=null==o?void 0:o.RecentContactMod)||void 0===e||e.forEach(o=>{const{RecentContactCreateContactGroup:{MsgContactGroupContactItem:e}}=o;let s=!1;null==e||e.forEach(o=>{const{MsgGroupItem:e,MsgRecentContactItem:a}=o,{GroupId:i,GroupName:c}=e,u=[];t.getConversationGroup(i)!==c&&(t.setConversationGroup(i,c),s=!0),n(a)&&a.forEach(t=>{var o;const e=g(t),n=r.conversationStore.getConversation(e);if(n&&!(null===(o=n.conversationGroupList)||void 0===o?void 0:o.includes(c))){const t=n.conversationGroupList.slice();t.push(c),u.push({conversationID:e,data:{conversationGroupList:t}})}}),s&&_(),E(u)})})}_handleConversationGroupDeleted(o){var e;const{utils:{isArray:n}}=this._core;null===(e=null==o?void 0:o.RecentContactMod)||void 0===e||e.forEach(o=>{const{MsgGroupItem:e}=(null==o?void 0:o.RecentContactDelContactGroup)||{};if(n(e)){let o=!1;const n=[];e.forEach(e=>{const{GroupId:r,GroupName:s}=e,a=t.getConversationGroupMap();a.has(r)&&(a.delete(r),o=!0,n.push(s))}),o&&_(),n.length>0&&this._deleteLocalConversationGroupName(n)}})}_handleConversationGroupUpdated(t){var o;null===(o=t.RecentContactMod)||void 0===o||o.forEach(t=>{const{RecentContactUpdateContactGroup:{MsgUpdateGroup:{GroupId:o,GroupName:e,OldGroupName:n,RecentContactUpdateGroupItem:r,UpdateGroupType:s}}}=t;1===s?this._handleGroupNameUpdated({groupID:o,newName:e,oldName:n}):2===s&&this._handleGroupAddOrDeleteFromConversation({groupInfoList:r,groupName:n})})}_handleConversationMarkUpdated(t){var o;const{appStore:e}=this._core;null===(o=null==t?void 0:t.RecentContactMod)||void 0===o||o.forEach(t=>{const{RecentContactMarkContact:{RecentContactMarkContactItem:o}}=t,n=[];null==o||o.forEach(t=>{const{RecentContactItem:o,CustomMark:r,StandardMark:s,OptType:a}=t,i=g(o),c=e.conversationStore.getConversation(i);c&&(a===C?this._updateStandMark({conversation:c,standardMark:s,updateConversationList:n}):a===h?this._updateCustomMark({conversation:c,customMark:r,updateConversationList:n}):a===m&&(this._updateStandMark({conversation:c,standardMark:s,updateConversationList:n}),this._updateCustomMark({conversation:c,customMark:r,updateConversationList:n})))}),E(n)})}_updateStandMark(t){const{conversation:o,standardMark:e,updateConversationList:n}=t,r=L(e);(function(t,o){if(t===o)return!0;if(!t||!o)return!1;if(t.length!==o.length)return!1;t.sort(),o.sort();for(let e=0,n=t.length;e<n;e++)if(t[e]!==o[e])return!1;return!0})(o.markList,r)||n.push({conversationID:o.conversationID,data:{markList:r}})}_updateCustomMark(t){const{conversation:o,customMark:e,updateConversationList:n}=t;o.customData!==e&&void 0!==e&&(o.customData=e,n.push({conversationID:o.conversationID,data:{customData:e}}))}_handleGroupNameUpdated(o){const{groupID:e,oldName:n,newName:r}=o;t.getConversationGroup(e)!==r&&(t.setConversationGroup(e,r),_(),this._updateLocalConversationGroupName({oldName:n,newName:r}))}_handleGroupAddOrDeleteFromConversation({groupInfoList:t,groupName:o}){const{appStore:e}=this._core,n=[];t.forEach(t=>{const{RecentContactItem:r,ContactOptType:s}=t,a=g(r),i=e.conversationStore.getConversation(a),c=i.conversationGroupList.indexOf(o);if(i){const t=i.conversationGroupList.slice();1===s&&-1===c?(t.push(o),n.push({conversationID:a,data:{conversationGroupList:t}})):2===s&&-1!==c&&(t.splice(c,1),n.push({conversationID:a,data:{conversationGroupList:t}}))}}),E(n)}dispose(){const{notificationCenter:t,InnerEvent:{MESSAGE_PUSH:o},InnerEventSubType:{CONVERSATION_MARK_UPDATED:e,CONVERSATION_GROUP_ADD:n,CONVERSATION_GROUP_DELETED:r,CONVERSATION_GROUP_UPDATED:s}}=this._core;t.unSubscribeInnerEvent(o,n,this._handleConversationGroupAdd,this),t.unSubscribeInnerEvent(o,r,this._handleConversationGroupDeleted,this),t.unSubscribeInnerEvent(o,s,this._handleConversationGroupUpdated,this),t.unSubscribeInnerEvent(o,e,this._handleConversationMarkUpdated,this)}};const y={required:!0,rules:["string"],allowEmpty:!1},U={required:!0,rules:["array"],allowEmpty:!1},M={createConversationGroup:{groupName:y,conversationIDList:{required:!0,rules:["array"],allowEmpty:!1}},renameConversationGroup:{oldName:y,newName:Object.assign(Object.assign({},y),{customValidator:t=>!(t.length>32)||"newName length cannot longer than 32"})},deleteConversationGroup:[{required:!0,rules:["string"],allowEmpty:!1}],addConversationsToGroup:{conversationIDList:U,groupName:y},deleteConversationsFromGroup:{conversationIDList:U,groupName:y},markConversation:{conversationIDList:U,markType:{required:!0,rules:["number"],allowEmpty:!1,customValidator:t=>t<=0?"markType must be greater than 0":!(t>=Math.pow(2,64))||"markType must be less than 2^64"},enableMark:{required:!0,rules:["boolean"],allowEmpty:!1}},setConversationCustomData:{conversationIDList:U,customData:{required:!1,rules:["string"],allowEmpty:!0,customValidator:t=>"string"!=typeof t?"customData must be string":!(t.length>256)||"customData length cannot longer than 256"}}},k={createConversationGroup:!0,deleteConversationGroup:!0,renameConversationGroup:!0,getConversationGroupList:!0,addConversationsToGroup:!0,deleteConversationsFromGroup:!0,markConversation:!0,setConversationCustomData:!0};var b=new class{constructor(){this.name="ConversationGroup"}install(o){this._core=o,e.init(o),t.init(o),R.init(o),A.init(o),T.init(o),o.helper.registerValidateConfig({auth:k,params:M}),o.notificationCenter.subscribeInnerEvent(o.InnerEvent.LOGOUT,this.reset,this),o.notificationCenter.subscribeInnerEvent(o.InnerEvent.DESTROY,this.dispose,this)}dispose(){const{notificationCenter:t,InnerEvent:o}=this._core;t.unSubscribeInnerEvent(o.LOGOUT,this.reset,this),t.unSubscribeInnerEvent(o.DESTROY,this.dispose,this),T.dispose(),A.dispose()}reset(){A.reset()}};export{b as default};