+var e,t=require("./__bundle-99f1d30a.cjs"),n=require("./__bundle-0946b84e.cjs"),s=require("./__bundle-dae7bdf2.cjs");exports.ChannelEventCategory=void 0,(e=exports.ChannelEventCategory||(exports.ChannelEventCategory={}))[e.NONE=0]="NONE",e[e.CHANNEL_ENTER=10102]="CHANNEL_ENTER",e[e.CHANNEL_EXIT=10103]="CHANNEL_EXIT",e[e.USER_CHANNEL_MUTE=10201]="USER_CHANNEL_MUTE",e[e.USER_CHANNEL_UNMUTE=10200]="USER_CHANNEL_UNMUTE",e[e.USER_CHANNEL_BAN=10601]="USER_CHANNEL_BAN",e[e.USER_CHANNEL_UNBAN=10600]="USER_CHANNEL_UNBAN",e[e.CHANNEL_FREEZE=10701]="CHANNEL_FREEZE",e[e.CHANNEL_UNFREEZE=10700]="CHANNEL_UNFREEZE",e[e.TYPING_START=10900]="TYPING_START",e[e.TYPING_END=10901]="TYPING_END",e[e.CHANNEL_JOIN=1e4]="CHANNEL_JOIN",e[e.CHANNEL_LEAVE=10001]="CHANNEL_LEAVE",e[e.CHANNEL_OPERATOR_UPDATE=10002]="CHANNEL_OPERATOR_UPDATE",e[e.CHANNEL_INVITE=10020]="CHANNEL_INVITE",e[e.CHANNEL_ACCEPT_INVITE=10021]="CHANNEL_ACCEPT_INVITE",e[e.CHANNEL_DECLINE_INVITE=10022]="CHANNEL_DECLINE_INVITE",e[e.CHANNEL_PROP_CHANGED=11e3]="CHANNEL_PROP_CHANGED",e[e.CHANNEL_DELETED=12e3]="CHANNEL_DELETED",e[e.CHANNEL_META_DATA_CHANGED=11100]="CHANNEL_META_DATA_CHANGED",e[e.CHANNEL_META_COUNTERS_CHANGED=11200]="CHANNEL_META_COUNTERS_CHANGED",e[e.CHANNEL_HIDE=13e3]="CHANNEL_HIDE",e[e.CHANNEL_UNHIDE=13001]="CHANNEL_UNHIDE",e[e.PINNED_MESSAGE_CHANGED=11300]="PINNED_MESSAGE_CHANGED";class a{constructor(e){var t;this.channelUrl=e.channel_url,this.channelType=e.channel_type,this.category=e.cat,this.data=null!==(t=e.data)&&void 0!==t?t:{},this.ts=e.ts}get isGroupChannelEvent(){return this.channelType===t.ChannelType.GROUP}get isOpenChannelEvent(){return this.channelType===t.ChannelType.OPEN}}class o extends t.WebSocketEventCommand{constructor(e,t,n){super(e,"SYEV",n),this.event=new a(n)}}class r extends t.InstancedObject{get _messageBroadcast(){return n.MessageBroadcast.of(this._iid)}constructor(e,t){super(e),this._logger=t.logger,this._sdkState=t.sdkState,this._sessionManager=t.sessionManager,this._requestQueue=t.requestQueue,this._dispatcher=t.dispatcher,this._cacheContext=t.cacheContext,this._channelType=t.channelType}subscribeMessageEvent(e,t){this._messageBroadcast.subscribe(e,t)}unsubscribeMessageEvent(e){this._messageBroadcast.unsubscribe(e)}getMessageFromCache(e){return t.__awaiter(this,void 0,void 0,(function*(){return null}))}getExactlyMatchingMessagesForTokenFromCache(e,n,s){return t.__awaiter(this,void 0,void 0,(function*(){return[]}))}getMessagesFromCache(e,n,s,a,o,r){return t.__awaiter(this,void 0,void 0,(function*(){return[]}))}getPollMessagesFromCache(e,n,s,a){return t.__awaiter(this,void 0,void 0,(function*(){return[]}))}getCachedMessageCountBetween(e,n,s,a){return t.__awaiter(this,void 0,void 0,(function*(){return 0}))}getUnsentMessagesFromCache(e,n){return t.__awaiter(this,void 0,void 0,(function*(){return[]}))}removeFailedMessageFromCache(e){return t.__awaiter(this,void 0,void 0,(function*(){}))}}class E extends t.WebSocketEventCommand{constructor(e,s,a){var o,r,E,i;super(e,"ADMM",a),this.message=new n.AdminMessage(e,a);const{sdkState:N}=t.Vault.of(e);this.isMentioned=t.checkIfMentioned(this.message.mentionType,null!==(E=null!==(o=this.message.mentionedUserIds)&&void 0!==o?o:null===(r=this.message.mentionedUsers)||void 0===r?void 0:r.map((e=>e.userId)))&&void 0!==E?E:[],N.userId),this.forceUpdateLastMessage=null!==(i=a.force_update_last_message)&&void 0!==i&&i}}class i extends t.WebSocketEventCommand{constructor(e,s,a){var o,r,E,i,N;super(e,"AEDI",a),this.message=new n.AdminMessage(e,a);const{sdkState:_}=t.Vault.of(e);this.mentionCountChange=t.calculateMentionCountChange({mentionType:null===(o=a.old_values)||void 0===o?void 0:o.mention_type,mentionedUserIds:null!==(E=null===(r=a.old_values)||void 0===r?void 0:r.mentioned_user_ids)&&void 0!==E?E:[]},t.undefineNullProps({mentionType:this.message.mentionType,mentionedUserIds:null!==(i=this.message.mentionedUserIds)&&void 0!==i?i:null===(N=this.message.mentionedUsers)||void 0===N?void 0:N.map((e=>e.userId))}),_.userId)}}class N extends t.WebSocketEventCommand{constructor(e,t,s){super(e,"MRCT",s),this.channelUrl=s.channel_url,this.channelType=s.channel_type,this.event=new n.ReactionEvent(s)}}class _ extends t.WebSocketEventCommand{constructor(e,t,s){super(e,"MTHD",s),this.event=new n.ThreadInfoUpdateEvent(e,s)}}class d extends t.WebSocketEventCommand{constructor(e,t,n){super(e,"MCNT",n),this.groupChannelMemberCounts=n.group_channels.map((e=>({channelUrl:e.channel_url,memberCount:e.member_count,joinedMemberCount:e.joined_member_count,updatedAt:e.ts}))),this.openChannelMemberCounts=n.open_channels.map((e=>({channelUrl:e.channel_url,participantCount:e.participant_count,updatedAt:e.ts})))}}class c extends t.WebSocketEventCommand{constructor(e,n,a){super(e,"PEDI",a),this.event=new s.PollUpdateEvent(e,a),this.status=t.parsePollStatusPayload(a.poll.status)||a.poll.status,this.channelUrl=a.channel_url,this.channelType=a.channel_type}}exports.AdminMessageEventCommand=E,exports.BaseChannelManager=r,exports.ChannelEventCommand=o,exports.MemberCountUpdateEventCommand=d,exports.OperatorUpdateEventCommand=class extends o{constructor(e,n,s){super(e,n,s);const{operators:a=[]}=s.data;this.operators=a.map((e=>new t.User(this._iid,e)))}},exports.PollUpdateEventCommand=c,exports.ReactionEventCommand=N,exports.ThreadInfoUpdateEventCommand=_,exports.UpdateAdminMessageEventCommand=i;
0 commit comments