@rongcloud/imlib-next 5.2.3 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1 +1 @@
1
- # RongIMLib 5.0
1
+ # @rongcloud/imlib-next
@@ -1,5 +1,5 @@
1
- import { LogLevel, MessageDirection, IReadReceiptInfo, IPushConfig, IPluginGenerator, IAsyncRes, ConnectionStatus, IEventListener, NotificationStatus, IConversationOption, ConversationType, ErrorCode, IBaseConversationInfo, IConversationState, IReceivedConversation, IChatroomInfo, IChatRoomEntry, IChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatRoomEntries, IRTCRoomBindOption, MentionedType, IUserProfile, IMessageReaderResponse, IReceivedMessage, ITagParam, ITagInfo, IConversationTag, IReceivedConversationByTag, FileType, IUploadAuth, UploadMethod } from '@rongcloud/engine';
2
- export { ConnectionStatus, ConversationType, ErrorCode, IBlockedMessageInfo, IChatRoomEntries, IChatRoomEntry, IChatroomListenerData, IConversationOption, IConversationState, IDeletedExpansion, IExpansionListenerData, IPluginGenerator, IRTCRoomBindOption, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IUpdatedExpansion, LogLevel, MentionedType, MessageBlockType, MessageDirection, NotificationStatus, ReceivedStatus, UploadMethod } from '@rongcloud/engine';
1
+ import { LogLevel, MessageDirection, IReadReceiptInfo, IPushConfig, IPluginGenerator, IAsyncRes, ConnectionStatus, IEventListener, NotificationStatus, NotificationLevel, IUserProfile, IConversationOption, ConversationType, ErrorCode, IBaseConversationInfo, IConversationState, IReceivedConversation, IUltraGroupOption, IChatroomInfo, IChatRoomEntry, IChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatRoomEntries, IRTCRoomBindOption, MentionedType, IMessageReaderResponse, IReceivedMessage, ITagParam, ITagInfo, IConversationTag, IReceivedConversationByTag, FileType, IUploadAuth, UploadMethod } from '@rongcloud/engine';
2
+ export { ConnectionStatus, ConversationType, ErrorCode, IBlockedMessageInfo, IChatRoomEntries, IChatRoomEntry, IChatroomListenerData, IConversationOption, IConversationState, IDeletedExpansion, IExpansionListenerData, IPluginGenerator, IRTCRoomBindOption, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IUpdatedExpansion, LogLevel, MentionedType, MessageBlockType, MessageDirection, NotificationLevel, NotificationStatus, ReceivedStatus, UploadMethod } from '@rongcloud/engine';
3
3
 
