@rongcloud/imlib-next 5.46.0-c-tmp-alpha.1 → 5.46.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/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import{ConversationType as e,EventEmitter as t,RCConnectionStatus as n,VersionManage as i,assert as o,AssertRules as r,isArray as s,isHttpUrl as a,LogDBProxy as u,APIContext as d,fail as c,ErrorCode as l,ok as f,LogTagId as v,MessageType as h,getMessageTypeDescription as g,MAX_UPLOAD_FILE_SIZE as E,UPLOAD_FILE_CHUNK_SIZE as m,httpRequest as p,fixUrlProtocol as S,UploadMethod as _,UUId as T,FileType as I,promiseWithResolvers as C,MAX_MESSAGE_CONTENT_BYTES as A,Validator as R,validate as N,MessageDirection as M,ReceivedStatus as U,SentStatus as O,NotificationStatus as x,trans2NotificationLevel as y,trans2NotificationStatus as P,transformReceivedStatusFlag as D,MAX_U32_INTEGER as L,usingCppEngine as b}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ConversationUnreadCountFilter,DirectionType,ErrorCode,FileType,FilterRobotType,FriendAddPermission,FriendApplicationStatus,FriendApplicationType,FriendRelationType,GroupApplicationDirection,GroupApplicationStatus,GroupApplicationType,GroupInviteHandlePermission,GroupJoinPermission,GroupMemberInfoEditPermission,GroupMemberRole,GroupOperation,GroupOperationPermission,GroupReadReceiptVersion,InterruptionLevel,LogL,LogLevel,MentionedType,MessageAuditType,MessageBlockSourceType,MessageBlockType,MessageDirection,MessageReactionOperationType,MessageType,NotificationLevel,NotificationStatus,OnlineStatus,OperateStatus,Platform,Platform as PlatformInfo,PushImportanceHonor,PushNotificationQuietHoursLevel,QueryFriendsDirectionType,QuoteMessageStatus,RCConnectionStatus,ReceivedStatus,ReferenceMessageStatus,SentStatus,SpeechToTextStatus,StreamMessageResponseEventType,SubscribeOperationType,SubscribeType,TranslateMessageParam,TranslateMode,TranslateStatus,TranslateStrategy,TranslateTextParam,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod,UserProfileVisibility,UserSettingsChangedKey,UserType,createLogDBProxy,fail,ok}from"@rongcloud/engine";
1
+ import{ConversationType as e,EventEmitter as t,RCConnectionStatus as n,VersionManage as i,assert as o,AssertRules as r,isArray as s,isHttpUrl as a,LogDBProxy as u,APIContext as d,fail as c,ErrorCode as l,ok as f,LogTagId as v,MessageType as g,getMessageTypeDescription as h,MAX_UPLOAD_FILE_SIZE as E,UPLOAD_FILE_CHUNK_SIZE as m,httpRequest as p,fixUrlProtocol as S,UploadMethod as _,UUId as T,FileType as I,promiseWithResolvers as C,MAX_MESSAGE_CONTENT_BYTES as A,Validator as R,validate as N,MessageDirection as M,ReceivedStatus as U,SentStatus as O,NotificationStatus as x,trans2NotificationLevel as y,trans2NotificationStatus as P,transformReceivedStatusFlag as D,MAX_U32_INTEGER as L,usingCppEngine as b}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ConversationUnreadCountFilter,DirectionType,ErrorCode,FileType,FilterRobotType,FriendAddPermission,FriendApplicationStatus,FriendApplicationType,FriendRelationType,GroupApplicationDirection,GroupApplicationStatus,GroupApplicationType,GroupInviteHandlePermission,GroupJoinPermission,GroupMemberInfoEditPermission,GroupMemberRole,GroupOperation,GroupOperationPermission,GroupReadReceiptVersion,InterruptionLevel,LogL,LogLevel,MentionedType,MessageAuditType,MessageBlockSourceType,MessageBlockType,MessageDirection,MessageReactionOperationType,MessageType,NotificationLevel,NotificationStatus,OnlineStatus,OperateStatus,Platform,Platform as PlatformInfo,PushImportanceHonor,PushNotificationQuietHoursLevel,QueryFriendsDirectionType,QuoteMessageStatus,RCConnectionStatus,ReceivedStatus,ReferenceMessageStatus,SentStatus,SpeechToTextStatus,StreamMessageResponseEventType,SubscribeOperationType,SubscribeType,TranslateMessageParam,TranslateMode,TranslateStatus,TranslateStrategy,TranslateTextParam,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod,UserProfileVisibility,UserSettingsChangedKey,UserType,createLogDBProxy,fail,ok}from"@rongcloud/engine";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function G(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{u(i.next(e))}catch(e){r(e)}}function a(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}function F(e){return Object.assign(Object.assign({},e),{channelId:e.channelId||""})}function H(t){const{conversationType:n,targetId:i,latestMessage:o,unreadMessageCount:r,hasMentioned:s,mentionedInfo:a,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:h,operationTime:g,draft:E,translateStrategy:m,editedMessageDraft:p,includeRobot:S,dataMgmtInfo:_}=t,T=o&&F(o);let I;I=s?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0;const C={conversationType:n,targetId:i,latestMessage:T,unreadMessageCount:r,hasMentioned:s,mentionedInfo:I,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:h,operationTime:g,draft:E||"",translateStrategy:m,editedMessageDraft:p,includeRobot:S,dataMgmtInfo:_};return C.conversationType===e.ULTRA_GROUP&&(C.firstUnreadMessage=t.firstUnreadMessage,C.channelType=t.channelType,C.unreadMentionedMeCount=t.unreadMentionedMeCount),C}function B(e,t){null===console||void 0===console||console.warn(`Method '${e}' is deprecated, please use '${t}' instead`)}var w;!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.MESSAGE_READ_RECEIPT_V4="MESSAGE_READ_RECEIPT_V4",e.SYNC_READ_STATUS="SYNC_READ_STATUS",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.USER_SETTINGS_SYNCED="USER_SETTINGS_SYNCED",e.USER_SETTINGS_CHANGED="USER_SETTINGS_CHANGED",e.CONVERSATIONS_SETTINGS_SYNCED="CONVERSATIONS_SETTINGS_SYNCED",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.CONVERSATIONS_SYNCED="CONVERSATIONS_SYNCED",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.USER_GROUP_STATUS="USER_GROUP_STATUS",e.SUBSCRIBED_USER_STATUS_CHANGE="SUBSCRIBED_USER_STATUS_CHANGE",e.SUBSCRIBED_RELATION_CHANGE="SUBSCRIBED_RELATION_CHANGE",e.SYNC_SUBSCRIBED_USER_STATUS_FINISHED="SYNC_SUBSCRIBED_USER_STATUS_FINISHED",e.OWN_USER_PROFILE_CHANGED="OWN_USER_PROFILE_CHANGED",e.GROUP_OPERATION="GROUP_OPERATION",e.GROUP_INFO_CHANGED="GROUP_INFO_CHANGED",e.GROUP_MEMBER_INFO_CHANGED="GROUP_MEMBER_INFO_CHANGED",e.GROUP_APPLICATION_EVENT="GROUP_APPLICATION_EVENT",e.GROUP_REMARK_CHANGED_SYNC="GROUP_REMARK_CHANGED_SYNC",e.GROUP_FOLLOWS_CHANGED_SYNC="GROUP_FOLLOWS_CHANGED_SYNC",e.FRIEND_ADDED="FRIEND_ADDED",e.FRIEND_DELETE="FRIEND_DELETE",e.FRIEND_APPLICATION_STATUS_CHANGED="FRIEND_APPLICATION_STATUS_CHANGED",e.FRIEND_CLEARED="FRIEND_CLEARED",e.FRIEND_INFO_CHANGED_SYNC="FRIEND_INFO_CHANGED_SYNC",e.DATABASE_OPENED="DATABASE_OPENED",e.DATABASE_UPGRADE_WILL_START="DATABASE_UPGRADE_WILL_START",e.DATABASE_UPGRADING="DATABASE_UPGRADING",e.DATABASE_UPGRADE_DID_COMPLETE="DATABASE_UPGRADE_DID_COMPLETE",e.STREAM_MESSAGE_RESPONSE="STREAM_MESSAGE_RESPONSE",e.MESSAGE_RECEIPT_RESPONSE_V5="MESSAGE_RECEIPT_RESPONSE_V5",e.SPEECH_TO_TEXT_RESPONSE="SPEECH_TO_TEXT_RESPONSE",e.TRANSLATE_RESPONSE="TRANSLATE_RESPONSE",e.MESSAGE_MODIFIED="MESSAGE_MODIFIED",e.MESSAGE_MODIFIED_SYNC_COMPLETED="MESSAGE_MODIFIED_SYNC_COMPLETED",e.ROBOTS_SYNCED="ROBOTS_SYNCED",e.SYNC_SERVER_SAVE_UNREAD_COMPLETED="SYNC_SERVER_SAVE_UNREAD_COMPLETED",e.MESSAGE_REACTION_CHANGED="MESSAGE_REACTION_CHANGED"}(w||(w={}));const k=new t,V={connection(e,t){switch(e){case n.CONNECTED:k.emit(w.CONNECTED);break;case n.CONNECTING:k.emit(w.CONNECTING);break;case n.SUSPENDED:k.emit(w.SUSPEND,t);break;case n.DISCONNECTED:k.emit(w.DISCONNECT,t)}},batchMessage:e=>{k.emit(w.MESSAGES,{messages:e.map((e=>F(e)))})},typingState:e=>{k.emit(w.TYPING_STATUS,{status:e})},readReceiptReceived:(e,t,n,i)=>{k.emit(w.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:i})},messageReceiptRequest:(e,t,n)=>{k.emit(w.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:(e,t,n)=>{k.emit(w.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:t=>{const n=t.map((({conversation:t,updatedItems:n})=>{const{conversationType:i}=t,o=H(t);return i===e.ULTRA_GROUP&&(o.versionTime=t.versionTime,o.unreadMessageCount=j(t.unreadMessageCount||0),o.unreadMentionedCount=j(t.unreadMentionedCount||0),o.unreadMentionedMeCount=j(t.unreadMentionedMeCount||0)),{conversation:o,updatedItems:n}}));k.emit(w.CONVERSATION,{conversationList:n})},chatroomState:e=>{k.emit(w.CHATROOM,e)},expansion:e=>{k.emit(w.EXPANSION,e)},pullFinished:()=>{k.emit(w.PULL_OFFLINE_MESSAGE_FINISHED)},tag:()=>{k.emit(w.TAG)},userSettingsSynced:e=>{k.emit(w.USER_SETTINGS_SYNCED,e)},userSettingsChanged:e=>{k.emit(w.USER_SETTINGS_CHANGED,e)},conversationStatusSynced:e=>{k.emit(w.CONVERSATIONS_SETTINGS_SYNCED,e)},robotsSynced:(e,t)=>{k.emit(w.ROBOTS_SYNCED,e,t)},conversationTagChanged:()=>{k.emit(w.CONVERSATION_TAG)},messageBlocked:e=>{k.emit(w.MESSAGE_BLOCKED,e)},ultraGroupEnable:()=>{k.emit(w.ULTRA_GROUP_ENABLE)},sgRelationsSynced:e=>{k.emit(w.CONVERSATIONS_SYNCED,e)},operateStatus:e=>{k.emit(w.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:e=>{k.emit(w.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((e=>F(e))))},ultraGroupMessageRecalled:e=>{k.emit(w.ULTRA_GROUP_MESSAGE_RECALLED,e.map((e=>F(e))))},ultraGroupChannelChangeType:e=>{k.emit(w.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:e=>{k.emit(w.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:e=>{k.emit(w.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:e=>{k.emit(w.USER_GROUP_STATUS,e)},messageReadReceipt:e=>{k.emit(w.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:e=>{k.emit(w.SYNC_READ_STATUS,e)},subscribedUserStatusChange:e=>{k.emit(w.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:e=>{k.emit(w.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:e=>{k.emit(w.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:e=>{k.emit(w.OWN_USER_PROFILE_CHANGED,e)},groupOperation:e=>{k.emit(w.GROUP_OPERATION,e)},groupInfoChanged:e=>{k.emit(w.GROUP_INFO_CHANGED,e)},groupMemberInfoChanged:e=>{k.emit(w.GROUP_MEMBER_INFO_CHANGED,e)},groupApplicationEvent:e=>{k.emit(w.GROUP_APPLICATION_EVENT,e)},groupRemarkChangedSync:e=>{k.emit(w.GROUP_REMARK_CHANGED_SYNC,e)},groupFollowsChangedSync:e=>{k.emit(w.GROUP_FOLLOWS_CHANGED_SYNC,e)},friendAdd:e=>{k.emit(w.FRIEND_ADDED,e)},friendDelete:e=>{k.emit(w.FRIEND_DELETE,e)},friendApplicationStatusChanged:e=>{k.emit(w.FRIEND_APPLICATION_STATUS_CHANGED,e)},friendCleared:e=>{k.emit(w.FRIEND_CLEARED,e)},friendInfoChangedSync:e=>{k.emit(w.FRIEND_INFO_CHANGED_SYNC,e)},databaseOpened:(e,t)=>{k.emit(w.DATABASE_OPENED,e,t)},databaseUpgradeWillStart:()=>{k.emit(w.DATABASE_UPGRADE_WILL_START)},databaseUpgrading:e=>{k.emit(w.DATABASE_UPGRADING,e)},databaseUpgradeDidComplete:e=>{k.emit(w.DATABASE_UPGRADE_DID_COMPLETE,e)},readReceiptResponseV5:e=>{k.emit(w.MESSAGE_RECEIPT_RESPONSE_V5,e)},speechToTextResponse:e=>{k.emit(w.SPEECH_TO_TEXT_RESPONSE,e)},translateResponse:e=>{k.emit(w.TRANSLATE_RESPONSE,e)},messagesModified:e=>{k.emit(w.MESSAGE_MODIFIED,e.map((e=>F(e))))},messageModifiedSyncCompleted:()=>{k.emit(w.MESSAGE_MODIFIED_SYNC_COMPLETED)},syncServerSaveUnreadCompleted:()=>{k.emit(w.SYNC_SERVER_SAVE_UNREAD_COMPLETED)},messageReaction(e){k.emit(w.MESSAGE_REACTION_CHANGED,e)}};function j(e){return e>999?999:e}i.add("imlib-next","5.46.0-c-tmp-alpha.1");let Y=null,z=null,$=null;function q(e){if(!Y)throw new Error("Not initialized yet!");return e(Y,$,z)}function W(){return Y?f(Y):c(l.BIZ_ERROR_CLIENT_NOT_INIT)}function X(e,t){return q((n=>n.install(e,t)))}let Q=0;const K=new Map;function J(e,t){const n=(...e)=>{const i=[],o=[];[...K.values()].forEach((([e,t,r])=>{e===n&&(o.push(t),r&&i.push(r))})),i.forEach((t=>{e=t(e)}));const r=t(...e);return o.forEach((t=>{t(e,r)})),r};return Object.defineProperty(n,"original",{value:t,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"monitorable",{value:!0,writable:!1,enumerable:!1,configurable:!1}),n}function Z(e,t,n){if(!e.monitorable)throw new Error(`Not monitorable API: ${e.name}`);const i=++Q;return K.set(i,[e,t,n]),i}function ee(e){K.delete(e)}function te(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.connect(e,!!t)))).trans((e=>({userId:e})))}))}const ne=J("disconnect",((e,t)=>q((n=>n.disconnect(e,t)))));function ie(e,t,n){k.on(e,t,n)}function oe(e,t,n){k.once(e,t,n)}function re(e,t,n){k.off(e,t,n)}function se(e){k.removeAll(e)}function ae(){k.clear()}class ue{constructor(e,t,n=!0,i=!0){Object.defineProperty(this,"messageType",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"isPersited",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isCounted",{enumerable:!0,configurable:!0,writable:!0,value:i})}}class de extends ue{constructor(e,t,n){super(e,n,t.isPersited,t.isCounted)}}class ce extends de{constructor(e){super(h.COMBINE,g(h.COMBINE),e)}}class le extends de{constructor(e){super(h.COMBINE_V2,g(h.COMBINE_V2),e)}}class fe extends de{constructor(e){super(h.COMMAND,g(h.COMMAND),e)}}class ve extends de{constructor(e){super(h.FILE,g(h.FILE),e)}}class he extends de{constructor(e){super(h.GIF,g(h.GIF),e)}}const ge=h.GROUP_NOTIFICATION;class Ee extends de{constructor(e){super(ge,g(ge),e)}}class me extends de{constructor(e){super(h.IMAGE,g(h.IMAGE),e)}}const pe=h.INFORMATION_NOTIFICATION;class Se extends de{constructor(e){super(pe,g(pe),e)}}class _e extends de{constructor(e){super(h.LOCATION,g(h.LOCATION),e)}}class Te extends de{constructor(e){super(h.REFERENCE,g(h.REFERENCE),e)}}class Ie extends de{constructor(e){super(h.RICH_CONTENT,g(h.RICH_CONTENT),e)}}class Ce extends de{constructor(e){super(h.SIGHT,g(h.SIGHT),e)}}class Ae extends de{constructor(e){super(h.TEXT,g(h.TEXT),e)}}class Re extends de{constructor(e){super(h.HQ_VOICE,g(h.HQ_VOICE),e)}}class Ne extends de{constructor(e){super(h.VOICE,g(h.VOICE),e)}}var Me;!function(e){e.ALIYUN="aliyun",e.S3="s3",e.MINIO="minio",e.QINIU="qiniu",e.RCX="rcx"}(Me||(Me={}));class Ue{constructor(e,t,n){Object.defineProperty(this,"_url",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_authInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_getFileToken",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isAbort",{enumerable:!0,configurable:!0,writable:!0,value:!1})}isAbort(){return this._isAbort}abort(){this._isAbort=!0,this._abortHandler()}upload(e){return e.file.size>E?Promise.resolve(c(l.UPLOAD_FAIL,"the file size is over 5GB!")):e.file.size>m&&this.multipartUpload?this.multipartUpload(e):this.commonUpload(e)}}function Oe(e){return Math.ceil(e/1024)||0}const xe={[Me.QINIU]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t),this._promise=p({url:S(this._url),headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:s}=yield this._promise.result();return this._promise=null,200===s||204===s?f({uniqueName:o.fileName,uploadMethod:_.QINIU}):c(l.UPLOAD_FAIL,s.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.ALIYUN]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=S(`${o.ossBucketName}.${this._url}`),s=new FormData;s.set("token",o.token),s.set("OSSAccessKeyId",o.osskeyId),s.set("policy",o.ossPolicy),s.set("Signature",o.ossSign),s.set("success_action_status","200"),s.set("key",o.fileName),s.set("file",t),this._promise=p({url:r,onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:s,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?f({uniqueName:o.fileName,uploadMethod:_.ALI}):c(l.UPLOAD_FAIL,a.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.S3]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i,contentDisposition:o}=e;let r=this._authInfo;const s=S(`${r.s3BucketName}.${this._url}`),a=new FormData;o?a.set("Content-Disposition",o):a.set("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),a.set("Content-Type",t.type),a.set("x-amz-credential",r.s3Credential),a.set("x-amz-algorithm",r.s3Algorithm),a.set("x-amz-date",r.s3Date),a.set("policy",r.s3Policy),a.set("x-amz-signature",r.s3Signature),a.set("key",r.fileName),a.set("file",t),this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:a,timeout:0});const{status:u,data:d}=yield this._promise.result();return this._promise=null,200===u||204===u?f({uniqueName:r.fileName,uploadMethod:_.AWS}):c(l.UPLOAD_FAIL,u.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.MINIO]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>G(this,void 0,void 0,(function*(){var t;const{file:n,fileType:i}=e;let o=yield this._getFileToken(i,n.name,"POST","uploads",void 0,Oe(n.size));if(!o.isOk)return o.wipe();let r=o.data;const s=S(`${this._url}/${r.minioBucketName}/${r.fileName}`),a=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploads`,headers:a,method:"POST"});const{status:u,data:d}=yield this._promise.result();this._promise=null;const v=null===(t=null==d?void 0:d.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===t?void 0:t[1];if(200!==u&&204!==u||!v)return c(l.UPLOAD_FAIL,"start upload fail");const h=[],g=yield this.requestUploadPart(s,n,v,r.fileName,e,h);if(!g.isOk)return g.wipe();if(o=yield this._getFileToken(i,r.fileName,"POST",`uploadId=${v}`,void 0,Oe(n.size)),!o.isOk)return o.wipe();r=o.data;let E=h.map(((e,t)=>`<Part><PartNumber>${t+1}</PartNumber><ETag>${e}</ETag></Part>`)).join("");E=`<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>${E}</CompleteMultipartUpload>`;const m=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploadId=${v}`,headers:m,method:"POST",body:E,timeout:0});const{status:T}=yield this._promise.result();return this._promise=null,200===T||204===T?f({uniqueName:r.fileName,uploadMethod:_.MINIO}):c(l.UPLOAD_FAIL,"end upload fail")}))})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=S(`${this._url}/${o.minioBucketName}/${o.fileName}`),s=this.getBaseHeaders(t,o,e);this._promise=p({url:r,headers:s,onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"PUT",body:t,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?f({uniqueName:o.fileName,uploadMethod:_.MINIO}):c(l.UPLOAD_FAIL,a.toString())}))}requestUploadPart(e,t,n,i,o,r,s=1,a=0){return G(this,void 0,void 0,(function*(){if(a>=5)return c(l.UPLOAD_FAIL,"Upload retry times exceeded 5. Procedure");const u=(s-1)*m,d=Math.min(m,t.size-u),v=`partNumber=${s}&uploadId=${n}`,h=yield this._getFileToken(o.fileType,i,"PUT",v,void 0,Oe(t.size));if(!h.isOk)return h.wipe();const g=h.data,E=t.slice(u,s*m),S=this.getBaseHeaders(t,g,o);this._promise=p({url:`${e}?${v}`,headers:S,method:"PUT",body:E,timeout:0,onProgress:e=>{var n;return null===(n=null==o?void 0:o.onProgress)||void 0===n?void 0:n.call(o,u+e.loaded,t.size)}});const{status:_,xhr:T}=yield this._promise.result();return this._promise=null,200===_||204===_?(r.push((null==T?void 0:T.getResponseHeader("ETag"))||""),u+d<t.size?this.requestUploadPart(e,t,n,i,o,r,s+1,0):f()):this.requestUploadPart(e,t,n,i,o,r,s,a+1)}))}getBaseHeaders(e,t,n){const{contentDisposition:i}=n;return{"Content-Disposition":`${i||("text/html"===e.type?"inline":"attachment")}; filename=${encodeURIComponent(e.name)};`,Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.RCX]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e,o=T.gen();let r=this._authInfo;return this._requestUploadPart(o,t,r.token,n)}))})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t);const s=S(this._url);this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:a,data:u}=yield this._promise.result();if(this._promise=null,(200===a||204===a)&&u){const e=JSON.parse(u);return f({uniqueName:e.rc_url.file_name,downloadUrl:`${s}/${e.rc_url.path}`,uploadMethod:_.QINIU})}return c(l.UPLOAD_FAIL,a.toString())}))}_requestUploadPart(e,t,n,i,o=0){return G(this,void 0,void 0,(function*(){const r=Math.min(m,t.size-o),s=e+t.name.substring(t.name.lastIndexOf(".")),a={Range:`bytes=${o}-${o+r}`,"X-File-TransactionId":s,"X-File-Total-Size":t.size.toString()},u=t.slice(o,o+r),d=new FormData;d.set("file",u,t.name),d.set("key",s),d.set("name",s),d.set("token",n);const v=S(this._url);this._promise=p({url:v,headers:a,onProgress:e=>null==i?void 0:i(o+e.loaded,t.size),method:"POST",body:d,timeout:0});const{status:h,data:g}=yield this._promise.result();if(this._promise=null,200===h||204===h){if(o+r<t.size)return this._requestUploadPart(e,t,n,i,o+r);const s=JSON.parse(g);return f({uniqueName:s.rc_url.file_name,downloadUrl:`${v}/${s.rc_url.path}`,uploadMethod:_.QINIU})}return c(l.UPLOAD_FAIL,h.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}}};function ye(e,t,n){const{promise:i,resolve:o}=C(),r=document.createElement("canvas"),s=r.getContext("2d"),a=new Image;return a.onload=e=>{const{maxHeight:i=160,maxWidth:u=160,quality:d=1,scale:c=1}=n||{},l=De(a.width,a.height,{maxHeight:i,maxWidth:u,scale:c});r.width=Math.min(l.w,u),r.height=Math.min(l.h,i),s.drawImage(a,l.x,l.y,l.w,l.h);let v=Pe(r,d);v=v.replace(/data:image\/[^;]+;base64,/,""),o(f(Object.assign(Object.assign({},t),{thumbnail:v,width:Math.ceil(l.w),height:Math.ceil(l.h)})))},a.onerror=e=>{o(c(l.UPLOAD_FAIL,`get image info fail:${JSON.stringify(e)}`))},a.src=(window.URL||window.webkitURL).createObjectURL(e),i}function Pe(e,t){let n=e.toDataURL("image/jpeg",t);return n.length>A-10240?Pe(e,t-.1):n}const De=(e,t,n)=>{const{maxHeight:i=160,maxWidth:o=160,scale:r=1}=n,s=e<t;let a,u,d,c=0,l=0;return(s?t/e:e/t)>r?(s?(a=e/160,u=160,d=t/a,d>i&&(l=(d-i)/2)):(a=t/160,d=160,u=e/a,u>o&&(c=(u-o)/2)),{w:u,h:d,x:-c,y:-l}):(s?(a=t/i,d=i,u=e/a):(a=e/o,u=o,d=t/a),{w:u,h:d,x:-c,y:-l})};let Le=0;class be{constructor(e,t){Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:++Le}),this._promise=this._handleUpload(e,t)}abort(){var e;null===(e=this._client)||void 0===e||e.abort()}_uploadInLoop(e,t,n,i,o=[]){return G(this,void 0,void 0,(function*(){for(let r=0;r<e.length;r++){const s=e[r],a=xe[s.type];if(!a){o.push({type:s.type,url:s.url,code:l.UPLOAD_FAIL,msg:"Upload type not supported"});continue}this._client=new a(s.url,n,i);const u=yield this._client.upload(t);if(u.isOk)return u;const{code:d}=u;if([l.RC_FILE_SIZE_EXCEED_LIMIT,l.INVALID_PARAMETER_SIZE_NOT_FOUND].includes(u.code))return u;if(this._client.isAbort())return this._client=null,u;this._client=null,o.push({type:s.type,url:s.url,code:d,msg:u.msg})}return c(l.UPLOAD_FAIL,`Failed to upload all channels, msg: ${JSON.stringify(o)}`)}))}_handleUpload(e,t){return G(this,void 0,void 0,(function*(){const{getFileToken:n,customDomain:i,uploadServer:o,ossConfig:r}=t,{file:s,fileType:a,thumbnailConfig:u}=e,d=yield n(a,s.name,void 0,void 0,void 0,Oe(s.size));if(!d.isOk)return d.wipe();const v=d.data,h=function(e,t,n){if(t)return[{type:Me.RCX,url:t,p:"1"}];if(e)return JSON.parse(e).map((e=>{const t={type:Me.QINIU,url:"",p:""};return Object.keys(e).forEach((n=>{"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort(((e,t)=>e.p-t.p));const i=[];return n&&i.push({type:Me.QINIU,url:n,p:"1"}),i}(v.ossConfig||r,i,o);if(0===h.length)return c(l.INVALID_PARAMETER_MEDIA_URL,"uploadUrlList is empty");const{code:g,data:E,msg:m,isOk:p}=yield this._uploadInLoop(h,e,v,n);if(!p)return c(g,m);let{downloadUrl:S,uploadMethod:_}=E;if(!S){const e=yield t.getFileUrl(a,E.uniqueName,_,s.name);if(!e.isOk)return c(e.code,"Get download url fail");S=e.data.downloadUrl}if(!S)return c(l.UPLOAD_FAIL,"Get download url fail");const T={downloadUrl:S,uniqueName:(null==E?void 0:E.uniqueName)||"",name:s.name,size:s.size,type:s.type};if(a===I.AUDIO){return function(e,t){const n=new AudioContext({sampleRate:16e3}),{promise:i,resolve:o}=C();return n.decodeAudioData(e,(e=>{var n,i;o(f(Object.assign(Object.assign({},t),{duration:e.duration,length:e.length,sampleRate:null!==(n=e.sampleRate)&&void 0!==n?n:void 0,numberOfChannels:null!==(i=e.numberOfChannels)&&void 0!==i?i:void 0})))}),(e=>{o(c(l.UPLOAD_FAIL,`get audio info fail:${JSON.stringify(e)}`))})),i}(yield s.arrayBuffer(),T)}return a===I.IMAGE?ye(s,T,u):f(T)}))}awaitResult(){return G(this,void 0,void 0,(function*(){return this._promise}))}}const Ge={};function Fe(e,t){const n=new be(e,t);return function(e){G(this,void 0,void 0,(function*(){Ge[e.id]=e,yield e.awaitResult(),delete Ge[e.id]}))}(n),n}const He=(e,t)=>{const n=e.getNaviInfoFromCache();return{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:t||"",ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer}};function Be(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){const{contentDisposition:n,fileType:i,file:o}=e;return R.create("createUploadTask").validate("contentDisposition",n,(e=>"inline"===e||"attachment"===e),!1).fail(l.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",i,I,!0).fail(l.INVALID_PARAMETER_MEDIA_TYPE).validate("file",o,(e=>e instanceof File&&(!(i===I.IMAGE&&!e.type.match(/^image\//))&&!(i===I.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(l.MEDIA_EXCEPTION).result().trans((()=>Fe(e,He(t,t.getOptions().uploadDomain))))}))))}))}function we(e){return G(this,void 0,void 0,(function*(){return f(function(e){const t=Ge[e];return!!t&&(t.abort(),!0)}(e))}))}function ke(e){return G(this,void 0,void 0,(function*(){const{contentDisposition:t,fileType:n,file:i}=e;return W().next((o=>G(this,void 0,void 0,(function*(){const r=yield R.create("upload").validate("contentDisposition",t,(e=>"inline"===e||"attachment"===e),!1).fail(l.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",n,I,!0).fail(l.INVALID_PARAMETER_MEDIA_TYPE).validate("file",i,(e=>e instanceof File&&(!(n===I.IMAGE&&!e.type.match(/^image\//))&&!(n===I.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(l.MEDIA_EXCEPTION).result().next((()=>function(e,t){return G(this,void 0,void 0,(function*(){return new be(e,t).awaitResult()}))}(e,He(o,o.getOptions().uploadDomain))));return r}))))}))}function Ve(e,t,n,i){return W().next((o=>o.getFileToken(e,t,n,i)))}function je(e){return W().next((t=>G(this,void 0,void 0,(function*(){return(yield R.create("getDownloadAuth").isNotEmptyString("url",e,!0).fail(l.INVALID_PARAMETER_MEDIA_URL).result().next((()=>t.getFileToken(1,void 0,void 0,void 0,e)))).trans((({deadline:e,token:t,downloadAuthInfo:n})=>({deadline:e,token:t,downloadAuthInfo:n})))}))))}function Ye(e,t,n,i,o){return G(this,void 0,void 0,(function*(){return(null==i?void 0:i.isBosRes)?f(i):W().next((i=>i.getFileUrl(e,t,o||_.QINIU,n)))}))}const ze=gi,$e=J("sendMessage",((e,t,n)=>G(void 0,void 0,void 0,(function*(){const{disableNotification:i,isMentioned:o,directionalUserIdList:r,canIncludeExpansion:s,onSendBefore:a,expansion:u,pushConfig:d,isStatusMessage:l,disableUpdateLastMessage:f}=n||{},h=function(e,t){const{disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:h,disableUpdateLastMessage:g,needReceipt:E,quoteInfo:m}=e;return Object.assign({disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:h,disableUpdateLastMessage:g,needReceipt:E,quoteInfo:m},t)}(n||{},t),g=Object.assign(Object.assign({},e),{isMentioned:!!o,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!i,canIncludeExpansion:!!s,expansion:u||null,senderUserId:"",messageUId:"",messageDirection:M.SEND,receivedTime:0,isStatusMessage:!!l,receivedStatus:U.UNREAD,isOffLineMessage:!1,pushConfig:d,sentStatus:O.SENDING,sentTime:0,directedUserIds:r||[],disableUpdateLastMessage:f}),E=yield W().next((t=>{g.senderUserId=t.getCurrentUserId();return t.sendMessage(e,h,(e=>{g.messageId=e;try{a&&a(F(g))}catch(e){t.logger.error(v.L_CALLBACK_E,`Callback method "onSendBefore" execution error.\n${null==e?void 0:e.stack}`),console.error(e)}}))}));return E.isOk?E.trans((e=>F(e))):(g.sentStatus=O.FAILED,c(E.code,E.msg,F(g)))}))));function qe(e,t,n){return $e(e,new Ae(t),n)}function We(e,t){return(n,i,o,s)=>G(this,void 0,void 0,(function*(){var a,u;const d=W();if(!d.isOk)return d.wipe();const f=d.data;if(!N("sendOptions.contentDisposition",null==s?void 0:s.contentDisposition,(e=>["inline","attachment"].includes(e))))return c(l.INVALID_PARAMETER_SENDOPTIONS);const h={contentDisposition:null==s?void 0:s.contentDisposition};if(s&&"thumbnailConfig"in s){const e=null===(a=s)||void 0===a?void 0:a.thumbnailConfig;if(!(N("sendOptions.maxHeight",null==e?void 0:e.maxHeight,r.NUMBER)&&N("sendOptions.maxWidth",null==e?void 0:e.maxWidth,r.NUMBER)&&N("sendOptions.quality",null==e?void 0:e.quality,r.NUMBER)&&N("sendOptions.scale",null==e?void 0:e.scale,r.NUMBER)))return c(l.INVALID_PARAMETER_SENDOPTIONS);h.thumbnailConfig=e}const{logger:g}=f,E=g.createTraceId();g.info(v.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:i.file.size,type:e}),E);const m=yield ke({file:i.file,fileType:e,onProgress:(e,t)=>{var n;null===(n=null==o?void 0:o.onProgress)||void 0===n||n.call(o,Math.floor(e/t*100))},contentDisposition:h.contentDisposition,thumbnailConfig:h.thumbnailConfig}),{code:p,data:S,msg:_}=m;if(p===l.SUCCESS&&S){const e=(null===(u=null==o?void 0:o.onComplete)||void 0===u?void 0:u.call(o,Object.assign({url:S.downloadUrl},S)))||t(S,i);return g.info(v.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:S.downloadUrl,code:l.SUCCESS}),E),$e(n,e,s)}return c(p,_)}))}const Xe=e=>{const t=e.match(/\.(\w+)$/);return t?t[1]:"bin"},Qe=We(I.FILE,((e,t)=>{const n={name:e.name,size:t.file.size,type:Xe(e.name),fileUrl:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new ve(n)})),Ke=We(I.IMAGE,((e,t)=>{const n={content:e.thumbnail,imageUri:e.downloadUrl,thumWidth:e.width,thumHeight:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new me(n)})),Je=We(I.IMAGE,((e,t)=>{const n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new he(n)})),Ze=We(I.AUDIO,((e,t)=>{var n;const i={remoteUrl:e.downloadUrl,duration:Math.floor(null!==(n=e.duration)&&void 0!==n?n:0),sampleRate:e.sampleRate,numberOfChannels:e.numberOfChannels};return t.user&&(i.user=t.user),t.extra&&(i.extra=t.extra),t.mentionedInfo&&(i.mentionedInfo=t.mentionedInfo),t.audit&&(i.audit=t.audit),new Re(i)})),et=We(I.SIGHT,((e,t)=>{const n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new Ce(n)}));function tt(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getHistoryMessage(e,t)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>F(e)))})))}))}function nt(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getRemoteHistoryMessages(e,t)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>F(e)))})))}))}function it(t,n,i,o){return G(this,void 0,void 0,(function*(){return W().next((r=>r.chat.sendReadReceiptMessage({targetId:t,conversationType:e.PRIVATE,channelId:o},n,i)))}))}function ot(t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.chat.sendReadReceiptRequest({targetId:t,conversationType:e.GROUP,channelId:i},n)))}))}function rt(e,t,n){return G(this,void 0,void 0,(function*(){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}function st(t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.chat.sendReadReceipt({targetId:t,conversationType:e.GROUP,channelId:i},n)))}))}function at(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.sendSyncReadStatusMessage(e,t)))}))}function ut(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.chat.sendReadReceiptMessageV4(e,t,n)))}))}function dt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.getMessageReadReceiptV4(e,t)))}))}function ct(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.batchGetMessageReadReceiptInfoV4(e,t)))}))}We(I.COMBINE_HTML,((e,t)=>{const n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new ce(n)}));const lt=J("recallMessage",((e,t)=>G(void 0,void 0,void 0,(function*(){return W().next((n=>G(void 0,void 0,void 0,(function*(){return(yield n.recallMessage(e,t)).trans((e=>F(e)))}))))}))));function ft(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.deleteRemoteMessage(e,t)))}))}function vt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.deleteRemoteMessageByTimestamp(e,t)))}))}function ht(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchClearRemoteHistoryMessages(e,t)))}))}function gt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.updateMessageExpansion(e,t)))}))}function Et(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeMessageExpansion(e,t)))}))}function mt(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chat.sendTypingStatus(e,t)))).trans(F)}))}function pt(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return i.chat.getMessageReader(e,t,n)}))))}))}function St(e,t,n,i,s){return q(((a,u)=>(o("messageType",e,r.STRING,!0),o("isPersited",t,r.BOOLEAN,!0),o("isCounted",n,r.BOOLEAN,!0),o("isStatusMessage",s,r.BOOLEAN),o("searchProps",i,r.ARRAY),u.info(v.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:s,isPersited:t,searchProps:i})),a.registerMessageType(e,t,n,i,s),function(e,t=!0,n=!0){return function(i){return new ue(e,i,t,n)}}(e,t,n))))}function _t(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getFirstUnreadMessage(e)))).trans((e=>e?F(e):null))}))}function Tt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getFirstUnreadMessageDigest(e)))}))}function It(e,t,n={}){return G(this,void 0,void 0,(function*(){return B("insertMessage","electronExtension.insertMessage"),hi(e,t,n)}))}function Ct(e){throw new Error("getUnreadMentionedMessages is deprecated, please use electronExtension.getUnreadMentionedMessages instead")}function At(e,t,n,i){return G(this,void 0,void 0,(function*(){return B("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessagesWithParams"),ci(e,t,n,i)}))}function Rt(e,t,n){return G(this,void 0,void 0,(function*(){return B("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.electronExtension.deleteMessagesByTimestamp"),vi(e,t,n)}))}function Nt(e){return G(this,void 0,void 0,(function*(){return B("RongIMLib.clearMessages","RongIMLib.electronExtension.clearMessages"),fi(e)}))}function Mt(e,t,n,i){return G(this,void 0,void 0,(function*(){return B("searchConversationByContent","electronExtension.searchConversationByContent"),ui(e,null!=n?n:[h.TEXT,h.FILE],i,t)}))}function Ut(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){return n.chat.clearUnreadCountByTimestamp(e,t)}))))}))}function Ot(e,t){return G(this,void 0,void 0,(function*(){return li(e,t)}))}function xt(e){return W().next((t=>t.sse.requestStreamMessageContent(e)))}function yt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){return n.sendReadReceiptResponseV5(e,t)}))))}))}function Pt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){return n.getMessageReadReceiptInfoV5(e,t)}))))}))}function Dt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){return t.getMessageReadReceiptInfoV5ByIdentifiers(e)}))))}))}function Lt(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return i.getMessagesReadReceiptUsersByPageV5(e,t,n)}))))}))}function bt(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return i.getMessagesReadReceiptByUsersV5(e,t,n)}))))}))}function Gt(e,t){return W().next((n=>n.requestSpeechToTextForMessage(e,t)))}function Ft(e){return W().next((t=>t.translateMessagesWithParams(e)))}function Ht(e){return W().next((t=>t.translateTextsWithParams(e)))}function Bt(e,t){return G(this,void 0,void 0,(function*(){return B("modifyMessage","modifyMessageWithParams"),wt({messageUId:null==t?void 0:t.messageUId,messageContent:e,conversation:{conversationType:null==t?void 0:t.conversationType,targetId:null==t?void 0:t.targetId,channelId:null==t?void 0:t.channelId}})}))}function wt(e){return W().next((t=>t.modifyMessageWithParams(e)))}function kt(e){return W().next((t=>{const n=e=>e.map((e=>({messageUId:e.messageUId,message:e.message?F(e.message):void 0,code:e.code})));return t.refreshReferenceMessageWithParams(Object.assign(Object.assign({},e),{remoteMessageBlock:t=>{e.remoteMessageBlock&&e.remoteMessageBlock(n(t))},localMessageBlock:t=>{e.localMessageBlock&&e.localMessageBlock(n(t))}}))}))}function Vt(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getMessagesByUIds(e.conversationIdentifier,e.messageUIds)))).trans((e=>e.map((e=>({messageUId:e.messageUId,message:e.message?F(e.message):void 0,code:e.code})))))}))}function jt(e,t){return G(this,void 0,void 0,(function*(){B("getConversationList","getConversationListByTimestamp");return(yield W().next((n=>G(this,void 0,void 0,(function*(){return n.getConversationList({count:(null==e?void 0:e.count)||300,startTime:(null==e?void 0:e.startTime)||0,order:null==e?void 0:e.order,channelId:t})}))))).trans((e=>e.map(H)))}))}function Yt(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>G(this,void 0,void 0,(function*(){return t.getAllConversationList(e)}))))).trans((e=>e.map(H)))}))}function zt(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>G(this,void 0,void 0,(function*(){return t.getConversationListByTimestamp(e)}))))).trans((e=>e.map(H)))}))}function $t(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){return(yield t.getConversation(e)).trans((e=>H(e)))}))))}))}const qt=J("removeConversation",((e,t)=>G(void 0,void 0,void 0,(function*(){return W().next((n=>n.removeConversation(e,t)))}))));function Wt(e){return G(this,void 0,void 0,(function*(){return B("batchRemoveConversation","batchDeleteConversations"),Xt({identifiers:e,deleteRemotely:!1,deleteMessages:!1})}))}function Xt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.batchDeleteConversations(e)))}))}function Qt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getTextMessageDraft(e)))}))}function Kt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.saveTextMessageDraft(e,t)))}))}function Jt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.clearTextMessageDraft(e)))}))}function Zt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getTotalUnreadCount(t,e)))}))}function en(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getTotalUnreadCountByLevels(e,t)))}))}function tn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getTotalUnreadCountByLevels(e,t,!0)))}))}function nn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUnreadCount(e)))}))}const on=J("clearMessagesUnreadStatus",(e=>G(void 0,void 0,void 0,(function*(){return W().next((t=>t.chat.clearUnreadCount(e)))}))));function rn(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.chat.clearAllUnreadCount()))}))}const sn=J("setConversationNotificationLevel",((e,t)=>G(void 0,void 0,void 0,(function*(){return W().next((n=>n.batchSetConversationNotificationLevel([e],t)))}))));function an(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchSetConversationNotificationLevel(e,t)))}))}function un(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchSetConversationTranslateStrategy(e,t)))}))}function dn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){if(t!==x.CLOSE&&t!==x.OPEN)return c(l.INVALID_PARAMETER_NOTIFICATION_LEVEL);const i=y(t);return n.batchSetConversationNotificationLevel([e],i)}))))}))}function cn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getConversationNotificationLevel(e)))}))}function ln(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){return(yield t.getConversationNotificationLevel(e)).trans((e=>P(e)))}))))}))}function fn(){return G(this,void 0,void 0,(function*(){return(yield W().next((e=>e.getBlockedConversationList()))).trans((e=>e.map(H)))}))}function vn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setConversationTypeNotificationLevel(e,t)))}))}function hn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getConversationTypeNotificationLevel(e)))}))}const gn=J("setConversationToTop",((e,t=!0,n=!0,i=!1)=>G(void 0,void 0,void 0,(function*(){return W().next((o=>o.batchSetConversationToTop([e],!!t,n,i)))}))));function En(e,t,n=!0,i=!0){return G(this,void 0,void 0,(function*(){return W().next((o=>o.batchSetConversationToTop(e,!!t,i,n)))}))}function mn(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getTopConversationList(e,t)))).trans((e=>e.map(H)))}))}function pn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getUnreadConversationList(e)))).trans((e=>e.map(H)))}))}function Sn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUnreadMentionedCount(e)))}))}function _n(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getAllUnreadMentionedCount()))}))}function Tn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>{var n,i,o;return t.getRealtimeConversations(null!==(n=null==e?void 0:e.count)&&void 0!==n?n:30,null!==(i=null==e?void 0:e.startTime)&&void 0!==i?i:0,null!==(o=null==e?void 0:e.order)&&void 0!==o?o:0)}))).trans((e=>e.map(H)))}))}function In(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getRealtimeConTotalUnreadCount()))}))}function Cn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.clearRealtimeConUnreadCount(e)))}))}function An(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeRealtimeConversations(e)))}))}function Rn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.batchGetRealtimeConUnreadCount(e)))}))}function Nn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getUnreadMentionMeConversationList(e)))).trans((e=>e.map(H)))}))}function Mn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.createConversationListLoader(e)))}))}function Un(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.chat.getConversationsIncludingRobots(e)))).trans((e=>e.map(H)))}))}function On(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.markRemoteConversationAsRead(e)))}))}function xn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUltraGroupList(e)))}))}function yn(){return G(this,void 0,void 0,(function*(){return(yield W().next((e=>e.getBlockedUGList()))).trans((e=>e.map((e=>H(e)))))}))}function Pn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.sendUltraGroupTypingStatus(e)))}))}function Dn(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>G(this,void 0,void 0,(function*(){return n.getUltraGroupMessageListByMessageUId(e,t)}))))).trans((e=>{const t={};for(const n in e)t[n]=e[n]?F(e[n]):void 0;return t}))}))}function Ln(e,t){return G(this,void 0,void 0,(function*(){return B("updateExpansionForUltraGroupMessage","updateMessageExpansion"),gt(e,t)}))}function bn(e,t){return G(this,void 0,void 0,(function*(){return B("removeExpansionForUltraGroupMessage","removeMessageExpansionForKey"),Et(e,t)}))}function Gn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeAllMessageExpansion(e)))}))}function Fn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getUGUnreadCountForAllChannels(e,!0,t)))}))}function Hn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUltraGroupDefaultNotificationLevel(null==e?void 0:e.targetId,null==e?void 0:e.channelId)))}))}function Bn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setUltraGroupDefaultNotificationLevel(null==e?void 0:e.targetId,t,null==e?void 0:e.channelId)))}))}function wn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getUGUnreadCountForAllChannels(e,!1,t)))}))}function kn(){return G(this,void 0,void 0,(function*(){return B("getAllUltraGroupUnreadCount","getTotalUnreadCountByLevels"),en([e.ULTRA_GROUP],[])}))}function Vn(){return G(this,void 0,void 0,(function*(){return B("getAllUltraGroupUnreadMentionedCount","getTotalUnreadMentionedCountByLevels"),tn([e.ULTRA_GROUP],[])}))}function jn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUGUnreadMentionedDigest(e)))}))}function Yn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUGFirstUnreadMessageDigest(e)))}))}function zn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUGUnreadInfoList(e)))}))}function $n(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.addToBlacklist(e)))}))}function qn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeFromBlacklist(e)))}))}function Wn(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getBlacklist()))}))}function Xn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getBlacklistStatus(e)))).trans((e=>0===e))}))}function Qn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.createTag(e)))}))}function Kn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeTag(e)))}))}function Jn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.updateTag(e)))}))}function Zn(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getTagList()))}))}function ei(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getTagsForConversation(e)))}))}function ti(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.addTagForConversations(e,t)))}))}function ni(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeTagForConversations(e,t)))}))}function ii(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeTagsForConversation(e,t)))}))}function oi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeTagForConversations(e,t)))}))}function ri(e,t,n){return G(this,void 0,void 0,(function*(){B("getConversationsFromTagByPage","createConversationListLoader");return(yield W().next((i=>i.getConversationListByTag(e,n,t)))).trans((e=>e.map((e=>{return t=e,Object.assign(Object.assign({},H(t)),{isTopInTag:t.isTopInTag});var t}))))}))}function si(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getUnreadCountByTag(e,t)))}))}function ai(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.setConversationStatusInTag(e,t,{isTop:n})))}))}function ui(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>G(this,void 0,void 0,(function*(){return(yield o.searchConversationByContent(e,t,n,i)).trans((e=>e.map((e=>H(e)))))}))))}))}function di(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.searchMessages(e,t)))).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:e,messages:t.map((e=>F(e)))})))}))}function ci(e,t,n,i,o){return G(this,void 0,void 0,(function*(){return B("RongIMLib.electronExtension.searchMessages","RongIMLib.electronExtension.searchMessagesWithParams"),di(e,{keyword:t,limit:i||L,order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{objectNames:o}})}))}function li(e,t){return G(this,void 0,void 0,(function*(){return B("setMessageReceivedStatus","setMessageReceivedStatusInfo"),W().next((n=>n.setMessageReceivedStatus(e,t)))}))}function fi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.clearLocalMessages(e)))}))}function vi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.deleteLocalMessagesByTimestamp(e,t,n)))}))}function hi(e,t,n={}){return G(this,void 0,void 0,(function*(){return t instanceof ue?function(e,t,n={}){return G(this,void 0,void 0,(function*(){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:"",messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,searchContent:o,messageDirection:M.SEND,isUnread:i,messageUId:"",disableUpdateLastMessage:r,quoteInfo:n.quoteInfo};return(yield W().next((t=>t.insertMessage(e,s)))).trans(F)}))}(e,t,n):function(e,t,n={}){return G(this,void 0,void 0,(function*(){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:null==t?void 0:t.senderUserId,messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,messageDirection:null==t?void 0:t.messageDirection,readStatus:"object"==typeof(null==t?void 0:t.receivedStatusInfo)?D(t.receivedStatusInfo):null==t?void 0:t.receivedStatus,sentTime:null==t?void 0:t.sentTime,sentStatus:null==t?void 0:t.sentStatus,searchContent:o,messageUId:"",isUnread:i,disableNotification:null==t?void 0:t.disableNotification,canIncludeExpansion:null==t?void 0:t.canIncludeExpansion,expansion:(null==t?void 0:t.expansion)||void 0,directedUserIds:null==t?void 0:t.directedUserIds,disableUpdateLastMessage:(null==t?void 0:t.disableUpdateLastMessage)||r,quoteInfo:null==t?void 0:t.quoteInfo};return(yield W().next((t=>t.insertMessage(e,s)))).trans(F)}))}(e,t,n)}))}function gi(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getLocalMessage(e)))).trans((e=>F(e)))}))}var Ei=Object.freeze({__proto__:null,getAllConversationList:function(e){return G(this,void 0,void 0,(function*(){return B("electronExtension.getAllConversationList","getAllConversationList"),Yt(e)}))},getConversationList:function(e,t,n,i){return G(this,void 0,void 0,(function*(){B("electronExtension.getConversationList","getAllConversationList or getConversationListByTimestamp");return(yield W().next((o=>G(this,void 0,void 0,(function*(){return o.getConversationList({startTime:e,count:t,channelId:n,topPriority:i})}))))).trans((e=>e.map((e=>H(e)))))}))},searchConversationByContent:ui,getConversations:function(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getConversations(e)))).trans((e=>e.map(H)))}))},getUntaggedConversationListByPage:function(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return(yield i.getUntaggedConversationListByPage(e,t,n)).trans((e=>e.map((e=>H(e)))))}))))}))},getRemoteConversations:function(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.syncRemoteConversations()))}))},saveEditedMessageDraft:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.saveEditedMessageDraft(e,t)))}))},getEditedMessageDraft:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.getEditedMessageDraft(e)))}))},clearEditedMessageDraft:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.clearEditedMessageDraft(e)))}))},searchMessages:ci,searchMessageInTimeRange:function(e,t){return G(this,void 0,void 0,(function*(){return B("RongIMLib.electronExtension.searchMessageInTimeRange","RongIMLib.electronExtension.searchMessagesWithParams"),di(e,{keyword:null==t?void 0:t.keyword,limit:(null==t?void 0:t.limit)||5,offset:null==t?void 0:t.offset,order:0,timeRange:{startTime:null==t?void 0:t.startTime,endTime:null==t?void 0:t.endTime}})}))},searchMessagesByUser:function(e,t,n,i){return G(this,void 0,void 0,(function*(){B("RongIMLib.electronExtension.searchMessagesByUser","RongIMLib.electronExtension.searchMessagesWithParams");return(yield di(e,{limit:i,keyword:"",order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{senderIds:[t]}})).trans((({messages:e})=>({messages:e})))}))},getHistoryMessagesByMessageTypes:function(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getHistoryMessagesByObjectNames(e,t)))).trans((({list:e,hasMore:t})=>{const n=e.map(F);return{messages:n,hasMore:t,list:n}}))}))},getContinuousMessages:function(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getContinuousMessages(e,t)))).trans((({list:e,hasMore:t,timestamp:n})=>({hasMore:t,list:e.map(F),timestamp:n})))}))},setMessageStatusToRead:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setMessageStatusToRead(e,t)))}))},setMessageReceivedStatus:li,setMessageReceivedStatusInfo:function(e,t){return G(this,void 0,void 0,(function*(){const n=D(t||{});return W().next((t=>t.setMessageReceivedStatus(e,n)))}))},setMessageSentStatus:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setMessageSentStatus(e,t)))}))},setMessageContent:function(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.setMessageContent(e,t,n)))}))},deleteMessages:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.deleteLocalMessages(e)))}))},clearMessages:fi,deleteMessagesByTimestamp:vi,batchClearMessagesByTimestamp:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.batchClearLocalMessagesByTimestamp(e)))}))},insertMessage:hi,batchInsertMessage:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchInsertMessage(e,t)))}))},getMessageCount:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getLocalMessageCount(e)))}))},setCheckDuplicateMessage:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setCheckDuplicateMessage(e)))}))},setCheckChatRoomDuplicateMessage:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chatroom.setCheckChatRoomDuplicateMessage(!!e)))}))},getMessagesAroundTimestamp:function(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>{const i=null==t?void 0:t.timestamp,o=null==t?void 0:t.beforeCount,r=null==t?void 0:t.afterCount;return n.getMessagesAroundTimestamp(e,i,o,r)}))).trans((e=>e.map(F)))}))},getLocalMessage:gi,searchMessagesWithParams:function(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.searchMessagesWithParams(e)))).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:n,messages:t.map((e=>F(e)))})))}))},setMessageSpeechToTextVisible:function(e,t){return W().next((n=>n.setMessageSpeechToTextVisible(e,t)))},deleteUltraGroupMessagesForAllChannel:function(e,t){return W().next((n=>n.deleteLocalUGMessagesForAllChannel(e,t)))},getUnreadMentionedMessages:function(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getUnreadMentionedMessages(e)))).trans((e=>e.map(F)))}))},clearLocalData:function(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.clearLocalData()))}))},enable:function(){return b()}});function mi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setProxy(e)))}))}function pi(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getProxy()))}))}function Si(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.testProxy(e,t)))}))}function _i(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.subscribeUser(e,t,n)))}))}function Ti(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.unSubscribeUser(e,t)))).wipe()}))}function Ii(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.getSubscribeUserList(e,t,n)))}))}function Ci(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getSubscribeUserStatus(e,t)))}))}function Ai(e){return W().next((t=>t.updateMyUserProfile(e)))}function Ri(e){return W().next((t=>t.getUserProfiles(e)))}function Ni(){return W().next((e=>e.getMyUserProfile()))}function Mi(e){return W().next((t=>t.dataHosting.updateMyUserProfileVisibility(e)))}function Ui(){return W().next((e=>e.dataHosting.getMyUserProfileVisibility()))}function Oi(e){return W().next((t=>t.dataHosting.searchUserProfileByUniqueId(e)))}function xi(e){return W().next((t=>t.getSubscribeUsersOnlineStatus(e)))}function yi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.createGroup(e,t)))}))}function Pi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.updateGroupInfo(e)))}))}function Di(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.getGroupsInfo(e)))}))}function Li(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.kickGroupMembers(e,t,n)))}))}function bi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.quitGroup(e,t)))}))}function Gi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.dismissGroup(e)))}))}function Fi(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.dataHosting.transferGroupOwner(e,t,!!n,i)))}))}function Hi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.addGroupManagers(e,t)))}))}function Bi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.removeGroupManagers(e,t)))}))}function wi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.getGroupMembersByRole(e,t,n)))}))}function ki(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.getGroupMembers(e,t)))}))}function Vi(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.dataHosting.setGroupMemberInfo(e,t,n,i)))}))}function ji(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.searchGroupMembers(e,t,n)))}))}function Yi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.joinGroup(e)))}))}function zi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.inviteUsersToGroup(e,t)))}))}function $i(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.acceptGroupInvite(e,t)))}))}function qi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.refuseGroupInvite(e,t,n)))}))}function Wi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.acceptGroupApplication(e,t,n)))}))}function Xi(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.dataHosting.refuseGroupApplication(e,t,n,i)))}))}function Qi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.getGroupApplications(e,t,n)))}))}function Ki(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.getJoinedGroupsByRole(t,e)))}))}function Ji(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.searchJoinedGroups(e,t)))}))}function Zi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.getJoinedGroups(e)))}))}function eo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.setGroupRemark(e,t)))}))}function to(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.addGroupFollows(e,t)))}))}function no(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.removeGroupFollows(e,t)))}))}function io(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.getGroupFollows(e)))}))}function oo(e,t,n){return W().next((i=>i.dataHosting.addFriend(e,t,n)))}function ro(e,t){return W().next((n=>n.dataHosting.deleteFriends(e,t)))}function so(e){return W().next((t=>t.dataHosting.acceptFriendRequest(e)))}function ao(e){return W().next((t=>t.dataHosting.refuseFriendRequest(e)))}function uo(e,t,n){return W().next((i=>i.dataHosting.setFriendInfo(e,t||"",n)))}function co(e,t){return W().next((n=>n.dataHosting.checkFriends(e,t)))}function lo(e,t){return W().next((n=>n.dataHosting.getFriends(e,t)))}function fo(e,t,n){return W().next((i=>i.dataHosting.getFriendApplications(e,t,n)))}function vo(e){return W().next((t=>t.dataHosting.getFriendsInfo(e)))}function ho(e){return W().next((t=>t.dataHosting.searchFriendsInfo(e)))}function go(e){return W().next((t=>t.dataHosting.setFriendAddPermission(e)))}function Eo(){return W().next((e=>e.dataHosting.getFriendAddPermission()))}function mo(e){!function(e){var t,n,i;Y?$.warn(v.A_INIT_REPEAT_O):(o("options.appkey",e.appkey,r.STRING,!0),o("options.navigators",e.navigators,(e=>s(e)&&(0===e.length||e.every(a)))),o("options.loggerProxy",e.loggerProxy,(e=>e instanceof u)),z=e,Y=d.init({appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,uploadDomain:e.uploadDomain,environment:null!==(t=e.environment)&&void 0!==t?t:"default",eventLoopBlockingCheck:e.eventLoopBlockingCheck,enableReadReceiptStorage:null===(n=e.enableReadReceiptStorage)||void 0===n||n,useNaviV2:null!==(i=e.useNaviV2)&&void 0!==i&&i,loggerProxy:e.loggerProxy,conversationCachePolicy:e.conversationCachePolicy}),$=Y.logger,Y.assignWatcher(V),Y.sse.on("message",((e,t)=>{const n=Object.assign(Object.assign({},t),{message:t.message?F(t.message):void 0});k.emit(w.STREAM_MESSAGE_RESPONSE,n)})))}(e)}function po(){return G(this,void 0,void 0,(function*(){return ae(),function(){return G(this,void 0,void 0,(function*(){Y&&(yield d.destroy(),z=null,Y=null,$=null)}))}()}))}function So(){return q((e=>e.getConnectionStatus()))}function _o(){return q((e=>e.getServerTime()))}function To(){return q((e=>e.getCurrentUserId()))}function Io(e,t){i.add(e,t)}function Co(){return q((e=>e.getDeviceId()))}function Ao(){const e=W().tryTrans((e=>e.getAppSettings()));return e.isOk?e.data:null}const Ro={COMET:"_",WEBSOCKET:"_"};function No(e){return W().next((t=>t.setNotificationQuietHoursWithSetting(e)))}function Mo(){return W().next((e=>e.removeNotificationQuietHoursSetting()))}function Uo(){return W().next((e=>e.getNotificationQuietHoursSetting()))}function Oo(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chatroom.joinChatroom(e,null==t?void 0:t.count,!0,null==t?void 0:t.extra)))).wipe()}))}function xo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.joinChatroom(e,null==t?void 0:t.count,!1,null==t?void 0:t.extra)))}))}function yo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.quitChatroom(e,t)))}))}function Po(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.getChatroomInfo(e,null==t?void 0:t.count,null==t?void 0:t.order)))}))}function Do(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.setChatroomEntry(e,t,!1)))}))}function Lo(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chatroom.setChatroomEntries(e,t)))).wipe()}))}function bo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.setChatroomEntry(e,t,!0)))}))}function Go(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.removeChatroomEntry(e,t,!1)))}))}function Fo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.removeChatroomEntries(e,{keys:null==t?void 0:t.entries,notificationExtra:null==t?void 0:t.notificationExtra})))}))}function Ho(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.removeChatroomEntry(e,t,!0)))}))}function Bo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.getChatroomEntry(e,t)))}))}function wo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chatroom.getAllChatroomEntries(e)))}))}function ko(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chatroom.getChatroomHistoryMessages(e,null==t?void 0:t.count,null==t?void 0:t.order,null==t?void 0:t.timestamp)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>F(e)))})))}))}function Vo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chatroom.bindRTCRoomForChatroom(e)))}))}function jo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setTranslationLanguage(e)))}))}function Yo(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getTranslationLanguage()))}))}function zo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setAutoTranslateEnabled(e)))}))}function $o(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getAutoTranslateEnabled()))}))}function qo(){return W().next((e=>e.getAllRobots()))}function Wo(e){return W().next((t=>t.getRobotById(e)))}function Xo(e){return W().next((t=>t.chat.addMessageReaction(e)))}function Qo(e){return W().next((t=>t.chat.removeMessageReaction(e)))}function Ko(e){return W().next((t=>t.chat.batchGetMessageReactionSummaries(e)))}function Jo(e){return W().next((t=>t.chat.getMessageReactions(e)))}function Zo(e){return W().next((t=>t.chat.getMessageReactionUsers(e)))}export{ue as BaseMessage,ce as CombineMessage,le as CombineV2Message,fe as CommandMessage,Ro as ConnectType,w as Events,ve as FileMessage,he as GIFMessage,Ee as GroupNotificationMessage,Re as HQVoiceMessage,me as ImageMessage,Se as InformationNotificationMessage,_e as LocationMessage,Te as ReferenceMessage,Ie as RichContentMessage,Ce as SightMessage,Ae as TextMessage,be as UploadTask,Ne as VoiceMessage,Io as __addSDKVersion,so as acceptFriendApplication,Wi as acceptGroupApplication,$i as acceptGroupInvite,ti as addConversationsToTag,ie as addEventListener,oo as addFriend,to as addGroupFollows,Hi as addGroupManagers,Xo as addMessageReaction,Z as addMonitor,Qn as addTag,$n as addToBlacklist,ht as batchClearRemoteHistoryMessages,Xt as batchDeleteConversations,Ko as batchGetMessageReactionSummaries,ct as batchGetMessageReadReceiptInfoV4,Wt as batchRemoveConversation,an as batchSetConversationNotificationLevel,En as batchSetConversationToTop,un as batchSetConversationTranslateStrategy,Vo as bindRTCRoomForChatroom,co as checkFriends,rn as clearAllMessagesUnreadStatus,ae as clearEventListeners,vt as clearHistoryMessages,Nt as clearMessages,on as clearMessagesUnreadStatus,Cn as clearRealtimeConUnreadCount,Jt as clearTextMessageDraft,Ut as clearUnreadCountByTimestamp,te as connect,Mn as createConversationListLoader,yi as createGroup,Be as createUploadTask,ro as deleteFriends,Rt as deleteLocalMessagesByTimestamp,ft as deleteMessages,po as destroy,ne as disconnect,Gi as dismissGroup,Ei as electronExtension,Ho as forceRemoveChatRoomEntry,bo as forceSetChatRoomEntry,wo as getAllChatRoomEntries,Yt as getAllConversationList,qo as getAllRobots,kn as getAllUltraGroupUnreadCount,Vn as getAllUltraGroupUnreadMentionedCount,_n as getAllUnreadMentionedCount,Ao as getAppSettings,$o as getAutoTranslateEnabled,Wn as getBlacklist,Xn as getBlacklistStatus,yn as getBlockUltraGroupList,fn as getBlockedConversationList,Bo as getChatRoomEntry,Po as getChatRoomInfo,ko as getChatroomHistoryMessages,So as getConnectionStatus,$t as getConversation,jt as getConversationList,zt as getConversationListByTimestamp,cn as getConversationNotificationLevel,ln as getConversationNotificationStatus,hn as getConversationTypeNotificationLevel,ri as getConversationsFromTagByPage,Un as getConversationsIncludingRobots,To as getCurrentUserId,Co as getDeviceId,je as getDownloadAuth,Ve as getFileToken,Ye as getFileUrl,_t as getFirstUnreadMessage,Tt as getFirstUnreadMessageInfo,Eo as getFriendAddPermission,fo as getFriendApplications,lo as getFriends,vo as getFriendsInfo,Qi as getGroupApplications,io as getGroupFollows,ki as getGroupMembers,wi as getGroupMembersByRole,Di as getGroupsInfo,tt as getHistoryMessages,Zi as getJoinedGroups,Ki as getJoinedGroupsByRole,ze as getMessage,Zo as getMessageReactionUsers,Jo as getMessageReactions,Pt as getMessageReadReceiptInfoV5,Dt as getMessageReadReceiptInfoV5ByIdentifiers,dt as getMessageReadReceiptV4,pt as getMessageReader,Vt as getMessagesByUIds,bt as getMessagesReadReceiptByUsersV5,Lt as getMessagesReadReceiptUsersByPageV5,Ni as getMyUserProfile,Ui as getMyUserProfileVisibility,Uo as getNotificationQuietHoursSetting,pi as getProxy,In as getRealtimeConTotalUnreadCount,Rn as getRealtimeConUnreadCounts,Tn as getRealtimeConversations,nt as getRemoteHistoryMessages,Wo as getRobotById,_o as getServerTime,Ii as getSubscribeUserList,Ci as getSubscribeUserStatus,xi as getSubscribeUsersOnlineStatus,Zn as getTags,ei as getTagsFromConversation,Qt as getTextMessageDraft,mn as getTopConversationList,Zt as getTotalUnreadCount,en as getTotalUnreadCountByLevels,tn as getTotalUnreadMentionedCountByLevels,Yo as getTranslationLanguage,Hn as getUltraGroupDefaultNotificationLevel,Yn as getUltraGroupFirstUnreadMessageTimestamp,xn as getUltraGroupList,Dn as getUltraGroupMessageListByMessageUId,wn as getUltraGroupUnreadCountByTargetId,zn as getUltraGroupUnreadInfoList,Fn as getUltraGroupUnreadMentionedCountByTargetId,jn as getUltraGroupUnreadMentionedMessages,pn as getUnreadConversationList,nn as getUnreadCount,si as getUnreadCountByTag,Nn as getUnreadMentionMeConversationList,Sn as getUnreadMentionedCount,Ct as getUnreadMentionedMessages,Ri as getUserProfiles,mo as init,It as insertMessage,X as installPlugin,zi as inviteUsersToGroup,Oo as joinChatRoom,xo as joinExistChatRoom,Yi as joinGroup,Li as kickGroupMembers,On as markRemoteConversationAsRead,Bt as modifyMessage,wt as modifyMessageWithParams,oe as onceEventListener,yo as quitChatRoom,bi as quitGroup,lt as recallMessage,kt as refreshReferenceMessageWithParams,ao as refuseFriendApplication,Xi as refuseGroupApplication,qi as refuseGroupInvite,St as registerMessageType,Gn as removeAllExpansionForUltraGroupMessage,Fo as removeChatRoomEntries,Go as removeChatRoomEntry,qt as removeConversation,ni as removeConversationsFromTag,re as removeEventListener,se as removeEventListeners,bn as removeExpansionForUltraGroupMessage,qn as removeFromBlacklist,no as removeGroupFollows,Bi as removeGroupManagers,Et as removeMessageExpansionForKey,Qo as removeMessageReaction,ee as removeMonitor,Mo as removeNotificationQuietHoursSetting,An as removeRealtimeConversations,Kn as removeTag,oi as removeTagFromConversations,ii as removeTagsFromConversation,Gt as requestSpeechToTextForMessage,xt as requestStreamMessageContent,Kt as saveTextMessageDraft,Mt as searchConversationByContent,ho as searchFriendsInfo,ji as searchGroupMembers,Ji as searchJoinedGroups,At as searchMessages,Oi as searchUserProfileByUniqueId,Qe as sendFileMessage,Je as sendGIFMessage,Ze as sendHQVoiceMessage,Ke as sendImageMessage,$e as sendMessage,it as sendReadReceiptMessage,ut as sendReadReceiptMessageV4,ot as sendReadReceiptRequest,rt as sendReadReceiptResponse,st as sendReadReceiptResponseV2,yt as sendReadReceiptResponseV5,et as sendSightMessage,at as sendSyncReadStatusMessage,qe as sendTextMessage,mt as sendTypingStatusMessage,Pn as sendUltraGroupTypingStatus,zo as setAutoTranslateEnabled,Lo as setChatRoomEntries,Do as setChatRoomEntry,sn as setConversationNotificationLevel,dn as setConversationNotificationStatus,gn as setConversationToTop,ai as setConversationToTopInTag,vn as setConversationTypeNotificationLevel,go as setFriendAddPermission,uo as setFriendInfo,Vi as setGroupMemberInfo,eo as setGroupRemark,Ot as setMessageReceivedStatus,No as setNotificationQuietHoursWithSetting,mi as setProxy,jo as setTranslationLanguage,Bn as setUltraGroupDefaultNotificationLevel,we as stopUploadTask,_i as subscribeUserStatus,Si as testProxy,Fi as transferGroupOwner,Ft as translateMessagesWithParams,Ht as translateTextsWithParams,Ti as unSubscribeUserStatus,Ln as updateExpansionForUltraGroupMessage,Pi as updateGroupInfo,gt as updateMessageExpansion,Ai as updateMyUserProfile,Mi as updateMyUserProfileVisibility,Jn as updateTag,ke as upload};
15
+ ***************************************************************************** */function G(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{u(i.next(e))}catch(e){r(e)}}function a(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}function F(e){return Object.assign(Object.assign({},e),{channelId:e.channelId||""})}function H(t){const{conversationType:n,targetId:i,latestMessage:o,unreadMessageCount:r,hasMentioned:s,mentionedInfo:a,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:g,operationTime:h,draft:E,translateStrategy:m,editedMessageDraft:p,includeRobot:S,dataMgmtInfo:_}=t,T=o&&F(o);let I;I=s?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0;const C={conversationType:n,targetId:i,latestMessage:T,unreadMessageCount:r,hasMentioned:s,mentionedInfo:I,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:g,operationTime:h,draft:E||"",translateStrategy:m,editedMessageDraft:p,includeRobot:S,dataMgmtInfo:_};return C.conversationType===e.ULTRA_GROUP&&(C.firstUnreadMessage=t.firstUnreadMessage,C.channelType=t.channelType,C.unreadMentionedMeCount=t.unreadMentionedMeCount),C}function B(e,t){null===console||void 0===console||console.warn(`Method '${e}' is deprecated, please use '${t}' instead`)}var w;!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.MESSAGE_READ_RECEIPT_V4="MESSAGE_READ_RECEIPT_V4",e.SYNC_READ_STATUS="SYNC_READ_STATUS",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.USER_SETTINGS_SYNCED="USER_SETTINGS_SYNCED",e.USER_SETTINGS_CHANGED="USER_SETTINGS_CHANGED",e.CONVERSATIONS_SETTINGS_SYNCED="CONVERSATIONS_SETTINGS_SYNCED",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.CONVERSATIONS_SYNCED="CONVERSATIONS_SYNCED",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.USER_GROUP_STATUS="USER_GROUP_STATUS",e.SUBSCRIBED_USER_STATUS_CHANGE="SUBSCRIBED_USER_STATUS_CHANGE",e.SUBSCRIBED_RELATION_CHANGE="SUBSCRIBED_RELATION_CHANGE",e.SYNC_SUBSCRIBED_USER_STATUS_FINISHED="SYNC_SUBSCRIBED_USER_STATUS_FINISHED",e.OWN_USER_PROFILE_CHANGED="OWN_USER_PROFILE_CHANGED",e.GROUP_OPERATION="GROUP_OPERATION",e.GROUP_INFO_CHANGED="GROUP_INFO_CHANGED",e.GROUP_MEMBER_INFO_CHANGED="GROUP_MEMBER_INFO_CHANGED",e.GROUP_APPLICATION_EVENT="GROUP_APPLICATION_EVENT",e.GROUP_REMARK_CHANGED_SYNC="GROUP_REMARK_CHANGED_SYNC",e.GROUP_FOLLOWS_CHANGED_SYNC="GROUP_FOLLOWS_CHANGED_SYNC",e.FRIEND_ADDED="FRIEND_ADDED",e.FRIEND_DELETE="FRIEND_DELETE",e.FRIEND_APPLICATION_STATUS_CHANGED="FRIEND_APPLICATION_STATUS_CHANGED",e.FRIEND_CLEARED="FRIEND_CLEARED",e.FRIEND_INFO_CHANGED_SYNC="FRIEND_INFO_CHANGED_SYNC",e.DATABASE_OPENED="DATABASE_OPENED",e.DATABASE_UPGRADE_WILL_START="DATABASE_UPGRADE_WILL_START",e.DATABASE_UPGRADING="DATABASE_UPGRADING",e.DATABASE_UPGRADE_DID_COMPLETE="DATABASE_UPGRADE_DID_COMPLETE",e.STREAM_MESSAGE_RESPONSE="STREAM_MESSAGE_RESPONSE",e.MESSAGE_RECEIPT_RESPONSE_V5="MESSAGE_RECEIPT_RESPONSE_V5",e.SPEECH_TO_TEXT_RESPONSE="SPEECH_TO_TEXT_RESPONSE",e.TRANSLATE_RESPONSE="TRANSLATE_RESPONSE",e.MESSAGE_MODIFIED="MESSAGE_MODIFIED",e.MESSAGE_MODIFIED_SYNC_COMPLETED="MESSAGE_MODIFIED_SYNC_COMPLETED",e.ROBOTS_SYNCED="ROBOTS_SYNCED",e.SYNC_SERVER_SAVE_UNREAD_COMPLETED="SYNC_SERVER_SAVE_UNREAD_COMPLETED",e.MESSAGE_REACTION_CHANGED="MESSAGE_REACTION_CHANGED"}(w||(w={}));const k=new t,V={connection(e,t){switch(e){case n.CONNECTED:k.emit(w.CONNECTED);break;case n.CONNECTING:k.emit(w.CONNECTING);break;case n.SUSPENDED:k.emit(w.SUSPEND,t);break;case n.DISCONNECTED:k.emit(w.DISCONNECT,t)}},batchMessage:e=>{k.emit(w.MESSAGES,{messages:e.map((e=>F(e)))})},typingState:e=>{k.emit(w.TYPING_STATUS,{status:e})},readReceiptReceived:(e,t,n,i)=>{k.emit(w.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:i})},messageReceiptRequest:(e,t,n)=>{k.emit(w.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:(e,t,n)=>{k.emit(w.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:t=>{const n=t.map((({conversation:t,updatedItems:n})=>{const{conversationType:i}=t,o=H(t);return i===e.ULTRA_GROUP&&(o.versionTime=t.versionTime,o.unreadMessageCount=j(t.unreadMessageCount||0),o.unreadMentionedCount=j(t.unreadMentionedCount||0),o.unreadMentionedMeCount=j(t.unreadMentionedMeCount||0)),{conversation:o,updatedItems:n}}));k.emit(w.CONVERSATION,{conversationList:n})},chatroomState:e=>{k.emit(w.CHATROOM,e)},expansion:e=>{k.emit(w.EXPANSION,e)},pullFinished:()=>{k.emit(w.PULL_OFFLINE_MESSAGE_FINISHED)},tag:()=>{k.emit(w.TAG)},userSettingsSynced:e=>{k.emit(w.USER_SETTINGS_SYNCED,e)},userSettingsChanged:e=>{k.emit(w.USER_SETTINGS_CHANGED,e)},conversationStatusSynced:e=>{k.emit(w.CONVERSATIONS_SETTINGS_SYNCED,e)},robotsSynced:(e,t)=>{k.emit(w.ROBOTS_SYNCED,e,t)},conversationTagChanged:()=>{k.emit(w.CONVERSATION_TAG)},messageBlocked:e=>{k.emit(w.MESSAGE_BLOCKED,e)},ultraGroupEnable:()=>{k.emit(w.ULTRA_GROUP_ENABLE)},sgRelationsSynced:e=>{k.emit(w.CONVERSATIONS_SYNCED,e)},operateStatus:e=>{k.emit(w.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:e=>{k.emit(w.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((e=>F(e))))},ultraGroupMessageRecalled:e=>{k.emit(w.ULTRA_GROUP_MESSAGE_RECALLED,e.map((e=>F(e))))},ultraGroupChannelChangeType:e=>{k.emit(w.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:e=>{k.emit(w.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:e=>{k.emit(w.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:e=>{k.emit(w.USER_GROUP_STATUS,e)},messageReadReceipt:e=>{k.emit(w.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:e=>{k.emit(w.SYNC_READ_STATUS,e)},subscribedUserStatusChange:e=>{k.emit(w.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:e=>{k.emit(w.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:e=>{k.emit(w.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:e=>{k.emit(w.OWN_USER_PROFILE_CHANGED,e)},groupOperation:e=>{k.emit(w.GROUP_OPERATION,e)},groupInfoChanged:e=>{k.emit(w.GROUP_INFO_CHANGED,e)},groupMemberInfoChanged:e=>{k.emit(w.GROUP_MEMBER_INFO_CHANGED,e)},groupApplicationEvent:e=>{k.emit(w.GROUP_APPLICATION_EVENT,e)},groupRemarkChangedSync:e=>{k.emit(w.GROUP_REMARK_CHANGED_SYNC,e)},groupFollowsChangedSync:e=>{k.emit(w.GROUP_FOLLOWS_CHANGED_SYNC,e)},friendAdd:e=>{k.emit(w.FRIEND_ADDED,e)},friendDelete:e=>{k.emit(w.FRIEND_DELETE,e)},friendApplicationStatusChanged:e=>{k.emit(w.FRIEND_APPLICATION_STATUS_CHANGED,e)},friendCleared:e=>{k.emit(w.FRIEND_CLEARED,e)},friendInfoChangedSync:e=>{k.emit(w.FRIEND_INFO_CHANGED_SYNC,e)},databaseOpened:(e,t)=>{k.emit(w.DATABASE_OPENED,e,t)},databaseUpgradeWillStart:()=>{k.emit(w.DATABASE_UPGRADE_WILL_START)},databaseUpgrading:e=>{k.emit(w.DATABASE_UPGRADING,e)},databaseUpgradeDidComplete:e=>{k.emit(w.DATABASE_UPGRADE_DID_COMPLETE,e)},readReceiptResponseV5:e=>{k.emit(w.MESSAGE_RECEIPT_RESPONSE_V5,e)},speechToTextResponse:e=>{k.emit(w.SPEECH_TO_TEXT_RESPONSE,e)},translateResponse:e=>{k.emit(w.TRANSLATE_RESPONSE,e)},messagesModified:e=>{k.emit(w.MESSAGE_MODIFIED,e.map((e=>F(e))))},messageModifiedSyncCompleted:()=>{k.emit(w.MESSAGE_MODIFIED_SYNC_COMPLETED)},syncServerSaveUnreadCompleted:()=>{k.emit(w.SYNC_SERVER_SAVE_UNREAD_COMPLETED)},messageReaction(e){k.emit(w.MESSAGE_REACTION_CHANGED,e)}};function j(e){return e>999?999:e}i.add("imlib-next","5.46.0");let Y=null,q=null,z=null;function $(e){if(!Y)throw new Error("Not initialized yet!");return e(Y,z,q)}function W(){return Y?f(Y):c(l.BIZ_ERROR_CLIENT_NOT_INIT)}function X(e,t){return $((n=>n.install(e,t)))}let Q=0;const K=new Map;function J(e,t){const n=(...e)=>{const i=[],o=[];[...K.values()].forEach((([e,t,r])=>{e===n&&(o.push(t),r&&i.push(r))})),i.forEach((t=>{e=t(e)}));const r=t(...e);return o.forEach((t=>{t(e,r)})),r};return Object.defineProperty(n,"original",{value:t,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"monitorable",{value:!0,writable:!1,enumerable:!1,configurable:!1}),n}function Z(e,t,n){if(!e.monitorable)throw new Error(`Not monitorable API: ${e.name}`);const i=++Q;return K.set(i,[e,t,n]),i}function ee(e){K.delete(e)}function te(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.connect(e,!!t)))).trans((e=>({userId:e})))}))}const ne=J("disconnect",((e,t)=>$((n=>n.disconnect(e,t)))));function ie(e,t,n){k.on(e,t,n)}function oe(e,t,n){k.once(e,t,n)}function re(e,t,n){k.off(e,t,n)}function se(e){k.removeAll(e)}function ae(){k.clear()}class ue{constructor(e,t,n=!0,i=!0){Object.defineProperty(this,"messageType",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"isPersited",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isCounted",{enumerable:!0,configurable:!0,writable:!0,value:i})}}class de extends ue{constructor(e,t,n){super(e,n,t.isPersited,t.isCounted)}}class ce extends de{constructor(e){super(g.COMBINE,h(g.COMBINE),e)}}class le extends de{constructor(e){super(g.COMBINE_V2,h(g.COMBINE_V2),e)}}class fe extends de{constructor(e){super(g.COMMAND,h(g.COMMAND),e)}}class ve extends de{constructor(e){super(g.FILE,h(g.FILE),e)}}class ge extends de{constructor(e){super(g.GIF,h(g.GIF),e)}}const he=g.GROUP_NOTIFICATION;class Ee extends de{constructor(e){super(he,h(he),e)}}class me extends de{constructor(e){super(g.IMAGE,h(g.IMAGE),e)}}const pe=g.INFORMATION_NOTIFICATION;class Se extends de{constructor(e){super(pe,h(pe),e)}}class _e extends de{constructor(e){super(g.LOCATION,h(g.LOCATION),e)}}class Te extends de{constructor(e){super(g.REFERENCE,h(g.REFERENCE),e)}}class Ie extends de{constructor(e){super(g.RICH_CONTENT,h(g.RICH_CONTENT),e)}}class Ce extends de{constructor(e){super(g.SIGHT,h(g.SIGHT),e)}}class Ae extends de{constructor(e){super(g.TEXT,h(g.TEXT),e)}}class Re extends de{constructor(e){super(g.HQ_VOICE,h(g.HQ_VOICE),e)}}class Ne extends de{constructor(e){super(g.VOICE,h(g.VOICE),e)}}var Me;!function(e){e.ALIYUN="aliyun",e.S3="s3",e.MINIO="minio",e.QINIU="qiniu",e.RCX="rcx"}(Me||(Me={}));class Ue{constructor(e,t,n){Object.defineProperty(this,"_url",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_authInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_getFileToken",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isAbort",{enumerable:!0,configurable:!0,writable:!0,value:!1})}isAbort(){return this._isAbort}abort(){this._isAbort=!0,this._abortHandler()}upload(e){return e.file.size>E?Promise.resolve(c(l.UPLOAD_FAIL,"the file size is over 5GB!")):e.file.size>m&&this.multipartUpload?this.multipartUpload(e):this.commonUpload(e)}}function Oe(e){return Math.ceil(e/1024)||0}const xe={[Me.QINIU]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t),this._promise=p({url:S(this._url),headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:s}=yield this._promise.result();return this._promise=null,200===s||204===s?f({uniqueName:o.fileName,uploadMethod:_.QINIU}):c(l.UPLOAD_FAIL,s.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.ALIYUN]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=S(`${o.ossBucketName}.${this._url}`),s=new FormData;s.set("token",o.token),s.set("OSSAccessKeyId",o.osskeyId),s.set("policy",o.ossPolicy),s.set("Signature",o.ossSign),s.set("success_action_status","200"),s.set("key",o.fileName),s.set("file",t),this._promise=p({url:r,onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:s,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?f({uniqueName:o.fileName,uploadMethod:_.ALI}):c(l.UPLOAD_FAIL,a.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.S3]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i,contentDisposition:o}=e;let r=this._authInfo;const s=S(`${r.s3BucketName}.${this._url}`),a=new FormData;o?a.set("Content-Disposition",o):a.set("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),a.set("Content-Type",t.type),a.set("x-amz-credential",r.s3Credential),a.set("x-amz-algorithm",r.s3Algorithm),a.set("x-amz-date",r.s3Date),a.set("policy",r.s3Policy),a.set("x-amz-signature",r.s3Signature),a.set("key",r.fileName),a.set("file",t),this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:a,timeout:0});const{status:u,data:d}=yield this._promise.result();return this._promise=null,200===u||204===u?f({uniqueName:r.fileName,uploadMethod:_.AWS}):c(l.UPLOAD_FAIL,u.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.MINIO]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>G(this,void 0,void 0,(function*(){var t;const{file:n,fileType:i}=e;let o=yield this._getFileToken(i,n.name,"POST","uploads",void 0,Oe(n.size));if(!o.isOk)return o.wipe();let r=o.data;const s=S(`${this._url}/${r.minioBucketName}/${r.fileName}`),a=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploads`,headers:a,method:"POST"});const{status:u,data:d}=yield this._promise.result();this._promise=null;const v=null===(t=null==d?void 0:d.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===t?void 0:t[1];if(200!==u&&204!==u||!v)return c(l.UPLOAD_FAIL,"start upload fail");const g=[],h=yield this.requestUploadPart(s,n,v,r.fileName,e,g);if(!h.isOk)return h.wipe();if(o=yield this._getFileToken(i,r.fileName,"POST",`uploadId=${v}`,void 0,Oe(n.size)),!o.isOk)return o.wipe();r=o.data;let E=g.map(((e,t)=>`<Part><PartNumber>${t+1}</PartNumber><ETag>${e}</ETag></Part>`)).join("");E=`<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>${E}</CompleteMultipartUpload>`;const m=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploadId=${v}`,headers:m,method:"POST",body:E,timeout:0});const{status:T}=yield this._promise.result();return this._promise=null,200===T||204===T?f({uniqueName:r.fileName,uploadMethod:_.MINIO}):c(l.UPLOAD_FAIL,"end upload fail")}))})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=S(`${this._url}/${o.minioBucketName}/${o.fileName}`),s=this.getBaseHeaders(t,o,e);this._promise=p({url:r,headers:s,onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"PUT",body:t,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?f({uniqueName:o.fileName,uploadMethod:_.MINIO}):c(l.UPLOAD_FAIL,a.toString())}))}requestUploadPart(e,t,n,i,o,r,s=1,a=0){return G(this,void 0,void 0,(function*(){if(a>=5)return c(l.UPLOAD_FAIL,"Upload retry times exceeded 5. Procedure");const u=(s-1)*m,d=Math.min(m,t.size-u),v=`partNumber=${s}&uploadId=${n}`,g=yield this._getFileToken(o.fileType,i,"PUT",v,void 0,Oe(t.size));if(!g.isOk)return g.wipe();const h=g.data,E=t.slice(u,s*m),S=this.getBaseHeaders(t,h,o);this._promise=p({url:`${e}?${v}`,headers:S,method:"PUT",body:E,timeout:0,onProgress:e=>{var n;return null===(n=null==o?void 0:o.onProgress)||void 0===n?void 0:n.call(o,u+e.loaded,t.size)}});const{status:_,xhr:T}=yield this._promise.result();return this._promise=null,200===_||204===_?(r.push((null==T?void 0:T.getResponseHeader("ETag"))||""),u+d<t.size?this.requestUploadPart(e,t,n,i,o,r,s+1,0):f()):this.requestUploadPart(e,t,n,i,o,r,s,a+1)}))}getBaseHeaders(e,t,n){const{contentDisposition:i}=n;return{"Content-Disposition":`${i||("text/html"===e.type?"inline":"attachment")}; filename=${encodeURIComponent(e.name)};`,Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.RCX]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e,o=T.gen();let r=this._authInfo;return this._requestUploadPart(o,t,r.token,n)}))})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t);const s=S(this._url);this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:a,data:u}=yield this._promise.result();if(this._promise=null,(200===a||204===a)&&u){const e=JSON.parse(u);return f({uniqueName:e.rc_url.file_name,downloadUrl:`${s}/${e.rc_url.path}`,uploadMethod:_.QINIU})}return c(l.UPLOAD_FAIL,a.toString())}))}_requestUploadPart(e,t,n,i,o=0){return G(this,void 0,void 0,(function*(){const r=Math.min(m,t.size-o),s=e+t.name.substring(t.name.lastIndexOf(".")),a={Range:`bytes=${o}-${o+r}`,"X-File-TransactionId":s,"X-File-Total-Size":t.size.toString()},u=t.slice(o,o+r),d=new FormData;d.set("file",u,t.name),d.set("key",s),d.set("name",s),d.set("token",n);const v=S(this._url);this._promise=p({url:v,headers:a,onProgress:e=>null==i?void 0:i(o+e.loaded,t.size),method:"POST",body:d,timeout:0});const{status:g,data:h}=yield this._promise.result();if(this._promise=null,200===g||204===g){if(o+r<t.size)return this._requestUploadPart(e,t,n,i,o+r);const s=JSON.parse(h);return f({uniqueName:s.rc_url.file_name,downloadUrl:`${v}/${s.rc_url.path}`,uploadMethod:_.QINIU})}return c(l.UPLOAD_FAIL,g.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}}};function ye(e,t,n){const{promise:i,resolve:o}=C(),r=document.createElement("canvas"),s=r.getContext("2d"),a=new Image;return a.onload=e=>{const{maxHeight:i=160,maxWidth:u=160,quality:d=1,scale:c=1}=n||{},l=De(a.width,a.height,{maxHeight:i,maxWidth:u,scale:c});r.width=Math.min(l.w,u),r.height=Math.min(l.h,i),s.drawImage(a,l.x,l.y,l.w,l.h);let v=Pe(r,d);v=v.replace(/data:image\/[^;]+;base64,/,""),o(f(Object.assign(Object.assign({},t),{thumbnail:v,width:Math.ceil(l.w),height:Math.ceil(l.h)})))},a.onerror=e=>{o(c(l.UPLOAD_FAIL,`get image info fail:${JSON.stringify(e)}`))},a.src=(window.URL||window.webkitURL).createObjectURL(e),i}function Pe(e,t){let n=e.toDataURL("image/jpeg",t);return n.length>A-10240?Pe(e,t-.1):n}const De=(e,t,n)=>{const{maxHeight:i=160,maxWidth:o=160,scale:r=1}=n,s=e<t;let a,u,d,c=0,l=0;return(s?t/e:e/t)>r?(s?(a=e/160,u=160,d=t/a,d>i&&(l=(d-i)/2)):(a=t/160,d=160,u=e/a,u>o&&(c=(u-o)/2)),{w:u,h:d,x:-c,y:-l}):(s?(a=t/i,d=i,u=e/a):(a=e/o,u=o,d=t/a),{w:u,h:d,x:-c,y:-l})};let Le=0;class be{constructor(e,t){Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:++Le}),this._promise=this._handleUpload(e,t)}abort(){var e;null===(e=this._client)||void 0===e||e.abort()}_uploadInLoop(e,t,n,i,o=[]){return G(this,void 0,void 0,(function*(){for(let r=0;r<e.length;r++){const s=e[r],a=xe[s.type];if(!a){o.push({type:s.type,url:s.url,code:l.UPLOAD_FAIL,msg:"Upload type not supported"});continue}this._client=new a(s.url,n,i);const u=yield this._client.upload(t);if(u.isOk)return u;const{code:d}=u;if([l.RC_FILE_SIZE_EXCEED_LIMIT,l.INVALID_PARAMETER_SIZE_NOT_FOUND].includes(u.code))return u;if(this._client.isAbort())return this._client=null,u;this._client=null,o.push({type:s.type,url:s.url,code:d,msg:u.msg})}return c(l.UPLOAD_FAIL,`Failed to upload all channels, msg: ${JSON.stringify(o)}`)}))}_handleUpload(e,t){return G(this,void 0,void 0,(function*(){const{getFileToken:n,customDomain:i,uploadServer:o,ossConfig:r}=t,{file:s,fileType:a,thumbnailConfig:u}=e,d=yield n(a,s.name,void 0,void 0,void 0,Oe(s.size));if(!d.isOk)return d.wipe();const v=d.data,g=function(e,t,n){if(t)return[{type:Me.RCX,url:t,p:"1"}];if(e)return JSON.parse(e).map((e=>{const t={type:Me.QINIU,url:"",p:""};return Object.keys(e).forEach((n=>{"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort(((e,t)=>e.p-t.p));const i=[];return n&&i.push({type:Me.QINIU,url:n,p:"1"}),i}(v.ossConfig||r,i,o);if(0===g.length)return c(l.INVALID_PARAMETER_MEDIA_URL,"uploadUrlList is empty");const{code:h,data:E,msg:m,isOk:p}=yield this._uploadInLoop(g,e,v,n);if(!p)return c(h,m);let{downloadUrl:S,uploadMethod:_}=E;if(!S){const e=yield t.getFileUrl(a,E.uniqueName,_,s.name);if(!e.isOk)return c(e.code,"Get download url fail");S=e.data.downloadUrl}if(!S)return c(l.UPLOAD_FAIL,"Get download url fail");const T={downloadUrl:S,uniqueName:(null==E?void 0:E.uniqueName)||"",name:s.name,size:s.size,type:s.type};if(a===I.AUDIO){return function(e,t){const n=new AudioContext({sampleRate:16e3}),{promise:i,resolve:o}=C();return n.decodeAudioData(e,(e=>{var n,i;o(f(Object.assign(Object.assign({},t),{duration:e.duration,length:e.length,sampleRate:null!==(n=e.sampleRate)&&void 0!==n?n:void 0,numberOfChannels:null!==(i=e.numberOfChannels)&&void 0!==i?i:void 0})))}),(e=>{o(c(l.UPLOAD_FAIL,`get audio info fail:${JSON.stringify(e)}`))})),i}(yield s.arrayBuffer(),T)}return a===I.IMAGE?ye(s,T,u):f(T)}))}awaitResult(){return G(this,void 0,void 0,(function*(){return this._promise}))}}const Ge={};function Fe(e,t){const n=new be(e,t);return function(e){G(this,void 0,void 0,(function*(){Ge[e.id]=e,yield e.awaitResult(),delete Ge[e.id]}))}(n),n}const He=(e,t)=>{const n=e.getNaviInfoFromCache();return{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:t||"",ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer}};function Be(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){const{contentDisposition:n,fileType:i,file:o}=e;return R.create("createUploadTask").validate("contentDisposition",n,(e=>"inline"===e||"attachment"===e),!1).fail(l.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",i,I,!0).fail(l.INVALID_PARAMETER_MEDIA_TYPE).validate("file",o,(e=>e instanceof File&&(!(i===I.IMAGE&&!e.type.match(/^image\//))&&!(i===I.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(l.MEDIA_EXCEPTION).result().trans((()=>Fe(e,He(t,t.getOptions().uploadDomain))))}))))}))}function we(e){return G(this,void 0,void 0,(function*(){return f(function(e){const t=Ge[e];return!!t&&(t.abort(),!0)}(e))}))}function ke(e){return G(this,void 0,void 0,(function*(){const{contentDisposition:t,fileType:n,file:i}=e;return W().next((o=>G(this,void 0,void 0,(function*(){const r=yield R.create("upload").validate("contentDisposition",t,(e=>"inline"===e||"attachment"===e),!1).fail(l.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",n,I,!0).fail(l.INVALID_PARAMETER_MEDIA_TYPE).validate("file",i,(e=>e instanceof File&&(!(n===I.IMAGE&&!e.type.match(/^image\//))&&!(n===I.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(l.MEDIA_EXCEPTION).result().next((()=>function(e,t){return G(this,void 0,void 0,(function*(){return new be(e,t).awaitResult()}))}(e,He(o,o.getOptions().uploadDomain))));return r}))))}))}function Ve(e,t,n,i){return W().next((o=>o.getFileToken(e,t,n,i)))}function je(e){return W().next((t=>G(this,void 0,void 0,(function*(){return(yield R.create("getDownloadAuth").isNotEmptyString("url",e,!0).fail(l.INVALID_PARAMETER_MEDIA_URL).result().next((()=>t.getFileToken(1,void 0,void 0,void 0,e)))).trans((({deadline:e,token:t,downloadAuthInfo:n})=>({deadline:e,token:t,downloadAuthInfo:n})))}))))}function Ye(e,t,n,i,o){return G(this,void 0,void 0,(function*(){return(null==i?void 0:i.isBosRes)?f(i):W().next((i=>i.getFileUrl(e,t,o||_.QINIU,n)))}))}const qe=hi,ze=J("sendMessage",((e,t,n)=>G(void 0,void 0,void 0,(function*(){const{disableNotification:i,isMentioned:o,directionalUserIdList:r,canIncludeExpansion:s,onSendBefore:a,expansion:u,pushConfig:d,isStatusMessage:l,disableUpdateLastMessage:f}=n||{},g=function(e,t){const{disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:g,disableUpdateLastMessage:h,needReceipt:E,quoteInfo:m}=e;return Object.assign({disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:g,disableUpdateLastMessage:h,needReceipt:E,quoteInfo:m},t)}(n||{},t),h=Object.assign(Object.assign({},e),{isMentioned:!!o,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!i,canIncludeExpansion:!!s,expansion:u||null,senderUserId:"",messageUId:"",messageDirection:M.SEND,receivedTime:0,isStatusMessage:!!l,receivedStatus:U.UNREAD,isOffLineMessage:!1,pushConfig:d,sentStatus:O.SENDING,sentTime:0,directedUserIds:r||[],disableUpdateLastMessage:f,quoteInfo:g.quoteInfo}),E=yield W().next((t=>{h.senderUserId=t.getCurrentUserId();return t.sendMessage(e,g,(e=>{h.messageId=e;try{a&&a(F(h))}catch(e){t.logger.error(v.L_CALLBACK_E,`Callback method "onSendBefore" execution error.\n${null==e?void 0:e.stack}`),console.error(e)}}))}));return E.isOk?E.trans((e=>F(e))):(h.sentStatus=O.FAILED,c(E.code,E.msg,F(h)))}))));function $e(e,t,n){return ze(e,new Ae(t),n)}function We(e,t){return(n,i,o,s)=>G(this,void 0,void 0,(function*(){var a,u;const d=W();if(!d.isOk)return d.wipe();const f=d.data;if(!N("sendOptions.contentDisposition",null==s?void 0:s.contentDisposition,(e=>["inline","attachment"].includes(e))))return c(l.INVALID_PARAMETER_SENDOPTIONS);const g={contentDisposition:null==s?void 0:s.contentDisposition};if(s&&"thumbnailConfig"in s){const e=null===(a=s)||void 0===a?void 0:a.thumbnailConfig;if(!(N("sendOptions.maxHeight",null==e?void 0:e.maxHeight,r.NUMBER)&&N("sendOptions.maxWidth",null==e?void 0:e.maxWidth,r.NUMBER)&&N("sendOptions.quality",null==e?void 0:e.quality,r.NUMBER)&&N("sendOptions.scale",null==e?void 0:e.scale,r.NUMBER)))return c(l.INVALID_PARAMETER_SENDOPTIONS);g.thumbnailConfig=e}const{logger:h}=f,E=h.createTraceId();h.info(v.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:i.file.size,type:e}),E);const m=yield ke({file:i.file,fileType:e,onProgress:(e,t)=>{var n;null===(n=null==o?void 0:o.onProgress)||void 0===n||n.call(o,Math.floor(e/t*100))},contentDisposition:g.contentDisposition,thumbnailConfig:g.thumbnailConfig}),{code:p,data:S,msg:_}=m;if(p===l.SUCCESS&&S){const e=(null===(u=null==o?void 0:o.onComplete)||void 0===u?void 0:u.call(o,Object.assign({url:S.downloadUrl},S)))||t(S,i);return h.info(v.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:S.downloadUrl,code:l.SUCCESS}),E),ze(n,e,s)}return c(p,_)}))}const Xe=e=>{const t=e.match(/\.(\w+)$/);return t?t[1]:"bin"},Qe=We(I.FILE,((e,t)=>{const n={name:e.name,size:t.file.size,type:Xe(e.name),fileUrl:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new ve(n)})),Ke=We(I.IMAGE,((e,t)=>{const n={content:e.thumbnail,imageUri:e.downloadUrl,thumWidth:e.width,thumHeight:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new me(n)})),Je=We(I.IMAGE,((e,t)=>{const n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new ge(n)})),Ze=We(I.AUDIO,((e,t)=>{var n;const i={remoteUrl:e.downloadUrl,duration:Math.floor(null!==(n=e.duration)&&void 0!==n?n:0),sampleRate:e.sampleRate,numberOfChannels:e.numberOfChannels};return t.user&&(i.user=t.user),t.extra&&(i.extra=t.extra),t.mentionedInfo&&(i.mentionedInfo=t.mentionedInfo),t.audit&&(i.audit=t.audit),new Re(i)})),et=We(I.SIGHT,((e,t)=>{const n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new Ce(n)}));function tt(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getHistoryMessage(e,t)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>F(e)))})))}))}function nt(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getRemoteHistoryMessages(e,t)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>F(e)))})))}))}function it(t,n,i,o){return G(this,void 0,void 0,(function*(){return W().next((r=>r.chat.sendReadReceiptMessage({targetId:t,conversationType:e.PRIVATE,channelId:o},n,i)))}))}function ot(t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.chat.sendReadReceiptRequest({targetId:t,conversationType:e.GROUP,channelId:i},n)))}))}function rt(e,t,n){return G(this,void 0,void 0,(function*(){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}function st(t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.chat.sendReadReceipt({targetId:t,conversationType:e.GROUP,channelId:i},n)))}))}function at(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.sendSyncReadStatusMessage(e,t)))}))}function ut(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.chat.sendReadReceiptMessageV4(e,t,n)))}))}function dt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.getMessageReadReceiptV4(e,t)))}))}function ct(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.batchGetMessageReadReceiptInfoV4(e,t)))}))}We(I.COMBINE_HTML,((e,t)=>{const n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new ce(n)}));const lt=J("recallMessage",((e,t)=>G(void 0,void 0,void 0,(function*(){return W().next((n=>G(void 0,void 0,void 0,(function*(){return(yield n.recallMessage(e,t)).trans((e=>F(e)))}))))}))));function ft(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.deleteRemoteMessage(e,t)))}))}function vt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.deleteRemoteMessageByTimestamp(e,t)))}))}function gt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchClearRemoteHistoryMessages(e,t)))}))}function ht(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.updateMessageExpansion(e,t)))}))}function Et(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeMessageExpansion(e,t)))}))}function mt(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chat.sendTypingStatus(e,t)))).trans(F)}))}function pt(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return i.chat.getMessageReader(e,t,n)}))))}))}function St(e,t,n,i,s){return $(((a,u)=>(o("messageType",e,r.STRING,!0),o("isPersited",t,r.BOOLEAN,!0),o("isCounted",n,r.BOOLEAN,!0),o("isStatusMessage",s,r.BOOLEAN),o("searchProps",i,r.ARRAY),u.info(v.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:s,isPersited:t,searchProps:i})),a.registerMessageType(e,t,n,i,s),function(e,t=!0,n=!0){return function(i){return new ue(e,i,t,n)}}(e,t,n))))}function _t(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getFirstUnreadMessage(e)))).trans((e=>e?F(e):null))}))}function Tt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getFirstUnreadMessageDigest(e)))}))}function It(e,t,n={}){return G(this,void 0,void 0,(function*(){return B("insertMessage","electronExtension.insertMessage"),gi(e,t,n)}))}function Ct(e){throw new Error("getUnreadMentionedMessages is deprecated, please use electronExtension.getUnreadMentionedMessages instead")}function At(e,t,n,i){return G(this,void 0,void 0,(function*(){return B("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessagesWithParams"),ci(e,t,n,i)}))}function Rt(e,t,n){return G(this,void 0,void 0,(function*(){return B("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.electronExtension.deleteMessagesByTimestamp"),vi(e,t,n)}))}function Nt(e){return G(this,void 0,void 0,(function*(){return B("RongIMLib.clearMessages","RongIMLib.electronExtension.clearMessages"),fi(e)}))}function Mt(e,t,n,i){return G(this,void 0,void 0,(function*(){return B("searchConversationByContent","electronExtension.searchConversationByContent"),ui(e,null!=n?n:[g.TEXT,g.FILE],i,t)}))}function Ut(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){return n.chat.clearUnreadCountByTimestamp(e,t)}))))}))}function Ot(e,t){return G(this,void 0,void 0,(function*(){return li(e,t)}))}function xt(e){return W().next((t=>t.sse.requestStreamMessageContent(e)))}function yt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){return n.sendReadReceiptResponseV5(e,t)}))))}))}function Pt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){return n.getMessageReadReceiptInfoV5(e,t)}))))}))}function Dt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){return t.getMessageReadReceiptInfoV5ByIdentifiers(e)}))))}))}function Lt(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return i.getMessagesReadReceiptUsersByPageV5(e,t,n)}))))}))}function bt(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return i.getMessagesReadReceiptByUsersV5(e,t,n)}))))}))}function Gt(e,t){return W().next((n=>n.requestSpeechToTextForMessage(e,t)))}function Ft(e){return W().next((t=>t.translateMessagesWithParams(e)))}function Ht(e){return W().next((t=>t.translateTextsWithParams(e)))}function Bt(e,t){return G(this,void 0,void 0,(function*(){return B("modifyMessage","modifyMessageWithParams"),wt({messageUId:null==t?void 0:t.messageUId,messageContent:e,conversation:{conversationType:null==t?void 0:t.conversationType,targetId:null==t?void 0:t.targetId,channelId:null==t?void 0:t.channelId}})}))}function wt(e){return W().next((t=>t.modifyMessageWithParams(e)))}function kt(e){return W().next((t=>{const n=e=>e.map((e=>({messageUId:e.messageUId,message:e.message?F(e.message):void 0,code:e.code})));return t.refreshReferenceMessageWithParams(Object.assign(Object.assign({},e),{remoteMessageBlock:t=>{e.remoteMessageBlock&&e.remoteMessageBlock(n(t))},localMessageBlock:t=>{e.localMessageBlock&&e.localMessageBlock(n(t))}}))}))}function Vt(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getMessagesByUIds(e.conversationIdentifier,e.messageUIds)))).trans((e=>e.map((e=>({messageUId:e.messageUId,message:e.message?F(e.message):void 0,code:e.code})))))}))}function jt(e,t){return G(this,void 0,void 0,(function*(){B("getConversationList","getConversationListByTimestamp");return(yield W().next((n=>G(this,void 0,void 0,(function*(){return n.getConversationList({count:(null==e?void 0:e.count)||300,startTime:(null==e?void 0:e.startTime)||0,order:null==e?void 0:e.order,channelId:t})}))))).trans((e=>e.map(H)))}))}function Yt(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>G(this,void 0,void 0,(function*(){return t.getAllConversationList(e)}))))).trans((e=>e.map(H)))}))}function qt(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>G(this,void 0,void 0,(function*(){return t.getConversationListByTimestamp(e)}))))).trans((e=>e.map(H)))}))}function zt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){return(yield t.getConversation(e)).trans((e=>H(e)))}))))}))}const $t=J("removeConversation",((e,t)=>G(void 0,void 0,void 0,(function*(){return W().next((n=>n.removeConversation(e,t)))}))));function Wt(e){return G(this,void 0,void 0,(function*(){return B("batchRemoveConversation","batchDeleteConversations"),Xt({identifiers:e,deleteRemotely:!1,deleteMessages:!1})}))}function Xt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.batchDeleteConversations(e)))}))}function Qt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getTextMessageDraft(e)))}))}function Kt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.saveTextMessageDraft(e,t)))}))}function Jt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.clearTextMessageDraft(e)))}))}function Zt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getTotalUnreadCount(t,e)))}))}function en(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getTotalUnreadCountByLevels(e,t)))}))}function tn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getTotalUnreadCountByLevels(e,t,!0)))}))}function nn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUnreadCount(e)))}))}const on=J("clearMessagesUnreadStatus",(e=>G(void 0,void 0,void 0,(function*(){return W().next((t=>t.chat.clearUnreadCount(e)))}))));function rn(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.chat.clearAllUnreadCount()))}))}const sn=J("setConversationNotificationLevel",((e,t)=>G(void 0,void 0,void 0,(function*(){return W().next((n=>n.batchSetConversationNotificationLevel([e],t)))}))));function an(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchSetConversationNotificationLevel(e,t)))}))}function un(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchSetConversationTranslateStrategy(e,t)))}))}function dn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){if(t!==x.CLOSE&&t!==x.OPEN)return c(l.INVALID_PARAMETER_NOTIFICATION_LEVEL);const i=y(t);return n.batchSetConversationNotificationLevel([e],i)}))))}))}function cn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getConversationNotificationLevel(e)))}))}function ln(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){return(yield t.getConversationNotificationLevel(e)).trans((e=>P(e)))}))))}))}function fn(){return G(this,void 0,void 0,(function*(){return(yield W().next((e=>e.getBlockedConversationList()))).trans((e=>e.map(H)))}))}function vn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setConversationTypeNotificationLevel(e,t)))}))}function gn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getConversationTypeNotificationLevel(e)))}))}const hn=J("setConversationToTop",((e,t=!0,n=!0,i=!1)=>G(void 0,void 0,void 0,(function*(){return W().next((o=>o.batchSetConversationToTop([e],!!t,n,i)))}))));function En(e,t,n=!0,i=!0){return G(this,void 0,void 0,(function*(){return W().next((o=>o.batchSetConversationToTop(e,!!t,i,n)))}))}function mn(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getTopConversationList(e,t)))).trans((e=>e.map(H)))}))}function pn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getUnreadConversationList(e)))).trans((e=>e.map(H)))}))}function Sn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUnreadMentionedCount(e)))}))}function _n(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getAllUnreadMentionedCount()))}))}function Tn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>{var n,i,o;return t.getRealtimeConversations(null!==(n=null==e?void 0:e.count)&&void 0!==n?n:30,null!==(i=null==e?void 0:e.startTime)&&void 0!==i?i:0,null!==(o=null==e?void 0:e.order)&&void 0!==o?o:0)}))).trans((e=>e.map(H)))}))}function In(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getRealtimeConTotalUnreadCount()))}))}function Cn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.clearRealtimeConUnreadCount(e)))}))}function An(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeRealtimeConversations(e)))}))}function Rn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.batchGetRealtimeConUnreadCount(e)))}))}function Nn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getUnreadMentionMeConversationList(e)))).trans((e=>e.map(H)))}))}function Mn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.createConversationListLoader(e)))}))}function Un(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.chat.getConversationsIncludingRobots(e)))).trans((e=>e.map(H)))}))}function On(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.markRemoteConversationAsRead(e)))}))}function xn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUltraGroupList(e)))}))}function yn(){return G(this,void 0,void 0,(function*(){return(yield W().next((e=>e.getBlockedUGList()))).trans((e=>e.map((e=>H(e)))))}))}function Pn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.sendUltraGroupTypingStatus(e)))}))}function Dn(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>G(this,void 0,void 0,(function*(){return n.getUltraGroupMessageListByMessageUId(e,t)}))))).trans((e=>{const t={};for(const n in e)t[n]=e[n]?F(e[n]):void 0;return t}))}))}function Ln(e,t){return G(this,void 0,void 0,(function*(){return B("updateExpansionForUltraGroupMessage","updateMessageExpansion"),ht(e,t)}))}function bn(e,t){return G(this,void 0,void 0,(function*(){return B("removeExpansionForUltraGroupMessage","removeMessageExpansionForKey"),Et(e,t)}))}function Gn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeAllMessageExpansion(e)))}))}function Fn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getUGUnreadCountForAllChannels(e,!0,t)))}))}function Hn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUltraGroupDefaultNotificationLevel(null==e?void 0:e.targetId,null==e?void 0:e.channelId)))}))}function Bn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setUltraGroupDefaultNotificationLevel(null==e?void 0:e.targetId,t,null==e?void 0:e.channelId)))}))}function wn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getUGUnreadCountForAllChannels(e,!1,t)))}))}function kn(){return G(this,void 0,void 0,(function*(){return B("getAllUltraGroupUnreadCount","getTotalUnreadCountByLevels"),en([e.ULTRA_GROUP],[])}))}function Vn(){return G(this,void 0,void 0,(function*(){return B("getAllUltraGroupUnreadMentionedCount","getTotalUnreadMentionedCountByLevels"),tn([e.ULTRA_GROUP],[])}))}function jn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUGUnreadMentionedDigest(e)))}))}function Yn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUGFirstUnreadMessageDigest(e)))}))}function qn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUGUnreadInfoList(e)))}))}function zn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.addToBlacklist(e)))}))}function $n(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeFromBlacklist(e)))}))}function Wn(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getBlacklist()))}))}function Xn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getBlacklistStatus(e)))).trans((e=>0===e))}))}function Qn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.createTag(e)))}))}function Kn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeTag(e)))}))}function Jn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.updateTag(e)))}))}function Zn(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getTagList()))}))}function ei(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getTagsForConversation(e)))}))}function ti(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.addTagForConversations(e,t)))}))}function ni(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeTagForConversations(e,t)))}))}function ii(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeTagsForConversation(e,t)))}))}function oi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeTagForConversations(e,t)))}))}function ri(e,t,n){return G(this,void 0,void 0,(function*(){B("getConversationsFromTagByPage","createConversationListLoader");return(yield W().next((i=>i.getConversationListByTag(e,n,t)))).trans((e=>e.map((e=>{return t=e,Object.assign(Object.assign({},H(t)),{isTopInTag:t.isTopInTag});var t}))))}))}function si(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getUnreadCountByTag(e,t)))}))}function ai(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.setConversationStatusInTag(e,t,{isTop:n})))}))}function ui(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>G(this,void 0,void 0,(function*(){return(yield o.searchConversationByContent(e,t,n,i)).trans((e=>e.map((e=>H(e)))))}))))}))}function di(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.searchMessages(e,t)))).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:e,messages:t.map((e=>F(e)))})))}))}function ci(e,t,n,i,o){return G(this,void 0,void 0,(function*(){return B("RongIMLib.electronExtension.searchMessages","RongIMLib.electronExtension.searchMessagesWithParams"),di(e,{keyword:t,limit:i||L,order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{objectNames:o}})}))}function li(e,t){return G(this,void 0,void 0,(function*(){return B("setMessageReceivedStatus","setMessageReceivedStatusInfo"),W().next((n=>n.setMessageReceivedStatus(e,t)))}))}function fi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.clearLocalMessages(e)))}))}function vi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.deleteLocalMessagesByTimestamp(e,t,n)))}))}function gi(e,t,n={}){return G(this,void 0,void 0,(function*(){return t instanceof ue?function(e,t,n={}){return G(this,void 0,void 0,(function*(){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:"",messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,searchContent:o,messageDirection:M.SEND,isUnread:i,messageUId:"",disableUpdateLastMessage:r,quoteInfo:n.quoteInfo};return(yield W().next((t=>t.insertMessage(e,s)))).trans(F)}))}(e,t,n):function(e,t,n={}){return G(this,void 0,void 0,(function*(){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:null==t?void 0:t.senderUserId,messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,messageDirection:null==t?void 0:t.messageDirection,readStatus:"object"==typeof(null==t?void 0:t.receivedStatusInfo)?D(t.receivedStatusInfo):null==t?void 0:t.receivedStatus,sentTime:null==t?void 0:t.sentTime,sentStatus:null==t?void 0:t.sentStatus,searchContent:o,messageUId:"",isUnread:i,disableNotification:null==t?void 0:t.disableNotification,canIncludeExpansion:null==t?void 0:t.canIncludeExpansion,expansion:(null==t?void 0:t.expansion)||void 0,directedUserIds:null==t?void 0:t.directedUserIds,disableUpdateLastMessage:(null==t?void 0:t.disableUpdateLastMessage)||r,quoteInfo:null==t?void 0:t.quoteInfo};return(yield W().next((t=>t.insertMessage(e,s)))).trans(F)}))}(e,t,n)}))}function hi(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getLocalMessage(e)))).trans((e=>F(e)))}))}var Ei=Object.freeze({__proto__:null,getAllConversationList:function(e){return G(this,void 0,void 0,(function*(){return B("electronExtension.getAllConversationList","getAllConversationList"),Yt(e)}))},getConversationList:function(e,t,n,i){return G(this,void 0,void 0,(function*(){B("electronExtension.getConversationList","getAllConversationList or getConversationListByTimestamp");return(yield W().next((o=>G(this,void 0,void 0,(function*(){return o.getConversationList({startTime:e,count:t,channelId:n,topPriority:i})}))))).trans((e=>e.map((e=>H(e)))))}))},searchConversationByContent:ui,getConversations:function(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getConversations(e)))).trans((e=>e.map(H)))}))},getUntaggedConversationListByPage:function(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return(yield i.getUntaggedConversationListByPage(e,t,n)).trans((e=>e.map((e=>H(e)))))}))))}))},getRemoteConversations:function(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.syncRemoteConversations()))}))},saveEditedMessageDraft:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.saveEditedMessageDraft(e,t)))}))},getEditedMessageDraft:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.getEditedMessageDraft(e)))}))},clearEditedMessageDraft:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.clearEditedMessageDraft(e)))}))},searchMessages:ci,searchMessageInTimeRange:function(e,t){return G(this,void 0,void 0,(function*(){return B("RongIMLib.electronExtension.searchMessageInTimeRange","RongIMLib.electronExtension.searchMessagesWithParams"),di(e,{keyword:null==t?void 0:t.keyword,limit:(null==t?void 0:t.limit)||5,offset:null==t?void 0:t.offset,order:0,timeRange:{startTime:null==t?void 0:t.startTime,endTime:null==t?void 0:t.endTime}})}))},searchMessagesByUser:function(e,t,n,i){return G(this,void 0,void 0,(function*(){B("RongIMLib.electronExtension.searchMessagesByUser","RongIMLib.electronExtension.searchMessagesWithParams");return(yield di(e,{limit:i,keyword:"",order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{senderIds:[t]}})).trans((({messages:e})=>({messages:e})))}))},getHistoryMessagesByMessageTypes:function(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getHistoryMessagesByObjectNames(e,t)))).trans((({list:e,hasMore:t})=>{const n=e.map(F);return{messages:n,hasMore:t,list:n}}))}))},getContinuousMessages:function(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getContinuousMessages(e,t)))).trans((({list:e,hasMore:t,timestamp:n})=>({hasMore:t,list:e.map(F),timestamp:n})))}))},setMessageStatusToRead:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setMessageStatusToRead(e,t)))}))},setMessageReceivedStatus:li,setMessageReceivedStatusInfo:function(e,t){return G(this,void 0,void 0,(function*(){const n=D(t||{});return W().next((t=>t.setMessageReceivedStatus(e,n)))}))},setMessageSentStatus:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setMessageSentStatus(e,t)))}))},setMessageContent:function(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.setMessageContent(e,t,n)))}))},deleteMessages:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.deleteLocalMessages(e)))}))},clearMessages:fi,deleteMessagesByTimestamp:vi,batchClearMessagesByTimestamp:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.batchClearLocalMessagesByTimestamp(e)))}))},insertMessage:gi,batchInsertMessage:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchInsertMessage(e,t)))}))},getMessageCount:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getLocalMessageCount(e)))}))},setCheckDuplicateMessage:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setCheckDuplicateMessage(e)))}))},setCheckChatRoomDuplicateMessage:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chatroom.setCheckChatRoomDuplicateMessage(!!e)))}))},getMessagesAroundTimestamp:function(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>{const i=null==t?void 0:t.timestamp,o=null==t?void 0:t.beforeCount,r=null==t?void 0:t.afterCount;return n.getMessagesAroundTimestamp(e,i,o,r)}))).trans((e=>e.map(F)))}))},getLocalMessage:hi,searchMessagesWithParams:function(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.searchMessagesWithParams(e)))).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:n,messages:t.map((e=>F(e)))})))}))},setMessageSpeechToTextVisible:function(e,t){return W().next((n=>n.setMessageSpeechToTextVisible(e,t)))},deleteUltraGroupMessagesForAllChannel:function(e,t){return W().next((n=>n.deleteLocalUGMessagesForAllChannel(e,t)))},getUnreadMentionedMessages:function(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getUnreadMentionedMessages(e)))).trans((e=>e.map(F)))}))},clearLocalData:function(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.clearLocalData()))}))},enable:function(){return b()}});function mi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setProxy(e)))}))}function pi(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getProxy()))}))}function Si(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.testProxy(e,t)))}))}function _i(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.subscribeUser(e,t,n)))}))}function Ti(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.unSubscribeUser(e,t)))).wipe()}))}function Ii(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.getSubscribeUserList(e,t,n)))}))}function Ci(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getSubscribeUserStatus(e,t)))}))}function Ai(e){return W().next((t=>t.updateMyUserProfile(e)))}function Ri(e){return W().next((t=>t.getUserProfiles(e)))}function Ni(){return W().next((e=>e.getMyUserProfile()))}function Mi(e){return W().next((t=>t.dataHosting.updateMyUserProfileVisibility(e)))}function Ui(){return W().next((e=>e.dataHosting.getMyUserProfileVisibility()))}function Oi(e){return W().next((t=>t.dataHosting.searchUserProfileByUniqueId(e)))}function xi(e){return W().next((t=>t.getSubscribeUsersOnlineStatus(e)))}function yi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.createGroup(e,t)))}))}function Pi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.updateGroupInfo(e)))}))}function Di(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.getGroupsInfo(e)))}))}function Li(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.kickGroupMembers(e,t,n)))}))}function bi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.quitGroup(e,t)))}))}function Gi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.dismissGroup(e)))}))}function Fi(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.dataHosting.transferGroupOwner(e,t,!!n,i)))}))}function Hi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.addGroupManagers(e,t)))}))}function Bi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.removeGroupManagers(e,t)))}))}function wi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.getGroupMembersByRole(e,t,n)))}))}function ki(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.getGroupMembers(e,t)))}))}function Vi(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.dataHosting.setGroupMemberInfo(e,t,n,i)))}))}function ji(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.searchGroupMembers(e,t,n)))}))}function Yi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.joinGroup(e)))}))}function qi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.inviteUsersToGroup(e,t)))}))}function zi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.acceptGroupInvite(e,t)))}))}function $i(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.refuseGroupInvite(e,t,n)))}))}function Wi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.acceptGroupApplication(e,t,n)))}))}function Xi(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.dataHosting.refuseGroupApplication(e,t,n,i)))}))}function Qi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.getGroupApplications(e,t,n)))}))}function Ki(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.getJoinedGroupsByRole(t,e)))}))}function Ji(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.searchJoinedGroups(e,t)))}))}function Zi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.getJoinedGroups(e)))}))}function eo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.setGroupRemark(e,t)))}))}function to(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.addGroupFollows(e,t)))}))}function no(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.removeGroupFollows(e,t)))}))}function io(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.getGroupFollows(e)))}))}function oo(e,t,n){return W().next((i=>i.dataHosting.addFriend(e,t,n)))}function ro(e,t){return W().next((n=>n.dataHosting.deleteFriends(e,t)))}function so(e){return W().next((t=>t.dataHosting.acceptFriendRequest(e)))}function ao(e){return W().next((t=>t.dataHosting.refuseFriendRequest(e)))}function uo(e,t,n){return W().next((i=>i.dataHosting.setFriendInfo(e,t||"",n)))}function co(e,t){return W().next((n=>n.dataHosting.checkFriends(e,t)))}function lo(e,t){return W().next((n=>n.dataHosting.getFriends(e,t)))}function fo(e,t,n){return W().next((i=>i.dataHosting.getFriendApplications(e,t,n)))}function vo(e){return W().next((t=>t.dataHosting.getFriendsInfo(e)))}function go(e){return W().next((t=>t.dataHosting.searchFriendsInfo(e)))}function ho(e){return W().next((t=>t.dataHosting.setFriendAddPermission(e)))}function Eo(){return W().next((e=>e.dataHosting.getFriendAddPermission()))}function mo(e){!function(e){var t,n,i;Y?z.warn(v.A_INIT_REPEAT_O):(o("options.appkey",e.appkey,r.STRING,!0),o("options.navigators",e.navigators,(e=>s(e)&&(0===e.length||e.every(a)))),o("options.loggerProxy",e.loggerProxy,(e=>e instanceof u)),q=e,Y=d.init({appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,uploadDomain:e.uploadDomain,environment:null!==(t=e.environment)&&void 0!==t?t:"default",eventLoopBlockingCheck:e.eventLoopBlockingCheck,enableReadReceiptStorage:null===(n=e.enableReadReceiptStorage)||void 0===n||n,useNaviV2:null!==(i=e.useNaviV2)&&void 0!==i&&i,loggerProxy:e.loggerProxy,conversationCachePolicy:e.conversationCachePolicy}),z=Y.logger,Y.assignWatcher(V),Y.sse.on("message",((e,t)=>{const n=Object.assign(Object.assign({},t),{message:t.message?F(t.message):void 0});k.emit(w.STREAM_MESSAGE_RESPONSE,n)})))}(e)}function po(){return G(this,void 0,void 0,(function*(){return ae(),function(){return G(this,void 0,void 0,(function*(){Y&&(yield d.destroy(),q=null,Y=null,z=null)}))}()}))}function So(){return $((e=>e.getConnectionStatus()))}function _o(){return $((e=>e.getServerTime()))}function To(){return $((e=>e.getCurrentUserId()))}function Io(e,t){i.add(e,t)}function Co(){return $((e=>e.getDeviceId()))}function Ao(){const e=W().tryTrans((e=>e.getAppSettings()));return e.isOk?e.data:null}const Ro={COMET:"_",WEBSOCKET:"_"};function No(e){return W().next((t=>t.setNotificationQuietHoursWithSetting(e)))}function Mo(){return W().next((e=>e.removeNotificationQuietHoursSetting()))}function Uo(){return W().next((e=>e.getNotificationQuietHoursSetting()))}function Oo(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chatroom.joinChatroom(e,null==t?void 0:t.count,!0,null==t?void 0:t.extra)))).wipe()}))}function xo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.joinChatroom(e,null==t?void 0:t.count,!1,null==t?void 0:t.extra)))}))}function yo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.quitChatroom(e,t)))}))}function Po(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.getChatroomInfo(e,null==t?void 0:t.count,null==t?void 0:t.order)))}))}function Do(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.setChatroomEntry(e,t,!1)))}))}function Lo(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chatroom.setChatroomEntries(e,t)))).wipe()}))}function bo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.setChatroomEntry(e,t,!0)))}))}function Go(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.removeChatroomEntry(e,t,!1)))}))}function Fo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.removeChatroomEntries(e,{keys:null==t?void 0:t.entries,notificationExtra:null==t?void 0:t.notificationExtra})))}))}function Ho(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.removeChatroomEntry(e,t,!0)))}))}function Bo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.getChatroomEntry(e,t)))}))}function wo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chatroom.getAllChatroomEntries(e)))}))}function ko(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chatroom.getChatroomHistoryMessages(e,null==t?void 0:t.count,null==t?void 0:t.order,null==t?void 0:t.timestamp)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>F(e)))})))}))}function Vo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chatroom.bindRTCRoomForChatroom(e)))}))}function jo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setTranslationLanguage(e)))}))}function Yo(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getTranslationLanguage()))}))}function qo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setAutoTranslateEnabled(e)))}))}function zo(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getAutoTranslateEnabled()))}))}function $o(){return W().next((e=>e.getAllRobots()))}function Wo(e){return W().next((t=>t.getRobotById(e)))}function Xo(e){return W().next((t=>t.chat.addMessageReaction(e)))}function Qo(e){return W().next((t=>t.chat.removeMessageReaction(e)))}function Ko(e){return W().next((t=>t.chat.batchGetMessageReactionSummaries(e)))}function Jo(e){return W().next((t=>t.chat.getMessageReactions(e)))}function Zo(e){return W().next((t=>t.chat.getMessageReactionUsers(e)))}export{ue as BaseMessage,ce as CombineMessage,le as CombineV2Message,fe as CommandMessage,Ro as ConnectType,w as Events,ve as FileMessage,ge as GIFMessage,Ee as GroupNotificationMessage,Re as HQVoiceMessage,me as ImageMessage,Se as InformationNotificationMessage,_e as LocationMessage,Te as ReferenceMessage,Ie as RichContentMessage,Ce as SightMessage,Ae as TextMessage,be as UploadTask,Ne as VoiceMessage,Io as __addSDKVersion,so as acceptFriendApplication,Wi as acceptGroupApplication,zi as acceptGroupInvite,ti as addConversationsToTag,ie as addEventListener,oo as addFriend,to as addGroupFollows,Hi as addGroupManagers,Xo as addMessageReaction,Z as addMonitor,Qn as addTag,zn as addToBlacklist,gt as batchClearRemoteHistoryMessages,Xt as batchDeleteConversations,Ko as batchGetMessageReactionSummaries,ct as batchGetMessageReadReceiptInfoV4,Wt as batchRemoveConversation,an as batchSetConversationNotificationLevel,En as batchSetConversationToTop,un as batchSetConversationTranslateStrategy,Vo as bindRTCRoomForChatroom,co as checkFriends,rn as clearAllMessagesUnreadStatus,ae as clearEventListeners,vt as clearHistoryMessages,Nt as clearMessages,on as clearMessagesUnreadStatus,Cn as clearRealtimeConUnreadCount,Jt as clearTextMessageDraft,Ut as clearUnreadCountByTimestamp,te as connect,Mn as createConversationListLoader,yi as createGroup,Be as createUploadTask,ro as deleteFriends,Rt as deleteLocalMessagesByTimestamp,ft as deleteMessages,po as destroy,ne as disconnect,Gi as dismissGroup,Ei as electronExtension,Ho as forceRemoveChatRoomEntry,bo as forceSetChatRoomEntry,wo as getAllChatRoomEntries,Yt as getAllConversationList,$o as getAllRobots,kn as getAllUltraGroupUnreadCount,Vn as getAllUltraGroupUnreadMentionedCount,_n as getAllUnreadMentionedCount,Ao as getAppSettings,zo as getAutoTranslateEnabled,Wn as getBlacklist,Xn as getBlacklistStatus,yn as getBlockUltraGroupList,fn as getBlockedConversationList,Bo as getChatRoomEntry,Po as getChatRoomInfo,ko as getChatroomHistoryMessages,So as getConnectionStatus,zt as getConversation,jt as getConversationList,qt as getConversationListByTimestamp,cn as getConversationNotificationLevel,ln as getConversationNotificationStatus,gn as getConversationTypeNotificationLevel,ri as getConversationsFromTagByPage,Un as getConversationsIncludingRobots,To as getCurrentUserId,Co as getDeviceId,je as getDownloadAuth,Ve as getFileToken,Ye as getFileUrl,_t as getFirstUnreadMessage,Tt as getFirstUnreadMessageInfo,Eo as getFriendAddPermission,fo as getFriendApplications,lo as getFriends,vo as getFriendsInfo,Qi as getGroupApplications,io as getGroupFollows,ki as getGroupMembers,wi as getGroupMembersByRole,Di as getGroupsInfo,tt as getHistoryMessages,Zi as getJoinedGroups,Ki as getJoinedGroupsByRole,qe as getMessage,Zo as getMessageReactionUsers,Jo as getMessageReactions,Pt as getMessageReadReceiptInfoV5,Dt as getMessageReadReceiptInfoV5ByIdentifiers,dt as getMessageReadReceiptV4,pt as getMessageReader,Vt as getMessagesByUIds,bt as getMessagesReadReceiptByUsersV5,Lt as getMessagesReadReceiptUsersByPageV5,Ni as getMyUserProfile,Ui as getMyUserProfileVisibility,Uo as getNotificationQuietHoursSetting,pi as getProxy,In as getRealtimeConTotalUnreadCount,Rn as getRealtimeConUnreadCounts,Tn as getRealtimeConversations,nt as getRemoteHistoryMessages,Wo as getRobotById,_o as getServerTime,Ii as getSubscribeUserList,Ci as getSubscribeUserStatus,xi as getSubscribeUsersOnlineStatus,Zn as getTags,ei as getTagsFromConversation,Qt as getTextMessageDraft,mn as getTopConversationList,Zt as getTotalUnreadCount,en as getTotalUnreadCountByLevels,tn as getTotalUnreadMentionedCountByLevels,Yo as getTranslationLanguage,Hn as getUltraGroupDefaultNotificationLevel,Yn as getUltraGroupFirstUnreadMessageTimestamp,xn as getUltraGroupList,Dn as getUltraGroupMessageListByMessageUId,wn as getUltraGroupUnreadCountByTargetId,qn as getUltraGroupUnreadInfoList,Fn as getUltraGroupUnreadMentionedCountByTargetId,jn as getUltraGroupUnreadMentionedMessages,pn as getUnreadConversationList,nn as getUnreadCount,si as getUnreadCountByTag,Nn as getUnreadMentionMeConversationList,Sn as getUnreadMentionedCount,Ct as getUnreadMentionedMessages,Ri as getUserProfiles,mo as init,It as insertMessage,X as installPlugin,qi as inviteUsersToGroup,Oo as joinChatRoom,xo as joinExistChatRoom,Yi as joinGroup,Li as kickGroupMembers,On as markRemoteConversationAsRead,Bt as modifyMessage,wt as modifyMessageWithParams,oe as onceEventListener,yo as quitChatRoom,bi as quitGroup,lt as recallMessage,kt as refreshReferenceMessageWithParams,ao as refuseFriendApplication,Xi as refuseGroupApplication,$i as refuseGroupInvite,St as registerMessageType,Gn as removeAllExpansionForUltraGroupMessage,Fo as removeChatRoomEntries,Go as removeChatRoomEntry,$t as removeConversation,ni as removeConversationsFromTag,re as removeEventListener,se as removeEventListeners,bn as removeExpansionForUltraGroupMessage,$n as removeFromBlacklist,no as removeGroupFollows,Bi as removeGroupManagers,Et as removeMessageExpansionForKey,Qo as removeMessageReaction,ee as removeMonitor,Mo as removeNotificationQuietHoursSetting,An as removeRealtimeConversations,Kn as removeTag,oi as removeTagFromConversations,ii as removeTagsFromConversation,Gt as requestSpeechToTextForMessage,xt as requestStreamMessageContent,Kt as saveTextMessageDraft,Mt as searchConversationByContent,go as searchFriendsInfo,ji as searchGroupMembers,Ji as searchJoinedGroups,At as searchMessages,Oi as searchUserProfileByUniqueId,Qe as sendFileMessage,Je as sendGIFMessage,Ze as sendHQVoiceMessage,Ke as sendImageMessage,ze as sendMessage,it as sendReadReceiptMessage,ut as sendReadReceiptMessageV4,ot as sendReadReceiptRequest,rt as sendReadReceiptResponse,st as sendReadReceiptResponseV2,yt as sendReadReceiptResponseV5,et as sendSightMessage,at as sendSyncReadStatusMessage,$e as sendTextMessage,mt as sendTypingStatusMessage,Pn as sendUltraGroupTypingStatus,qo as setAutoTranslateEnabled,Lo as setChatRoomEntries,Do as setChatRoomEntry,sn as setConversationNotificationLevel,dn as setConversationNotificationStatus,hn as setConversationToTop,ai as setConversationToTopInTag,vn as setConversationTypeNotificationLevel,ho as setFriendAddPermission,uo as setFriendInfo,Vi as setGroupMemberInfo,eo as setGroupRemark,Ot as setMessageReceivedStatus,No as setNotificationQuietHoursWithSetting,mi as setProxy,jo as setTranslationLanguage,Bn as setUltraGroupDefaultNotificationLevel,we as stopUploadTask,_i as subscribeUserStatus,Si as testProxy,Fi as transferGroupOwner,Ft as translateMessagesWithParams,Ht as translateTextsWithParams,Ti as unSubscribeUserStatus,Ln as updateExpansionForUltraGroupMessage,Pi as updateGroupInfo,ht as updateMessageExpansion,Ai as updateMyUserProfile,Mi as updateMyUserProfileVisibility,Jn as updateTag,ke as upload};