4
4
  declare type IInitOption = {
5
5
  /**
@@ -221,6 +221,15 @@ declare function removeEventListeners(eventType: string): void;
221
221
  declare function clearEventListeners(): void;
222
222
  declare function __addSDKVersion(name: string, version: string): void;
223
223
 
224
+ declare class BaseMessage<T = any> {
225
+ readonly messageType: string;
226
+ readonly content: T;
227
+ readonly isPersited: boolean;
228
+ readonly isCounted: boolean;
229
+ constructor(messageType: string, content: T, isPersited?: boolean, isCounted?: boolean);
230
+ }
231
+ declare type MessageConstructor<T> = new (content: T) => BaseMessage<T>;
232
+
224
233
  interface IConversationUpdateItem {
225
234
  time: number;
226
235
  val: any;
@@ -297,6 +306,7 @@ interface IAReceivedConversation {
297
306
  * * 2: 关闭免打扰
298
307
  */
299
308
  notificationStatus?: NotificationStatus;
309
+ notificationLevel?: NotificationLevel;
300
310
  /**
301
311
  * 会话是否置顶
302
312
  */
@@ -375,6 +385,33 @@ interface ISendMessageOptions {
375
385
  */
376
386
  pushConfig?: IPushConfig;
377
387
  }
388
+ /**
389
+ * 文件消息配置
390
+ */
391
+ interface IUploadMessageOption extends ISendMessageOptions {
392
+ /**
393
+ * 文件链接在浏览器中展示形式(仅 aws、stc 上传有效)
394
+ * 'inline': 在浏览器中预览,
395
+ * 'attachment': 直接下载
396
+ * 不传: html 类型文件会预览,其他类型为直接下载
397
+ */
398
+ contentDisposition?: 'inline' | 'attachment';
399
+ }
400
+ /**
401
+ * 缩略图配置
402
+ */
403
+ interface IThumbnailConfig {
404
+ maxHeight?: number;
405
+ maxWidth?: number;
406
+ quality?: number;
407
+ scale?: number;
408
+ }
409
+ /**
410
+ * 图片消息配置
411
+ */
412
+ interface IImageMessageOption extends IUploadMessageOption {
413
+ thumbnailConfig?: IThumbnailConfig;
414
+ }
378
415
  interface IInsertOptions {
379
416
  /**
380
417
  * 插入消息是否计入未读数: true 计数 false 不计数, 默认不计数
@@ -421,13 +458,47 @@ interface IMessageDesc {
421
458
  sendTime: number;
422
459
  }
423
460
  /**
424
- * 缩略图配置
461
+ * 撤回消息 option 参数
425
462
  */
426
- interface IThumbnailConfig {
427
- maxHeight?: number;
428
- maxWidth?: number;
429
- quality?: number;
430
- scale?: number;
463
+ interface IRecallMessageOptions {
464
+ /**
465
+ * 消息的唯一id,客户端依赖此属性查找要撤回的消息
466
+ */
467
+ messageUId: string;
468
+ /**
469
+ * 消息发送时间,服务端依赖此属性查找要撤回的消息
470
+ */
471
+ sentTime: number;
472
+ /**
473
+ * 撤回消息携带用户信息
474
+ */
475
+ user?: IUserProfile;
476
+ /**
477
+ * 是否发送静默消息
478
+ * @description
479
+ * 当值为 `true` 时,服务器将不会发送 Push 信息,移动端也不会弹出本地通知提醒
480
+ */
481
+ disableNotification?: boolean;
482
+ /**
483
+ * 移动端推送配置
484
+ */
485
+ pushConfig?: IPushConfig;
486
+ extra?: string;
487
+ }
488
+ /**
489
+ * 上传过程中的回调钩子
490
+ */
491
+ interface IUploadHooks {
492
+ /**
493
+ * 文件上传进度回调
494
+ */
495
+ onProgress?: (progress: number) => void;
496
+ /**
497
+ * 文件上传完成回调,可通过修改返回值以修改待发布的消息内容,如实现自定义消息
498
+ */
499
+ onComplete?: (fileInfo: {
500
+ url: string;
501
+ }) => (void | BaseMessage);
431
502
  }
432
503
 
433
504
  /**
@@ -453,6 +524,12 @@ declare function getConversationList(options?: {
453
524
  */
454
525
  order?: 0 | 1;
455
526
  }, channelId?: string): Promise<IAsyncRes<IAReceivedConversation[]>>;
527
+ /**
528
+ * 获取指定会话数据
529
+ * @description 通过该方法获取的会话可能并不存在于当前的会话列表中,此处只作为功能性封装语法糖
530
+ * @param options
531
+ */
532
+ declare function getConversation(options: IConversationOption): Promise<IAsyncRes<IAReceivedConversation | null | undefined>>;
456
533
  /**
457
534
  * 移除指定的会话实例
458
535
  */
@@ -503,15 +580,37 @@ declare function clearMessagesUnreadStatus(options: IConversationOption): Promis
503
580
  declare function clearAllMessagesUnreadStatus(): Promise<IAsyncRes<ErrorCode>>;
504
581
  /**
505
582
  * 设置会话免打扰
583
+ * 原: setConversationNotificationStatus 已废弃
584
+ * 是否免打扰
585
+ * * -1: 全部消息通知(接收全部消息通知 -- 显示指定关闭免打扰功能)
586
+ * * 0: 未设置(向上查询群或者APP级别设置)//存量数据中0表示未设置
587
+ * * 1: 群聊超级群仅@消息通知(现在通知)单聊代表全部消息通知
588
+ * * 2: @ 指定用户通知
589
+ * * 3: @ 群用户组通知,通知用户组暂未实现,暂不暴露出去
590
+ * * 4: @ 群全员通知
591
+ * * 5: 消息通知被屏蔽,即不接收消息通知
592
+ * @desc 注意单聊的 level 只有 -1、0、1
593
+ */
594
+ declare function setConversationNotificationLevel(options: IConversationOption, notificationLevel: NotificationLevel): Promise<IAsyncRes<void>>;
595
+ /**
596
+ * 设置会话免打扰
597
+ * @deprecated 已废弃,请使用 setConversationNotificationLevel
506
598
  * 原: setConversationStatus,免打扰和置顶一体的
507
599
  * 是否免打扰
508
600
  * * 1: 开启免打扰
509
601
  * * 2: 关闭免打扰
510
602
  */
511
603
  declare function setConversationNotificationStatus(options: IConversationOption, notificationStatus: NotificationStatus): Promise<IAsyncRes<void>>;
604
+ /**
605
+ * 查询指定会话和频道免打扰
606
+ * 原: getConversationNotificationStatus 已废弃
607
+ * @desc 注意单聊的 level 只有 -1、0、1
608
+ */
609
+ declare function getConversationNotificationLevel(options: IConversationOption): Promise<IAsyncRes<NotificationLevel | undefined>>;
512
610
  /**
513
611
  * 获取免打扰状态
514
612
  * getConversationNotificationStatus
613
+ * @deprecated 已废弃,请使用 getConversationNotificationLevel
515
614
  */
516
615
  declare function getConversationNotificationStatus(options: IConversationOption): Promise<IAsyncRes<NotificationStatus | undefined>>;
517
616
  /**
@@ -581,6 +680,35 @@ declare function modifyMessage(content: {
581
680
  * 获取超级群所有子频道的未读数
582
681
  */
583
682
  declare function getUltraGroupUnreadMentionedCountByTargetId(targetId: string): Promise<IAsyncRes>;
683
+ /**
684
+ * 查询指定超级群默认通知配置
685
+ */
686
+ declare function getUltraGroupDefaultNotificationLevel(options: IUltraGroupOption): Promise<IAsyncRes<NotificationLevel>>;
687
+ /**
688
+ * 设置指定超级群默认通知配置
689
+ * @param options
690
+ * * 设置超级群默认通知配置 options: { targetId: 'xxx' }, channelId 不传或传 ''
691
+ * * 设置超级群指定频道默认通知配置 options: { targetId: 'xxx', channelId: 'xxx' }
692
+ * @param notificationLevel
693
+ * * NotificationLevel
694
+ */
695
+ declare function setUltraGroupDefaultNotificationLevel(options: IUltraGroupOption, notificationLevel: NotificationLevel): Promise<IAsyncRes<void>>;
696
+ /**
697
+ * 获取指定超级群所有频道未读数
698
+ * @param targetId 超级群 Id
699
+ * @returns 未读数
700
+ */
701
+ declare function getUltraGroupUnreadCountByTargetId(targetId: string): Promise<IAsyncRes<number>>;
702
+ /**
703
+ * 超级群类型所有未读数
704
+ * @returns 未读数
705
+ */
706
+ declare function getAllUltraGroupUnreadCount(): Promise<IAsyncRes<number>>;
707
+ /**
708
+ * 超级群类型所有 @ 消息未读数
709
+ * @returns 未读数
710
+ */
711
+ declare function getAllUltraGroupUnreadMentionedCount(): Promise<IAsyncRes<number>>;
584
712
 
585
713
  /**
586
714
  * 加入聊天室
@@ -675,15 +803,6 @@ declare function getAllChatRoomEntries(targetId: string): Promise<IAsyncRes<{
675
803
  declare function getChatroomHistoryMessages(targetId: string, options: GetHistoryMessageOption): Promise<IAsyncRes<GetHistoryMessageResult>>;
676
804
  declare function bindRTCRoomForChatroom(option: IRTCRoomBindOption): Promise<IAsyncRes>;
677
805
 
678
- declare class BaseMessage<T = any> {
679
- readonly messageType: string;
680
- readonly content: T;
681
- readonly isPersited: boolean;
682
- readonly isCounted: boolean;
683
- constructor(messageType: string, content: T, isPersited?: boolean, isCounted?: boolean);
684
- }
685
- declare type MessageConstructor<T> = new (content: T) => BaseMessage<T>;
686
-
687
806
  /**
688
807
  * 群组内的消息包含的 @ 数据
689
808
  */
@@ -898,51 +1017,16 @@ declare type ISendFileMessageOptions = ISendBody;
898
1017
  /**
899
1018
  * 发送文件消息
900
1019
  */
901
- declare const sendFileMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: {
902
- /**
903
- * 文件上传进度回调
904
- */
905
- onProgress?: ((progress: number) => void) | undefined;
906
- /**
907
- * 文件上传完成回调,可通过修改返回值以修改待发布的消息内容,如实现自定义消息
908
- */
909
- onComplete?: ((fileInfo: {
910
- url: string;
911
- }) => (void | BaseMessage)) | undefined;
912
- } | undefined, sendOptions?: ISendMessageOptions | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
1020
+ declare const sendFileMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
913
1021
  declare type ISendImageMessageOptions = ISendBody;
914
1022
  /**
915
1023
  * 发送图片消息
916
1024
  */
917
- declare const sendImageMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: {
918
- /**
919
- * 文件上传进度回调
920
- */
921
- onProgress?: ((progress: number) => void) | undefined;
922
- /**
923
- * 文件上传完成回调,可通过修改返回值以修改待发布的消息内容,如实现自定义消息
924
- */
925
- onComplete?: ((fileInfo: {
926
- url: string;
927
- }) => (void | BaseMessage)) | undefined;
928
- } | undefined, sendOptions?: ({
929
- thumbnailConfig?: IThumbnailConfig | undefined;
930
- } & ISendMessageOptions) | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
1025
+ declare const sendImageMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IImageMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
931
1026
  /**
932
1027
  * 发送高清语音消息,待发送的文件必须为 AAC 音频文件
933
1028
  */
934
- declare const sendHQVoiceMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: {
935
- /**
936
- * 文件上传进度回调
937
- */
938
- onProgress?: ((progress: number) => void) | undefined;
939
- /**
940
- * 文件上传完成回调,可通过修改返回值以修改待发布的消息内容,如实现自定义消息
941
- */
942
- onComplete?: ((fileInfo: {
943
- url: string;
944
- }) => (void | BaseMessage)) | undefined;
945
- } | undefined, sendOptions?: ISendMessageOptions | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
1029
+ declare const sendHQVoiceMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
946
1030
  declare type ISendSightMessageOptions = {
947
1031
  duration: number;
948
1032
  thumbnail: string;
@@ -952,18 +1036,7 @@ declare type ISendSightMessageOptions = {
952
1036
  * 发送小视频消息
953
1037
  * @description 发送的小视频消息必须是 MP4 文件,且音频编码为 AAC,视频编码 H264,否则可能造成 iOS 或 Android 接收后不可播放问题
954
1038
  */
955
- declare const sendSightMessage: (conversation: IConversationOption, msgBody: ISendSightMessageOptions, hooks?: {
956
- /**
957
- * 文件上传进度回调
958
- */
959
- onProgress?: ((progress: number) => void) | undefined;
960
- /**
961
- * 文件上传完成回调,可通过修改返回值以修改待发布的消息内容,如实现自定义消息
962
- */
963
- onComplete?: ((fileInfo: {
964
- url: string;
965
- }) => (void | BaseMessage)) | undefined;
966
- } | undefined, sendOptions?: ISendMessageOptions | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
1039
+ declare const sendSightMessage: (conversation: IConversationOption, msgBody: ISendSightMessageOptions, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
967
1040
  /**
968
1041
  * 获取历史消息
969
1042
  */
@@ -1000,40 +1073,17 @@ declare function sendReadReceiptResponseV2(targetId: string, messageList: {
1000
1073
  * @param timestamp
1001
1074
  */
1002
1075
  declare function sendSyncReadStatusMessage(conversation: IConversationOption, lastMessageSendTime: number): Promise<{
1003
- code: ErrorCode;
1076
+ code: ErrorCode.SUCCESS;
1004
1077
  msg?: undefined;
1005
1078
  } | {
1006
- code: never;
1079
+ code: ErrorCode.TIMEOUT | ErrorCode.UNKNOWN | ErrorCode.PARAMETER_ERROR | ErrorCode.EXTRA_METHOD_UNDEFINED | ErrorCode.MAIN_PROCESS_ERROR | ErrorCode.PARAMETER_CHANGED | ErrorCode.RC_MSG_UNAUTHORIZED | ErrorCode.RC_DISCUSSION_GROUP_ID_INVALID | ErrorCode.SEND_FREQUENCY_TOO_FAST | ErrorCode.NOT_IN_DISCUSSION | ErrorCode.FORBIDDEN_IN_GROUP | ErrorCode.RECALL_MESSAGE | ErrorCode.NOT_IN_GROUP | ErrorCode.NOT_IN_CHATROOM | ErrorCode.FORBIDDEN_IN_CHATROOM | ErrorCode.RC_CHATROOM_USER_KICKED | ErrorCode.RC_CHATROOM_NOT_EXIST | ErrorCode.RC_CHATROOM_IS_FULL | ErrorCode.RC_CHATROOM_PATAMETER_INVALID | ErrorCode.CHATROOM_GET_HISTORYMSG_ERROR | ErrorCode.CHATROOM_NOT_OPEN_HISTORYMSG_STORE | ErrorCode.CHATROOM_KV_EXCEED | ErrorCode.CHATROOM_KV_OVERWRITE_INVALID | ErrorCode.CHATROOM_KV_STORE_NOT_OPEN | ErrorCode.CHATROOM_KEY_NOT_EXIST | ErrorCode.CHATROOM_KV_SET_ERROR | ErrorCode.SENSITIVE_SHIELD | ErrorCode.SENSITIVE_REPLACE | ErrorCode.JOIN_IN_DISCUSSION | ErrorCode.CREATE_DISCUSSION | ErrorCode.INVITE_DICUSSION | ErrorCode.GET_USERINFO_ERROR | ErrorCode.REJECTED_BY_BLACKLIST | ErrorCode.RC_NET_CHANNEL_INVALID | ErrorCode.RC_NET_UNAVAILABLE | ErrorCode.RC_MSG_RESP_TIMEOUT | ErrorCode.RC_HTTP_SEND_FAIL | ErrorCode.RC_HTTP_REQ_TIMEOUT | ErrorCode.RC_HTTP_RECV_FAIL | ErrorCode.RC_NAVI_RESOURCE_ERROR | ErrorCode.RC_NODE_NOT_FOUND | ErrorCode.RC_DOMAIN_NOT_RESOLVE | ErrorCode.RC_SOCKET_NOT_CREATED | ErrorCode.RC_SOCKET_DISCONNECTED | ErrorCode.RC_PING_SEND_FAIL | ErrorCode.RC_PONG_RECV_FAIL | ErrorCode.RC_MSG_SEND_FAIL | ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT | ErrorCode.RC_CONN_ACK_TIMEOUT | ErrorCode.RC_CONN_PROTO_VERSION_ERROR | ErrorCode.RC_CONN_ID_REJECT | ErrorCode.RC_CONN_SERVER_UNAVAILABLE | ErrorCode.RC_CONN_USER_OR_PASSWD_ERROR | ErrorCode.RC_CONN_NOT_AUTHRORIZED | ErrorCode.RC_CONN_REDIRECTED | ErrorCode.RC_CONN_PACKAGE_NAME_INVALID | ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED | ErrorCode.RC_CONN_USER_BLOCKED | ErrorCode.RC_DISCONN_KICK | ErrorCode.RC_DISCONN_EXCEPTION | ErrorCode.RC_APP_AUTH_NOT_PASS | ErrorCode.RC_OTP_USED | ErrorCode.RC_PLATFORM_ERROR | ErrorCode.RC_QUERY_ACK_NO_DATA | ErrorCode.RC_MSG_DATA_INCOMPLETE | ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT | ErrorCode.BIZ_ERROR_DATABASE_ERROR | ErrorCode.BIZ_ERROR_INVALID_PARAMETER | ErrorCode.BIZ_ERROR_NO_CHANNEL | ErrorCode.BIZ_ERROR_RECONNECT_SUCCESS | ErrorCode.BIZ_ERROR_CONNECTING | ErrorCode.MSG_ROAMING_SERVICE_UNAVAILABLE | ErrorCode.MSG_INSERT_ERROR | ErrorCode.MSG_DEL_ERROR | ErrorCode.TAG_EXISTS | ErrorCode.TAG_NOT_EXIST | ErrorCode.NO_TAG_IN_CONVER | ErrorCode.CONVER_REMOVE_ERROR | ErrorCode.CONVER_GETLIST_ERROR | ErrorCode.CONVER_SETOP_ERROR | ErrorCode.CONVER_TOTAL_UNREAD_ERROR | ErrorCode.CONVER_TYPE_UNREAD_ERROR | ErrorCode.CONVER_ID_TYPE_UNREAD_ERROR | ErrorCode.CONVER_CLEAR_ERROR | ErrorCode.EXPANSION_LIMIT_EXCEET | ErrorCode.MESSAGE_KV_NOT_SUPPORT | ErrorCode.CLEAR_HIS_TIME_ERROR | ErrorCode.CONVER_OUT_LIMIT_ERROR | ErrorCode.CONVER_GET_ERROR | ErrorCode.GROUP_SYNC_ERROR | ErrorCode.GROUP_MATCH_ERROR | ErrorCode.READ_RECEIPT_ERROR | ErrorCode.PACKAGE_ENVIRONMENT_ERROR | ErrorCode.CAN_NOT_RECONNECT | ErrorCode.SERVER_UNAVAILABLE | ErrorCode.HOSTNAME_ERROR | ErrorCode.HAS_OHTER_SAME_CLIENT_ON_LINE | ErrorCode.METHOD_NOT_AVAILABLE | ErrorCode.METHOD_NOT_SUPPORT | ErrorCode.MSG_LIMIT_ERROR | ErrorCode.METHOD_ONLY_SUPPORT_ULTRA_GROUP | ErrorCode.UPLOAD_FILE_FAILED | ErrorCode.CHATROOM_ID_ISNULL | ErrorCode.CHARTOOM_JOIN_ERROR | ErrorCode.CHATROOM_HISMESSAGE_ERROR | ErrorCode.CHATROOM_KV_NOT_FOUND | ErrorCode.BLACK_ADD_ERROR | ErrorCode.BLACK_GETSTATUS_ERROR | ErrorCode.BLACK_REMOVE_ERROR | ErrorCode.DRAF_GET_ERROR | ErrorCode.DRAF_SAVE_ERROR | ErrorCode.DRAF_REMOVE_ERROR | ErrorCode.SUBSCRIBE_ERROR | ErrorCode.NOT_SUPPORT | ErrorCode.QNTKN_FILETYPE_ERROR | ErrorCode.QNTKN_GET_ERROR | ErrorCode.COOKIE_ENABLE | ErrorCode.GET_MESSAGE_BY_ID_ERROR | ErrorCode.HAVNODEVICEID | ErrorCode.DEVICEIDISHAVE | ErrorCode.FEILD | ErrorCode.VOIPISNULL | ErrorCode.NOENGINETYPE | ErrorCode.NULLCHANNELNAME | ErrorCode.VOIPDYANMICERROR | ErrorCode.NOVOIP | ErrorCode.INTERNALERRROR | ErrorCode.VOIPCLOSE | ErrorCode.ALREADY_IN_USE | ErrorCode.INVALID_CHANNEL_NAME | ErrorCode.VIDEO_CONTAINER_IS_NULL | ErrorCode.CANCEL | ErrorCode.REJECT | ErrorCode.HANGUP | ErrorCode.BUSYLINE | ErrorCode.NO_RESPONSE | ErrorCode.ENGINE_UN_SUPPORTED | ErrorCode.NETWORK_ERROR | ErrorCode.REMOTE_CANCEL | ErrorCode.REMOTE_REJECT | ErrorCode.REMOTE_HANGUP | ErrorCode.REMOTE_BUSYLINE | ErrorCode.REMOTE_NO_RESPONSE | ErrorCode.REMOTE_ENGINE_UN_SUPPORTED | ErrorCode.REMOTE_NETWORK_ERROR | ErrorCode.VOIP_NOT_AVALIABLE | ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS | ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT;
1007
1080
  msg: string | undefined;
1008
1081
  }>;
1009
1082
  /**
1010
1083
  * 撤回消息
1011
1084
  * @param options
1012
1085
  */
1013
- declare function recallMessage(conversation: IConversationOption, options: {
1014
- /**
1015
- * 消息的唯一id,客户端依赖此属性查找要撤回的消息
1016
- */
1017
- messageUId: string;
1018
- /**
1019
- * 消息发送时间,服务端依赖此属性查找要撤回的消息
1020
- */
1021
- sentTime: number;
1022
- /**
1023
- * 撤回消息携带用户信息
1024
- */
1025
- user?: IUserProfile;
1026
- /**
1027
- * 是否发送静默消息
1028
- * @description
1029
- * 当值为 `true` 时,服务器将不会发送 Push 信息,移动端也不会弹出本地通知提醒
1030
- */
1031
- disableNotification?: boolean;
1032
- /**
1033
- * 移动端推送配置
1034
- */
1035
- pushConfig?: IPushConfig;
1036
- }): Promise<IAsyncRes<IAReceivedMessage>>;
1086
+ declare function recallMessage(conversation: IConversationOption, options: IRecallMessageOptions): Promise<IAsyncRes<IAReceivedMessage>>;
1037
1087
  /**
1038
1088
  * 按消息 id 删除消息
1039
1089
  */
@@ -1312,4 +1362,4 @@ declare const MessageType: {
1312
1362
  RECALL_MESSAGE_TYPE: string;
1313
1363
  };
1314
1364
 
1315
- export { BaseMessage, _default$6 as CombineMessage, ConnectType, Events, _default$5 as FileMessage, _default$4 as GIFMessage, GetHistoryMessageOption, GetHistoryMessageResult, _default$9 as HQVoiceMessage, IAReceivedConversation, IAReceivedMessage, ICombineMessageBody, IConversationUpdateItem, IFileMessageBody, IGIFMessageBody, IHQVoiceMessageBody, IImageMessageBody, IInitOption, ILocationMessageBody, IReceivedUpdateConversation, IReferenceMessageBody, IRichContentMessageBody, ISendFileMessageOptions, ISendImageMessageOptions, ISendMessageOptions, ISightMessageBody, ITextMessageBody, IVoiceMessageBody, _default$a as ImageMessage, _default$2 as LocationMessage, MentionedInfo$1 as MentionedInfo, MessageConstructor, MessageType, _default$1 as ReferenceMessage, _default as RichContentMessage, _default$8 as SightMessage, _default$7 as TextMessage, _default$3 as VoiceMessage, __addSDKVersion, addConversationsToTag, addEventListener, addTag, bindRTCRoomForChatroom, clearAllMessagesUnreadStatus, clearEventListeners, clearHistoryMessages, clearMessages, clearMessagesUnreadStatus, clearTextMessageDraft, clearUnreadCountByTimestamp, connect, deleteLocalMessagesByTimestamp, deleteMessages, disconnect, forceRemoveChatRoomEntry, forceSetChatRoomEntry, getAllChatRoomEntries, getAllConversationState, getAllUnreadMentionedCount, getBlockUltraGroupList, getBlockedConversationList, getChatRoomEntry, getChatRoomInfo, getChatroomHistoryMessages, getConnectionStatus, getConversationList, getConversationNotificationStatus, getConversationsFromTagByPage, getCurrentUserId, getFileToken, getFileUrl, getFirstUnreadMessage, getHistoryMessages, getMessage, getMessageReader, getRemoteHistoryMessages, getServerTime, getTags, getTagsFromConversation, getTextMessageDraft, getTopConversationList, getTotalUnreadCount, getUltraGroupList, getUltraGroupMessageListByMessageUId, getUltraGroupUnreadMentionedCountByTargetId, getUnreadCount, getUnreadCountByTag, getUnreadMentionedCount, getUnreadMentionedMessages, init, insertMessage, installPlugin, joinChatRoom, joinExistChatRoom, modifyMessage, onceEventListener, quitChatRoom, recallMessage, registerMessageType, removeAllExpansionForUltraGroupMessage, removeChatRoomEntries, removeChatRoomEntry, removeConversation, removeConversationsFromTag, removeEventListener, removeEventListeners, removeExpansionForUltraGroupMessage, removeMessageExpansionForKey, removeTag, removeTagFromConversations, removeTagsFromConversation, saveTextMessageDraft, searchConversationByContent, searchMessages, sendFileMessage, sendHQVoiceMessage, sendImageMessage, sendMessage, sendReadReceiptMessage, sendReadReceiptRequest, sendReadReceiptResponse, sendReadReceiptResponseV2, sendSightMessage, sendSyncReadStatusMessage, sendTextMessage, sendTypingStatusMessage, sendUltraGroupTypingStatus, setChatRoomEntries, setChatRoomEntry, setConversationNotificationStatus, setConversationToTop, setConversationToTopInTag, setMessageReceivedStatus, updateExpansionForUltraGroupMessage, updateMessageExpansion, updateTag };
1365
+ export { BaseMessage, _default$6 as CombineMessage, ConnectType, Events, _default$5 as FileMessage, _default$4 as GIFMessage, GetHistoryMessageOption, GetHistoryMessageResult, _default$9 as HQVoiceMessage, IAReceivedConversation, IAReceivedMessage, ICombineMessageBody, IConversationUpdateItem, IFileMessageBody, IGIFMessageBody, IHQVoiceMessageBody, IImageMessageBody, IImageMessageOption, IInitOption, ILocationMessageBody, IReceivedUpdateConversation, IReferenceMessageBody, IRichContentMessageBody, ISendFileMessageOptions, ISendImageMessageOptions, ISendMessageOptions, ISightMessageBody, ITextMessageBody, IThumbnailConfig, IUploadHooks, IUploadMessageOption, IVoiceMessageBody, _default$a as ImageMessage, _default$2 as LocationMessage, MentionedInfo$1 as MentionedInfo, MessageConstructor, MessageType, _default$1 as ReferenceMessage, _default as RichContentMessage, _default$8 as SightMessage, _default$7 as TextMessage, _default$3 as VoiceMessage, __addSDKVersion, addConversationsToTag, addEventListener, addTag, bindRTCRoomForChatroom, clearAllMessagesUnreadStatus, clearEventListeners, clearHistoryMessages, clearMessages, clearMessagesUnreadStatus, clearTextMessageDraft, clearUnreadCountByTimestamp, connect, deleteLocalMessagesByTimestamp, deleteMessages, disconnect, forceRemoveChatRoomEntry, forceSetChatRoomEntry, getAllChatRoomEntries, getAllConversationState, getAllUltraGroupUnreadCount, getAllUltraGroupUnreadMentionedCount, getAllUnreadMentionedCount, getBlockUltraGroupList, getBlockedConversationList, getChatRoomEntry, getChatRoomInfo, getChatroomHistoryMessages, getConnectionStatus, getConversation, getConversationList, getConversationNotificationLevel, getConversationNotificationStatus, getConversationsFromTagByPage, getCurrentUserId, getFileToken, getFileUrl, getFirstUnreadMessage, getHistoryMessages, getMessage, getMessageReader, getRemoteHistoryMessages, getServerTime, getTags, getTagsFromConversation, getTextMessageDraft, getTopConversationList, getTotalUnreadCount, getUltraGroupDefaultNotificationLevel, getUltraGroupList, getUltraGroupMessageListByMessageUId, getUltraGroupUnreadCountByTargetId, getUltraGroupUnreadMentionedCountByTargetId, getUnreadCount, getUnreadCountByTag, getUnreadMentionedCount, getUnreadMentionedMessages, init, insertMessage, installPlugin, joinChatRoom, joinExistChatRoom, modifyMessage, onceEventListener, quitChatRoom, recallMessage, registerMessageType, removeAllExpansionForUltraGroupMessage, removeChatRoomEntries, removeChatRoomEntry, removeConversation, removeConversationsFromTag, removeEventListener, removeEventListeners, removeExpansionForUltraGroupMessage, removeMessageExpansionForKey, removeTag, removeTagFromConversations, removeTagsFromConversation, saveTextMessageDraft, searchConversationByContent, searchMessages, sendFileMessage, sendHQVoiceMessage, sendImageMessage, sendMessage, sendReadReceiptMessage, sendReadReceiptRequest, sendReadReceiptResponse, sendReadReceiptResponseV2, sendSightMessage, sendSyncReadStatusMessage, sendTextMessage, sendTypingStatusMessage, sendUltraGroupTypingStatus, setChatRoomEntries, setChatRoomEntry, setConversationNotificationLevel, setConversationNotificationStatus, setConversationToTop, setConversationToTopInTag, setMessageReceivedStatus, setUltraGroupDefaultNotificationLevel, updateExpansionForUltraGroupMessage, updateMessageExpansion, updateTag };
package/index.esm.js ADDED
@@ -0,0 +1 @@
1
+ import{Logger as e,WebSocketChannel as t,CometChannel as n,NetworkType as o,HttpMethod as a,appendUrl as i,ErrorCode as r,ConversationType as s,ReceivedStatus as c,assert as u,isArray as d,isHttpUrl as l,CONNECTION_TYPE as g,APIContext as f,EventEmitter as m,VersionManage as p,AssertRules as v,isValidConversationType as h,NotificationLevel as I,isString as S,UploadMethod as C,FileType as T,isValidFileType as E,usingCppEngine as y,MessageDirection as N}from"@rongcloud/engine";export{ConnectionStatus,ConversationType,ErrorCode,LogLevel,MentionedType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,ReceivedStatus,UploadMethod}from"@rongcloud/engine";var R=function(e,t){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},R(e,t)};var U=function(){return U=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},U.apply(this,arguments)};function O(e,t,n,o){return new(n||(n=Promise))((function(a,i){function r(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}c((o=o.apply(e,t||[])).next())}))}function w(e,t){var n,o,a,i,r={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=2&i[0]?o.return:i[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,i[1])).done)return a;switch(o=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,o=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(!(a=r.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){r=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(6===i[0]&&r.label<a[1]){r.label=a[1],a=i;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(i);break}a[2]&&r.ops.pop(),r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e],o=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var M=new e("RCIM"),_=function(){return!("undefined"==typeof uni||!function(e){for(var t=["canIUse","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},A=_();var x,b={tag:"browser",httpReq:function(e){var t=e.method||a.GET,n=e.timeout||6e4,o=e.headers,r=e.query,s=e.body,c=i(e.url,r);return new Promise((function(e){var a,i=(a="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&a?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),r="[object XDomainRequest]"===Object.prototype.toString.call(i);if(i.open(t,c),o&&i.setRequestHeader)for(var u in o)i.setRequestHeader(u,o[u]);if(r){i.timeout=n,i.onload=function(){e({data:i.responseText,status:i.status||200})},i.onerror=function(){e({status:i.status||0})},i.ontimeout=function(){e({status:i.status||0})};var d="object"==typeof s?JSON.stringify(s):s;i.send(d)}else i.onreadystatechange=function(){4===i.readyState&&e({data:i.responseText,status:i.status})},i.onerror=function(){e({status:i.status||0})},setTimeout((function(){return e({status:i.status||0})}),n),i.send(s)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,isSupportSocket:function(){var e="undefined"!=typeof WebSocket;return e||console.warn("websocket not support"),e},useNavi:!0,connectPlatform:"",isFromUniapp:A,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},createDataChannel:function(e,o){return this.isSupportSocket()&&"websocket"===o?new t(this,e):new n(this,e)},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t=e.type,n=e.effectiveType,a=t||n||o.UNKONWN;return new Promise((function(e){e(a)}))}},P=_(),L=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){console.error(e)}}},G={setItem:L("setStorageSync"),getItem:L("getStorageSync"),removeItem:L("removeStorageSync"),clear:L("clearStorageSync")},D={tag:"wechat",httpReq:function(e){var t=e.method||a.GET,n=e.timeout||6e4,o=e.headers,s=e.query,c=e.body,u=i(e.url,s);return new Promise((function(e){wx.request({url:u,method:t,headers:o,timeout:n,data:c,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_TIMEOUT})}})}))},localStorage:G,sessionStorage:G,isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:P,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},createDataChannel:function(e,o){return"websocket"===o?new t(this,e):new n(this,e)},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(o.UNKONWN)}})}))}},k=_(),H=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return my[e].apply(my,t)}catch(e){console.error(e)}}},B={setItem:H("setStorageSync"),getItem:H("getStorageSync"),removeItem:H("removeStorageSync"),clear:H("clearStorageSync")},F={tag:"alipay",httpReq:function(e){var t=e.method||a.GET,n=e.timeout||6e4,o=e.headers,s=e.query,c=e.body,u=i(e.url,s),d=e.dataType||"json";return new Promise((function(e){my.request({url:u,method:t,headers:o,timeout:n,data:c,dataType:d,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_TIMEOUT})}})}))},localStorage:B,sessionStorage:B,isSupportSocket:function(){return!1},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:k,createDataChannel:function(e,o){return"websocket"===o?new t(this,e):new n(this,e)},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(o.UNKONWN)}})}))}},q=_(),V=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return console.log("tt",tt),tt[e].apply(tt,t)}catch(e){console.error(e)}}},z={setItem:V("setStorageSync"),getItem:V("getStorageSync"),removeItem:V("removeStorageSync"),clear:V("clearStorageSync")},K={tag:"toutiao",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:q,localStorage:z,sessionStorage:z,httpReq:function(e){return new Promise((function(t,n){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){console.log("调用成功",e.data);var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){console.log("调用失败",e.errMsg),n({data:e.errMsg})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},createDataChannel:function(e,o){return"websocket"===o?new t(this,e):new n(this,e)},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(o.UNKONWN)}})}))}},W=_(),X=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return console.log("swan",swan),swan[e].apply(swan,t)}catch(e){console.error(e)}}},j={setItem:X("setStorageSync"),getItem:X("getStorageSync"),removeItem:X("removeStorageSync"),clear:X("clearStorageSync")},J={tag:"baidu",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:W,localStorage:j,sessionStorage:j,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){console.log("调用成功",e.data);var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){console.log("调用失败",e.errorCode),n({data:e.errorCode})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},createDataChannel:function(e,o){return"websocket"===o?new t(this,e):new n(this,e)},getNetworkType:function(){return O(this,void 0,void 0,(function(){return w(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(o.UNKONWN)}})}))]}))}))}},Y=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){console.error(e)}}},Q={setItem:Y("setStorageSync"),getItem:Y("getStorageSync"),removeItem:Y("removeStorageSync"),clear:Y("clearStorageSync")},Z={tag:"uniapp",httpReq:function(e){var t=e.method||a.GET,n=e.timeout||6e4,o=e.headers,s=e.query,c=e.body,u=i(e.url,s);return new Promise((function(e){uni.request({url:u,method:t,headers:o,timeout:n,data:c,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_TIMEOUT})}})}))},localStorage:Q,sessionStorage:Q,isSupportSocket:function(){return!0},useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},createDataChannel:function(e,o){return"websocket"===o?new t(this,e):new n(this,e)},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(o.UNKONWN)}})}))}},$=function(e){return e&&e.canIUse&&e.getSystemInfo},ee="undefined"!=typeof uni&&$(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Z;case"mp-baidu":return J;case"mp-toutiao":return K;case"mp-alipay":return F;case"mp-weixin":return D;default:return b}}():"undefined"!=typeof my&&$(my)?F:"undefined"!=typeof tt&&$(tt)?K:"undefined"!=typeof swan&&$(swan)?J:"undefined"!=typeof wx&&$(wx)?D:b;function te(e){var t=e.conversationType,n=e.channelId,o=e.messageType,a=e.content,i=e.senderUserId,r=e.targetId,u=e.sentTime,d=e.receivedTime,l=e.messageUId,g=e.messageDirection,f=e.isPersited,m=e.isCounted,p=e.isOffLineMessage,v=e.canIncludeExpansion,h=e.expansion,I=e.receivedStatus,S=e.disableNotification,C=e.isMentioned,T=e.isStatusMessage,E=e.readReceiptInfo,y=e.pushConfig,N=e.messageId,R=e.isInterrupt,U=e.isModifyMessage;I||(I=c.UNREAD);var O={messageType:o,channelId:n||"",content:a,senderUserId:i,targetId:r,conversationType:t,sentTime:u,receivedTime:d,messageUId:l,messageDirection:g,isPersited:f,isCounted:m,isMentioned:C,disableNotification:S,isStatusMessage:T,canIncludeExpansion:v,expansion:h,receivedStatus:I,readReceiptInfo:E,pushConfig:y,messageId:N,isInterrupt:R,isModifyMessage:U};return t!==s.ULTRA_GROUP&&(O.isOffLineMessage=p),O}function ne(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,a=e.unreadMessageCount,i=e.hasMentioned,r=e.mentionedInfo,s=e.lastUnreadTime,c=e.notificationStatus,u=e.isTop,d=e.channelId,l=e.unreadMentionedCount;return{conversationType:t,targetId:n,latestMessage:o&&te(o),unreadMessageCount:a,hasMentioned:i,mentionedInfo:i?{type:null==r?void 0:r.type,userIdList:null==r?void 0:r.userIdList}:void 0,lastUnreadTime:s,notificationStatus:c,isTop:u,channelId:d,unreadMentionedCount:l}}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED"}(x||(x={}));var oe,ae=function(e){function t(n){var o=e.call(this)||this;if(t.imClient)return M.error("Please do not repeatedly perform the init method"),t.imClient;u("options.navigators",n.navigators,(function(e){return d(e)&&(0===e.length||e.every(l))}));var a=null==n?void 0:n.connectType;return a?g.WEBSOCKET!==a&&g.COMET!==a&&(M.warn("RongIMLib connectionType must be ".concat(g.WEBSOCKET," or ").concat(g.COMET)),a=g.WEBSOCKET):a=g.WEBSOCKET,o._context=f.init(ee,{appkey:n.appkey,apiVersion:"5.3.0",navigators:n.navigators||[],miniCMPProxy:n.customCMP||[],connectionType:a,logLevel:n.logLevel,logStdout:n.logStdout,indexDBSwitch:n.indexDBSwitch,checkCA:n.checkCA}),o.watch(),t.imClient=o,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),Object.defineProperty(t.prototype,"context",{get:function(){if(!this._context)throw new Error("Please perform the init method!");return this._context},enumerable:!1,configurable:!0}),t.prototype.watch=function(){var e=this,t={onConnecting:function(){e.emit(x.CONNECTING)},onConnected:function(){e.emit(x.CONNECTED)},onDisconnect:function(t){e.emit(x.DISCONNECT,t)},onSuspend:function(t){e.emit(x.SUSPEND,t)},batchMessage:function(t){e.emit(x.MESSAGES,{messages:t.map((function(e){return te(e)}))})},typingState:function(t){e.emit(x.TYPING_STATUS,{status:t})},readReceiptReceived:function(t,n,o){e.emit(x.READ_RECEIPT_RECEIVED,{conversation:t,messageUId:n,sentTime:o})},messageReceiptRequest:function(t,n,o){e.emit(x.MESSAGE_RECEIPT_REQUEST,{conversation:t,messageUId:n,senderUserId:o})},messageReceiptResponse:function(t,n,o){e.emit(x.MESSAGE_RECEIPT_RESPONSE,{conversation:t,receivedUserId:n,messageUIdList:o})},conversationState:function(t){var n=t.map((function(e){var t=e.conversationType;return t===s.ULTRA_GROUP?{conversation:{conversationType:t,latestMessage:e.latestMessage?te(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,versionTime:e.versionTime,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId}}:{conversation:{conversationType:t,latestMessage:e.latestMessage?te(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,hasMentioned:e.hasMentioned,mentionedInfo:e.mentionedInfo,lastUnreadTime:e.lastUnreadTime,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,isTop:e.isTop,channelId:e.channelId,unreadMentionedCount:e.unreadMentionedCount},updatedItems:e.updatedItems}}));e.emit(x.CONVERSATION,{conversationList:n})},chatroomState:function(t){e.emit(x.CHATROOM,t)},expansion:function(t){e.emit(x.EXPANSION,t)},pullFinished:function(){e.emit(x.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){e.emit(x.TAG)},conversationTagChanged:function(){e.emit(x.CONVERSATION_TAG)},messageBlocked:function(t){e.emit(x.MESSAGE_BLOCKED,t)},ultraGroupEnable:function(t){e.emit(x.ULTRA_GROUP_ENABLE,t)},operateStatus:function(t){e.emit(x.OPERATE_STATUS,t)},ultraGroupMessageExpansionUpdated:function(t){e.emit(x.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,t)},ultraGroupMessageModified:function(t){e.emit(x.ULTRA_GROUP_MESSAGE_MODIFIED,t)},ultraGroupMessageRecalled:function(t){e.emit(x.ULTRA_GROUP_MESSAGE_RECALLED,t)}};this.context.assignWatcher(t)},t}(m),ie={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},re={},se={};for(var ce in ie){var ue=ie[ce],de=ue.code;re[de]=ce,se[de]=ue}ie.ROAMING_SERVICE_UNAVAILABLE.code;var le=function(e){oe=oe||new ae(e)};function ge(e,t){return null==oe?void 0:oe.context.install(e,t)}function fe(e,t){return O(this,void 0,void 0,(function(){var n;return w(this,(function(o){switch(o.label){case 0:return u("token",e,v.STRING,!0),M.warn("RongIMLib Version: ".concat("5.3.0",", Commit: ").concat("2b095a7c99182017bf43750be5f591157e00beda")),[4,oe.context.connect(e,!1,t)];case 1:return(n=o.sent()).code===r.SUCCESS?[2,{code:n.code,data:{userId:n.userId}}]:[2,{code:n.code,msg:re[n.code]}]}}))}))}function me(){return oe.context.disconnect()}function pe(){return oe.context.getConnectionStatus()}function ve(){return oe.context.getServerTime()}function he(){return oe.context.getCurrentUserId()}function Ie(e,t,n){oe.on(e,t,n)}function Se(e,t,n){oe.once(e,t,n)}function Ce(e,t,n){oe.off(e,t,n)}function Te(e){oe.removeAll(e)}function Ee(){oe.clear()}function ye(e,t){p.add(e,t)}function Ne(e,t){return O(this,void 0,void 0,(function(){var n,o,a;return w(this,(function(i){switch(i.label){case 0:return M.debug("get conversation list ->"),[4,ae.imClient.context.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=i.sent(),o=n.code,a=n.data,o===r.SUCCESS&&a?[2,{code:0,data:a.map((function(e){return ne(e)}))}]:(M.warn("get conversation list fail ->"+o+":"+re[o]),[2,{code:o,msg:re[o]}])}}))}))}function Re(e){return O(this,void 0,void 0,(function(){var t,n,o;return w(this,(function(a){switch(a.label){case 0:return u("options.conversationType",e.conversationType,h,!0),u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),[4,ae.imClient.context.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=a.sent(),n=t.code,o=t.data,n!==r.SUCCESS?(M.warn("getConversation ->code:"+n+", targetId:"+e.targetId),[2,{code:n,msg:re[n]}]):[2,{code:n,data:o?ne(o):null}]}}))}))}function Ue(e){return O(this,void 0,void 0,(function(){var t,n;return w(this,(function(o){switch(o.label){case 0:return u("options.conversationType",e.conversationType,h,!0),u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),[4,ae.imClient.context.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=o.sent(),n="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("destroy conversation ->"+n),t!==r.SUCCESS?(M.warn("destroy conversation fail ->"+t+":"+re[t]+","+n),[2,{code:t,msg:re[t]}]):[2,{code:t}]}}))}))}function Oe(e){return O(this,void 0,void 0,(function(){var t,n,o,a;return w(this,(function(i){switch(i.label){case 0:return u("options.conversationType",e.conversationType,h,!0),u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),[4,ae.imClient.context.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),n=t.code,o=t.data,a="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("get draft ->"+a),n===r.SUCCESS?[2,{code:n,data:o||""}]:(M.warn("get draft fail ->"+n+":"+re[n]+","+a),[2,{code:n,msg:re[n]}])}}))}))}function we(e,t){return O(this,void 0,void 0,(function(){var n,o;return w(this,(function(a){switch(a.label){case 0:return u("options.conversationType",e.conversationType,h,!0),u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),u("draft",t,v.STRING,!0),n="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("set draft ->"+n),[4,ae.imClient.context.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(o=a.sent())===r.SUCCESS?[2,{code:o}]:(M.warn("set draft fail ->"+o+":"+re[o]+","+n),[2,{code:o,msg:re[o]}])}}))}))}function Me(e){return O(this,void 0,void 0,(function(){var t,n;return w(this,(function(o){switch(o.label){case 0:return u("options.conversationType",e.conversationType,h,!0),u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),t="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("delete draft ->"+t),[4,ae.imClient.context.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(n=o.sent())===r.SUCCESS?[2,{code:n}]:(M.warn("delete draft fail ->"+n+":"+re[n]+","+t),[2,{code:n,msg:re[n]}])}}))}))}function _e(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s,c;return w(this,(function(d){switch(d.label){case 0:if(M.debug("get total unread count -> ConversationType:"+JSON.stringify(t)+" includeMuted:"+e),u("includeMuted",e,v.BOOLEAN,!1),u("conversationTypes",t,v.ARRAY,!1),t)for(n=0,o=t;n<o.length;n++)a=o[n],u("conversationType",a,h);return[4,ae.imClient.context.getTotalUnreadCount("",t,e)];case 1:return i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS?[2,{code:s,data:c}]:(M.warn("getTotalUnreadCount fail ->"+s+":"+re[s]),[2,{code:s,msg:re[s]}])}}))}))}function Ae(e){return O(this,void 0,void 0,(function(){var t,n,o,a;return w(this,(function(i){switch(i.label){case 0:return u("options.conversationType",e.conversationType,h,!0),u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),[4,ae.imClient.context.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),n=t.code,o=t.data,a="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("get unreadCount ->"+a),n===r.SUCCESS?[2,{code:n,data:o}]:(M.warn("get unreadCount fail ->"+n+":"+re[n]+","+a),[2,{code:n,msg:re[n]}])}}))}))}function xe(e){return O(this,void 0,void 0,(function(){var t,n;return w(this,(function(o){switch(o.label){case 0:return u("options.conversationType",e.conversationType,h,!0),u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),[4,ae.imClient.context.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=o.sent(),n="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("clear unreadMsgNum ->"+n),t!==r.SUCCESS?(M.warn("clear unreadMsgNum fail ->"+t+":"+re[t]+","+n),[2,{code:t,msg:re[t]}]):[2,{code:t}]}}))}))}function be(){return O(this,void 0,void 0,(function(){return w(this,(function(e){switch(e.label){case 0:return[4,ae.imClient.context.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}var Pe=function(e,t){void 0===t&&(t=""),u("options.conversationType",e.conversationType,h,!0),u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID);var n="conversationType:"+e.conversationType+",targetId:"+e.targetId;return M.debug("".concat(t," -> ").concat(n)),n},Le=function(e,t,n){return void 0===n&&(n=""),O(void 0,void 0,void 0,(function(){var o,a;return w(this,(function(i){switch(i.label){case 0:return o=Pe(e,n),[4,t()];case 1:return(a=i.sent())!==r.SUCCESS?(M.warn("".concat(n," fail -> ").concat(a," : ").concat(re[a]," , ").concat(o)),[2,{code:a,msg:re[a]}]):[2,{code:a}]}}))}))};function Ge(e,t){return O(this,void 0,void 0,(function(){return w(this,(function(n){return u("notificationLevel",t,(function(t){return e.conversationType===s.PRIVATE?[I.ALL_MESSAGE,I.NOT_SET,I.AT_MESSAGE_NOTIFICATION].includes(t):void 0!==I[t]}),!0),[2,Le(e,(function(){return ae.imClient.context.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")]}))}))}function De(e,t){return O(this,void 0,void 0,(function(){return w(this,(function(n){return u("notificationStatus",t,(function(e){return 1===e||2===e}),!0),[2,Le(e,(function(){return ae.imClient.context.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")]}))}))}function ke(e){return O(this,void 0,void 0,(function(){var t,n,o,a;return w(this,(function(i){switch(i.label){case 0:return t=Pe(e,"getConversationNotificationLevel"),[4,ae.imClient.context.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return n=i.sent(),o=n.code,a=n.data,o===r.SUCCESS?[2,{code:o,data:a}]:(M.warn("getConversationNotificationLevel fail -> ".concat(o," : ").concat(re[o]," , ").concat(t)),[2,{code:o,msg:re[o]}])}}))}))}function He(e){return O(this,void 0,void 0,(function(){var t,n,o;return w(this,(function(a){switch(a.label){case 0:return u("options.conversationType",e.conversationType,h,!0),u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),M.info("getConversationNotificationStatus ->targetId:"+e.targetId+",conversationType:"+e.conversationType),[4,ae.imClient.context.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),n=t.code,o=t.data,n===r.SUCCESS?[2,{code:n,data:o}]:(M.warn("getConversationNotificationStatus ->code:"+n+",targetId:"+e.targetId),[2,{code:n,msg:re[n]}])}}))}))}function Be(){return O(this,void 0,void 0,(function(){var e,t,n;return w(this,(function(o){switch(o.label){case 0:return[4,ae.imClient.context.getBlockConversationList()];case 1:return e=o.sent(),t=e.code,n=e.data,[2,{code:t,data:n}]}}))}))}function Fe(e,t){return void 0===t&&(t=!0),O(this,void 0,void 0,(function(){var n,o;return w(this,(function(a){switch(a.label){case 0:return u("options.type",e.conversationType,h,!0),u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),n="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("set conversation status ->"+n),[4,ae.imClient.context.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(o=a.sent())!==r.SUCCESS?(M.warn("set conversation status fail ->"+o+":"+re[o]+","+n),[2,{code:o,msg:re[o]}]):[2,{code:o}]}}))}))}function qe(){return O(this,void 0,void 0,(function(){var e,t,n;return w(this,(function(o){switch(o.label){case 0:return[4,ae.imClient.context.getTopConversationList()];case 1:return e=o.sent(),t=e.code,n=e.data,[2,{code:t,data:n}]}}))}))}function Ve(e){return O(this,void 0,void 0,(function(){return w(this,(function(t){return u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),M.debug("getUnreadMentionedCount"+e.targetId+",channelId:"+e.channelId),[2,ae.imClient.context.getUnreadMentionedCount(e)]}))}))}function ze(){return O(this,void 0,void 0,(function(){return w(this,(function(e){return M.debug("getAllUnreadMentionedCount"),[2,ae.imClient.context.getAllUnreadMentionedCount()]}))}))}function Ke(){return O(this,void 0,void 0,(function(){return w(this,(function(e){return[2,ae.imClient.context.getAllConversationState()]}))}))}function We(){return O(this,void 0,void 0,(function(){var e,t,n;return w(this,(function(o){switch(o.label){case 0:return[4,ae.imClient.context.getUltraGroupList()];case 1:return e=o.sent(),t=e.code,n=e.data,t===r.SUCCESS?[2,{code:r.SUCCESS,data:n}]:(M.warn("get ultragroup ->"+t+":"+re[t]),[2,{code:t,msg:re[t]}])}}))}))}function Xe(){return O(this,void 0,void 0,(function(){var e,t,n;return w(this,(function(o){switch(o.label){case 0:return[4,ae.imClient.context.getBlockUltraGroupList()];case 1:return e=o.sent(),t=e.code,n=e.data,t===r.SUCCESS?[2,{code:r.SUCCESS,data:n}]:(M.warn("get block ultragroup ->"+t+":"+re[t]),[2,{code:t,msg:re[t]}])}}))}))}function je(e){return O(this,void 0,void 0,(function(){var t;return w(this,(function(n){switch(n.label){case 0:return u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),u("options.conversationType",e.conversationType,h,!0),[4,ae.imClient.context.sendUltraGroupTypingStatus(e)];case 1:return(t=n.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(M.warn("send ultraGroup OperateStatus ->"+t+":"+re[t]),[2,{code:t,msg:re[t]}])}}))}))}function Je(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s,c,d,l;return w(this,(function(g){switch(g.label){case 0:return u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),u("options.conversationType",e.conversationType,h,!0),u("msgs",t,v.ARRAY,!0),n=e.targetId,o=e.conversationType,a=e.channelId,i=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;i.push({sendTime:t,messageUId:n,channelId:a})})),s={targetId:n,conversationType:o,messages:i},[4,ae.imClient.context.getUltraGroupMessageListByMessageUId(s)];case 1:return c=g.sent(),d=c.code,l=c.data,d===r.SUCCESS?[2,{code:r.SUCCESS,data:l}]:(M.warn("get UltraGroup MessageList by messageUId ->"+d+":"+re[d]),[2,{code:d,msg:re[d]}])}}))}))}function Ye(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s,c,d,l,g;return w(this,(function(f){switch(f.label){case 0:return u("expansion",e,v.OBJECT,!0),u("message",t,v.OBJECT,!0),n=t.conversationType,o=t.targetId,a=t.messageUId,i=t.sentTime,s=t.canIncludeExpansion,c=t.channelId,d="conversationType:"+n+",targetId:"+o+",channelId:"+c+",messageUId:"+a,M.debug("update expansion for ultragroup message ->"+d),l={targetId:o,channelId:c,conversationType:n,sendTime:i,canIncludeExpansion:s,messageUId:a,expansion:e},[4,ae.imClient.context.expandUltraMessage(l)];case 1:return(g=f.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(M.warn("update expansion for ultragroup message ->"+g+":"+re[g]),[2,{code:g,msg:re[g]}])}}))}))}function Qe(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s,c,d,l,g;return w(this,(function(f){switch(f.label){case 0:return u("expansion",e,v.ARRAY,!0),u("message",t,v.OBJECT,!0),n=t.conversationType,o=t.targetId,a=t.messageUId,i=t.sentTime,s=t.canIncludeExpansion,c=t.channelId,d="conversationType:"+n+",targetId:"+o+",channelId:"+c+",messageUId:"+a,M.debug("remove expansion for ultragroup message ->"+d),l={targetId:o,channelId:c,conversationType:n,sendTime:i,canIncludeExpansion:s,messageUId:a,keys:e},[4,ae.imClient.context.expandUltraMessage(l)];case 1:return(g=f.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(M.warn("remove expansion for ultraGroup message ->"+g+":"+re[g]),[2,{code:g,msg:re[g]}])}}))}))}function Ze(e){return O(this,void 0,void 0,(function(){var t,n,o,a,i,s,c,d,l;return w(this,(function(g){switch(g.label){case 0:return u("message",e,v.OBJECT,!0),t=e.conversationType,n=e.targetId,o=e.messageUId,a=e.sentTime,i=e.canIncludeExpansion,s=e.channelId,c="conversationType:"+t+",targetId:"+n+",channelId:"+s+",messageUId:"+o,M.debug("remove all expansion for ultraGroup message ->"+c),d={targetId:n,channelId:s,conversationType:t,sendTime:a,canIncludeExpansion:i,messageUId:o,removeAll:!0},[4,ae.imClient.context.expandUltraMessage(d)];case 1:return(l=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(M.warn("remove all expansion for ultraGroup message ->"+l+":"+re[l]),[2,{code:l,msg:re[l]}])}}))}))}function $e(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s,c,d,l,g,f;return w(this,(function(m){switch(m.label){case 0:return u("content",e,v.OBJECT,!0),u("message",t,v.OBJECT,!0),n=t.conversationType,o=t.targetId,a=t.messageUId,i=t.senderUserId,s=t.sentTime,c=t.canIncludeExpansion,d=t.channelId,l="conversationType:"+n+",targetId:"+o+",channelId:"+d+",messageUId:"+a,M.debug("update ultragroup message expansion ->"+l),g={targetId:o,channelId:d,conversationType:n,fromUserId:i,sendTime:s,canIncludeExpansion:c,messageUId:a,content:e},[4,ae.imClient.context.modifyMessage(g)];case 1:return(f=m.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(M.warn("modify ultraGroup message ->"+f+":"+re[f]),[2,{code:f,msg:re[f]}])}}))}))}function et(e){return O(this,void 0,void 0,(function(){var t,n,o;return w(this,(function(a){switch(a.label){case 0:return u("cotargetIdntent",e,v.STRING,!0),M.debug("get UltraGroup unreadMentionedCount by targetId:"+e),[4,ae.imClient.context.getUltraGroupUnreadMentionedCountByTargetId(e)];case 1:return t=a.sent(),n=t.code,o=t.data,n===r.SUCCESS?[2,{code:r.SUCCESS,data:o}]:(M.warn("get UltraGroup unreadMentionedCount by targetId error ->"+n+":"+re[n]),[2,{code:n,msg:re[n]}])}}))}))}function nt(e){return O(this,void 0,void 0,(function(){var t,n,o,a,i;return w(this,(function(s){switch(s.label){case 0:return u("options.targetId",e.targetId,v.STRING,!0),u("options.channelId",e.channelId,v.CHANNEL_ID),t="getUltraGroupDefaultNotificationLevel",n="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),M.debug("".concat(t," -> ").concat(n)),[4,ae.imClient.context.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return o=s.sent(),a=o.code,i=o.data,a===r.SUCCESS?[2,{code:a,data:i}]:(M.warn("".concat(t," fail -> ").concat(a," : ").concat(re[a]," , ").concat(n)),[2,{code:a,msg:re[a]}])}}))}))}function ot(e,t){return O(this,void 0,void 0,(function(){var n,o,a;return w(this,(function(i){switch(i.label){case 0:return u("options.targetId",e.targetId,v.STRING,!0),e.channelId=e.channelId||"",u("options.channelId",e.channelId,v.ONLY_STRING,!0),u("notificationLevel",t,(function(e){return void 0!==I[e]}),!0),n="setUltraGroupDefaultNotificationLevel",o="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),M.debug("".concat(n," -> ").concat(o)),[4,ae.imClient.context.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(a=i.sent().code)===r.SUCCESS?[2,{code:a}]:(M.warn("".concat(n," fail -> ").concat(a," : ").concat(re[a]," , ").concat(o)),[2,{code:a,msg:re[a]}])}}))}))}function at(e){return O(this,void 0,void 0,(function(){var t,n,o,a,i;return w(this,(function(s){switch(s.label){case 0:return u("options.targetId",e,v.STRING,!0),t="getUltraGroupUnreadCountByTargetId",[4,ae.imClient.context.getUltraGroupUnreadCountByTargetId(e)];case 1:return n=s.sent(),o=n.code,a=n.data,i="targetId: ".concat(e),M.debug("".concat(t," -> ").concat(i)),o===r.SUCCESS?[2,{code:o,data:a}]:(M.warn("".concat(t," fail -> ").concat(o,": ").concat(re[o],", ").concat(i)),[2,{code:o,msg:re[o]}])}}))}))}function it(){return O(this,void 0,void 0,(function(){var e,t,n,o;return w(this,(function(a){switch(a.label){case 0:return e="getAllUltraGroupUnreadCount",[4,ae.imClient.context.getAllUltraGroupUnreadCount()];case 1:return t=a.sent(),n=t.code,o=t.data,M.debug(e),n===r.SUCCESS?[2,{code:n,data:o}]:(M.warn("".concat(e," fail ->").concat(n,": ").concat(re[n])),[2,{code:n,msg:re[n]}])}}))}))}function rt(){return O(this,void 0,void 0,(function(){var e,t,n,o;return w(this,(function(a){switch(a.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,ae.imClient.context.getAllUltraGroupUnreadCount(true)];case 1:return t=a.sent(),n=t.code,o=t.data,M.debug(e),n===r.SUCCESS?[2,{code:n,data:o}]:(M.warn("".concat(e," fail ->").concat(n,": ").concat(re[n])),[2,{code:n,msg:re[n]}])}}))}))}var st=function(e){u("options.key",e.key,v.STRING,!0),u("options.value",e.value,v.STRING,!0),u("options.isAutoDelete",e.isAutoDelete,v.BOOLEAN),u("options.isSendNotification",e.isSendNotification,v.BOOLEAN),u("options.notificationExtra",e.notificationExtra,v.STRING)},ct=function(e){u("options.key",e.key,v.STRING,!0),u("options.isSendNotification",e.isSendNotification,v.BOOLEAN),u("options.notificationExtra",e.notificationExtra,v.STRING)};function ut(e,t){return O(this,void 0,void 0,(function(){var n,o;return w(this,(function(a){switch(a.label){case 0:return u("options.count",t.count,v.NUMBER,!0),n="id:"+e,M.debug("join chatroom ->"+n),[4,ae.imClient.context.joinChatroom(e,t.count)];case 1:return(o=a.sent())!==r.SUCCESS?(M.warn("join chatroom fail ->code+:"+re[o]+","+n),[2,{code:o,msg:re[o]}]):[2,{code:o}]}}))}))}function dt(e,t){return O(this,void 0,void 0,(function(){var n,o;return w(this,(function(a){switch(a.label){case 0:return u("options.count",t.count,v.NUMBER,!0),n="id:"+e,M.debug("join exist chatroom ->"+n),[4,ae.imClient.context.joinExistChatroom(e,t.count)];case 1:return(o=a.sent())!==r.SUCCESS?(M.warn("join exist chatroom fail ->code:"+re[o]+","+n),[2,{code:o,msg:re[o]}]):[2,{code:o}]}}))}))}function lt(e){return O(this,void 0,void 0,(function(){var t,n;return w(this,(function(o){switch(o.label){case 0:return t="id:"+e,M.debug("quit chatroom ->"+t),[4,ae.imClient.context.quitChatroom(e)];case 1:return(n=o.sent())!==r.SUCCESS?(M.warn("quit chatroom fail ->code+:"+re[n]+","+t),[2,{code:n,msg:re[n]}]):[2,{code:n}]}}))}))}function gt(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i;return w(this,(function(s){switch(s.label){case 0:return u("options.count",t.count,v.NUMBER),u("options.order",t.order,(function(e){return[0,1,2].includes(e)})),n="id:"+e,M.debug("get chatroom info ->"+n),[4,ae.imClient.context.getChatroomInfo(e,t.count,t.order)];case 1:return o=s.sent(),a=o.code,i=o.data,a===r.SUCCESS&&i?[2,{code:a,data:i}]:(M.warn("get chatroom info fail ->code+:"+re[a]+","+n),[2,{code:a,msg:re[a]}])}}))}))}function ft(e,t){return O(this,void 0,void 0,(function(){var n,o;return w(this,(function(a){switch(a.label){case 0:return u("targetId",e,v.STRING,!0),st(t),n="id:"+e,M.debug("set chatroom entry->"+n),[4,ae.imClient.context.setChatroomEntry(e,t)];case 1:return(o=a.sent())!==r.SUCCESS?(M.warn("set chatroom entry fail ->code+:"+re[o]+","+n),[2,{code:o,msg:re[o]}]):[2,{code:o}]}}))}))}function mt(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i;return w(this,(function(s){switch(s.label){case 0:return u("targetId",e,v.STRING,!0),function(e){e.entries.forEach((function(e){u("entry.key",e.key,v.STRING,!0),u("entry.value",e.value,v.STRING,!0)})),u("options.isAutoDelete",e.isAutoDelete,v.BOOLEAN),u("options.notificationExtra",e.notificationExtra,v.STRING)}(t),t.entries.length>10?[2,ie.CHATROOM_KV_STORE_OUT_LIMIT]:(n="id:"+e,M.debug("set chatroom entry->"+n),[4,ae.imClient.context.setChatroomEntries(e,t)]);case 1:return o=s.sent(),a=o.code,i=o.data,a!==r.SUCCESS?(M.warn("set chatroom entry fail ->code+:"+re[a]+","+n),[2,{code:a,msg:re[a],data:i}]):[2,{code:a}]}}))}))}function pt(e,t){return O(this,void 0,void 0,(function(){var n,o;return w(this,(function(a){switch(a.label){case 0:return u("targetId",e,v.STRING,!0),st(t),n="id:"+e,M.debug("force set chatroom entry ->"+n),[4,ae.imClient.context.forceSetChatroomEntry(e,t)];case 1:return(o=a.sent())!==r.SUCCESS?(M.warn("force set chatroom entry fail ->code+:"+re[o]+","+n),[2,{code:o,msg:re[o]}]):[2,{code:o}]}}))}))}function vt(e,t){return O(this,void 0,void 0,(function(){var n,o;return w(this,(function(a){switch(a.label){case 0:return u("targetId",e,v.STRING,!0),ct(t),n="id:"+e,M.debug("remove chatroom entry->"+n),[4,ae.imClient.context.removeChatroomEntry(e,t)];case 1:return(o=a.sent())!==r.SUCCESS?(M.warn("remove chatroom entry fail ->code+:"+re[o]+","+n),[2,{code:o,msg:re[o]}]):[2,{code:o}]}}))}))}function ht(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s;return w(this,(function(c){switch(c.label){case 0:return u("targetId",e,v.STRING,!0),function(e){e.entries.forEach((function(e){u("key",e,v.STRING,!0)})),u("options.notificationExtra",e.notificationExtra,v.STRING)}(t),n="id:"+e,M.debug("remove chatroom entry->"+n),(o=Object.assign({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,ae.imClient.context.removeChatroomEntries(e,o)];case 1:return a=c.sent(),i=a.code,s=a.data,i!==r.SUCCESS?(M.warn("remove chatroom entry fail ->code+:"+re[i]+","+n),[2,{code:i,msg:re[i],data:s}]):[2,{code:i}]}}))}))}function It(e,t){return O(this,void 0,void 0,(function(){var n,o;return w(this,(function(a){switch(a.label){case 0:return u("targetId",e,v.STRING,!0),ct(t),n="id:"+e,M.debug("force remove chatroom entry ->"+n),[4,ae.imClient.context.forceRemoveChatroomEntry(e,t)];case 1:return(o=a.sent())!==r.SUCCESS?(M.warn("force remove chatroom entry fail ->code+:"+re[o]+","+n),[2,{code:o,msg:re[o]}]):[2,{code:o}]}}))}))}function St(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i;return w(this,(function(s){switch(s.label){case 0:return u("key",t,(function(e){return S(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0),n="id:"+e,M.debug("get chatroom entry->"+n),[4,ae.imClient.context.getChatroomEntry(e,t)];case 1:return o=s.sent(),a=o.code,i=o.data,a===r.SUCCESS&&i?[2,{code:a,data:i}]:(M.warn("get chatroom entry fail ->code+:"+re[a]+","+n),[2,{code:a,msg:re[a]}])}}))}))}function Ct(e){return O(this,void 0,void 0,(function(){var t,n,o,a;return w(this,(function(i){switch(i.label){case 0:return t="id:"+e,M.debug("get all chatroom entries->"+t),[4,ae.imClient.context.getAllChatroomEntries(e)];case 1:return n=i.sent(),o=n.code,a=n.data,o===r.SUCCESS&&a?[2,{code:o,data:a}]:(M.warn("get all chatroom entries fail ->code+:"+re[o]+","+t),[2,{code:o,msg:re[o]}])}}))}))}function Tt(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s;return w(this,(function(c){switch(c.label){case 0:return u("options.timestamp",t.timestamp,v.NUMBER),u("options.count",t.count,v.NUMBER),u("options.order",t.order,(function(e){return 0===e||1===e})),n="id:"+e,M.debug("get chatroom history message->"+n),[4,ae.imClient.context.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return o=c.sent(),a=o.code,i=o.data,a===r.SUCCESS&&i?(s=i.list.map((function(e){return te(e)})),[2,{code:a,data:{list:s,hasMore:!!i.hasMore}}]):(M.warn("get chatroom history message fail ->code+:"+re[a]+","+n),[2,{code:a,msg:re[a]}])}}))}))}function Et(e){return O(this,void 0,void 0,(function(){var t;return w(this,(function(n){switch(n.label){case 0:return[4,ae.imClient.context.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=n.sent(),msg:re[t]}]}}))}))}var yt=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function Nt(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new yt(e,o,t,n)}}var Rt,Ut,Ot=Nt("RC:ImgMsg"),wt=Nt("RC:HQVCMsg"),Mt=Nt("RC:SightMsg"),_t=Nt("RC:TxtMsg"),At=Nt("RC:CombineMsg"),xt=Nt("RC:FileMsg"),bt=Nt("RC:GIFMsg"),Pt=Nt("RC:VcMsg"),Lt=Nt("RC:LBSMsg"),Gt=Nt("RC:ReferenceMsg"),Dt=Nt("RC:ImgTextMsg"),kt={qiniu:function(e,t,n,o){var a,i="https://"+t.uploadHost.qiniu;a=qt()+Ht[0][1]||i,Ht.shift();var r=new XMLHttpRequest;r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var a=JSON.parse(r.responseText||"{}");a.filename=t.uniqueValue,a.uploadMethod=C?C.QINIU:"",200===r.status?n.onCompleted(a):Ht.length?kt[Ht[0][0]](e,t,n,o):n.onError("upload fail")}},t.isChunk&&(a=function(e,t){var n="";Ft(t,(function(e,t){"token"!==e&&(n+=(n?"&":"")+encodeURIComponent(e)+"="+encodeURIComponent(t))})),n&&(e+=(e.indexOf("?")>0?"&":"?")+n);return e}(a+="/mkblk/"+e.size,t.multi_parmas));r.open(t.method,a,!0),n.onOpen(r),t.stream&&r.setRequestHeader("authorization","UpToken "+t.multi_parmas.token);Ft(t.headers,(function(e,t){r.setRequestHeader(e,t)})),r.send(e)},baidu:function(e,t,n,o){if(o.size>Bt)throw new Error("the file size is over 5GB!");var a=t||{};t=t||Ut;var i=new XMLHttpRequest,r=qt();if(!a.uploadHost.bos&&!a.bosUploadPath)return;var s=r+Ht[0][1]+a.bosUploadPath;Ht.shift();var c=a.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});i.onreadystatechange=function(){if(4===i.readyState)if(JSON.parse(i.responseText||"{}").filename=t.uniqueValue,200===i.status){n.onCompleted(u,!0)}else Ht.length?kt[Ht[0][0]](e,t,n,o):n.onError("upload fail")},i.open(t.method,s,!0),i.setRequestHeader("authorization",c.bosToken),i.setRequestHeader("x-bce-date",c.bosDate),i.send(o)},aliyun:function(e,t,n,o){if(o.size>Bt)throw new Error("the file size is over 5GB!");var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token"));var i=Ht[0][1];Ht.shift(),e=e||Rt,t=(t=t||{})||Ut;var r=new XMLHttpRequest,s=qt()+t.ossBucketName+"."+i;r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var e=JSON.parse(r.responseText||"{}");e.name=t.uniqueValue,e.filename=t.uploadFileName,e.uploadMethod=C?C.ALI:"",200===r.status?n.onCompleted(e):Ht.length?kt[Ht[0][0]](a,t,n,o):n.onError("upload fail")}},r.open(t.method,s,!0),console.log("ali:url",s);var c=t.aliHeader||{};e.set("OSSAccessKeyId",c.osskeyId),e.set("policy",c.ossPolicy),e.set("Signature",c.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",t.uploadFileName),e.delete("file"),e.append("file",o),r.send(e)},s3:function(e,t,n,o){var a=new FormData,i=new XMLHttpRequest,r=qt(),s=t.contentDisposition,c=Ht[0][1],u=r+t.s3BucketName+"."+c;console.log("uploadS3:url",u),Ht.shift(),i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var a=JSON.parse(i.responseText||"{}");if(a.name=t.uniqueValue,a.filename=t.uploadFileName,a.uploadMethod=C.AWS,200===i.status||204===i.status)n.onCompleted(a);else if(Ht.length){var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token")),kt[Ht[0][0]](r,t,n,o)}else n.onError("upload fail")}},i.open(t.method,u,!0);var d=t?t.s3Header:{},l=o&&o.type;s?a.set("Content-Disposition",s+";"):a.set("Content-Disposition","text/html"===l?"inline;":"attachment;");a.set("Content-Type",l),a.set("x-amz-credential",d.s3Credential),a.set("x-amz-algorithm",d.s3Algorithm),a.set("x-amz-date",d.s3Date),a.set("policy",d.s3Policy),a.set("x-amz-signature",d.s3Signature),a.set("key",t.uploadFileName),a.set("file",o),i.send(a)},stc:function(e,t,n,o){var a=new XMLHttpRequest,i=t.contentDisposition,r="https://"+Ht[0][1]+"/"+t.stcBucketName+"/"+t.uploadFileName;Ht.shift(),a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var i=JSON.parse(a.responseText||"{}");if(i.name=t.uniqueValue,i.filename=t.uploadFileName,i.uploadMethod=C?C.STC:"",200===a.status||204===a.status)n.onCompleted(i);else if(Ht.length){var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token")),kt[Ht[0][0]](r,t,n,o)}else n.onError("upload fail")}},a.open("PUT",r,!0);var s=t?t.stcHeader:{};a.setRequestHeader("Content-Type",o.type),i?a.setRequestHeader("Content-Disposition",i+";"):a.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;");a.setRequestHeader("Authorization",s.stcAuthorization),a.setRequestHeader("x-amz-content-sha256",s.stcContentSha256),a.setRequestHeader("x-amz-date",s.stcDate),a.send(o)}},Ht=[],Bt=5368709120;function Ft(e,t){for(var n in e)t(n,e[n])}function qt(){var e="https://";return"http:"!==location.protocol&&"file:"!==location.protocol||(e="http://"),e}function Vt(e,t,n){var o,a,i=e&&e.type||"text/plain",r=i.indexOf("image")>-1?1:4,s=t.contentDisposition,c=Math.ceil(e.size/t.stc_chunk_size),u=t&&JSON.parse(t.ossConfig?t.ossConfig:"");Array.isArray(u)||(u=[]);var d=u.find((function(e){return Object.keys(e).includes("stc")})),l="uploads";ae.imClient.context.getFileToken(r,o,"POST",l).then((function(r){o=r.fileName,a="https://"+d.stc+"/"+t.stcBucketName+"/"+o,console.log("uploadStcMultipart:url",a);var u=new XMLHttpRequest;u.open("POST",a+"?"+l,!0),s?u.setRequestHeader("Content-Disposition",s+";"):u.setRequestHeader("Content-Disposition","text/html"===e.type?"inline;":"attachment;"),u.setRequestHeader("Authorization",r&&r.stcAuthorization),u.setRequestHeader("x-amz-content-sha256",r&&r.stcContentSha256),u.setRequestHeader("x-amz-date",r&&r.stcDate),u.setRequestHeader("Content-Type",i),u.send(),u.onreadystatechange=function(){if(4===u.readyState){var e=u.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===u.status||204===u.status?function(e){for(var t=[],n=1;n<=c;n++)t.push(p(e,n));m(e,t)}(Array.isArray(e)&&e[1]):n.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){n.onError("uploadStcMultipart:"+e)}));var g=[],f=new Map;function m(s,u){u&&Array.isArray(u)&&0!==u.length&&Promise.all(u).then((function(){var u="uploadId="+s;if(f.size===c)ae.imClient.context.getFileToken(r,o,"POST",u).then((function(o){console.log("onSuccess",o),console.log("onSuccess:uploadId",s);var r=new XMLHttpRequest;r.open("POST",a+"?"+u,!0),r.setRequestHeader("Authorization",o&&o.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",o&&o.stcContentSha256),r.setRequestHeader("x-amz-date",o&&o.stcDate),r.setRequestHeader("Content-Type",i);var c="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",d=Array.from(f.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",d),d.forEach((function(e){c+="<Part><ETag>".concat(f.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),c+="</CompleteMultipartUpload>",r.send(c),console.log("xml",c),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var o={name:e.name,filename:t.uploadFileName,uploadMethod:C.STC};n.onCompleted(o)}else n.onError("uploadStcMultipart:upload does not end")}}),(function(e){n.onError("uploadStcMultipart:"+e)}));else{for(var d=[],l=0,v=g;l<v.length;l++){var h=v[l];d.push(p(s,h))}m(s,d)}}),(function(e){console.error(e),n.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],o=0,a=g;o<a.length;o++){var i=a[o];t.push(p(s,i))}m(s,t)}))}function p(n,s){return new Promise((function(c,u){var d="partNumber="+s+"&uploadId="+n;ae.imClient.context.getFileToken(r,o,"PUT",d).then((function(n){console.log("signature "+s+" onSuccess",n);var o=e&&e.slice((s-1)*t.stc_chunk_size,s*t.stc_chunk_size);console.log("fileChunk:size",o.size);var r=new XMLHttpRequest;r.open("PUT",a+"?"+d,!0),r.setRequestHeader("Authorization",n&&n.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",n&&n.stcContentSha256),r.setRequestHeader("x-amz-date",n&&n.stcDate),r.setRequestHeader("Content-Type",i),r.send(o),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e=r.getResponseHeader("etag");console.log("etag:"+s,e),f.set(s,e),c(e)}else g.includes(s)||g.push(s),u(s)}}),(function(e){console.log("getETags:签名验证失败"),g.includes(s)||g.push(s),u(s)}))}))}}var zt={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),a=Kt()+o;n.append(t.unique_key,a),t.uniqueValue=a}return n.append(t.file_data_name,e),Wt(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),a=Kt()+o;n[t.unique_key]=a,t.uniqueValue=a}return n[t.file_data_name]=e,Wt(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Kt(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function Wt(e,t){for(var n in e)t(n,e[n])}var Xt,jt=0,Jt=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:zt.form,genUId:Kt};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;Wt(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t){if(e){var n=this;!function(e,t,n){if(Rt=e,Ut=t,Ht=[],t.ossConfig){var o,a,i=JSON.parse(t.ossConfig),r="",s=[];i.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(r=e[n]),"s3"===n&&(o=e[n]),"stc"===n&&(a=e[n]),"p"!==n&&(s[t]=[n,e[n]])})),s.forEach((function(e){e&&Ht.push(e)})),i.length!==Ht.length&&(Ht=[["qiniu",t.domain],["baidu",t.uploadHost.bos],["aliyun",r],["s3",o],["stc",a]])}else Ht=[["qiniu",t.domain],["baidu",t.uploadHost.bos]];var c;if(t.ossConfig){var u=t&&JSON.parse(t.ossConfig);Array.isArray(u)||(u=[]),c=u.find((function(e){return Object.keys(e).includes("stc")}))}if(c&&1===parseInt(c.p)&&e.size>=4194304)Vt(e,t,n);else{var d=t.data(e,t);kt[Ht[0][0]](d,t,n,e)}}(e,this.options,{onProgress:function(e,n,o){(Xt=e,o)?Xt=jt+e/n*(n-jt):jt=Xt;t.onProgress(Xt,n)},onCompleted:function(e){t.onCompleted(e)},onError:function(e){t.onError(e)},onOpen:function(e){n.xhr=e}})}else t.onError("upload file is null.")},e.prototype.cancel=function(){this.xhr&&this.xhr.abort()},e}();var Yt,Qt,Zt={init:function(e){return new Jt(e)},dataType:zt,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),a=new FileReader;a.readAsDataURL(e),a.onload=function(e){var a=e.target.result,i=new Image;i.src=a;var r=i.width,s=i.height,c=function(e,t){var n=1,o=e.width,a=t.maxWidth||0;a>0&&o>a&&(n=a/o);var i=e.height,r=t.maxHeight||0;if(r>0&&i>r){var s=r/i;n=Math.min(n,s)}var c=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;n=Math.min(n,d)}return n}({width:r,height:s,size:e.total},t),u=a;c<1&&(u=function(e,t,n){return o.width=t,o.height=n,o.getContext("2d").drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(i,r*c,s*c)),n(u)}}},$t=function(e,t,n){var o=document.createElement("canvas"),a=o.getContext("2d"),i=new Image,r="string"==typeof e;i.onload=function(r){var s=function(e,t,n){var o,a,i,r=e<t,s=0,c=0;return(r?t/e:e/t)>n.scale?(r?(a=100,c=((i=t/(o=e/100))-n.maxHeight)/2):(i=100,s=((a=e/(o=t/100))-n.maxWidth)/2),{w:a,h:i,x:-s,y:-c}):(r?(o=t/n.maxHeight,i=n.maxHeight,a=e/o):(o=e/n.maxWidth,a=n.maxWidth,i=t/o),{w:a,h:i,x:-s,y:-c})}(i.width,i.height,t);o.width=s.w>t.maxWidth?t.maxWidth:s.w,o.height=s.h>t.maxHeight?t.maxHeight:s.h,a.drawImage(i,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},i.src=r?"data:image/jpg;base64,"+e:function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},en=function(e,t){var n=e.file,o=e.compress;$t(n,o,t)},tn=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas||(e.multi_parmas={}),e.multi_parmas.token=n,e.uploadHost||(e.uploadHost={}),e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader||(e.bosHeader={}),e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers||(e.headers={}),e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken "+n),console.log("data",o);var a=Zt.init(e);t(a)}));else{e.headers||(e.headers={}),e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Zt.init(e);t(n)}},nn=function(e,t,n){t.upload(e.file,{onError:function(e){n.onError(e)},onProgress:function(e,t){n.onProgress(e,t)},onCompleted:function(t){t.filename||(t.filename=t.hash);var o=e.compressThumbnail||en;e.compress?o(e,(function(e){t.thumbnail=e,n.onCompleted(t)})):n.onCompleted(t)}})},on=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t){nn({file:e},this.instance,t)},e.prototype.cancel=function(){this.instance.cancel()},e}(),an=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t){var n={file:e,compress:this.cfg};nn(n,this.instance,t)},e.prototype.cancel=function(){this.instance.cancel()},e}(),rn=function(e,t){tn(e,(function(n){var o,a,i,r,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.maxWidth)||160,quality:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.quality)||.5,scale:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.scale)||2.4},c=new an(n,s);t(c)}))},sn=function(e,t){tn(e,(function(e){var n=new on(e);t(n)}))},cn=rn;Zt.dataType;function un(e){return Yt=Yt||new AudioContext,new Promise((function(t,n){Yt.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function dn(e,t,n,o){return new Promise((function(a){ae.imClient.context.getFileToken(e,t,n,o).then((function(e){a({code:r.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:re[e]})}))}))}function ln(e,t,n,o,a){return u("fileType",e,E,!0),u("filename",t,v.STRING),u("saveName",n,v.STRING),u("serverType",a,v.NUMBER),new Promise((function(i){ae.imClient.context.getFileUrl(e,t,n,o,a).then((function(e){i({code:r.SUCCESS,data:e})})).catch((function(e){i({code:e})}))}))}function gn(e,t,n){return O(this,void 0,void 0,(function(){var o,a,i,d,l,g,f,m,p,h;return w(this,(function(I){switch(I.label){case 0:return n=n||{},t instanceof yt==!1?(M.warn("send message fail -> message parameter is not an instance of BaseMessage"),[2,ie.ILLGAL_PARAMS]):(u("conversation",e,v.OBJECT,!0),o=e.conversationType,a=e.targetId,i=e.channelId,u("conversation.targetId",a,v.STRING,!0),u("conversation.conversationType",o,v.NUMBER),u("conversation.channelId",i,v.CHANNEL_ID),u("options.isStatusMessage",null==n?void 0:n.isStatusMessage,v.BOOLEAN),u("options.disableNotification",null==n?void 0:n.disableNotification,v.BOOLEAN),u("options.pushContent",null==n?void 0:n.pushContent,v.STRING),u("options.pushData",null==n?void 0:n.pushData,v.STRING),u("options.isMentioned",null==n?void 0:n.isMentioned,v.BOOLEAN),u("options.mentionedType",null==n?void 0:n.mentionedType,v.NUMBER),u("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,v.ARRAY),u("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,v.ARRAY),u("options.isVoipPush",null==n?void 0:n.isVoipPush,v.BOOLEAN),u("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,v.BOOLEAN),u("options.expansion",null==n?void 0:n.expansion,v.OBJECT),u("options.pushConfig",null==n?void 0:n.pushConfig,v.OBJECT),d="conversationType:"+o+",targetId:"+a,M.debug("send message ->"+d),(l=Object.assign(n,t)).channelId=i||"",[4,ae.imClient.context.sendMessage(o,a,l)]);case 1:return g=I.sent(),f=g.code,m=g.data,f===r.SUCCESS?(p=te(m),[2,{code:f,data:p}]):(M.warn("send message fail ->"+f+":"+re[f]+","+d),h={isMentioned:!!n.isMentioned,content:t.content,messageType:t.messageType,isPersited:t.isPersited||!1,isCounted:t.isCounted||!1,disableNotification:!!(null==n?void 0:n.disableNotification),canIncludeExpansion:!!(null==n?void 0:n.canIncludeExpansion),expansion:(null==n?void 0:n.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:ae.imClient.context.getCurrentUserId(),messageUId:"",messageDirection:N.SEND,sentTime:(null==m?void 0:m.sentTime)||0,receivedTime:0,isStatusMessage:n.isStatusMessage||!1,receivedStatus:c.UNREAD,isOffLineMessage:!1},o!==s.ULTRA_GROUP&&(h.isOffLineMessage=!1),[2,{code:f,msg:re[f],data:te(h)}])}}))}))}function fn(e,t,n){return gn(e,new _t(t),n)}function mn(e,t){return function(n,o,a,i){u("sendOptions.contentDisposition",null==i?void 0:i.contentDisposition,(function(e){return["inline","attachment"].includes(e)}));var s={contentDisposition:null==i?void 0:i.contentDisposition};if(i&&"thumbnailConfig"in i){var c=null==i?void 0:i.thumbnailConfig;u("sendOptions.maxHeight",null==c?void 0:c.maxHeight,v.NUMBER),u("sendOptions.maxWidth",null==c?void 0:c.maxWidth,v.NUMBER),u("sendOptions.quality",null==c?void 0:c.quality,v.NUMBER),u("sendOptions.scale",null==c?void 0:c.scale,v.NUMBER),s.thumbnailConfig=c}return new Promise((function(c){!function(e,t,n,o){var a,i=this;if(void 0===t&&(t=T.FILE),a=t===T.IMAGE?T.IMAGE:T.FILE,!Qt){Qt="upload.qiniup.com";var r=ae.imClient.context.getInfoFromCache();if(r&&r.ossConfig)try{var s=JSON.parse(r.ossConfig).find((function(e){return void 0!==e.qiniu}));s&&(Qt=s.qiniu)}catch(e){}}var c=U({domain:Qt,getToken:function(e){ae.imClient.context.getFileToken(a).then((function(t){e(t.token,t)})).catch((function(e){n.onFail(e)}))}},o);(a===T.IMAGE?cn:sn)(c,(function(o){o.upload(e,{onProgress:function(e,t){var o,a=Math.floor(e/t*100);null===(o=n.onProgress)||void 0===o||o.call(n,a)},onCompleted:function(o){return O(i,void 0,void 0,(function(){var i=this;return w(this,(function(r){return ln(a,o.filename,o.name,o,o.uploadMethod).then((function(r){return O(i,void 0,void 0,(function(){var i,s;return w(this,(function(c){return 0!==r.code?(n.onFail(r),[2]):((i=r.data).type=e.type,i.name=o.name||o.filename,t===T.AUDIO?("function"==typeof e.arrayBuffer?e.arrayBuffer().then(un).then((function(e){Object.assign(i,e),n.onSuccess(i)}),(function(){n.onSuccess(i)})):((s=new FileReader).onload=function(){s.result?un(s.result).then((function(e){Object.assign(i,e),n.onSuccess(i)}),(function(){n.onSuccess(i)})):n.onSuccess(i)},s.onerror=function(){i.duration=0,n.onSuccess(i)},s.readAsArrayBuffer(e)),[2]):(a===T.IMAGE&&(i.thumbnail=o.thumbnail),n.onSuccess(i),[2]))}))}))})).catch((function(e){n.onFail(e)})),[2]}))}))},onError:function(e){n.onFail(e)}})}))}(o.file,e,{onProgress:null==a?void 0:a.onProgress,onSuccess:function(e){var r,s=(null===(r=null==a?void 0:a.onComplete)||void 0===r?void 0:r.call(a,{url:e.downloadUrl}))||t(e,o);gn(n,s,i).then(c)},onFail:function(e){c({code:r.UPLOAD_FILE_FAILED,msg:e||r[r.UPLOAD_FILE_FAILED]})}},s)}))}}var pn=mn(T.FILE,(function(e,t){return new xt({name:e.name,size:t.file.size,type:t.file.type,fileUrl:e.downloadUrl,user:t.user,extra:t.extra})})),vn=mn(T.IMAGE,(function(e,t){return new Ot({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),hn=mn(T.AUDIO,(function(e,t){return new wt({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),In=mn(T.SIGHT,(function(e,t){return new Mt({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));function Sn(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s;return w(this,(function(c){switch(c.label){case 0:return u("options.timestamp",null==t?void 0:t.timestamp,v.NUMBER),u("options.count",null==t?void 0:t.count,v.NUMBER),u("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e})),u("conversation.channelId",null==e?void 0:e.channelId,v.CHANNEL_ID),n="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("get history message ->"+n),[4,ae.imClient.context.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId)];case 1:return o=c.sent(),a=o.code,i=o.data,a===r.SUCCESS&&i?(s=i.list.map((function(e){return te(e)})),[2,{code:a,data:{list:s,hasMore:i.hasMore}}]):(M.warn("get history message fail ->"+a+":"+re[a]+","+n),[2,{code:a,msg:re[a]}])}}))}))}function Cn(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s;return w(this,(function(c){switch(c.label){case 0:return u("options.timestamp",null==t?void 0:t.timestamp,v.NUMBER),u("options.count",null==t?void 0:t.count,v.NUMBER),u("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e})),u("conversation.channelId",null==e?void 0:e.channelId,v.CHANNEL_ID),n="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("get history message ->"+n),[4,ae.imClient.context.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return o=c.sent(),a=o.code,i=o.data,a===r.SUCCESS&&i?(s=i.list.map((function(e){return te(e)})),[2,{code:a,data:{list:s,hasMore:i.hasMore}}]):(M.warn("get history message fail ->"+a+":"+re[a]+","+n),[2,{code:a,msg:re[a]}])}}))}))}function Tn(e,t,n,o){return O(this,void 0,void 0,(function(){var a,i,r,c,u;return w(this,(function(d){switch(d.label){case 0:return a={targetId:e,conversationType:s.PRIVATE,channelId:o},i=new yt("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,gn(a,i)];case 1:return r=d.sent(),c=r.code,u=r.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}function En(e,t,n){return O(this,void 0,void 0,(function(){var o,a,i,r,c;return w(this,(function(d){switch(d.label){case 0:return u("messageUId",t,v.STRING,!0),u("channelId",n,v.CHANNEL_ID),o="messageUId:"+t+",targetId:"+e,M.debug("send read receipt message ->"+o),a=new yt("RC:RRReqMsg",{messageUId:t}),[4,gn({targetId:e,conversationType:s.GROUP,channelId:n},a)];case 1:return i=d.sent(),r=i.code,c=i.msg,0===r?[2,{code:r}]:[2,{code:r,msg:c}]}}))}))}function yn(e,t,n){return O(this,void 0,void 0,(function(){return w(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Nn(e,t,n){return O(this,void 0,void 0,(function(){var o,a,i,c,d,l,g;return w(this,(function(f){switch(f.label){case 0:return u("targetId",e,v.STRING,!0),u("messageList",t,v.OBJECT,!0),u("channelId",n,v.CHANNEL_ID),Object.keys(t).forEach((function(e){u(e,t[e],v.ARRAY)})),o={targetId:e,conversationType:s.GROUP,channelId:n},i=ae.imClient.context.getInfoFromCache(),0!==(c=(null==i?void 0:i.grpRRVer)||0)?[3,2]:(d=new yt("RC:RRRspMsg",{receiptMessageDic:t}),[4,gn(o,d)]);case 1:return a=f.sent(),[3,4];case 2:return 1!==c?[3,4]:(l=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===l.indexOf(e)&&l.push(e)}))})),l.length?[4,ae.imClient.context.sendReadReceiptMessage(e,l,n)]:(M.warn("Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 3:a=f.sent(),f.label=4;case 4:return(g=a.code)===r.SUCCESS?[2,{code:g}]:(M.warn("send read receipt message fail ->"+g+":"+re[g]),[2,{code:g,msg:re[g]}])}}))}))}function Rn(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i;return w(this,(function(r){switch(r.label){case 0:return u("conversation.type",e.conversationType,v.NUMBER,!0),u("conversation.targetId",e.targetId,v.STRING,!0),u("lastMessageSendTime",t,v.NUMBER,!0),u("conversation.channelId",null==e?void 0:e.channelId,v.CHANNEL_ID),n=new yt("RC:SRSMsg",{lastMessageSendTime:t}),[4,gn(e,n)];case 1:return o=r.sent(),a=o.code,i=o.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))}function Un(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s;return w(this,(function(c){switch(c.label){case 0:return u("options.messageUId",t.messageUId,v.STRING,!0),u("options.sentTime",t.sentTime,v.NUMBER,!0),u("options.disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN),u("options.pushConfig",null==t?void 0:t.pushConfig,v.OBJECT),u("conversation.channelId",null==e?void 0:e.channelId,v.CHANNEL_ID),n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra},o="conversationType:"+e.conversationType+",targetId:"+e.targetId+",messageUId:"+t.messageUId,M.debug("recall message ->"+o),[4,ae.imClient.context.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS&&s?[2,{code:i,data:te(s)}]:i===r.SUCCESS?[2,{code:i}]:(M.warn("recall message fail ->"+i+":"+re[i]+","+o),[2,{code:i,msg:re[i]}])}}))}))}function On(e,t){return O(this,void 0,void 0,(function(){var n,o;return w(this,(function(a){switch(a.label){case 0:return u("options",t,(function(e){return d(e)&&e.length}),!0),t.forEach((function(e){u("options.messageUId",e.messageUId,v.STRING,!0),u("options.sentTime",e.sentTime,v.NUMBER,!0),u("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)})),u("conversation.channelId",null==e?void 0:e.channelId,v.CHANNEL_ID),n="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("delete messages ->"+n),[4,ae.imClient.context.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(o=a.sent())!==r.SUCCESS?(M.warn("delete message fail ->"+o+":"+re[o]+","+n),[2,{code:o,msg:re[o]}]):[2,{code:r.SUCCESS}]}}))}))}function wn(e,t){return O(this,void 0,void 0,(function(){var n,o;return w(this,(function(a){switch(a.label){case 0:return u("options.timestamp",t,v.NUMBER,!0),u("conversation.channelId",null==e?void 0:e.channelId,v.CHANNEL_ID),n="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("clear message ->"+n),[4,ae.imClient.context.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(o=a.sent())!==r.SUCCESS?(M.warn("clear message ->"+o+":"+re[o]+","+n),[2,{code:o,msg:re[o]}]):[2,{code:r.SUCCESS}]}}))}))}function Mn(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s,c,d,l;return w(this,(function(g){switch(g.label){case 0:return u("expansion",e,v.OBJECT,!0),u("message",t,v.OBJECT,!0),n=t.conversationType,o=t.targetId,a=t.messageUId,i=t.canIncludeExpansion,s=t.expansion,c=t.channelId,d="conversationType:"+n+",targetId:"+o+",messageUId:"+a,M.debug("update message expansion ->"+d),[4,ae.imClient.context.sendExpansionMessage({conversationType:n,targetId:o,messageUId:a,expansion:e,canIncludeExpansion:i,originExpansion:s,channelId:c})];case 1:return(l=g.sent().code)!==r.SUCCESS?(M.warn("update message expansion fail ->"+l+":"+re[l]+","+d),[2,{code:l,msg:re[l]}]):[2,{code:l}]}}))}))}function _n(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s,c,d;return w(this,(function(l){switch(l.label){case 0:return u("keys",e,v.ARRAY,!0),u("message",t,v.OBJECT,!0),n=t.conversationType,o=t.targetId,a=t.messageUId,i=t.canIncludeExpansion,s=t.channelId,c="conversationType:"+n+",targetId:"+o+",messageUId:"+a,M.debug("remove message expansion ->"+c),[4,ae.imClient.context.sendExpansionMessage({conversationType:n,targetId:o,messageUId:a,canIncludeExpansion:i,keys:e,channelId:s})];case 1:return(d=l.sent().code)!==r.SUCCESS?(M.warn("remove message expansion fail ->"+d+":"+re[d]+","+c),[2,{code:d,msg:re[d]}]):[2,{code:d}]}}))}))}function An(e,t){return O(this,void 0,void 0,(function(){var n,o,a,i,s;return w(this,(function(c){switch(c.label){case 0:return u("typingContentType",t,v.STRING,!0),n="conversationType:"+e.conversationType+",targetId:"+e.targetId,M.debug("send typing status message ->"+n),o={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},[4,ae.imClient.context.sendMessage(e.conversationType,e.targetId,o)];case 1:return a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS?[2,{code:i,data:te(s)}]:(M.warn("send typing status message fail ->"+i+":"+re[i]+","+n),[2,{code:i,msg:re[i]}])}}))}))}function xn(e,t,n){return O(this,void 0,void 0,(function(){var o,a,i,s;return w(this,(function(c){switch(c.label){case 0:return u("messageUId",t,v.STRING,!0),o="messageUId:"+t+",targetId:"+e,M.debug("get message reader ->"+o),[4,ae.imClient.context.getMessageReader(e,t,n)];case 1:return a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS?[2,{code:i,data:s}]:(M.warn("get message reader fail ->"+i+":"+re[i]+","+o),[2,{code:i,msg:re[i]}])}}))}))}function bn(e,t,n,o,a){return u("messageType",e,v.STRING,!0),u("isPersited",t,v.BOOLEAN,!0),u("isCounted",n,v.BOOLEAN,!0),u("isStatusMessage",a,v.BOOLEAN,!1),ae.imClient.context.registerMessageType(e,t,n,o,a),Nt(e,t,n)}function Pn(e){return O(this,void 0,void 0,(function(){var t,n,o;return w(this,(function(a){switch(a.label){case 0:return y()?(u("conversation.conversationType",e.conversationType,v.NUMBER,!0),u("conversation.targetId",e.targetId,v.STRING,!0),u("conversation.channelId",null==e?void 0:e.channelId,v.CHANNEL_ID),[4,ae.imClient.context.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)]):[2,{code:r.NOT_SUPPORT,msg:re[r.NOT_SUPPORT]}];case 1:return t=a.sent(),n=t.code,o=t.data,n===r.SUCCESS?[2,{code:n,data:o}]:(M.warn("insertMessage ->code:"+n+",targetId:"+e.targetId),[2,{code:n,msg:re[n]}])}}))}))}function Ln(e,t,n){return void 0===n&&(n={}),O(this,void 0,void 0,(function(){var o,a,i,s,c,u,d,l,g,f,m,p,v,h,I,S;return w(this,(function(C){switch(C.label){case 0:return y()?(o=t.senderUserId,a=t.messageType,i=t.content,s=t.messageDirection,c=t.messageUId,u=t.canIncludeExpansion,d=t.expansion,l=t.disableNotification,g=t.sentTime,f=t.sentStatus,M.info("insertMessage ->targetId:"+e.targetId+",conversationType:"+e.conversationType),m=n.isUnread,p=n.searchContent,v={senderUserId:o,messageType:a,content:i,messageDirection:s,sentTime:g,sentStatus:f,searchContent:p,isUnread:m,messageUId:c,disableNotification:l,canIncludeExpansion:u,expansionMsg:JSON.stringify(d),channelId:e.channelId||""},[4,ae.imClient.context.insertMessage(e.conversationType,e.targetId,v)]):[2,{code:r.NOT_SUPPORT,msg:re[r.NOT_SUPPORT]}];case 1:return h=C.sent(),I=h.code,S=h.data,I===r.SUCCESS?[2,{code:I,data:te(S)}]:(M.warn("insertMessage ->code:"+I+",targetId:"+e.targetId),[2,{code:I,msg:re[I]}])}}))}))}function Gn(e){return O(this,void 0,void 0,(function(){var t,n,o;return w(this,(function(a){switch(a.label){case 0:return y()?[4,ae.imClient.context.getMessage(e)]:[2,{code:r.NOT_SUPPORT,msg:re[r.NOT_SUPPORT]}];case 1:return t=a.sent(),n=t.code,o=t.data,n===r.SUCCESS?[2,{code:n,data:te(o)}]:(M.warn("getMessage ->code:"+n+",messageId:"+e),[2,{code:n,msg:re[n]}])}}))}))}function Dn(e){if(!y())return{code:r.NOT_SUPPORT,msg:re[r.NOT_SUPPORT]};u("conversationType",e.conversationType,v.NUMBER,!0),u("targetId",e.targetId,v.STRING,!0);var t=ae.imClient.context.getUnreadMentionedMessages(e.conversationType,e.targetId),n=[];return t&&t.length&&t.forEach((function(e){return n.push(te(e))})),{code:r.SUCCESS,data:n}}function kn(e,t,n,o){return O(this,void 0,void 0,(function(){var a,i,s,c;return w(this,(function(d){switch(d.label){case 0:return y()?(u("conversationType",e.conversationType,v.NUMBER,!0),u("targetId",e.targetId,v.STRING,!0),u("keyword",t,v.STRING,!0),u("timestamp",n,v.NUMBER),u("count",o,v.NUMBER),1,[4,ae.imClient.context.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)]):[2,{code:r.NOT_SUPPORT,msg:re[r.NOT_SUPPORT]}];case 1:return a=d.sent(),i=a.code,s=a.data,i===r.SUCCESS?(c=[],(null==s?void 0:s.messages)&&s.messages.length&&s.messages.forEach((function(e){return c.push(te(e))})),[2,{code:i,data:{messages:c,count:null==s?void 0:s.count}}]):(M.warn("searchMessages ->code:"+i+",targetId:"+e.targetId),[2,{code:i,msg:re[i]}])}}))}))}function Hn(e,t,n){return O(this,void 0,void 0,(function(){var o;return w(this,(function(a){switch(a.label){case 0:return y()?(u("conversationType",e.conversationType,v.NUMBER,!0),u("targetId",e.targetId,v.STRING,!0),u("timestamp",t,v.NUMBER,!0),u("cleanSpace",n,v.BOOLEAN),[4,ae.imClient.context.deleteMessagesByTimestamp(e.conversationType,e.targetId,t,n,e.channelId)]):[2,{code:r.NOT_SUPPORT,msg:re[r.NOT_SUPPORT]}];case 1:return(o=a.sent())===r.SUCCESS?[2,{code:o}]:(M.warn("deleteLocalMessagesByTimestamp ->code:"+o+",targetId:"+e.targetId),[2,{code:o,msg:re[o]}])}}))}))}function Bn(e){return O(this,void 0,void 0,(function(){var t;return w(this,(function(n){switch(n.label){case 0:return y()?(M.info("clearMessages ->targetId:"+e.targetId+",conversationType:"+e.conversationType),[4,ae.imClient.context.clearMessages(e.conversationType,e.targetId,e.channelId)]):[2,{code:r.NOT_SUPPORT,msg:re[r.NOT_SUPPORT]}];case 1:return(t=n.sent())===r.SUCCESS?[2,{code:t}]:(M.warn("clearMessages ->code:"+t+",targetId:"+e.targetId),[2,{code:t,msg:re[t]}])}}))}))}function Fn(e,t,n,o){return O(this,void 0,void 0,(function(){var a,i,s;return w(this,(function(c){switch(c.label){case 0:return y()?(M.info("searchConversationByContent ->keyword:"+e),[4,ae.imClient.context.searchConversationByContent(e,n,o,t)]):[2,{code:r.NOT_SUPPORT,msg:re[r.NOT_SUPPORT]}];case 1:return a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS?[2,{code:i,data:s}]:(M.warn("searchConversationByContent ->code:"+i+",keyword:"+e),[2,{code:i,msg:re[i]}])}}))}))}function qn(e,t){return O(this,void 0,void 0,(function(){var n;return w(this,(function(o){switch(o.label){case 0:return y()?(M.info("clearUnreadCountByTimestamp ->targetId:"+e.targetId+",conversationType:"+e.conversationType),[4,ae.imClient.context.clearUnreadCountByTimestamp(e.conversationType,e.targetId,t,e.channelId)]):[2,{code:r.NOT_SUPPORT,msg:re[r.NOT_SUPPORT]}];case 1:return(n=o.sent())===r.SUCCESS?[2,{code:n}]:(M.warn("clearUnreadCountByTimestamp ->code:"+n+",targetId:"+e.targetId),[2,{code:n,msg:re[n]}])}}))}))}function Vn(e,t){return O(this,void 0,void 0,(function(){var n;return w(this,(function(o){switch(o.label){case 0:return y()?(u("messageId",e,v.NUMBER,!0),u("receivedStatus",t,v.NUMBER,!0),M.info("setMessageReceivedStatus ->messageId:"+e+",receivedStatus:"+t),[4,ae.imClient.context.setMessageReceivedStatus(e,t)]):[2,{code:r.NOT_SUPPORT,msg:re[r.NOT_SUPPORT]}];case 1:return(n=o.sent())===r.SUCCESS?[2,{code:n}]:(M.warn("setMessageReceivedStatus ->code:"+n+",messageId:"+e),[2,{code:n,msg:re[n]}])}}))}))}function zn(e){return O(this,void 0,void 0,(function(){var t;return w(this,(function(n){switch(n.label){case 0:return u("tag.tagId",e.tagId,v.STRING,!0),u("tag.tagId",e.tagId,(function(e){return e.length<=10})),u("tag.tagName",e.tagName,(function(e){return e.length<=15})),u("tag.tagName",e.tagName,v.STRING,!0),M.info("createTag ->tagId:"+e.tagId+",tagName:"+e.tagName),[4,ae.imClient.context.createTag(e)];case 1:return(t=n.sent().code)===r.SUCCESS?[2,{code:t}]:(M.warn("createTag ->code:"+t+",tagId:"+e.tagId),[2,{code:t,msg:re[t]}])}}))}))}function Kn(e){return O(this,void 0,void 0,(function(){var t;return w(this,(function(n){switch(n.label){case 0:return u("tagId",e,v.STRING,!0),M.info("removeTag ->tagId:"+e),[4,ae.imClient.context.removeTag(e)];case 1:return(t=n.sent().code)===r.SUCCESS?[2,{code:t}]:(M.warn("removeTag ->code:"+t+",tagId:"+e),[2,{code:t,msg:re[t]}])}}))}))}function Wn(e){return O(this,void 0,void 0,(function(){var t;return w(this,(function(n){switch(n.label){case 0:return u("tag.tagId",e.tagId,v.STRING,!0),u("tag.tagName",e.tagName,v.STRING,!0),u("tag.tagName",e.tagName,(function(e){return e.length<=15})),M.info("updateTag ->tagId:"+e.tagId+",tagName:"+e.tagName),[4,ae.imClient.context.updateTag(e)];case 1:return(t=n.sent().code)===r.SUCCESS?[2,{code:t}]:(M.warn("updateTag ->code:"+t+",tagId:"+e.tagId),[2,{code:t,msg:re[t]}])}}))}))}function Xn(){return O(this,void 0,void 0,(function(){var e,t,n;return w(this,(function(o){switch(o.label){case 0:return[4,ae.imClient.context.getTagList()];case 1:return e=o.sent(),t=e.code,n=e.data,t===r.SUCCESS?[2,{code:r.SUCCESS,data:n}]:(M.warn("getTagList ->code:"+t),[2,{code:t,msg:re[t]}])}}))}))}function jn(e){return O(this,void 0,void 0,(function(){var t,n,o;return w(this,(function(a){switch(a.label){case 0:return u("conversationType",e.conversationType,v.NUMBER),u("targetId",e.targetId,v.STRING),u("channelId",e.channelId,v.CHANNEL_ID),M.info("getTagsForConversation ->targetId:"+e.targetId+",conversationType:"+e.conversationType),[4,ae.imClient.context.getTagsForConversation(e)];case 1:return t=a.sent(),n=t.code,o=t.data,n===r.SUCCESS?[2,{code:n,data:o}]:[2,{code:n,msg:re[n]}]}}))}))}function Jn(e,t){return O(this,void 0,void 0,(function(){var n;return w(this,(function(o){switch(o.label){case 0:return u("tagId",e,v.STRING,!0),u("conversations",t,v.ARRAY,!0),t.forEach((function(e){u("conversation.conversationType",e.conversationType,v.NUMBER,!0),u("conversation.targetId",e.targetId,v.STRING,!0),u("conversation.channelId",e.channelId,v.CHANNEL_ID)})),M.info("addTagForConversations ->tagId:"+e),[4,ae.imClient.context.addTagForConversations(e,t)];case 1:return(n=o.sent().code)===r.SUCCESS?[2,{code:n}]:(M.warn("addTagForConversations ->code:"+n+",tagId:"+e),[2,{code:n,msg:re[n]}])}}))}))}function Yn(e,t){return O(this,void 0,void 0,(function(){var n;return w(this,(function(o){switch(o.label){case 0:return u("tagId",e,v.STRING,!0),u("conversations",t,v.ARRAY,!0),t.forEach((function(e){u("conversation.conversationType",e.conversationType,v.NUMBER,!0),u("conversation.targetId",e.targetId,v.STRING,!0),u("conversation.channelId",e.channelId,v.CHANNEL_ID)})),M.info("removeTagForConversations ->tagId:"+e),[4,ae.imClient.context.removeTagForConversations(e,t)];case 1:return(n=o.sent().code)===r.SUCCESS?[2,{code:n}]:(M.warn("removeTagForConversations ->code:"+n+",tagId:"+e),[2,{code:n,msg:re[n]}])}}))}))}function Qn(e,t){return O(this,void 0,void 0,(function(){var n;return w(this,(function(o){switch(o.label){case 0:return u("conversation.conversationType",e.conversationType,v.NUMBER,!0),u("conversation.targetId",e.targetId,v.STRING,!0),u("conversation.channelId",e.channelId,v.CHANNEL_ID),u("tagIds",t,v.ARRAY,!0),t.forEach((function(e){u("tagId",e,v.STRING,!0)})),M.info("removeTagsForConversation ->tagIds:"+t+",targetId:"+e.targetId+",conversationType:"+e.conversationType),[4,ae.imClient.context.removeTagsForConversation(e,t)];case 1:return(n=o.sent().code)===r.SUCCESS?[2,{code:n}]:(M.warn("removeTagsForConversation ->code:"+n+",tagIds:"+t),[2,{code:n,msg:re[n]}])}}))}))}function Zn(e,t){return O(this,void 0,void 0,(function(){var n;return w(this,(function(o){switch(o.label){case 0:return u("tagId",e,v.STRING,!0),u("conversations",t,v.ARRAY,!0),t.forEach((function(e){u("conversation.conversationType",e.conversationType,v.NUMBER,!0),u("conversation.targetId",e.targetId,v.STRING,!0),u("conversation.channelId",e.channelId,v.CHANNEL_ID)})),M.info("removeTagForConversations ->tagId:"+e),[4,ae.imClient.context.removeTagForConversations(e,t)];case 1:return(n=o.sent().code)===r.SUCCESS?[2,{code:n}]:(M.warn("removeTagForConversations ->code:"+n+",tagId:"+e),[2,{code:n,msg:re[n]}])}}))}))}function $n(e,t,n){return O(this,void 0,void 0,(function(){var o,a,i;return w(this,(function(s){switch(s.label){case 0:return u("tagId",e,v.STRING,!0),u("count",t,v.NUMBER,!0),u("startTime",n,v.NUMBER,!0),M.info("getConversationListByTag ->tagId:"+e),[4,ae.imClient.context.getConversationListByTag(e,n,t)];case 1:return o=s.sent(),a=o.code,i=o.data,a===r.SUCCESS?[2,{code:a,data:i}]:(M.warn("getConversationListByTag ->code:"+a+",tagId:"+e),[2,{code:a,msg:re[a]}])}}))}))}function eo(e,t){return O(this,void 0,void 0,(function(){var n,o,a;return w(this,(function(i){switch(i.label){case 0:return u("tagId",e,v.STRING,!0),u("containMuted",t,v.BOOLEAN,!0),M.info("getUnreadCountByTag ->tagId:"+e),[4,ae.imClient.context.getUnreadCountByTag(e,t)];case 1:return n=i.sent(),o=n.code,a=n.data,M.info(o,a),o===r.SUCCESS?[2,{code:o,data:a}]:(M.warn("getUnreadCountByTag ->code:"+o+",tagId:"+e),[2,{code:o,msg:re[o]}])}}))}))}function to(e,t,n){return O(this,void 0,void 0,(function(){var o,a;return w(this,(function(i){switch(i.label){case 0:return u("tagId",e,v.STRING,!0),u("conversation.targetId",t.targetId,v.STRING,!0),u("conversation.conversationType",t.conversationType,v.NUMBER,!0),u("conversation.channelId",t.channelId,v.CHANNEL_ID),u("status.isTop",n,v.BOOLEAN,!0),M.info("setConversationStatusInTag ->tagId:"+e+",targetId:"+t.targetId+",conversationType"+t.conversationType),[4,ae.imClient.context.setConversationStatusInTag(e,t,{isTop:n})];case 1:return o=i.sent(),(a=o.code)===r.SUCCESS?[2,{code:a}]:(M.warn("setConversationStatusInTag ->code:"+a+",tagId:"+e),[2,{code:a,msg:re[a]}])}}))}))}mn(T.COMBINE_HTML,(function(e,t){return new At({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var no={COMET:"comet",WEBSOCKET:"websocket"},oo={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};p.add("imlib-next","5.3.0");export{yt as BaseMessage,At as CombineMessage,no as ConnectType,x as Events,xt as FileMessage,bt as GIFMessage,wt as HQVoiceMessage,Ot as ImageMessage,Lt as LocationMessage,oo as MessageType,Gt as ReferenceMessage,Dt as RichContentMessage,Mt as SightMessage,_t as TextMessage,Pt as VoiceMessage,ye as __addSDKVersion,Jn as addConversationsToTag,Ie as addEventListener,zn as addTag,Et as bindRTCRoomForChatroom,be as clearAllMessagesUnreadStatus,Ee as clearEventListeners,wn as clearHistoryMessages,Bn as clearMessages,xe as clearMessagesUnreadStatus,Me as clearTextMessageDraft,qn as clearUnreadCountByTimestamp,fe as connect,Hn as deleteLocalMessagesByTimestamp,On as deleteMessages,me as disconnect,It as forceRemoveChatRoomEntry,pt as forceSetChatRoomEntry,Ct as getAllChatRoomEntries,Ke as getAllConversationState,it as getAllUltraGroupUnreadCount,rt as getAllUltraGroupUnreadMentionedCount,ze as getAllUnreadMentionedCount,Xe as getBlockUltraGroupList,Be as getBlockedConversationList,St as getChatRoomEntry,gt as getChatRoomInfo,Tt as getChatroomHistoryMessages,pe as getConnectionStatus,Re as getConversation,Ne as getConversationList,ke as getConversationNotificationLevel,He as getConversationNotificationStatus,$n as getConversationsFromTagByPage,he as getCurrentUserId,dn as getFileToken,ln as getFileUrl,Pn as getFirstUnreadMessage,Sn as getHistoryMessages,Gn as getMessage,xn as getMessageReader,Cn as getRemoteHistoryMessages,ve as getServerTime,Xn as getTags,jn as getTagsFromConversation,Oe as getTextMessageDraft,qe as getTopConversationList,_e as getTotalUnreadCount,nt as getUltraGroupDefaultNotificationLevel,We as getUltraGroupList,Je as getUltraGroupMessageListByMessageUId,at as getUltraGroupUnreadCountByTargetId,et as getUltraGroupUnreadMentionedCountByTargetId,Ae as getUnreadCount,eo as getUnreadCountByTag,Ve as getUnreadMentionedCount,Dn as getUnreadMentionedMessages,le as init,Ln as insertMessage,ge as installPlugin,ut as joinChatRoom,dt as joinExistChatRoom,$e as modifyMessage,Se as onceEventListener,lt as quitChatRoom,Un as recallMessage,bn as registerMessageType,Ze as removeAllExpansionForUltraGroupMessage,ht as removeChatRoomEntries,vt as removeChatRoomEntry,Ue as removeConversation,Yn as removeConversationsFromTag,Ce as removeEventListener,Te as removeEventListeners,Qe as removeExpansionForUltraGroupMessage,_n as removeMessageExpansionForKey,Kn as removeTag,Zn as removeTagFromConversations,Qn as removeTagsFromConversation,we as saveTextMessageDraft,Fn as searchConversationByContent,kn as searchMessages,pn as sendFileMessage,hn as sendHQVoiceMessage,vn as sendImageMessage,gn as sendMessage,Tn as sendReadReceiptMessage,En as sendReadReceiptRequest,yn as sendReadReceiptResponse,Nn as sendReadReceiptResponseV2,In as sendSightMessage,Rn as sendSyncReadStatusMessage,fn as sendTextMessage,An as sendTypingStatusMessage,je as sendUltraGroupTypingStatus,mt as setChatRoomEntries,ft as setChatRoomEntry,Ge as setConversationNotificationLevel,De as setConversationNotificationStatus,Fe as setConversationToTop,to as setConversationToTopInTag,Vn as setMessageReceivedStatus,ot as setUltraGroupDefaultNotificationLevel,Ye as updateExpansionForUltraGroupMessage,Mn as updateMessageExpansion,Wn as updateTag};