From 0669f1c3ca346b81e3ad605bae820bc866452600 Mon Sep 17 00:00:00 2001 From: "Ritik.CometChat" Date: Wed, 13 Dec 2023 19:01:18 +0530 Subject: [PATCH] v4.0.4 --- CometChat.d.ts | 191 +++++++++++++++++++++++++++++++++++++++++++++++-- CometChat.js | 2 +- package.json | 5 +- 3 files changed, 191 insertions(+), 7 deletions(-) diff --git a/CometChat.d.ts b/CometChat.d.ts index f08df04..8f3018c 100644 --- a/CometChat.d.ts +++ b/CometChat.d.ts @@ -295,6 +295,24 @@ export namespace CometChat { */ export function getUnreadMessageCountForGroup(GUID: string, doHideMessages?: boolean): Promise; + /** + * Function to add reaction for the provided messageID. + * @param {string | any} messageId + * @param {string} reaction + * @returns {Promise} + * @memberof CometChat + */ + export function addReaction(messageId: string | any, reaction: string): Promise; + + /** + * Function to remove reaction for the provided messageID. + * @param {string | any} messageId + * @param {string} reaction + * @returns {Promise} + * @memberof CometChat + */ + export function removeReaction(messageId: string | any, reaction: string): Promise; + /** * Funtion to edit a message. * @param {BaseMessage} message @@ -1185,6 +1203,8 @@ export class BaseMessage implements Message { protected sender?: User; protected receiverId?: string; protected receiver?: User | Group; + protected data?: object; + protected reactions?: ReactionCount[]; protected type?: string; protected category?: MessageCategory; protected receiverType?: string; @@ -1204,9 +1224,20 @@ export class BaseMessage implements Message { protected deletedBy: string; protected replyCount: number; protected rawMessage: Object; + protected unreadRepliesCount: number; protected mentionedUsers?: User[]; protected mentionedMe?: boolean; constructor(receiverId: string, messageType: string, receiverType: string, category: MessageCategory); + /** + * Get unread replies count of the message + * @returns {number} + */ + getUnreadRepliesCount(): number; + /** + * @param {number} + * Set unread replies count of the message + */ + setUnreadRepliesCount(value: number): void; /** * Get ID of the message * @returns {number} @@ -1441,6 +1472,26 @@ export class BaseMessage implements Message { * @returns */ hasMentionedMe(): boolean; + /** + * Method to get data of the message. + * @returns {Object} + */ + getData(): any; + /** + * Method to set data of the message. + * @param {Object} value + */ + setData(value: object): void; + /** + * set the array of reactions in message + * @returns {ReactionCount[]} + */ + setReactions(reactions: any): ReactionCount[]; + /** + * Get the array of reactions in message + * @returns {ReactionCount[]} + */ + getReactions(): ReactionCount[]; } /** @@ -1455,7 +1506,7 @@ export class TextMessage extends BaseMessage implements Message { }; /** @private */ static readonly CATEGORY: string; private text?; - private data?; + protected data?; private processedText?; private tags?; /** @@ -1496,7 +1547,7 @@ export class TextMessage extends BaseMessage implements Message { * Method to set data of the message. * @param {Object} value */ - setData(value: string): void; + setData(value: any): void; /** * Method to get text of the message. * @returns {string} @@ -1531,6 +1582,7 @@ export const constants: { export const DEFAULT_VALUES: { ZERO: number; MSGS_LIMIT: number; + REACTIONS_LIMIT: number; MSGS_MAX_LIMIT: number; USERS_LIMIT: number; USERS_MAX_LIMIT: number; @@ -1612,6 +1664,8 @@ export const ResponseConstants: { KEY_DATA: string; KEY_META: string; KEY_CURSOR: string; + KEY_NEXT: string; + KEY_PREVIOUS: string; KEY_ACTION: string; KEY_MESSAGE: string; KEY_ERROR: string; @@ -1623,6 +1677,7 @@ export const ResponseConstants: { KEY_IDENTITY: string; KEY_SERVICE: string; KEY_ENTITIES: string; + KEY_REACTIONS: string; KEY_ENTITITY: string; KEY_ENTITYTYPE: string; KEY_ATTACHMENTS: string; @@ -2298,6 +2353,10 @@ export const AIErrors: { details: string; }; }; +export enum REACTION_ACTION { + REACTION_ADDED = "message_reaction_added", + REACTION_REMOVED = "message_reaction_removed" +} export const ExtensionErrors: { INVALID_EXTENSION: { code: string; @@ -2693,8 +2752,17 @@ export class MessageListener { * This event is triggered when a interaction goal is completd . */ onInteractionGoalCompleted?: Function; + /** + * This event is triggered when a reaction is added. + */ + onMessageReactionAdded?: Function; /** + /** + * This event is triggered when a reaction is removed. + */ + onMessageReactionRemoved?: Function; constructor(...args: any[]); } + export class CallListener { /** * This event is triggered when an incoming call is received. @@ -3109,6 +3177,7 @@ export class Action extends BaseMessage implements Message { TYPE_MESSAGE_DELETED: string; TYPE_MEMBER_ADDED: string; }; + protected data?: any; protected actionBy: User | Group | BaseMessage; protected actionFor: User | Group | BaseMessage; protected actionOn: User | Group | BaseMessage; @@ -3808,7 +3877,7 @@ export class TypingIndicator { export class CustomMessage extends BaseMessage implements Message { private customData; private subType; - private data?; + protected data?; private tags?; constructor(...args: any[]); /** @@ -4117,6 +4186,7 @@ export class CometChatHelper { * @memberof CometChat */ static getConversationFromMessage(message: TextMessage | MediaMessage | CustomMessage | InteractiveMessage | any): Promise; + static updateMessageWithReactionInfo(baseMessage: BaseMessage, messageReaction: MessageReaction, action: REACTION_ACTION): Promise; } /** @@ -4129,13 +4199,35 @@ export class Conversation { protected lastMessage: TextMessage | MediaMessage | CustomMessage | InteractiveMessage | any; protected conversationWith: User | Group; protected unreadMessageCount: number; + protected unreadMentionsCount: number; + protected lastReadMessageId: string; protected tags: Array; - constructor(conversationId: string, conversationType: string, lastMessage: TextMessage | MediaMessage | CustomMessage | InteractiveMessage |any, conversationWith: User | Group, unreadMessageCount: number, tags: Array); + constructor(conversationId: string, conversationType: string, lastMessage: TextMessage | MediaMessage | CustomMessage | any, conversationWith: User | Group, unreadMessageCount: number, tags: Array, unreadMentionsCount: number | any, lastReadMessageId: string | any); /** * Method to set conversation ID of the conversation. * @param {string} conversationId */ setConversationId(conversationId: string): void; + /** + * Method to get unreadMentionsCount of the conversation. + * @returns {number} + */ + getUnreadMentionsCount(): number; + /** + * Method to set unreadMentionsCount of the conversation. + * @param {number} + */ + setUnreadMentionsCount(count: number): void; + /** + * Method to get lastReadMessageId of the conversation. + * @returns {string} + */ + getLastReadMessageId(): string; + /** + * Method to set lastReadMessageId of the conversation. + * @param {string} + */ + setLastReadMessageId(id: string): void; /** * Method to set conversation type of the conversation. * @param {string} conversationId @@ -4624,6 +4716,7 @@ export class CCExtension { } export class TransientMessage { + protected data: any; constructor(receiverId: string, receiverType: string, data: any); /** * Method to get receiverID of the transient message. @@ -4771,6 +4864,54 @@ export class MessageReceipt { setReceiptType(receiptType?: string): void; } +export class ReactionCount { + reaction: string; + count: number; + reactedByMe?: boolean; + /** + * Method to get reacted reaction. + * @returns {string} + */ + getReaction(): string; + /** + * Method to set reacted reaction. + */ + setReaction(reaction: string): void; + /** + * Method to get no of users reacted with a reaction. + * @returns {number} + */ + getCount(): number; + /** + * Method to set no of users reacted with a reaction. + */ + setCount(count: number): void; + /** + * Method to get if loggedIn user reacted with the a reaction. + * @returns {boolean} + */ + getReactedByMe(): boolean; + /** + * Method to set if loggedIn user reacted with the a reaction. + */ + setReactedByMe(reactedByMe: boolean): void; +} +export class MessageReaction { + constructor(object: any); + getReactionId(): string; + setReactionId(id: string): void; + getMessageId(): number | string; + setMessageId(messageId: number | string): void; + getReaction(): string; + setReaction(reaction: string): void; + getUid(): string; + setUid(uid: string): void; + getReactedAt(): number; + setReactedAt(reactedAt: number): void; + getReactedBy(): User; + setReactedBy(reactedBy: User): void; +} + export class RTCUser { constructor(uid: string); setUID(uid: string): void; @@ -4839,7 +4980,7 @@ export class InteractiveMessage extends BaseMessage implements Message { }; private interactiveData; private interactionGoal; - private data?; + protected data?; private interactions?; private tags?; private allowSenderInteraction?; @@ -5031,5 +5172,45 @@ export class InteractionReceipt { setInteractions(interactions: Array): void; } +export class ReactionRequest { + constructor(builder?: ReactionRequestBuilder); + /** + * Get list of next reactions list based on the parameters specified in ReactionRequestBuilder class. The Developer need to call this method repeatedly using the same object of ReactionRequest class to get paginated list of reactions. + * @returns {Promise} + */ + fetchNext(): Promise; + /** + * Get list of previous reactions list based on the parameters specified in ReactionRequestBuilder class. The Developer need to call this method repeatedly using the same object of ReactionRequest class to get paginated list of reactions. + * @returns {Promise} + */ + fetchPrevious(): Promise; +} +export class ReactionRequestBuilder { + /** @private */ limit?: number; + /** @private */ msgId: number; + /** @private */ reaction?: string; + /** + * A method to set limit for the number of entries returned in a single iteration. A maximum of 100 entries can fetched in a single iteration. + * @param {number} limit + * @returns + */ + setLimit(limit: number): this; + /** + * A method to set message ID for which reactions needed to fetch. + * @param {number} id + * @returns + */ + setMessageId(id?: number): this; + /** + * A method to fetch list of MessageReaction for a specific reaction. + * @returns + */ + setReaction(reaction: string): this; + /** + * This method will return an object of the ReactionRequest class. + * @returns {ReactionRequest} + */ + build(): ReactionRequest; +} } diff --git a/CometChat.js b/CometChat.js index dbed9b4..19304be 100644 --- a/CometChat.js +++ b/CometChat.js @@ -1 +1 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@react-native-async-storage/async-storage"),require("react-native"),require("react"));else if("function"==typeof define&&define.amd)define(["@react-native-async-storage/async-storage","react-native","react"],e);else{var n="object"==typeof exports?e(require("@react-native-async-storage/async-storage"),require("react-native"),require("react")):e(t["@react-native-async-storage/async-storage"],t["react-native"],t.react);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,function(n,o,s){return function(n){var o={};function s(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,s),e.l=!0,e.exports}return s.m=n,s.c=o,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=34)}([function(t,W,r){"use strict";(function(K){W.__esModule=!0,W.validateQuestion=W.updatePropertiesWithDynamicValue=W.getCallSettings=W.isCallingComponentInstalled=W.getKeyprefix=W.validateConversationType=W.validateUpdateUser=W.validateCreateUser=W.validateMessage=W.validateChatType=W.validateMsgId=W.validateArray=W.validateHideMessagesFromBlockedUsers=W.validateId=W.validateCreateGroup=W.validateJoinGroup=W.validateUpdateGroup=W.validateScope=W.isAudio=W.isVideo=W.isImage=W.getUpdatedSettings=W.getAppSettings=W.getCurrentTime=W.Logger=W.createUidFromJid=W.format=W.getOrdinalSuffix=W.isFalsy=W.isTruthy=W.isObject=W.getJidHost=W.getChatHost=void 0;var o=r(14),B=r(1),t=r(6),b=r(2),i=r(19),a=r(20),E=r(22),F=r(5),e=r(13),x=r(37),V=r(48),J=r(15),c=r(24);function k(t){return null!=t&&("string"==typeof t&&(t=t.trim()),"object"==typeof t&&0===Object.keys(t).length&&(t=void 0)),["",0,"0",!1,null,"null",void 0,"undefined"].includes(t)}function u(t){for(var o=[],e=1;ei[0]&&e[1] All store cleared successfully","true"),t(!0)})}catch(t){d.Logger.error("CometChat: clearCache",t),e(t)}})},T.connect=function(t){var e=t||{},n=e.onSuccess,o=e.onError;T.user?(it.connection||(T.onConnectionSuccess=n,T.disconnectedByUser=!1,T.WSLogin(T.user)),T.didAnalyticsPingStart()||T.isAnalyticsDisabled||(T.pingAnalytics(),T.startAnalyticsPingTimer())):o&&o(new g.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},T.disconnect=function(t){var e=t||{},n=e.onSuccess,o=e.onError;T.user?(T.disconnectedByUser=!0,T.disconnectInternally({onError:o}),it.clearWSResponseTimer(),T.onDisconnectSuccess=n):o&&o(new g.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},T.disconnectInternally=function(t){var e=(t||{}).onError;T.user?(it.connection&&it.WSLogout(),T.didAnalyticsPingStart()&&T.clearAnalyticsPingTimer(),T.clearWSReconnectionTimer()):e&&e(new g.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},T.prototype.internalRestart=function(t){T.internalRestart||T.getInstance().internalLogout(!1).then(function(){T.internalRestart=!0,T.login(t).then(function(t){T.shouldConnectToWS=!0,T.internalRestart=!1},function(t){d.Logger.error("CometChat: internalRestart :: login",t),T.internalRestart=!1})},function(t){d.Logger.error("CometChat: internalRestart :: internalLogout",t)})},T.prototype.internalLogout=function(n){return void 0===n&&(n=!0),new Promise(function(t,e){try{T.didAnalyticsPingStart()&&T.clearAnalyticsPingTimer(),T.WSReconnectionInProgress&&T.clearWSReconnectionTimer(),T.isLoggedOut=!0,T.WSReconnectionInProgress=!1,T.isAnalyticsDisabled=!1,T.clearCache().then(function(){T.apiKey=void 0,T.user=void 0,T.authToken=void 0,T.cometChat=void 0,T.mode=void 0,it.WSLogout(),n&&T.pushToLoginListener("","Logout_Success"),t(!0)})}catch(t){d.Logger.error("CometChat: internalLogout",t),e(t)}})},T.markAsInteracted=function(t,o,e){return new Promise(function(n,e){try{d.isFalsy(t)?e(new g.CometChatException(m.ERRORS.PARAMETER_MISSING)):_.makeApiCall("markInteracted",{messageId:t},{interactions:[o]}).then(function(t){var e;e=t&&t.data&&t.data.message?t.data.message:"Marked interacted",n(e)},function(t){e(new g.CometChatException(t.error))})}catch(t){e(new g.CometChatException(t))}})},T.initialzed=!1,T.CometChatException=g.CometChatException,T.TextMessage=A.TextMessage,T.MediaMessage=S.MediaMessage,T.CustomMessage=w.CustomMessage,T.Action=i.Action,T.Call=s.Call,T.TypingIndicator=Y.TypingIndicator,T.TransientMessage=Q.TransientMessage,T.InteractiveMessage=tt.InteractiveMessage,T.InteractionGoal=et.InteractionGoal,T.Interaction=nt.Interaction,T.InteractionReceipt=ot.InteractionReceipt,T.Group=a.Group,T.User=l.User,T.GroupMember=K.GroupMember,T.Conversation=x.Conversation,T.USER_STATUS={ONLINE:f.PresenceConstatnts.STATUS.ONLINE,OFFLINE:f.PresenceConstatnts.STATUS.OFFLINE},T.MessagesRequest=U.MessagesRequest,T.MessagesRequestBuilder=U.MessagesRequestBuilder,T.UsersRequest=v.UsersRequest,T.UsersRequestBuilder=v.UsersRequestBuilder,T.ConversationsRequest=P.ConversationsRequest,T.ConversationsRequestBuilder=P.ConversationsRequestBuilder,T.BlockedUsersRequest=B.BlockedUsersRequest,T.BlockedUsersRequestBuilder=B.BlockedUsersRequestBuilder,T.GroupsRequest=y.GroupsRequest,T.GroupsRequestBuilder=y.GroupsRequestBuilder,T.GroupMembersRequest=M.GroupMembersRequest,T.GroupMembersRequestBuilder=M.GroupMembersRequestBuilder,T.BannedMembersRequest=L.BannedMembersRequest,T.BannedMembersRequestBuilder=L.BannedMembersRequestBuilder,T.CallSettings=k.CallSettings,T.CallSettingsBuilder=k.CallSettingsBuilder,T.MainVideoContainerSetting=k.MainVideoContainerSetting,T.AppSettings=b.AppSettings,T.AppSettingsBuilder=b.AppSettingsBuilder,T.CallingComponent=H.CallingComponent,T.MessageListener=o.MessageListener,T.UserListener=o.UserListener,T.GroupListener=o.GroupListener,T.OngoingCallListener=o.OngoingCallListener,T.CallListener=o.CallListener,T.ConnectionListener=o.ConnectionListener,T.LoginListener=o.LoginListener,T.CallController=N.CallController,T.CometChatHelper=F.CometChatHelper,T.Attachment=J.Attachment,T.GoalType=f.GoalType,T.MESSAGE_TYPE=f.MessageConstatnts.TYPE,T.CATEGORY_MESSAGE=f.MessageConstatnts.CATEGORY.MESSAGE,T.CATEGORY_ACTION=f.MessageConstatnts.CATEGORY.ACTION,T.CATEGORY_CALL=f.MessageConstatnts.CATEGORY.CALL,T.CATEGORY_CUSTOM=f.MessageConstatnts.CATEGORY.CUSTOM,T.ACTION_TYPE=f.ActionConstatnts.ACTIONS,T.CALL_TYPE=f.CallConstants.CALL_TYPE,T.CATEGORY_INTERACTIVE=f.MessageConstatnts.CATEGORY.INTERACTIVE,T.RECEIVER_TYPE=f.MessageConstatnts.RECEIVER_TYPE,T.CALL_STATUS=f.CallConstants.CALL_STATUS,T.GROUP_MEMBER_SCOPE=f.GROUP_MEMBER_SCOPE,T.GROUP_TYPE=f.GROUP_TYPE,T.MESSAGE_REQUEST=f.MessageConstatnts.PAGINATION.CURSOR_FILEDS,T.CONNECTION_STATUS=f.CONNECTION_STATUS,T.CALL_MODE=f.CallConstants.CALL_MODE,T.AUDIO_MODE=f.CallConstants.AUDIO_MODE,T.SORT_BY=f.UserConstants.SORT_BY,T.SORT_ORDER=f.UserConstants.SORT_ORDER,T.WSReconnectionInProgress=!1,T.WSReconnectionTimerInterval=5e3,T.currentConnectionStatus=f.CONNECTION_STATUS.DISCONNECTED,T.isConnectingFromInit=!1,T.loginInProgress=!1,T.internalRestart=!1,T.settingsInterval=6e4,T.isAnalyticsPingStarted=!1,T.isLoggedOut=!0,T.isAnalyticsDisabled=!1,T.disconnectedByUser=!1,T.shouldConnectToWS=!0,T.isAppInactive=!1,T.onConnectionSuccess=null,T.onDisconnectSuccess=null,T.onConnectionError=null,T.callWaitTimer=null,T.callWaitTime=30,T}();e.CometChat=Et},function(t,e,n){"use strict";e.__esModule=!0,e.postData=e.makeAdminApiCall=e.makeApiCall=void 0;var c=n(36),u=n(5),S=n(0),p=n(2),C=n(13),l=n(1);function T(n,t,o,e,s){var r;return void 0===n&&(n=""),void 0===t&&(t="GET"),void 0===o&&(o={}),void 0===e&&(e={}),o=S.isFalsy(o)?void 0:("GET"==t&&(n+="?",Object.keys(o).map(function(t,e){n=e===Object.keys(o).length-1?n+t+"="+o[t]:n+t+"="+o[t]+"&"}),o=void 0),s&&(r=new FormData,Object.keys(o).map(function(e){if("data"!=e){if("tags"==e)o[e].forEach(function(t){r.append(e+"[]",t)});else if("metadata"!=e)if("files"===e)for(var t=0;t"}},getFriends:{endpoint:"user/friends",method:"GET"},unfriend:{endpoint:"user/friends/{{uid}}/{{gid}}",method:"DELETE",data:{uids:"array"}},acceptFriendRequest:{endpoint:"user/friends/{{uid}}/accept",method:"PUT",data:{uids:"array"}},rejectFriendRequest:{endpoint:"user/friends/{{uid}}/reject",method:"DELETE",data:{uids:"array"}},createGroup:{endpoint:"groups",method:"POST",data:{guid:"required|string|max:100",name:"required|string|max:100",type:"enum|public,protected,password",password:"filled|string|max:100"}},getGroups:{endpoint:"groups",method:"GET"},getGroup:{endpoint:"groups/{{guid}}",method:"GET"},updateGroup:{endpoint:"groups/{{guid}}",method:"PUT"},deleteGroup:{endpoint:"groups/{{guid}}",method:"DELETE"},addGroupMembers:{endpoint:"groups/{{guid}}/members",method:"POST",data:{uids:"array"}},getGroupMembers:{endpoint:"groups/{{guid}}/members",method:"GET"},joinGroup:{endpoint:"groups/{{guid}}/members",method:"POST"},leaveGroup:{endpoint:"groups/{{guid}}/members",method:"DELETE"},kickGroupMembers:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"DELETE",data:{uids:"array"}},changeScopeOfMember:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"PUT",data:{uids:"array"}},banGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"POST",data:{uids:"array"}},unbanGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"DELETE",data:{uids:"array"}},addMemebersToGroup:{endpoint:"groups/{{guid}}/members",method:"PUT"},getBannedGroupMembers:{endpoint:"groups/{{guid}}/bannedusers",method:"GET"},promotemoteGroupMember:{endpoint:"groups/{{guid}}/promote",method:"PUT",data:{uids:"array"}},demoteGroupMember:{endpoint:"groups/{{guid}}/demote",method:"DELETE",data:{uids:"array"}},transferOwnership:{endpoint:"groups/{{guid}}/owner",method:"PATCH"},sendMessage:{endpoint:"messages",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},sendMessageInThread:{endpoint:"messages/{{parentId}}/thread",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},getMessages:{endpoint:"messages",method:"GET"},getMessageDetails:{endpoint:"messages/{{messageId}}",method:"GET"},getUserMessages:{endpoint:"users/{{listId}}/messages",method:"GET"},getGroupMessages:{endpoint:"groups/{{listId}}/messages",method:"GET"},getThreadMessages:{endpoint:"messages/{{listId}}/thread",method:"GET"},getMessage:{endpoint:"user/messages/{{muid}}",method:"GET"},updateMessage:{endpoint:"messages/{{messageId}}",method:"PUT"},deleteMessage:{endpoint:"messages/{{messageId}}",method:"DELETE"},markAsReadForUser:{endpoint:"users/{{uid}}/conversation/read",method:"POST"},markAsReadForGroup:{endpoint:"groups/{{guid}}/conversation/read",method:"POST"},markAsDeliveredForUser:{endpoint:"users/{{uid}}/conversation/delivered",method:"POST"},markAsDeliveredForGroup:{endpoint:"groups/{{guid}}/conversation/delivered",method:"POST"},markUserMessagesAsUnread:{endpoint:"users/{{uid}}/conversation/read",method:"DELETE"},markGroupMessagesAsUnread:{endpoint:"groups/{{guid}}/conversation/read",method:"DELETE"},createCallSession:{endpoint:"calls",method:"POST",data:{}},updateCallSession:{endpoint:"calls/{{sessionid}}",method:"put",data:{}},getConversations:{endpoint:"conversations",method:"GET"},getUserConversation:{endpoint:"users/{{uid}}/conversation",method:"GET"},getGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"GET"},deleteUserConversation:{endpoint:"users/{{uid}}/conversation",method:"DELETE"},deleteGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"DELETE"},updateUserConversation:{endpoint:"users/{{uid}}/conversation",method:"PUT"},updateGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"PUT"},updateCallType:{endpoint:"calls/{{sessionid}}/type",method:"PATCH"},getUserConversationStarter:{endpoint:"ai/conversation-starter/users/{{uid}}",method:"GET",isAIApi:!0},getGroupConversationStarter:{endpoint:"ai/conversation-starter/groups/{{guid}}",method:"GET",isAIApi:!0},getUserSmartReply:{endpoint:"ai/smart-replies/users/{{uid}}",method:"GET",isAIApi:!0},getGroupSmartReply:{endpoint:"ai/smart-replies/groups/{{guid}}",method:"GET",isAIApi:!0},markInteracted:{endpoint:"messages/{{messageId}}/interacted",method:"PATCH"},getUserConversationSummary:{endpoint:"ai/conversation-summary/users/{{uid}}",method:"GET",isAIApi:!0},getGroupConversationSummary:{endpoint:"ai/conversation-summary/groups/{{guid}}",method:"GET",isAIApi:!0},getBotAssistanceInUserConversation:{endpoint:"ai/bots/{{botId}}/assistance/users/{{uid}}",method:"GET",isAIApi:!0},getBotAssistanceInGroupConversation:{endpoint:"ai/bots/{{botId}}/assistance/groups/{{guid}}",method:"GET",isAIApi:!0}}}return a.prototype.getEndpointData=function(i){return new Promise(function(o,e){try{var s=S.CometChat.appSettings.getAdminHost(),r=S.CometChat.appSettings.getClientHost();u.LocalStorage.getInstance().get(c.LOCAL_STORE.KEY_APP_SETTINGS).then(function(t){if(E.isFalsy(t)){var e={};if((new a).uriEndpoints.hasOwnProperty(i))if((e=(new a).uriEndpoints[i]).hasOwnProperty("isAdminApi"))if(E.isFalsy(s)){var n=E.format((new a).adminApiUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else{n="https://"+s+"/"+e.endpoint;e.endpoint=n,o(e)}else if(E.isFalsy(r)){n=E.format((new a).baseUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else{n="https://"+r+"/"+e.endpoint;e.endpoint=n,o(e)}}else{e={};if((new a).uriEndpoints.hasOwnProperty(i))if((e=(new a).uriEndpoints[i]).hasOwnProperty("isAdminApi")){n="https://"+t[c.APP_SETTINGS.KEYS.ADMIN_API_HOST]+"/"+t[c.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+e.endpoint;e.endpoint=n,o(e)}else{n="https://"+t[c.APP_SETTINGS.KEYS.CLIENT_API_HOST]+"/"+t[c.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+e.endpoint;e.endpoint=n,o(e)}}},function(t){var e;if((new a).uriEndpoints.hasOwnProperty(i))if((e=(new a).uriEndpoints[i]).hasOwnProperty(["isAdminApi"]))if(E.isFalsy(s)){var n=E.format((new a).adminApiUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else e.endpoint="https://"+s+"/"+e.endpoint,o(e);else if(E.isFalsy(r)){n=E.format((new a).baseUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else e.endpoint="https://"+r+"/"+e.endpoint,o(e)})}catch(t){e(new p.CometChatException(t))}})},a}();e.EndpointFactory=o},function(t,e,n){"use strict";e.__esModule=!0,e.getEndPoint=void 0;var o=n(35),i=n(2);e.getEndPoint=function(t,r){void 0===t&&(t=""),void 0===r&&(r={});var e=new o.EndpointFactory;return new Promise(function(o,s){try{e.getEndpointData(t).then(function(t){var e=t;if(e){for(var n in r)e.endpoint=e.endpoint.replace("{{"+n+"}}",r[n]);o(e)}else s({error:"Unknown endPoint name."})})}catch(t){s(new i.CometChatException(t))}})}},function(t,e,n){"use strict";e.__esModule=!0,e.MainVideoContainerSetting=e.CallSettingsBuilder=e.CallSettings=void 0;var o=n(1),s=n(0),r=function(){function t(t){this.sessionID=t.sessionID,this.defaultLayout=t.defaultLayout,this.isAudioOnly=t.isAudioOnly,this.region=t.region,this.domain=t.domain,this.user=t.user,this.listener=t.listener,this.mode=t.mode,this.ShowEndCallButton=t.ShowEndCallButton,this.ShowSwitchCameraButton=t.ShowSwitchCameraButton,this.ShowMuteAudioButton=t.ShowMuteAudioButton,this.ShowPauseVideoButton=t.ShowPauseVideoButton,this.ShowAudioModeButton=t.ShowAudioModeButton,this.StartAudioMuted=t.StartAudioMuted,this.StartVideoMuted=t.StartVideoMuted,this.analyticsSettings=t.analyticsSettings,this.appId=t.appId,this.defaultAudioMode=t.defaultAudioMode,this.ShowSwitchToVideoCallButton=t.ShowSwitchToVideoCallButton,this.AvatarMode=t.AvatarMode,this.ShowRecordingButton=t.ShowRecordingButton,this.StartRecordingOnCallStart=t.StartRecordingOnCallStart,this.MainVideoContainerSetting=t.MainVideoContainerSetting,this.EnableVideoTileClick=t.EnableVideoTileClick,this.enableDraggableVideoTile=t.enableDraggableVideoTile}return t.prototype.getSessionId=function(){return this.sessionID},t.prototype.isAudioOnlyCall=function(){return this.isAudioOnly},t.prototype.getUser=function(){return this.user},t.prototype.getRegion=function(){return this.region},t.prototype.getAppId=function(){return this.appId},t.prototype.getDomain=function(){return this.domain},t.prototype.isDefaultLayoutEnabled=function(){return this.defaultLayout},t.prototype.getCallEventListener=function(){return this.listener},t.prototype.getMode=function(){return this.mode},t.prototype.isEndCallButtonEnabled=function(){return this.ShowEndCallButton},t.prototype.isSwitchCameraButtonEnabled=function(){return this.ShowSwitchCameraButton},t.prototype.isMuteAudioButtonEnabled=function(){return this.ShowMuteAudioButton},t.prototype.isPauseVideoButtonEnabled=function(){return this.ShowPauseVideoButton},t.prototype.isAudioModeButtonEnabled=function(){return this.ShowAudioModeButton},t.prototype.getStartWithAudioMuted=function(){return this.StartAudioMuted},t.prototype.getStartWithVideoMuted=function(){return this.StartVideoMuted},t.prototype.getAnalyticsSettings=function(){return this.analyticsSettings},t.prototype.getDefaultAudioMode=function(){return this.defaultAudioMode},t.prototype.isAudioToVideoButtonEnabled=function(){return this.ShowSwitchToVideoCallButton},t.prototype.getAvatarMode=function(){return this.AvatarMode},t.prototype.isRecordingButtonEnabled=function(){return this.ShowRecordingButton},t.prototype.shouldStartRecordingOnCallStart=function(){return this.StartRecordingOnCallStart},t.prototype.getMainVideoContainerSetting=function(){return this.MainVideoContainerSetting},t.prototype.isVideoTileClickEnabled=function(){return this.EnableVideoTileClick},t.prototype.isVideoTileDragEnabled=function(){return this.enableDraggableVideoTile},t.POSITION_TOP_LEFT="top-left",t.POSITION_TOP_RIGHT="top-right",t.POSITION_BOTTOM_LEFT="bottom-left",t.POSITION_BOTTOM_RIGHT="bottom-right",t.ASPECT_RATIO_DEFAULT="default",t.ASPECT_RATIO_CONTAIN="contain",t.ASPECT_RATIO_COVER="cover",t}();e.CallSettings=r;var i=function(){function t(){this.defaultLayout=!0,this.isAudioOnly=!1,this.mode=o.CallConstants.CALL_MODE.DEFAULT,this.ShowEndCallButton=!0,this.ShowSwitchCameraButton=!0,this.ShowMuteAudioButton=!0,this.ShowPauseVideoButton=!0,this.ShowAudioModeButton=!0,this.StartAudioMuted=!1,this.StartVideoMuted=!1,this.analyticsSettings={},this.ShowSwitchToVideoCallButton=!0,this.AvatarMode="circle",this.ShowRecordingButton=!1,this.StartRecordingOnCallStart=!1,this.MainVideoContainerSetting=new a,this.EnableVideoTileClick=!0,this.enableDraggableVideoTile=!0}return t.prototype.setSessionID=function(t){return this.sessionID=t,this},t.prototype.enableDefaultLayout=function(t){return this.defaultLayout=t,this},t.prototype.setIsAudioOnlyCall=function(t){return this.isAudioOnly=t,this},t.prototype.setRegion=function(t){return this.region=t,this},t.prototype.setDomain=function(t){return this.domain=t,this},t.prototype.setUser=function(t){return this.user=t,this},t.prototype.setCallEventListener=function(t){return this.listener=t,this},t.prototype.setMode=function(t){return this.mode=t,this},t.prototype.showEndCallButton=function(t){return this.ShowEndCallButton=t,this},t.prototype.showSwitchCameraButton=function(t){return this.ShowSwitchCameraButton=t,this},t.prototype.showMuteAudioButton=function(t){return this.ShowMuteAudioButton=t,this},t.prototype.showPauseVideoButton=function(t){return this.ShowPauseVideoButton=t,this},t.prototype.showAudioModeButton=function(t){return this.ShowAudioModeButton=t,this},t.prototype.startWithAudioMuted=function(t){return this.StartAudioMuted=t,this},t.prototype.startWithVideoMuted=function(t){return this.StartVideoMuted=t,this},t.prototype.setAnalyticsSettings=function(t){return this.analyticsSettings=t,this},t.prototype.setAppId=function(t){return this.appId=t,this},t.prototype.setDefaultAudioMode=function(t){return this.defaultAudioMode=t,this},t.prototype.showSwitchToVideoCallButton=function(t){return this.ShowSwitchToVideoCallButton=t,this},t.prototype.setAvatarMode=function(t){return this.AvatarMode=t,this},t.prototype.showRecordingButton=function(t){return this.ShowRecordingButton=t,this},t.prototype.startRecordingOnCallStart=function(t){return this.StartRecordingOnCallStart=t,this},t.prototype.setMainVideoContainerSetting=function(t){return this.MainVideoContainerSetting=t,this},t.prototype.enableVideoTileClick=function(t){return this.EnableVideoTileClick=t,this},t.prototype.enableVideoTileDrag=function(t){return this.enableDraggableVideoTile=t,this},t.prototype.build=function(){return new r(this)},t}();e.CallSettingsBuilder=i;var a=function(){function t(){this.videoFit=r.ASPECT_RATIO_CONTAIN,this.zoomButton=o.CallConstants.ZOOM_BUTTON_DEFAULT_PARAMS,this.fullScreenButton=o.CallConstants.FULL_SCREEN_BUTTON_DEFAULT_PARAMS,this.userListButton=o.CallConstants.USER_LIST_BUTTON_DEFAULT_PARAMS,this.nameLabel=o.CallConstants.NAME_LABEL_DEFAULT_PARAMS}return t.prototype.setMainVideoAspectRatio=function(t){this.videoFit=t},t.prototype.setFullScreenButtonParams=function(t,e){s.isFalsy(t)||(this.fullScreenButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.fullScreenButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e)},t.prototype.setNameLabelParams=function(t,e,n){s.isFalsy(t)||(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e),s.isFalsy(n)||(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.COLOR]=n)},t.prototype.setZoomButtonParams=function(t,e){s.isFalsy(t)||(this.zoomButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.zoomButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e)},t.prototype.setUserListButtonParams=function(t,e){s.isFalsy(t)||(this.userListButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.userListButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e)},t}();e.MainVideoContainerSetting=a},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});e.__esModule=!0,e.CallingComponent=void 0;var i,a,E,c,u,S=n(49),p=n(16),C=n(5),l=n(3),T=n(1),d=n(15),g=n(50),_=n(0),h=n(6),r=function(e){function r(t){var r=e.call(this,t)||this;return r.state={shouldLoad:!1},a=t.callsettings,_.getCallSettings(a).then(function(t){var e=t.callSettingsNew,n=t.call,o=t.CallScreen,s=t.CometChatRTC;E=e,i=n,c=o,u=s,r.setState({shouldLoad:!0})}),r}return s(r,e),r.prototype.render=function(){return this.state.shouldLoad?S.createElement(p.View,{style:{flex:1,backgroundColor:"#000"}},S.createElement(c,{ref:function(t){return r.ref=t},style:{flex:1,backgroundColor:"#000"},callsettings:E,onCallEnded:function(){_.Logger.log("CallingComponent","oncallEnded")},onCallEndButtonPressed:function(){var t,e,n,o;i?(_.isFalsy(u)?(null===(t=null==r?void 0:r.ref)||void 0===t?void 0:t.endCall)&&(null===(e=null==r?void 0:r.ref)||void 0===e||e.endCall()):u.endCall(),setTimeout(function(){C.CometChat.endCall(a.getSessionId(),!0)},1e3)):(_.isFalsy(u)?(null===(n=null==r?void 0:r.ref)||void 0===n?void 0:n.endCall)&&(null===(o=null==r?void 0:r.ref)||void 0===o||o.endCall()):u.endCall(),d.CallController.getInstance().getCallListner()&&d.CallController.getInstance().getCallListner()._eventListener.onCallEnded(null))},onUserJoined:function(t){if(t){var e=void 0;_.isFalsy(t.uid)||_.isFalsy(t.name)||((e=new l.User(t)).setStatus("online"),C.CometChat.user.getUid().toLowerCase()!=e.getUid().toLowerCase()&&d.CallController.getInstance().getCallListner()&&(_.isFalsy(d.CallController.getInstance().getCallListner()._eventListener.onUserJoined)||d.CallController.getInstance().getCallListner()._eventListener.onUserJoined(e)))}},onUserLeft:function(t){if(t){var e=void 0;_.isFalsy(t.uid)||_.isFalsy(t.name)||((e=new l.User(t)).setStatus("online"),C.CometChat.user.getUid().toLowerCase()!=e.getUid().toLowerCase()&&d.CallController.getInstance().getCallListner()&&(_.isFalsy(d.CallController.getInstance().getCallListner()._eventListener.onUserLeft)||d.CallController.getInstance().getCallListner()._eventListener.onUserLeft(e)))}},onUserListChanged:function(t){var n=[];t&&0=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function C(t,e){if(S.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return w(t).length;default:if(o)return G(t).length;e=(""+e).toLowerCase(),o=!0}}function l(t,e,n){var o=t[e];t[e]=t[n],t[n]=o}function T(t,e,n,o,s){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):2147483647=t.length){if(s)return-1;n=t.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof e&&(e=S.from(e,o)),S.isBuffer(e))return 0===e.length?-1:d(t,e,n,o,s);if("number"==typeof e)return e&=255,S.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):d(t,[e],n,o,s);throw new TypeError("val must be string, number or Buffer")}function d(t,e,n,o,s){var r,i=1,a=t.length,E=e.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(t.length<2||e.length<2)return-1;a/=i=2,E/=2,n/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(s){var u=-1;for(r=n;r>>10&1023|55296),u=56320|1023&u),o.push(u),s+=S}return function(t){var e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);var n="",o=0;for(;othis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,n);case"utf8":case"utf-8":return A(this,e,n);case"ascii":return I(this,e,n);case"latin1":case"binary":return f(this,e,n);case"base64":return h(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,n);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}.apply(this,arguments)},S.prototype.equals=function(t){if(!S.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===S.compare(this,t)},S.prototype.inspect=function(){var t="",e=B.INSPECT_MAX_BYTES;return 0e&&(t+=" ... ")),""},S.prototype.compare=function(t,e,n,o,s){if(!S.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===s&&(s=this.length),e<0||n>t.length||o<0||s>this.length)throw new RangeError("out of range index");if(s<=o&&n<=e)return 0;if(s<=o)return-1;if(n<=e)return 1;if(this===t)return 0;for(var r=(s>>>=0)-(o>>>=0),i=(n>>>=0)-(e>>>=0),a=Math.min(r,i),E=this.slice(o,s),c=t.slice(e,n),u=0;uthis.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var r,i,a,E,c,u,S,p,C,l=!1;;)switch(o){case"hex":return g(this,t,e,n);case"utf8":case"utf-8":return p=e,C=n,K(G(t,(S=this).length-p),S,p,C);case"ascii":return _(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return E=this,c=e,u=n,K(w(t),E,c,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i=e,a=n,K(function(t,e){for(var n,o,s,r=[],i=0;i>8,s=n%256,r.push(s),r.push(o);return r}(t,(r=this).length-i),r,i,a);default:if(l)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),l=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function I(t,e,n){var o="";n=Math.min(t.length,n);for(var s=e;st.length)throw new RangeError("Index out of range")}function M(t,e,n,o){e<0&&(e=65535+e+1);for(var s=0,r=Math.min(t.length-n,2);s>>8*(o?s:1-s)}function L(t,e,n,o){e<0&&(e=4294967295+e+1);for(var s=0,r=Math.min(t.length-n,4);s>>8*(o?s:3-s)&255}function v(t,e,n,o,s,r){if(n+o>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,o,s){return s||v(t,0,n,4),r.write(t,e,n,o,23,4),n+4}function U(t,e,n,o,s){return s||v(t,0,n,8),r.write(t,e,n,o,52,8),n+8}S.prototype.slice=function(t,e){var n,o=this.length;if((t=~~t)<0?(t+=o)<0&&(t=0):o>>8):M(this,t,e,!0),e+2},S.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,2,65535,0),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},S.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,4294967295,0),S.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},S.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,4294967295,0),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},S.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e|=0,!o){var s=Math.pow(2,8*n-1);y(this,t,e,n,s-1,-s)}var r=0,i=1,a=0;for(this[e]=255&t;++r>0)-a&255;return e+n},S.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e|=0,!o){var s=Math.pow(2,8*n-1);y(this,t,e,n,s-1,-s)}var r=n-1,i=1,a=0;for(this[e+r]=255&t;0<=--r&&(i*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/i>>0)-a&255;return e+n},S.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,1,127,-128),S.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},S.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,2,32767,-32768),S.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},S.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,2,32767,-32768),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},S.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,2147483647,-2147483648),S.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},S.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),S.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},S.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},S.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},S.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},S.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},S.prototype.copy=function(t,e,n,o){if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(r=e;r>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function w(t){return o.toByteArray(function(t){var e;if((t=(e=t,e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function K(t,e,n,o){for(var s=0;s=e.length||s>=t.length);++s)e[s+n]=t[s];return s}}).call(this,e(18))},function(t,e,n){"use strict";e.__esModule=!0,e.RTCUser=void 0;var o=n(0),s=function(){function t(t){this.avatar="",o.isFalsy(t)||(this.uid=t.toString())}return t.prototype.setUID=function(t){this.uid=t?t.toString():""},t.prototype.getUID=function(){return this.uid.toString()},t.prototype.setName=function(t){this.name=t?t.toString():""},t.prototype.getName=function(){return this.name.toString()},t.prototype.setAvatar=function(t){this.avatar=t?t.toString():""},t.prototype.getAvatar=function(){return this.avatar.toString()},t.prototype.setJWT=function(t){this.jwt=t?t.toString():""},t.prototype.getJWT=function(){return this.jwt.toString()},t.prototype.setResource=function(t){this.resource=t?t.toString():""},t.prototype.getResource=function(){return this.resource.toString()},t}();e.RTCUser=s},function(t,e){t.exports=s},function(t,e,n){"use strict";e.__esModule=!0,e.AudioMode=void 0;var o=n(0),s=function(){function t(t,e){this.isSelected=!1,this.mode="",o.isFalsy(t)||(this.mode=t.toString()),this.isSelected=e||!1}return t.prototype.setMode=function(t){this.mode=t?t.toString():""},t.prototype.getMode=function(){return this.mode.toString()},t.prototype.setIsSelected=function(t){this.isSelected=t||!1},t.prototype.getIsSelected=function(){return this.isSelected},t}();e.AudioMode=s},function(t,e,n){"use strict";e.__esModule=!0,e.GroupsRequestBuilder=e.GroupsRequest=void 0;var s=n(6),o=n(0),r=n(2),i=n(17),a=n(1),E=function(){function t(t){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.hasJoined=0,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(t)||(o.isFalsy(t.limit)||(this.limit=t.limit),o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.hasJoined)||(this.hasJoined=1),o.isFalsy(t.tags)||(this.tags=t.tags),o.isFalsy(t.showTags)||(this.withTags=t.showTags))}return t.prototype.validateGroupBuilder=function(){if(void 0===this.limit)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>a.DEFAULT_VALUES.GROUPS_MAX_LIMIT)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.GROUPS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=100,t.DEFAULT_LIMIT=30,t}();e.GroupsRequest=E;var c=function(){function t(){}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.joinedOnly=function(t){return this.hasJoined=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.showTags=t,this},t.prototype.build=function(){return new E(this)},t}();e.GroupsRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.GroupMembersRequestBuilder=e.GroupMembersRequest=void 0;var s=n(6),o=n(0),r=n(14),i=n(2),a=n(40),E=n(1),c=function(){function t(t){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},this.store=r.LocalStorage.getInstance(),o.isFalsy(t)||(this.limit=t.limit,this.guid=t.guid,o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.scopes)||(this.scopes=t.scopes))}return t.prototype.validateGroupMembersBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>E.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",E.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();e.GroupMembersRequest=c;var u=function(){function t(t){this.guid=t}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setScopes=function(t){return this.scopes=t,this},t.prototype.build=function(){return new c(this)},t}();e.GroupMembersRequestBuilder=u},function(t,e,n){"use strict";e.__esModule=!0,e.BannedMembersRequestBuilder=e.BannedMembersRequest=void 0;var s=n(6),o=n(0),r=n(2),i=n(40),a=n(1),E=function(){function t(t){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(t)||(this.limit=t.limit,this.guid=t.guid,o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.scopes)||(this.scopes=t.scopes))}return t.prototype.validateBannedMembersBuilder=function(){if(void 0===this.limit)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>a.DEFAULT_VALUES.USERS_MAX_LIMIT)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();e.BannedMembersRequest=E;var c=function(){function t(t){this.guid=t}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setScopes=function(t){return this.scopes=t,this},t.prototype.build=function(){return new E(this)},t}();e.BannedMembersRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.UsersRequestBuilder=e.UsersRequest=void 0;var s=n(6),o=n(0),r=n(11),i=n(2),a=n(55),E=n(1),c=function(){function e(t){this.next_page=1,this.current_page=1,this.total_pages=-1,this.hideBlockedUsers=!1,this.friendsOnly=!1,this.fetchingInProgress=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},e.userStore=a.UserStore.getInstance(),o.isFalsy(t)||(this.limit=t.limit,o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.status)||(t.status==e.USER_STATUS.ONLINE?this.status=E.PresenceConstatnts.STATUS.AVAILABLE:this.status=t.status),o.isFalsy(t.shouldHideBlockedUsers)||(this.hideBlockedUsers=t.shouldHideBlockedUsers),o.isFalsy(t.showFriendsOnly)||(this.friendsOnly=t.showFriendsOnly),o.isFalsy(t.showTags)||(this.withTags=t.showTags),o.isFalsy(t.role)||(this.role=t.role),o.isFalsy(t.roles)||(this.roles=t.roles),o.isFalsy(t.tags)||(this.tags=t.tags),o.isFalsy(t.UIDs)||(this.UIDs=t.UIDs),o.isFalsy(t.SortBy)||(this.sortBy=t.SortBy),o.isFalsy(t.SearchIn)||(this.searchIn=t.SearchIn),o.isFalsy(t.SortOrder)||(this.sortOrder=t.SortOrder))}return e.prototype.validateUserBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>E.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",E.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},e.USER_STATUS={ONLINE:E.PresenceConstatnts.STATUS.ONLINE,OFFLINE:E.PresenceConstatnts.STATUS.OFFLINE},e}();e.UsersRequest=c;var u=function(){function t(){this.shouldHideBlockedUsers=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setStatus=function(t){return this.status=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.hideBlockedUsers=function(t){return this.shouldHideBlockedUsers=t,this},t.prototype.setRole=function(t){return this.role=t,this},t.prototype.setRoles=function(t){return this.roles=t,this},t.prototype.friendsOnly=function(t){return this.showFriendsOnly=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.showTags=t,this},t.prototype.setUIDs=function(t){return this.UIDs=t,this},t.prototype.sortBy=function(t){return this.SortBy=t,this},t.prototype.sortByOrder=function(t){return this.SortOrder=t,this},t.prototype.searchIn=function(t){return this.SearchIn=t,this},t.prototype.build=function(){return this.role&&this.roles&&this.roles.push(this.role),new c(this)},t}();e.UsersRequestBuilder=u},function(t,e,n){"use strict";e.__esModule=!0,e.UserStore=void 0;var r=n(0),i=n(1),a=n(2),o=n(12),s=function(){function t(t){this.store=i.constants.DEFAULT_STORE,r.isFalsy(t)||(this.store=t);try{this.userStore=o.default}catch(t){r.Logger.error("UserStore: constructor",{e:t})}}return t.getInstance=function(){return null==t.UserStore&&(t.UserStore=new t),t.UserStore},t.prototype.set=function(t,e){var n=r.getKeyprefix(i.LOCAL_STORE.USERS_STORE,t);return this.userStore.setItem(n,JSON.stringify(e))},t.prototype.get=function(t){var o=this,s=r.getKeyprefix(i.LOCAL_STORE.USERS_STORE,t);return new Promise(function(n,e){try{o.userStore.getItem(s).then(function(e){try{n(JSON.parse(e))}catch(t){n(e)}},function(t){e(t)})}catch(t){e(new a.CometChatException(t))}})},t.prototype.clear=function(t){},t.prototype.selectStore=function(t){this.store=t},t.prototype.storeUsers=function(t){var e=this;return t.map(function(t){e.set(t.getUid(),t)}),!0},t.prototype.storeUser=function(t){return this.set(t.getUid(),t),!0},t}();e.UserStore=s},function(t,e,n){"use strict";e.__esModule=!0,e.ConversationsRequestBuilder=e.ConversationsRequest=void 0;var s=n(6),o=n(0),r=n(2),i=n(30),a=n(1),E=function(){function t(t){this.limit=100,this.next_page=1,this.current_page=1,this.total_pages=-1,this.fetchingInProgress=!1,this.getUserAndGroupTags=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(t)||(this.limit=t.limit,o.isFalsy(t.conversationType)||(this.conversationType=t.conversationType)),o.isFalsy(t.getUserAndGroupTags)||(this.getUserAndGroupTags=t.getUserAndGroupTags),t.tags&&(this.tags=t.tags),o.isFalsy(t.WithTags)||(this.withTags=t.WithTags),t.groupTags&&(this.groupTags=t.groupTags),t.userTags&&(this.userTags=t.userTags)}return t.prototype.validateConversationBuilder=function(){return void 0===this.limit?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit"))):isNaN(this.limit)?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))):this.limit>a.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT))):this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t}();e.ConversationsRequest=E;var c=function(){function t(){this.WithTags=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setConversationType=function(t){return this.conversationType=t,this},t.prototype.withUserAndGroupTags=function(t){return"boolean"==typeof t&&(this.getUserAndGroupTags=t),this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.WithTags=t,this},t.prototype.setGroupTags=function(t){return this.groupTags=t,this},t.prototype.setUserTags=function(t){return this.userTags=t,this},t.prototype.build=function(){return new E(this)},t}();e.ConversationsRequestBuilder=c},function(t,e,n){"use strict";var f=this&&this.__awaiter||function(t,i,a,E){return new(a||(a=Promise))(function(n,e){function o(t){try{r(E.next(t))}catch(t){e(t)}}function s(t){try{r(E.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):(e=t.value,e instanceof a?e:new a(function(t){t(e)})).then(o,s)}r((E=E.apply(t,i||[])).next())})},O=this&&this.__generator||function(n,o){var s,r,i,t,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(s)throw new TypeError("Generator is already executing.");for(;a;)try{if(s=1,r&&(i=2&e[0]?r.return:e[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,e[1])).done)return i;switch(r=0,i&&(e=[2&e[0],i.value]),e[0]){case 0:case 1:i=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,r=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]L.DEFAULT_VALUES.MSGS_MAX_LIMIT)return void e(new N.CometChatException(JSON.parse(M.format(JSON.stringify(L.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",L.DEFAULT_VALUES.MSGS_MAX_LIMIT))));if(Et&&v.MessageListnerMaping.getInstance().set(L.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(a.id))},function(t){v.MessageListnerMaping.getInstance().set(L.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(a.id))}),this.affix==L.MessageConstatnts.PAGINATION.AFFIX.APPEND?(this.idparseInt(a.id)&&(this.id=parseInt(a.id)),this.timestamp>a.sentAt&&(this.timestamp=a.sentAt),this.updatedAt>a.updatedAt&&(this.updatedAt=a.updatedAt)),this.id&&(this.paginationMeta[L.MessageConstatnts.PAGINATION.KEYS.ID]=this.id),this.timestamp&&(this.paginationMeta[L.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=this.timestamp),this.updatedAt&&(this.paginationMeta[L.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=this.updatedAt),a.category!==L.MessageConstatnts.CATEGORY.MESSAGE&&a.category!==L.MessageConstatnts.CATEGORY.CUSTOM||a.type===L.MessageConstatnts.TYPE.TEXT||!a.data.attachments||0===(null===(s=a.data.attachments)||void 0===s?void 0:s.length)?[3,2]:(null===(r=P.CometChat.user)||void 0===r?void 0:r.getFat())&&P.CometChat.SECURED_MEDIA_HOST?(e=P.CometChat.SECURED_MEDIA_HOST,n=null===(i=P.CometChat.user)||void 0===i?void 0:i.getFat(),[4,M.updatePropertiesWithDynamicValue(a,e,"?"+L.ADDITIONAL_CONSTANTS.SECURE_URL_PROPERTY+"="+n)]):[3,2];case 1:(o=t.sent())&&(a=o),t.label=2;case 2:return E.push(y.MessageController.trasformJSONMessge(a)),[2]}})})})):E=[],o(E),[2]})})},function(t){e(new N.CometChatException(t.error))})}catch(t){e(new N.CometChatException(t))}})},t.prototype.createEndpoint=function(){this.parentMessageId?(this.endpointName="getThreadMessages",this.listId=this.parentMessageId.toString(),this.hideReplies&&(this.hideReplies=!1,delete this.paginationMeta[L.MessageConstatnts.PAGINATION.KEYS.HIDE_REPLIES])):(M.isFalsy(this.guid)||M.isFalsy(this.uid))&&M.isFalsy(this.guid)?(M.isFalsy(this.uid)?this.endpointName="getMessages":this.endpointName="getUserMessages",this.listId=this.uid):(this.endpointName="getGroupMessages",this.listId=this.guid)},t.prototype.makeData=function(){var t={};t[L.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,t[L.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,(M.isFalsy(this.guid)||M.isFalsy(this.uid))&&M.isFalsy(this.guid)&&M.isFalsy(this.uid)},t.prototype.getFilteredPreviousDataByReceiverId=function(e){return f(this,void 0,void 0,function(){var n,o=this;return O(this,function(t){switch(t.label){case 0:switch(n=[],e){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,r.MessagesStore.getInstance().get(this.uid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 2:return t.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 4:t.sent(),t.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).filter(function(t){return e[t].sender.uid==o.uid}).map(function(t){n=s(n,[e[t]])})})];case 6:return t.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 8:return t.sent(),[3,9];case 9:return[2,n]}})})},t.prototype.getFilteredNextDataByReceiverId=function(e){return f(this,void 0,void 0,function(){var n,o=this;return O(this,function(t){switch(t.label){case 0:switch(n=[],e){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,r.MessagesStore.getInstance().get(this.uid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 2:return t.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 4:t.sent(),t.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).filter(function(t){return e[t].sender.uid==o.uid}).map(function(t){n=s(n,[e[t]])})})];case 6:return t.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 8:return t.sent(),[3,9];case 9:return[2,n]}})})},t}();e.MessagesRequest=o;var a=function(){function t(){this.maxLimit=L.DEFAULT_VALUES.MSGS_MAX_LIMIT,this.timestamp=0,this.id=L.DEFAULT_VALUES.DEFAULT_MSG_ID,this.unread=!1,this.HideMessagesFromBlockedUsers=!1,this.onlyUpdate=0,this.HideDeletedMessages=!1,this.WithTags=!1,this.myMentionsOnlyFlag=!1,this.mentionsWithTagInfoFlag=!1,this.mentionsWithBlockedInfoFlag=!1,this.interactionGoalCompletedOnly=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setGUID=function(t){return this.guid=t,this},t.prototype.setUID=function(t){return this.uid=t,this},t.prototype.setParentMessageId=function(t){return this.parentMessageId=t,this},t.prototype.setTimestamp=function(t){return void 0===t&&(t=M.getCurrentTime()),this.timestamp=t,this},t.prototype.setMessageId=function(t){return void 0===t&&(t=L.DEFAULT_VALUES.DEFAULT_MSG_ID),this.id=t,this},t.prototype.setUnread=function(t){return void 0===t&&(t=!1),this.unread=t,this},t.prototype.hideMessagesFromBlockedUsers=function(t){return void 0===t&&(t=!1),this.HideMessagesFromBlockedUsers=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKey=t,this},t.prototype.setUpdatedAfter=function(t){return this.updatedAt=t,this},t.prototype.updatesOnly=function(t){return t&&(this.onlyUpdate=1),this},t.prototype.setCategory=function(t){return this.category=t,this},t.prototype.setCategories=function(t){return this.categories=t,this},t.prototype.setType=function(t){return this.type=t,this},t.prototype.setTypes=function(t){return this.types=t,this},t.prototype.hideReplies=function(t){return this.HideReplies=t,this},t.prototype.hideDeletedMessages=function(t){return this.HideDeletedMessages=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.WithTags=t,this},t.prototype.myMentionsOnly=function(t){return void 0===t&&(t=!1),this.myMentionsOnlyFlag=t,this},t.prototype.mentionsWithTagInfo=function(t){return void 0===t&&(t=!1),this.mentionsWithTagInfoFlag=t,this},t.prototype.mentionsWithBlockedInfo=function(t){return void 0===t&&(t=!1),this.mentionsWithBlockedInfoFlag=t,this},t.prototype.setInteractionGoalCompletedOnly=function(t){return void 0===t&&(t=!1),this.interactionGoalCompletedOnly=t,this},t.prototype.build=function(){return this.category&&this.categories&&this.categories.push(this.category),this.type&&this.types&&this.types.push(this.type),new o(this)},t}();e.MessagesRequestBuilder=a},function(t,e,n){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,n=1,o=arguments.length;nt.getId()&&(i=parseInt(t.getId().toString())),oa.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t.directions=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS,t}();e.BlockedUsersRequest=E;var c=function(){function t(){}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setDirection=function(t){return this.direction=t,this},t.prototype.blockedByMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BLOCKED_BY_ME,this},t.prototype.hasBlockedMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.HAS_BLOCKED_ME,this},t.prototype.build=function(){return new E(this)},t}();e.BlockedUsersRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.AppSettingsBuilder=e.AppSettings=void 0;var o=n(1),s=function(){function e(t){this.subscriptionType=e.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=o.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null,this.subscriptionType=t.subscriptionType,this.roles=t.roles,this.region=t.region,this.autoJoinGroup=t.autoJoinGroup,this.establishSocketConnection=t.establishSocketConnection,this.adminHost=t.adminHost,this.clientHost=t.clientHost}return e.prototype.getSubscriptionType=function(){return this.subscriptionType},e.prototype.getRoles=function(){return this.roles},e.prototype.getRegion=function(){return this.region},e.prototype.getIsAutoJoinEnabled=function(){return this.autoJoinGroup},e.prototype.shouldAutoEstablishSocketConnection=function(){return this.establishSocketConnection},e.prototype.getAdminHost=function(){return this.adminHost},e.prototype.getClientHost=function(){return this.clientHost},e.SUBSCRIPTION_TYPE_NONE="NONE",e.SUBSCRIPTION_TYPE_ALL_USERS="ALL_USERS",e.SUBSCRIPTION_TYPE_ROLES="ROLES",e.SUBSCRIPTION_TYPE_FRIENDS="FRIENDS",e.REGION_EU=o.DEFAULT_VALUES.REGION_DEFAULT_EU,e.REGION_US=o.DEFAULT_VALUES.REGION_DEFAULT_US,e.REGION_IN=o.DEFAULT_VALUES.REGION_DEFAULT_IN,e.REGION_PRIVATE=o.DEFAULT_VALUES.REGION_DEFAULT_PRIVATE,e}();e.AppSettings=s;var r=function(){function t(){this.subscriptionType=s.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=o.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null}return t.prototype.subscribePresenceForAllUsers=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ALL_USERS,this},t.prototype.subscribePresenceForRoles=function(t){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ROLES,this.roles=t,this},t.prototype.subscribePresenceForFriends=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_FRIENDS,this},t.prototype.setRegion=function(t){return void 0===t&&(t=o.DEFAULT_VALUES.REGION_DEFAULT),this.region=t.toLowerCase(),this},t.prototype.enableAutoJoinForGroups=function(t){return void 0===t&&(t=!0),this.autoJoinGroup=t,this},t.prototype.autoEstablishSocketConnection=function(t){return void 0===t&&(t=!0),this.establishSocketConnection=t,this},t.prototype.overrideAdminHost=function(t){return this.adminHost=t,this},t.prototype.overrideClientHost=function(t){return this.clientHost=t,this},t.prototype.build=function(){return new s(this)},t}();e.AppSettingsBuilder=r},function(t,e,n){"use strict";e.__esModule=!0,e.CometChatHelper=void 0;var S=n(10),p=n(1),C=n(11),l=n(17),T=n(30),o=n(5),s=n(2),r=n(0),i=function(){function t(){}return t.processMessage=function(t){try{return S.MessageController.trasformJSONMessge(t)}catch(t){r.Logger.error("CometChatHelper: processMessage",t)}},t.getConversationFromMessage=function(u){return new Promise(function(E,c){try{o.CometChat.getLoggedinUser().then(function(t){if(null!==t){var e=S.MessageController.trasformJSONMessge(u),n=e.receiverType,o=e.conversationId,s=void 0,r=S.MessageController.trasformJSONMessge(u);if(n==p.MessageConstatnts.RECEIVER_TYPE.USER){var i=C.UsersController.trasformJSONUser(e[p.MessageConstatnts.KEYS.SENDER]);s=i.getUid()==t.getUid()?C.UsersController.trasformJSONUser(e[p.MessageConstatnts.KEYS.RECEIVER]):i}else s=l.GroupsController.trasformJSONGroup(e[p.MessageConstatnts.KEYS.RECEIVER]);var a=T.ConversationController.trasformJSONConversation(o,n,r,s,0,[]);E(a)}else c(p.UserErrors.USER_NOT_LOGGED_IN)},function(t){c(new s.CometChatException(t.error))})}catch(t){c(new s.CometChatException(t))}})},t}();e.CometChatHelper=i},function(t,e,n){"use strict";var o=this&&this.__awaiter||function(t,i,a,E){return new(a||(a=Promise))(function(n,e){function o(t){try{r(E.next(t))}catch(t){e(t)}}function s(t){try{r(E.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):(e=t.value,e instanceof a?e:new a(function(t){t(e)})).then(o,s)}r((E=E.apply(t,i||[])).next())})},a=this&&this.__generator||function(n,o){var s,r,i,t,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(s)throw new TypeError("Generator is already executing.");for(;a;)try{if(s=1,r&&(i=2&e[0]?r.return:e[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,e[1])).done)return i;switch(r=0,i&&(e=[2&e[0],i.value]),e[0]){case 0:case 1:i=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,r=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]>16&255,r[i++]=e>>8&255,r[i++]=255&e;var c,u;2===s&&(e=S[t.charCodeAt(E)]<<2|S[t.charCodeAt(E+1)]>>4,r[i++]=255&e);1===s&&(e=S[t.charCodeAt(E)]<<10|S[t.charCodeAt(E+1)]<<4|S[t.charCodeAt(E+2)]>>2,r[i++]=e>>8&255,r[i++]=255&e);return r},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,s=[],r=0,i=n-o;r>2]+a[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],s.push(a[e>>10]+a[e>>4&63]+a[e<<2&63]+"="));return s.join("")};for(var a=[],S=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,r=o.length;s>18&63]+a[s>>12&63]+a[s>>6&63]+a[63&s]);return r.join("")}S["-".charCodeAt(0)]=62,S["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,o,s){var r,i,a=8*s-o-1,E=(1<>1,u=-7,S=n?s-1:0,p=n?-1:1,C=t[e+S];for(S+=p,r=C&(1<<-u)-1,C>>=-u,u+=a;0>=-u,u+=o;0>1,p=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,C=o?0:r-1,l=o?1:-1,T=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,i=u):(i=Math.floor(Math.log(e)/Math.LN2),e*(E=Math.pow(2,-i))<1&&(i--,E*=2),2<=(e+=1<=i+S?p/E:p*Math.pow(2,1-S))*E&&(i++,E/=2),u<=i+S?(a=0,i=u):1<=i+S?(a=(e*E-1)*Math.pow(2,s),i+=S):(a=e*Math.pow(2,S-1)*Math.pow(2,s),i=0));8<=s;t[n+C]=255&a,C+=l,a/=256,s-=8);for(i=i<i[0]&&e[1]>>((3&e)<<3)&255;return s}}},function(t,e){for(var s=[],n=0;n<256;++n)s[n]=(n+256).toString(16).substr(1);t.exports=function(t,e){var n=e||0,o=s;return[o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]]].join("")}}])}),function(){try{require("@cometchat/calls-sdk-react-native")&&(this.CometChatCallSDK=require("@cometchat/calls-sdk-react-native/package.json"),this.CometChatCalling={},this.CometChatCalling.isCallingComponentInstalled=!0,this.CometChatCalling.CallScreen=require("@cometchat/calls-sdk-react-native").default,this.CometChatCalling.CometChatRTC=require("@cometchat/calls-sdk-react-native").CometChatRTC,this.CometChatCalling.CometChatCalls=require("@cometchat/calls-sdk-react-native").CometChatCalls,this.CometChatCalling.CallEventListener=require("@cometchat/calls-sdk-react-native").CallEventListener)}catch(t){}try{require("@cometchat/chat-uikit-react-native")&&(this.CometChatUiKit=require("@cometchat/chat-uikit-react-native/package.json"))}catch(t){}}(); \ No newline at end of file +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@react-native-async-storage/async-storage"),require("react-native"),require("react"));else if("function"==typeof define&&define.amd)define(["@react-native-async-storage/async-storage","react-native","react"],e);else{var n="object"==typeof exports?e(require("@react-native-async-storage/async-storage"),require("react-native"),require("react")):e(t["@react-native-async-storage/async-storage"],t["react-native"],t.react);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,function(n,o,s){return function(n){var o={};function s(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,s),e.l=!0,e.exports}return s.m=n,s.c=o,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=35)}([function(t,W,r){"use strict";(function(K){W.__esModule=!0,W.validateQuestion=W.updatePropertiesWithDynamicValue=W.getCallSettings=W.isCallingComponentInstalled=W.getKeyprefix=W.validateConversationType=W.validateUpdateUser=W.validateCreateUser=W.validateMessage=W.validateChatType=W.validateMsgId=W.validateArray=W.validateHideMessagesFromBlockedUsers=W.validateId=W.validateCreateGroup=W.validateJoinGroup=W.validateUpdateGroup=W.validateScope=W.isAudio=W.isVideo=W.isImage=W.getUpdatedSettings=W.getAppSettings=W.getCurrentTime=W.Logger=W.createUidFromJid=W.format=W.getOrdinalSuffix=W.isFalsy=W.isTruthy=W.isObject=W.getJidHost=W.getChatHost=void 0;var o=r(14),B=r(1),t=r(5),b=r(2),i=r(19),a=r(21),E=r(23),F=r(6),e=r(10),x=r(38),V=r(49),J=r(15),c=r(25);function k(t){return null!=t&&("string"==typeof t&&(t=t.trim()),"object"==typeof t&&0===Object.keys(t).length&&(t=void 0)),["",0,"0",!1,null,"null",void 0,"undefined"].includes(t)}function u(t){for(var o=[],e=1;ei[0]&&e[1] All store cleared successfully","true"),t(!0)})}catch(t){d.Logger.error("CometChat: clearCache",t),e(t)}})},T.connect=function(t){var e=t||{},n=e.onSuccess,o=e.onError;T.user?(at.connection||(T.onConnectionSuccess=n,T.disconnectedByUser=!1,T.WSLogin(T.user)),T.didAnalyticsPingStart()||T.isAnalyticsDisabled||(T.pingAnalytics(),T.startAnalyticsPingTimer())):o&&o(new g.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},T.disconnect=function(t){var e=t||{},n=e.onSuccess,o=e.onError;T.user?(T.disconnectedByUser=!0,T.disconnectInternally({onError:o}),at.clearWSResponseTimer(),T.onDisconnectSuccess=n):o&&o(new g.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},T.disconnectInternally=function(t){var e=(t||{}).onError;T.user?(at.connection&&at.WSLogout(),T.didAnalyticsPingStart()&&T.clearAnalyticsPingTimer(),T.clearWSReconnectionTimer()):e&&e(new g.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},T.prototype.internalRestart=function(t){T.internalRestart||T.getInstance().internalLogout(!1).then(function(){T.internalRestart=!0,T.login(t).then(function(t){T.shouldConnectToWS=!0,T.internalRestart=!1},function(t){d.Logger.error("CometChat: internalRestart :: login",t),T.internalRestart=!1})},function(t){d.Logger.error("CometChat: internalRestart :: internalLogout",t)})},T.prototype.internalLogout=function(n){return void 0===n&&(n=!0),new Promise(function(t,e){try{T.didAnalyticsPingStart()&&T.clearAnalyticsPingTimer(),T.WSReconnectionInProgress&&T.clearWSReconnectionTimer(),T.isLoggedOut=!0,T.WSReconnectionInProgress=!1,T.isAnalyticsDisabled=!1,T.clearCache().then(function(){T.apiKey=void 0,T.user=void 0,T.authToken=void 0,T.cometChat=void 0,T.mode=void 0,at.WSLogout(),n&&T.pushToLoginListener("","Logout_Success"),t(!0)})}catch(t){d.Logger.error("CometChat: internalLogout",t),e(t)}})},T.markAsInteracted=function(t,o,e){return new Promise(function(n,e){try{d.isFalsy(t)?e(new g.CometChatException(m.ERRORS.PARAMETER_MISSING)):h.makeApiCall("markInteracted",{messageId:t},{interactions:[o]}).then(function(t){var e;e=t&&t.data&&t.data.message?t.data.message:"Marked interacted",n(e)},function(t){e(new g.CometChatException(t.error))})}catch(t){e(new g.CometChatException(t))}})},T.initialzed=!1,T.CometChatException=g.CometChatException,T.TextMessage=R.TextMessage,T.MediaMessage=p.MediaMessage,T.CustomMessage=w.CustomMessage,T.Action=i.Action,T.Call=s.Call,T.TypingIndicator=Y.TypingIndicator,T.TransientMessage=Q.TransientMessage,T.InteractiveMessage=tt.InteractiveMessage,T.InteractionGoal=et.InteractionGoal,T.Interaction=nt.Interaction,T.InteractionReceipt=ot.InteractionReceipt,T.Group=a.Group,T.User=l.User,T.GroupMember=K.GroupMember,T.Conversation=x.Conversation,T.USER_STATUS={ONLINE:f.PresenceConstatnts.STATUS.ONLINE,OFFLINE:f.PresenceConstatnts.STATUS.OFFLINE},T.MessagesRequest=D.MessagesRequest,T.MessagesRequestBuilder=D.MessagesRequestBuilder,T.ReactionRequest=rt.ReactionRequest,T.ReactionRequestBuilder=rt.ReactionRequestBuilder,T.UsersRequest=v.UsersRequest,T.UsersRequestBuilder=v.UsersRequestBuilder,T.ConversationsRequest=P.ConversationsRequest,T.ConversationsRequestBuilder=P.ConversationsRequestBuilder,T.BlockedUsersRequest=B.BlockedUsersRequest,T.BlockedUsersRequestBuilder=B.BlockedUsersRequestBuilder,T.GroupsRequest=y.GroupsRequest,T.GroupsRequestBuilder=y.GroupsRequestBuilder,T.GroupMembersRequest=M.GroupMembersRequest,T.GroupMembersRequestBuilder=M.GroupMembersRequestBuilder,T.BannedMembersRequest=L.BannedMembersRequest,T.BannedMembersRequestBuilder=L.BannedMembersRequestBuilder,T.CallSettings=k.CallSettings,T.CallSettingsBuilder=k.CallSettingsBuilder,T.MainVideoContainerSetting=k.MainVideoContainerSetting,T.AppSettings=b.AppSettings,T.AppSettingsBuilder=b.AppSettingsBuilder,T.CallingComponent=H.CallingComponent,T.MessageListener=o.MessageListener,T.UserListener=o.UserListener,T.GroupListener=o.GroupListener,T.OngoingCallListener=o.OngoingCallListener,T.CallListener=o.CallListener,T.ConnectionListener=o.ConnectionListener,T.LoginListener=o.LoginListener,T.CallController=N.CallController,T.CometChatHelper=F.CometChatHelper,T.Attachment=J.Attachment,T.GoalType=f.GoalType,T.MESSAGE_TYPE=f.MessageConstatnts.TYPE,T.CATEGORY_MESSAGE=f.MessageConstatnts.CATEGORY.MESSAGE,T.CATEGORY_ACTION=f.MessageConstatnts.CATEGORY.ACTION,T.CATEGORY_CALL=f.MessageConstatnts.CATEGORY.CALL,T.CATEGORY_CUSTOM=f.MessageConstatnts.CATEGORY.CUSTOM,T.ACTION_TYPE=f.ActionConstatnts.ACTIONS,T.CALL_TYPE=f.CallConstants.CALL_TYPE,T.CATEGORY_INTERACTIVE=f.MessageConstatnts.CATEGORY.INTERACTIVE,T.REACTION_ACTION=f.REACTION_ACTION,T.RECEIVER_TYPE=f.MessageConstatnts.RECEIVER_TYPE,T.CALL_STATUS=f.CallConstants.CALL_STATUS,T.GROUP_MEMBER_SCOPE=f.GROUP_MEMBER_SCOPE,T.GROUP_TYPE=f.GROUP_TYPE,T.MESSAGE_REQUEST=f.MessageConstatnts.PAGINATION.CURSOR_FILEDS,T.CONNECTION_STATUS=f.CONNECTION_STATUS,T.CALL_MODE=f.CallConstants.CALL_MODE,T.AUDIO_MODE=f.CallConstants.AUDIO_MODE,T.SORT_BY=f.UserConstants.SORT_BY,T.SORT_ORDER=f.UserConstants.SORT_ORDER,T.WSReconnectionInProgress=!1,T.WSReconnectionTimerInterval=5e3,T.currentConnectionStatus=f.CONNECTION_STATUS.DISCONNECTED,T.isConnectingFromInit=!1,T.loginInProgress=!1,T.internalRestart=!1,T.settingsInterval=6e4,T.isAnalyticsPingStarted=!1,T.isLoggedOut=!0,T.isAnalyticsDisabled=!1,T.disconnectedByUser=!1,T.shouldConnectToWS=!0,T.isAppInactive=!1,T.onConnectionSuccess=null,T.onDisconnectSuccess=null,T.onConnectionError=null,T.callWaitTimer=null,T.callWaitTime=30,T}();e.CometChat=ct},function(t,e,n){"use strict";e.__esModule=!0,e.BaseMessage=void 0;var o=n(1),s=n(20),r=n(0),i=function(){function t(t,e,n,o){this.mentionedUsers=[],this.mentionedMe=!1,this.receiverId=t,this.type=e,this.receiverType=n,this.category=o}return t.prototype.getId=function(){return this.id},t.prototype.setId=function(t){this.id=t},t.prototype.getUnreadRepliesCount=function(){return this.unreadRepliesCount},t.prototype.setUnreadRepliesCount=function(t){this.unreadRepliesCount=t},t.prototype.getConversationId=function(){return this.conversationId},t.prototype.setConversationId=function(t){this.conversationId=t},t.prototype.getParentMessageId=function(){return this.parentMessageId},t.prototype.setParentMessageId=function(t){this.parentMessageId=t},t.prototype.getMuid=function(){return this.muid},t.prototype.setMuid=function(t){this.muid=t},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(t){this.sender=t},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(t){this.receiver=t},t.prototype.getReceiverId=function(){return this.receiverId},t.prototype.setReceiverId=function(t){this.receiverId=t},t.prototype.getType=function(){return this.type},t.prototype.setType=function(t){this.type=t},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(t){this.receiverType=t},t.prototype.getSentAt=function(){return this.sentAt},t.prototype.setSentAt=function(t){this.sentAt=t},t.prototype.getStatus=function(){return this.status},t.prototype.setStatus=function(t){this.status=t},t.prototype.getDeliveredAt=function(){return this.deliveredAt},t.prototype.setDeliveredAt=function(t){this.deliveredAt=t},t.prototype.getDeliveredToMeAt=function(){return this.deliveredToMeAt},t.prototype.setDeliveredToMeAt=function(t){this.deliveredToMeAt=t},t.prototype.getReadAt=function(){return this.readAt},t.prototype.setReadAt=function(t){this.readAt=t},t.prototype.getReadByMeAt=function(){return this.readByMeAt},t.prototype.setReadByMeAt=function(t){this.readByMeAt=t},t.prototype.getCategory=function(){return this.category},t.prototype.setCategory=function(t){this.category=t},t.prototype.getEditedAt=function(){return this.editedAt},t.prototype.setEditedAt=function(t){this.editedAt=t},t.prototype.getEditedBy=function(){return this.editedBy},t.prototype.setEditedBy=function(t){this.editedBy=t},t.prototype.getDeletedAt=function(){return this.deletedAt},t.prototype.setDeletedAt=function(t){this.deletedAt=t},t.prototype.getDeletedBy=function(){return this.deletedBy},t.prototype.setDeletedBy=function(t){this.deletedBy=t},t.prototype.getReplyCount=function(){return this.replyCount},t.prototype.setReplyCount=function(t){this.replyCount=t},t.prototype.getRawMessage=function(){return this.rawMessage},t.prototype.setRawMessage=function(t){this.rawMessage=t},t.prototype.setMentionedUsers=function(t){this.mentionedUsers=t},t.prototype.getMentionedUsers=function(){return this.mentionedUsers},t.prototype.setHasMentionedMe=function(t){this.mentionedMe=t},t.prototype.hasMentionedMe=function(){return this.mentionedMe},t.prototype.getData=function(){return this.data},t.prototype.setData=function(t){this.data=t},t.prototype.setReactions=function(t){try{this.setReactionsToData(t)}catch(t){return this.reactions}},t.prototype.getReactions=function(){try{return this.getReactionsFromData()}catch(t){return this.reactions}},t.prototype.setReactionsToData=function(t){var e=this.getData();if(e[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS]){var n=t.map(function(t){var e=new s.ReactionCount({});return Object.assign(e,t),e});e[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS]=n,this.setData(e),this.reactions=n}else e[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS]=t,this.setData(e),this.reactions=t},t.prototype.getReactionsFromData=function(){try{var t=this.getData(),n=[];if(t[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS])t[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS].forEach(function(t){var e=new s.ReactionCount({});Object.assign(e,t),n.push(e)});return n}catch(t){r.Logger.error("BaseMessageModel: getReactionsFromData",t)}},t}();e.BaseMessage=i},function(t,e,n){"use strict";e.__esModule=!0,e.Group=void 0;var o=n(1),s=function(){function t(t,e,n,o,s,r,i){this.hasJoined=!1,this.membersCount=0,this.guid=t,e&&(this.name=e),n&&(this.type=n),!o&&""!==o||"password"!=n||(this.password=o),(s||""===s)&&(this.icon=s),(r||""===r)&&(this.description=r),i&&(this.hasJoined=i)}return t.prototype.getGuid=function(){return this.guid},t.prototype.setGuid=function(t){this.guid=t},t.prototype.getName=function(){return this.name},t.prototype.setName=function(t){t&&(this.name=t)},t.prototype.getType=function(){return this.type},t.prototype.setType=function(t){this.type=t},t.prototype.getPassword=function(){return this.password},t.prototype.setPassword=function(t){this.password=t},t.prototype.getIcon=function(){return this.icon},t.prototype.setIcon=function(t){this.icon=t},t.prototype.getDescription=function(){return this.description},t.prototype.setDescription=function(t){this.description=t},t.prototype.getOwner=function(){return this.owner},t.prototype.setOwner=function(t){this.owner=t},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(t){this.metadata=t},t.prototype.getCreatedAt=function(){return this.createdAt},t.prototype.setCreatedAt=function(t){this.createdAt=t},t.prototype.getUpdatedAt=function(){return this.updatedAt},t.prototype.setUpdatedAt=function(t){this.updatedAt=t},t.prototype.getHasJoined=function(){return this.hasJoined},t.prototype.setHasJoined=function(t){this.hasJoined=t},t.prototype.getWsChannel=function(){return this.wsChannel},t.prototype.setWsChannel=function(t){this.wsChannel=t},t.prototype.setScope=function(t){this.scope=t},t.prototype.getScope=function(){return this.scope},t.prototype.getJoinedAt=function(){return this.joinedAt},t.prototype.setJoinedAt=function(t){this.joinedAt=t},t.prototype.getMembersCount=function(){return this.membersCount},t.prototype.setMembersCount=function(t){this.membersCount=t},t.prototype.setTags=function(t){this.tags=t},t.prototype.getTags=function(){return this.tags},t.TYPE=o.GroupType,t.Type=t.TYPE,t}();e.Group=s},function(t,e,n){"use strict";e.__esModule=!0,e.CometChatEvent=void 0;var i=n(0),o=n(4),s=function(){function t(t,e,n,o,s,r){i.isFalsy(t)||(this.appId=t),i.isFalsy(e)||(this.receiver=e),i.isFalsy(n)||(this.receiverType=n),i.isFalsy(s)||(this.deviceId=s),i.isFalsy(o)||(this.sender=o),i.isFalsy(r)||(this.messageSender=r)}return t.prototype.getAppId=function(){return this.appId},t.prototype.setAppId=function(t){this.appId=t},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(t){this.receiver=t},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(t){this.sender=t},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(t){this.receiverType=t},t.prototype.getType=function(){return this.type},t.prototype.setType=function(t){this.type=t},t.prototype.getDeviceId=function(){return this.deviceId},t.prototype.setDeviceId=function(t){this.deviceId=t},t.prototype.getMessageSender=function(){return this.messageSender},t.prototype.setMessageSender=function(t){this.messageSender=t},t.prototype.getCometChatEventJSON=function(){var t={};return t[o.KEYS.APP_ID]=this.getAppId(),t[o.KEYS.RECEIVER]=this.getReceiver(),t[o.KEYS.RECEIVER_TYPE]=this.getReceiverType(),t[o.KEYS.DEVICE_ID]=this.getDeviceId(),t[o.KEYS.TYPE]=this.getType(),t[o.KEYS.SENDER]=this.getSender(),i.isFalsy(this.getMessageSender())||(t[o.KEYS.MESSAGE_SENDER]=this.getMessageSender()),t},t}();e.CometChatEvent=s},function(t,e,n){"use strict";e.__esModule=!0,e.FETCH_ERROR=e.TYPINGNOTIFICATION_CONSTANTS=e.LOGIN_ERROR=e.MESSAGE_ERRORS=e.MESSAGES_REQUEST_ERRORS=e.USERS_REQUEST_ERRORS=e.GROUP_CREATION_ERRORS=e.INIT_ERROR=e.ERRORS=e.SERVER_ERRORS=void 0,e.SERVER_ERRORS={AUTH_ERR:{code:"AUTH_ERR_AUTH_TOKEN_NOT_FOUND",message:"The auth token %s% does not exist. Please make sure you are logged in and have a valid auth token or try login again."}},e.ERRORS={PARAMETER_MISSING:{code:"MISSING_PARAMETERS",name:"Invalid or no parameter passed to the method."}},e.INIT_ERROR={NO_APP_ID:{code:e.ERRORS.PARAMETER_MISSING.code,name:e.ERRORS.PARAMETER_MISSING.name,message:"AppID cannot be empty. Please specify a valid appID.",details:{}}},e.GROUP_CREATION_ERRORS={EMPTY_PASSWORD:{code:"ERR_EMPTY_GROUP_PASS",details:void 0,message:"Password is mandatory to join a group.",name:void 0}},e.USERS_REQUEST_ERRORS={EMPTY_USERS_LIST:{code:"EMPTY_USERS_LIST",name:"EMPTY_USERS_LIST",message:"The users list needs to have atleast one UID.",details:{}}},e.MESSAGES_REQUEST_ERRORS={REQUEST_IN_PROGRESS_ERROR:{code:"REQUEST_IN_PROGRESS",name:"REQUEST_IN_PROGRESS",message:"Request in progress.",details:{}},NOT_ENOUGH_PARAMS:{code:"NOT_ENOUGH_PARAMETERS",name:"NOT_ENOUGH_PARAMETERS",message:"`Timestamp`, `MessageId` or `updatedAfter` is required to use the 'fetchNext()' method.",details:{}}},e.MESSAGE_ERRORS={INVALID_CUSTOM_DATA:{code:"-1",name:"%s_CUSTOM_DATA",message:"",details:{}}},e.LOGIN_ERROR={NOT_INITIALIZED:{code:"-1",name:"COMETCHAT_INITIALIZATION_NOT_DONE",message:"please initialize the cometchat before using login method.",details:{}},UNAUTHORISED:{code:401,name:"USER_NOT_AUTHORISED",message:"The `authToken` of the user is not authorised. Please verify again.",details:{}},WS_CONNECTION_FAIL:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. %s",details:{}},WS_CONNECTION_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. Trying to connect with port: %s",details:{}},WS_CONNECTION_FALLBACK_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FALLBACK_FAIL",message:"WS Connection fallback failed. Trying to connect with port: %s",details:{}},WS_AUTH_FAIL:{code:-1,name:"WS_AUTH_FAIL",message:"WS username/password not correct.",details:{}},NO_INTERNET:{code:-1,name:"NO_INTERNET_CONNECTION",message:"You do not have internet connection.",details:{}},REQUEST_IN_PROGRESS:{code:-1,name:"LOGIN_IN_PROGRESS",message:"Please wait until the previous login request ends.",details:{}}},e.TYPINGNOTIFICATION_CONSTANTS={TOO_MANY_REQUEST:{code:"TOO_MANY_REQUEST",name:"TOO MANY REQUEST",message:"too many request, wait for `%s` seconds before sending next request.",details:{}}},e.FETCH_ERROR={ERROR_IN_API_CALL:{code:"FAILED_TO_FETCH",name:"FAILED_TO_FETCH",message:"There is an unknown issue with the API request. Please check your internet connection and verify the api call.",details:{}}}},function(t,e,n){"use strict";e.__esModule=!0,e.MessageController=void 0;var a=n(7),E=n(19),c=n(21),u=n(0),p=n(1),S=n(27),C=n(28),l=n(29),r=n(2),T=n(22),d=n(23),g=n(6),h=n(12),_=n(3),R=n(25),o=function(){function i(){}return i.trasformJSONMessge=function(n){try{var t=null;n.hasOwnProperty("rawMessage")||(t=JSON.parse(JSON.stringify(n)));var e=void 0;switch(n[p.MessageConstatnts.KEYS.CATEGORY]){case p.MessageConstatnts.CATEGORY.ACTION:e=S.Action.actionFromJSON(n);break;case p.MessageConstatnts.CATEGORY.CALL:e=C.Call.callFromJSON(n);break;case p.MessageConstatnts.CATEGORY.MESSAGE:switch(n[p.MessageConstatnts.KEYS.TYPE]){case p.MessageConstatnts.TYPE.TEXT:e=new E.TextMessage(n[p.MessageConstatnts.KEYS.RECEIVER],n[p.MessageConstatnts.KEYS.DATA][p.MessageConstatnts.KEYS.TEXT],n[p.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;case p.MessageConstatnts.TYPE.CUSTOM:e=new d.CustomMessage(n[p.MessageConstatnts.KEYS.RECEIVER],n[p.MessageConstatnts.KEYS.DATA][p.MessageConstatnts.KEYS.CUSTOM_DATA],n[p.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;default:if(e=new c.MediaMessage(n[p.MessageConstatnts.KEYS.RECEIVER],n[p.MessageConstatnts.KEYS.DATA][p.MessageConstatnts.KEYS.URL],n[p.MessageConstatnts.KEYS.TYPE],n[p.MessageConstatnts.KEYS.RECEIVER_TYPE]),n.hasOwnProperty(p.MessageConstatnts.KEYS.DATA)){var o=n[p.MessageConstatnts.KEYS.DATA];if(o.hasOwnProperty(p.MessageConstatnts.KEYS.ATTATCHMENTS)){var s,r=o[p.MessageConstatnts.KEYS.ATTATCHMENTS];new Array;r.map(function(t){s=new T.Attachment(t)}),e.setAttachment(s)}o.hasOwnProperty(p.MessageConstatnts.KEYS.TEXT)&&e.setCaption(o[p.MessageConstatnts.KEYS.TEXT])}e.hasOwnProperty("file")&&delete e.file}break;case p.MessageConstatnts.CATEGORY.CUSTOM:e=new d.CustomMessage(n[p.MessageConstatnts.KEYS.RECEIVER],n[p.MessageConstatnts.KEYS.DATA][p.MessageConstatnts.KEYS.CUSTOM_DATA],n[p.MessageConstatnts.KEYS.RECEIVER_TYPE],n.type);break;case p.MessageConstatnts.CATEGORY.INTERACTIVE:e=new R.InteractiveMessage(n[p.MessageConstatnts.KEYS.RECEIVER],n[p.MessageConstatnts.KEYS.RECEIVER_TYPE],n.type,n[p.MessageConstatnts.KEYS.DATA][p.MessageConstatnts.KEYS.INTERACTIVE_DATA],n[p.MessageConstatnts.KEYS.DATA][p.MessageConstatnts.KEYS.INTERACTION_GOAL])}n[p.MessageConstatnts.KEYS.MY_RECEIPTS]&&(n[p.MessageConstatnts.KEYS.MY_RECEIPTS]=n[p.MessageConstatnts.KEYS.MY_RECEIPTS],Object.keys(n[p.MessageConstatnts.KEYS.MY_RECEIPTS]).map(function(t){var e=new l.MessageReceipt;t==p.DELIVERY_RECEIPTS.DELIVERED_AT&&(e.setReceiptType(e.RECEIPT_TYPE.DELIVERY_RECEIPT),e.setDeliveredAt(n[p.MessageConstatnts.KEYS.MY_RECEIPTS][p.DELIVERY_RECEIPTS.DELIVERED_AT]),u.isFalsy(n[p.MessageConstatnts.KEYS.MY_RECEIPTS][p.DELIVERY_RECEIPTS.RECIPIENT])?n[p.DELIVERY_RECEIPTS.DELIVERED_TO_ME_AT]=n[p.MessageConstatnts.KEYS.MY_RECEIPTS][p.DELIVERY_RECEIPTS.DELIVERED_AT]:e.setSender(n[p.MessageConstatnts.KEYS.MY_RECEIPTS][p.DELIVERY_RECEIPTS.RECIPIENT]),e.setReceiverType(n[p.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(n[p.MessageConstatnts.KEYS.RECEIVER])),n[p.MessageConstatnts.KEYS.MY_RECEIPTS][p.READ_RECEIPTS.READ_AT]&&(e.setReceiptType(e.RECEIPT_TYPE.READ_RECEIPT),e.setReadAt(n[p.MessageConstatnts.KEYS.MY_RECEIPTS][p.READ_RECEIPTS.READ_AT]),u.isFalsy(n[p.MessageConstatnts.KEYS.MY_RECEIPTS][p.READ_RECEIPTS.RECIPIENT])?n[p.READ_RECEIPTS.READ_BY_ME_AT]=n[p.MessageConstatnts.KEYS.MY_RECEIPTS][p.READ_RECEIPTS.READ_AT]:e.setSender(n[p.MessageConstatnts.KEYS.MY_RECEIPTS][p.READ_RECEIPTS.RECIPIENT]),e.setReceiverType(n[p.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(n[p.MessageConstatnts.KEYS.RECEIVER]))}));try{if(Object.assign(e,n),(n=e).parentId&&(n.parentMessageId=n.parentId,delete n.parentId),n instanceof a.BaseMessage&&(u.isFalsy(t)||n.setRawMessage(t)),n instanceof E.TextMessage)i.extractDetailsFromMentions(n),n.setSender(n.getSender()),n.setReceiver(n.getReceiver()),n.getData()[p.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[p.MessageConstatnts.KEYS.METADATA]);else if(n instanceof c.MediaMessage)i.extractDetailsFromMentions(n),n.getData()[p.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[p.MessageConstatnts.KEYS.METADATA]),n.setSender(n.getSender()),n.setReceiver(n.getReceiver());else if(n instanceof S.Action)n.setSender(n.getSender()),n.setReceiver(n.getActionFor()),n.setActionBy(n.getActionBy()),n.setActionOn(n.getActionOn()),n.setActionFor(n.getActionFor()),n.setMessage(n.getMessage());else if(n instanceof C.Call){try{n.setSender(n.getSender())}catch(t){u.Logger.error("MessageController: trasformJSONMessge: setSender",t)}try{n.setCallInitiator(n.getCallInitiator())}catch(t){u.Logger.error("MessageController: trasformJSONMessge: setCallInitiator",t)}try{n.setReceiver(n.getCallReceiver()),n.setCallReceiver(n.getCallReceiver())}catch(t){u.Logger.error("MessageController: trasformJSONMessge: setCallreceiver",t)}}else n instanceof d.CustomMessage?(n.getData()[p.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[p.MessageConstatnts.KEYS.METADATA]),n.setCustomData(n.getData()[p.MessageConstatnts.KEYS.CUSTOM_DATA]),n.setSubType(n.getData()[p.MessageConstatnts.KEYS.CUSTOM_SUB_TYPE]),n.setSender(n.getSender()),n.setReceiver(n.getReceiver())):n instanceof R.InteractiveMessage&&(n.setMetadata(n.getData()[p.MessageConstatnts.KEYS.METADATA]),n.setInteractiveData(n.getData()[p.MessageConstatnts.KEYS.INTERACTIVE_DATA]),n.setInteractionGoal(n.getInteractionGoal()),n.setInteractions(n.getInteractions()),n.setSender(n.getSender()),n.setReceiver(n.getReceiver()),n.setIsSenderInteractionAllowed(n.getData()[p.MessageConstatnts.KEYS.ALLOW_SENDER_INTERACTION]))}catch(t){u.Logger.error("MessageController: trasformJSONMessge: Main",t),n=null}return n}catch(t){u.Logger.error("MessageController: trasformJSONMessge",t)}},i.extractDetailsFromMentions=function(t){if(t.getData()[p.MessageConstatnts.KEYS.MENTIONS]){var e=[],n=!1,o=g.CometChat.user,s=t.getData()[p.MessageConstatnts.KEYS.MENTIONS];for(var r in s)r.toString()==(null==o?void 0:o.getUid())&&(n=!0),e.push(new _.User(s[r]));t.setMentionedUsers(e),t.setHasMentionedMe(n)}},i.getReceiptsFromJSON=function(s){return new Promise(function(t,e){try{var o=[];g.CometChat.getLoggedInUser().then(function(n){u.isFalsy(s.receipts)?t([]):(s.receipts.data.map(function(t){var e=new l.MessageReceipt;t[p.DELIVERY_RECEIPTS.DELIVERED_AT]&&(e.setReceiptType(e.RECEIPT_TYPE.DELIVERY_RECEIPT),e.setDeliveredAt(t[p.DELIVERY_RECEIPTS.DELIVERED_AT]),e.setTimestamp(t[p.DELIVERY_RECEIPTS.DELIVERED_AT]),u.isFalsy(t[p.DELIVERY_RECEIPTS.RECIPIENT])?e.setSender(n):e.setSender(h.UsersController.trasformJSONUser(t[p.DELIVERY_RECEIPTS.RECIPIENT])),e.setReceiverType(s[p.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(s[p.MessageConstatnts.KEYS.RECEIVER])),t[p.READ_RECEIPTS.READ_AT]&&(e.setReceiptType(e.RECEIPT_TYPE.READ_RECEIPT),e.setReadAt(t[p.READ_RECEIPTS.READ_AT]),e.setTimestamp(t[t[p.READ_RECEIPTS.READ_AT]]),u.isFalsy(t[p.READ_RECEIPTS.RECIPIENT])?e.setSender(n):e.setSender(h.UsersController.trasformJSONUser(t[p.READ_RECEIPTS.RECIPIENT])),e.setReceiverType(s[p.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(s[p.MessageConstatnts.KEYS.RECEIVER])),o.push(e)}),t(o))})}catch(t){e(new r.CometChatException(t))}})},i}();e.MessageController=o},function(t,e,n){"use strict";e.__esModule=!0,e.UsersController=void 0;var o=n(3),s=n(0),r=function(){function t(){}return t.trasformJSONUser=function(t){var e;try{t.uid=t.uid.toString(),t.name=t.name.toString(),t.status&&"offline"!==t.status?t.status="online":t.status="offline",e=new o.User(t),Object.assign(e,t),t=e}catch(t){s.Logger.error("UsersController:transformJSONUser",t)}return t},t}();e.UsersController=r},function(t,e){t.exports=n},function(t,e,n){"use strict";e.__esModule=!0,e.LocalStorage=void 0;var r=n(0),i=n(1),a=n(2),o=n(13),s=function(){function t(t){this.store=i.constants.DEFAULT_STORE,r.isFalsy(t)||(this.store=t);try{this.localStore=o.default}catch(t){r.Logger.error("store: constructor",{e:t})}}return t.getInstance=function(){return null==t.localStorage&&(t.localStorage=new t),t.localStorage},t.prototype.set=function(t,e){var n=r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,t);return this.localStore.setItem(n,JSON.stringify(e))},t.prototype.get=function(t){var o=this,s=r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,t);return new Promise(function(n,e){try{o.localStore.getItem(s).then(function(e){try{n(JSON.parse(e))}catch(t){n(e)}},function(t){e(t)})}catch(t){e(new a.CometChatException(t))}})},t.prototype.clearStore=function(){var s=this;return new Promise(function(n,e){try{var o=[r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,i.LOCAL_STORE.KEY_USER),r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,i.LOCAL_STORE.KEY_APP_SETTINGS)];s.localStore.getAllKeys().then(function(t){if(0"}},getFriends:{endpoint:"user/friends",method:"GET"},unfriend:{endpoint:"user/friends/{{uid}}/{{gid}}",method:"DELETE",data:{uids:"array"}},acceptFriendRequest:{endpoint:"user/friends/{{uid}}/accept",method:"PUT",data:{uids:"array"}},rejectFriendRequest:{endpoint:"user/friends/{{uid}}/reject",method:"DELETE",data:{uids:"array"}},createGroup:{endpoint:"groups",method:"POST",data:{guid:"required|string|max:100",name:"required|string|max:100",type:"enum|public,protected,password",password:"filled|string|max:100"}},getGroups:{endpoint:"groups",method:"GET"},getGroup:{endpoint:"groups/{{guid}}",method:"GET"},updateGroup:{endpoint:"groups/{{guid}}",method:"PUT"},deleteGroup:{endpoint:"groups/{{guid}}",method:"DELETE"},addGroupMembers:{endpoint:"groups/{{guid}}/members",method:"POST",data:{uids:"array"}},getGroupMembers:{endpoint:"groups/{{guid}}/members",method:"GET"},joinGroup:{endpoint:"groups/{{guid}}/members",method:"POST"},leaveGroup:{endpoint:"groups/{{guid}}/members",method:"DELETE"},kickGroupMembers:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"DELETE",data:{uids:"array"}},changeScopeOfMember:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"PUT",data:{uids:"array"}},banGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"POST",data:{uids:"array"}},unbanGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"DELETE",data:{uids:"array"}},addMemebersToGroup:{endpoint:"groups/{{guid}}/members",method:"PUT"},getBannedGroupMembers:{endpoint:"groups/{{guid}}/bannedusers",method:"GET"},promotemoteGroupMember:{endpoint:"groups/{{guid}}/promote",method:"PUT",data:{uids:"array"}},demoteGroupMember:{endpoint:"groups/{{guid}}/demote",method:"DELETE",data:{uids:"array"}},transferOwnership:{endpoint:"groups/{{guid}}/owner",method:"PATCH"},sendMessage:{endpoint:"messages",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},sendMessageInThread:{endpoint:"messages/{{parentId}}/thread",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},getMessages:{endpoint:"messages",method:"GET"},getMessageDetails:{endpoint:"messages/{{messageId}}",method:"GET"},addReaction:{endpoint:"messages/{{messageId}}/reactions/{{reaction}}",method:"POST"},removeReaction:{endpoint:"messages/{{messageId}}/reactions/{{reaction}}",method:"DELETE"},getFilteredReactionsList:{endpoint:"messages/{{messageId}}/reactions/{{reaction}}",method:"GET",data:{}},getReactionsList:{endpoint:"messages/{{messageId}}/reactions",method:"GET",data:{}},getUserMessages:{endpoint:"users/{{listId}}/messages",method:"GET"},getGroupMessages:{endpoint:"groups/{{listId}}/messages",method:"GET"},getThreadMessages:{endpoint:"messages/{{listId}}/thread",method:"GET"},getMessage:{endpoint:"user/messages/{{muid}}",method:"GET"},updateMessage:{endpoint:"messages/{{messageId}}",method:"PUT"},deleteMessage:{endpoint:"messages/{{messageId}}",method:"DELETE"},markAsReadForUser:{endpoint:"users/{{uid}}/conversation/read",method:"POST"},markAsReadForGroup:{endpoint:"groups/{{guid}}/conversation/read",method:"POST"},markAsDeliveredForUser:{endpoint:"users/{{uid}}/conversation/delivered",method:"POST"},markAsDeliveredForGroup:{endpoint:"groups/{{guid}}/conversation/delivered",method:"POST"},markUserMessagesAsUnread:{endpoint:"users/{{uid}}/conversation/read",method:"DELETE"},markGroupMessagesAsUnread:{endpoint:"groups/{{guid}}/conversation/read",method:"DELETE"},createCallSession:{endpoint:"calls",method:"POST",data:{}},updateCallSession:{endpoint:"calls/{{sessionid}}",method:"put",data:{}},getConversations:{endpoint:"conversations",method:"GET"},getUserConversation:{endpoint:"users/{{uid}}/conversation",method:"GET"},getGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"GET"},deleteUserConversation:{endpoint:"users/{{uid}}/conversation",method:"DELETE"},deleteGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"DELETE"},updateUserConversation:{endpoint:"users/{{uid}}/conversation",method:"PUT"},updateGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"PUT"},updateCallType:{endpoint:"calls/{{sessionid}}/type",method:"PATCH"},getUserConversationStarter:{endpoint:"ai/conversation-starter/users/{{uid}}",method:"GET",isAIApi:!0},getGroupConversationStarter:{endpoint:"ai/conversation-starter/groups/{{guid}}",method:"GET",isAIApi:!0},getUserSmartReply:{endpoint:"ai/smart-replies/users/{{uid}}",method:"GET",isAIApi:!0},getGroupSmartReply:{endpoint:"ai/smart-replies/groups/{{guid}}",method:"GET",isAIApi:!0},markInteracted:{endpoint:"messages/{{messageId}}/interacted",method:"PATCH"},getUserConversationSummary:{endpoint:"ai/conversation-summary/users/{{uid}}",method:"GET",isAIApi:!0},getGroupConversationSummary:{endpoint:"ai/conversation-summary/groups/{{guid}}",method:"GET",isAIApi:!0},getBotAssistanceInUserConversation:{endpoint:"ai/bots/{{botId}}/assistance/users/{{uid}}",method:"GET",isAIApi:!0},getBotAssistanceInGroupConversation:{endpoint:"ai/bots/{{botId}}/assistance/groups/{{guid}}",method:"GET",isAIApi:!0}}}return a.prototype.getEndpointData=function(i){return new Promise(function(o,e){try{var s=p.CometChat.appSettings.getAdminHost(),r=p.CometChat.appSettings.getClientHost();u.LocalStorage.getInstance().get(c.LOCAL_STORE.KEY_APP_SETTINGS).then(function(t){if(E.isFalsy(t)){var e={};if((new a).uriEndpoints.hasOwnProperty(i))if((e=(new a).uriEndpoints[i]).hasOwnProperty("isAdminApi"))if(E.isFalsy(s)){var n=E.format((new a).adminApiUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else{n="https://"+s+"/"+e.endpoint;e.endpoint=n,o(e)}else if(E.isFalsy(r)){n=E.format((new a).baseUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else{n="https://"+r+"/"+e.endpoint;e.endpoint=n,o(e)}}else{e={};if((new a).uriEndpoints.hasOwnProperty(i))if((e=(new a).uriEndpoints[i]).hasOwnProperty("isAdminApi")){n="https://"+t[c.APP_SETTINGS.KEYS.ADMIN_API_HOST]+"/"+t[c.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+e.endpoint;e.endpoint=n,o(e)}else{n="https://"+t[c.APP_SETTINGS.KEYS.CLIENT_API_HOST]+"/"+t[c.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+e.endpoint;e.endpoint=n,o(e)}}},function(t){var e;if((new a).uriEndpoints.hasOwnProperty(i))if((e=(new a).uriEndpoints[i]).hasOwnProperty(["isAdminApi"]))if(E.isFalsy(s)){var n=E.format((new a).adminApiUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else e.endpoint="https://"+s+"/"+e.endpoint,o(e);else if(E.isFalsy(r)){n=E.format((new a).baseUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else e.endpoint="https://"+r+"/"+e.endpoint,o(e)})}catch(t){e(new S.CometChatException(t))}})},a}();e.EndpointFactory=o},function(t,e,n){"use strict";e.__esModule=!0,e.getEndPoint=void 0;var o=n(36),i=n(2);e.getEndPoint=function(t,r){void 0===t&&(t=""),void 0===r&&(r={});var e=new o.EndpointFactory;return new Promise(function(o,s){try{e.getEndpointData(t).then(function(t){var e=t;if(e){for(var n in r)e.endpoint=e.endpoint.replace("{{"+n+"}}",r[n]);o(e)}else s({error:"Unknown endPoint name."})})}catch(t){s(new i.CometChatException(t))}})}},function(t,e,n){"use strict";e.__esModule=!0,e.MainVideoContainerSetting=e.CallSettingsBuilder=e.CallSettings=void 0;var o=n(1),s=n(0),r=function(){function t(t){this.sessionID=t.sessionID,this.defaultLayout=t.defaultLayout,this.isAudioOnly=t.isAudioOnly,this.region=t.region,this.domain=t.domain,this.user=t.user,this.listener=t.listener,this.mode=t.mode,this.ShowEndCallButton=t.ShowEndCallButton,this.ShowSwitchCameraButton=t.ShowSwitchCameraButton,this.ShowMuteAudioButton=t.ShowMuteAudioButton,this.ShowPauseVideoButton=t.ShowPauseVideoButton,this.ShowAudioModeButton=t.ShowAudioModeButton,this.StartAudioMuted=t.StartAudioMuted,this.StartVideoMuted=t.StartVideoMuted,this.analyticsSettings=t.analyticsSettings,this.appId=t.appId,this.defaultAudioMode=t.defaultAudioMode,this.ShowSwitchToVideoCallButton=t.ShowSwitchToVideoCallButton,this.AvatarMode=t.AvatarMode,this.ShowRecordingButton=t.ShowRecordingButton,this.StartRecordingOnCallStart=t.StartRecordingOnCallStart,this.MainVideoContainerSetting=t.MainVideoContainerSetting,this.EnableVideoTileClick=t.EnableVideoTileClick,this.enableDraggableVideoTile=t.enableDraggableVideoTile}return t.prototype.getSessionId=function(){return this.sessionID},t.prototype.isAudioOnlyCall=function(){return this.isAudioOnly},t.prototype.getUser=function(){return this.user},t.prototype.getRegion=function(){return this.region},t.prototype.getAppId=function(){return this.appId},t.prototype.getDomain=function(){return this.domain},t.prototype.isDefaultLayoutEnabled=function(){return this.defaultLayout},t.prototype.getCallEventListener=function(){return this.listener},t.prototype.getMode=function(){return this.mode},t.prototype.isEndCallButtonEnabled=function(){return this.ShowEndCallButton},t.prototype.isSwitchCameraButtonEnabled=function(){return this.ShowSwitchCameraButton},t.prototype.isMuteAudioButtonEnabled=function(){return this.ShowMuteAudioButton},t.prototype.isPauseVideoButtonEnabled=function(){return this.ShowPauseVideoButton},t.prototype.isAudioModeButtonEnabled=function(){return this.ShowAudioModeButton},t.prototype.getStartWithAudioMuted=function(){return this.StartAudioMuted},t.prototype.getStartWithVideoMuted=function(){return this.StartVideoMuted},t.prototype.getAnalyticsSettings=function(){return this.analyticsSettings},t.prototype.getDefaultAudioMode=function(){return this.defaultAudioMode},t.prototype.isAudioToVideoButtonEnabled=function(){return this.ShowSwitchToVideoCallButton},t.prototype.getAvatarMode=function(){return this.AvatarMode},t.prototype.isRecordingButtonEnabled=function(){return this.ShowRecordingButton},t.prototype.shouldStartRecordingOnCallStart=function(){return this.StartRecordingOnCallStart},t.prototype.getMainVideoContainerSetting=function(){return this.MainVideoContainerSetting},t.prototype.isVideoTileClickEnabled=function(){return this.EnableVideoTileClick},t.prototype.isVideoTileDragEnabled=function(){return this.enableDraggableVideoTile},t.POSITION_TOP_LEFT="top-left",t.POSITION_TOP_RIGHT="top-right",t.POSITION_BOTTOM_LEFT="bottom-left",t.POSITION_BOTTOM_RIGHT="bottom-right",t.ASPECT_RATIO_DEFAULT="default",t.ASPECT_RATIO_CONTAIN="contain",t.ASPECT_RATIO_COVER="cover",t}();e.CallSettings=r;var i=function(){function t(){this.defaultLayout=!0,this.isAudioOnly=!1,this.mode=o.CallConstants.CALL_MODE.DEFAULT,this.ShowEndCallButton=!0,this.ShowSwitchCameraButton=!0,this.ShowMuteAudioButton=!0,this.ShowPauseVideoButton=!0,this.ShowAudioModeButton=!0,this.StartAudioMuted=!1,this.StartVideoMuted=!1,this.analyticsSettings={},this.ShowSwitchToVideoCallButton=!0,this.AvatarMode="circle",this.ShowRecordingButton=!1,this.StartRecordingOnCallStart=!1,this.MainVideoContainerSetting=new a,this.EnableVideoTileClick=!0,this.enableDraggableVideoTile=!0}return t.prototype.setSessionID=function(t){return this.sessionID=t,this},t.prototype.enableDefaultLayout=function(t){return this.defaultLayout=t,this},t.prototype.setIsAudioOnlyCall=function(t){return this.isAudioOnly=t,this},t.prototype.setRegion=function(t){return this.region=t,this},t.prototype.setDomain=function(t){return this.domain=t,this},t.prototype.setUser=function(t){return this.user=t,this},t.prototype.setCallEventListener=function(t){return this.listener=t,this},t.prototype.setMode=function(t){return this.mode=t,this},t.prototype.showEndCallButton=function(t){return this.ShowEndCallButton=t,this},t.prototype.showSwitchCameraButton=function(t){return this.ShowSwitchCameraButton=t,this},t.prototype.showMuteAudioButton=function(t){return this.ShowMuteAudioButton=t,this},t.prototype.showPauseVideoButton=function(t){return this.ShowPauseVideoButton=t,this},t.prototype.showAudioModeButton=function(t){return this.ShowAudioModeButton=t,this},t.prototype.startWithAudioMuted=function(t){return this.StartAudioMuted=t,this},t.prototype.startWithVideoMuted=function(t){return this.StartVideoMuted=t,this},t.prototype.setAnalyticsSettings=function(t){return this.analyticsSettings=t,this},t.prototype.setAppId=function(t){return this.appId=t,this},t.prototype.setDefaultAudioMode=function(t){return this.defaultAudioMode=t,this},t.prototype.showSwitchToVideoCallButton=function(t){return this.ShowSwitchToVideoCallButton=t,this},t.prototype.setAvatarMode=function(t){return this.AvatarMode=t,this},t.prototype.showRecordingButton=function(t){return this.ShowRecordingButton=t,this},t.prototype.startRecordingOnCallStart=function(t){return this.StartRecordingOnCallStart=t,this},t.prototype.setMainVideoContainerSetting=function(t){return this.MainVideoContainerSetting=t,this},t.prototype.enableVideoTileClick=function(t){return this.EnableVideoTileClick=t,this},t.prototype.enableVideoTileDrag=function(t){return this.enableDraggableVideoTile=t,this},t.prototype.build=function(){return new r(this)},t}();e.CallSettingsBuilder=i;var a=function(){function t(){this.videoFit=r.ASPECT_RATIO_CONTAIN,this.zoomButton=o.CallConstants.ZOOM_BUTTON_DEFAULT_PARAMS,this.fullScreenButton=o.CallConstants.FULL_SCREEN_BUTTON_DEFAULT_PARAMS,this.userListButton=o.CallConstants.USER_LIST_BUTTON_DEFAULT_PARAMS,this.nameLabel=o.CallConstants.NAME_LABEL_DEFAULT_PARAMS}return t.prototype.setMainVideoAspectRatio=function(t){this.videoFit=t},t.prototype.setFullScreenButtonParams=function(t,e){s.isFalsy(t)||(this.fullScreenButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.fullScreenButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e)},t.prototype.setNameLabelParams=function(t,e,n){s.isFalsy(t)||(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e),s.isFalsy(n)||(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.COLOR]=n)},t.prototype.setZoomButtonParams=function(t,e){s.isFalsy(t)||(this.zoomButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.zoomButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e)},t.prototype.setUserListButtonParams=function(t,e){s.isFalsy(t)||(this.userListButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.userListButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e)},t}();e.MainVideoContainerSetting=a},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});e.__esModule=!0,e.CallingComponent=void 0;var i,a,E,c,u,p=n(50),S=n(16),C=n(6),l=n(3),T=n(1),d=n(15),g=n(51),h=n(0),_=n(5),r=function(e){function r(t){var r=e.call(this,t)||this;return r.state={shouldLoad:!1},a=t.callsettings,h.getCallSettings(a).then(function(t){var e=t.callSettingsNew,n=t.call,o=t.CallScreen,s=t.CometChatRTC;E=e,i=n,c=o,u=s,r.setState({shouldLoad:!0})}),r}return s(r,e),r.prototype.render=function(){return this.state.shouldLoad?p.createElement(S.View,{style:{flex:1,backgroundColor:"#000"}},p.createElement(c,{ref:function(t){return r.ref=t},style:{flex:1,backgroundColor:"#000"},callsettings:E,onCallEnded:function(){h.Logger.log("CallingComponent","oncallEnded")},onCallEndButtonPressed:function(){var t,e,n,o;i?(h.isFalsy(u)?(null===(t=null==r?void 0:r.ref)||void 0===t?void 0:t.endCall)&&(null===(e=null==r?void 0:r.ref)||void 0===e||e.endCall()):u.endCall(),setTimeout(function(){C.CometChat.endCall(a.getSessionId(),!0)},1e3)):(h.isFalsy(u)?(null===(n=null==r?void 0:r.ref)||void 0===n?void 0:n.endCall)&&(null===(o=null==r?void 0:r.ref)||void 0===o||o.endCall()):u.endCall(),d.CallController.getInstance().getCallListner()&&d.CallController.getInstance().getCallListner()._eventListener.onCallEnded(null))},onUserJoined:function(t){if(t){var e=void 0;h.isFalsy(t.uid)||h.isFalsy(t.name)||((e=new l.User(t)).setStatus("online"),C.CometChat.user.getUid().toLowerCase()!=e.getUid().toLowerCase()&&d.CallController.getInstance().getCallListner()&&(h.isFalsy(d.CallController.getInstance().getCallListner()._eventListener.onUserJoined)||d.CallController.getInstance().getCallListner()._eventListener.onUserJoined(e)))}},onUserLeft:function(t){if(t){var e=void 0;h.isFalsy(t.uid)||h.isFalsy(t.name)||((e=new l.User(t)).setStatus("online"),C.CometChat.user.getUid().toLowerCase()!=e.getUid().toLowerCase()&&d.CallController.getInstance().getCallListner()&&(h.isFalsy(d.CallController.getInstance().getCallListner()._eventListener.onUserLeft)||d.CallController.getInstance().getCallListner()._eventListener.onUserLeft(e)))}},onUserListChanged:function(t){var n=[];t&&0=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function C(t,e){if(p.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return w(t).length;default:if(o)return G(t).length;e=(""+e).toLowerCase(),o=!0}}function l(t,e,n){var o=t[e];t[e]=t[n],t[n]=o}function T(t,e,n,o,s){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):2147483647=t.length){if(s)return-1;n=t.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof e&&(e=p.from(e,o)),p.isBuffer(e))return 0===e.length?-1:d(t,e,n,o,s);if("number"==typeof e)return e&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):d(t,[e],n,o,s);throw new TypeError("val must be string, number or Buffer")}function d(t,e,n,o,s){var r,i=1,a=t.length,E=e.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(t.length<2||e.length<2)return-1;a/=i=2,E/=2,n/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(s){var u=-1;for(r=n;r>>10&1023|55296),u=56320|1023&u),o.push(u),s+=p}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);var n="",o=0;for(;othis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,n);case"utf8":case"utf-8":return R(this,e,n);case"ascii":return I(this,e,n);case"latin1":case"binary":return f(this,e,n);case"base64":return _(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,n);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}.apply(this,arguments)},p.prototype.equals=function(t){if(!p.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===p.compare(this,t)},p.prototype.inspect=function(){var t="",e=B.INSPECT_MAX_BYTES;return 0e&&(t+=" ... ")),""},p.prototype.compare=function(t,e,n,o,s){if(!p.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===s&&(s=this.length),e<0||n>t.length||o<0||s>this.length)throw new RangeError("out of range index");if(s<=o&&n<=e)return 0;if(s<=o)return-1;if(n<=e)return 1;if(this===t)return 0;for(var r=(s>>>=0)-(o>>>=0),i=(n>>>=0)-(e>>>=0),a=Math.min(r,i),E=this.slice(o,s),c=t.slice(e,n),u=0;uthis.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var r,i,a,E,c,u,p,S,C,l=!1;;)switch(o){case"hex":return g(this,t,e,n);case"utf8":case"utf-8":return S=e,C=n,K(G(t,(p=this).length-S),p,S,C);case"ascii":return h(this,t,e,n);case"latin1":case"binary":return h(this,t,e,n);case"base64":return E=this,c=e,u=n,K(w(t),E,c,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i=e,a=n,K(function(t,e){for(var n,o,s,r=[],i=0;i>8,s=n%256,r.push(s),r.push(o);return r}(t,(r=this).length-i),r,i,a);default:if(l)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),l=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function I(t,e,n){var o="";n=Math.min(t.length,n);for(var s=e;st.length)throw new RangeError("Index out of range")}function M(t,e,n,o){e<0&&(e=65535+e+1);for(var s=0,r=Math.min(t.length-n,2);s>>8*(o?s:1-s)}function L(t,e,n,o){e<0&&(e=4294967295+e+1);for(var s=0,r=Math.min(t.length-n,4);s>>8*(o?s:3-s)&255}function v(t,e,n,o,s,r){if(n+o>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,o,s){return s||v(t,0,n,4),r.write(t,e,n,o,23,4),n+4}function D(t,e,n,o,s){return s||v(t,0,n,8),r.write(t,e,n,o,52,8),n+8}p.prototype.slice=function(t,e){var n,o=this.length;if((t=~~t)<0?(t+=o)<0&&(t=0):o>>8):M(this,t,e,!0),e+2},p.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},p.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},p.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},p.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e|=0,!o){var s=Math.pow(2,8*n-1);y(this,t,e,n,s-1,-s)}var r=0,i=1,a=0;for(this[e]=255&t;++r>0)-a&255;return e+n},p.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e|=0,!o){var s=Math.pow(2,8*n-1);y(this,t,e,n,s-1,-s)}var r=n-1,i=1,a=0;for(this[e+r]=255&t;0<=--r&&(i*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/i>>0)-a&255;return e+n},p.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,1,127,-128),p.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},p.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},p.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},p.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},p.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},p.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},p.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},p.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},p.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},p.prototype.copy=function(t,e,n,o){if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(r=e;r>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function w(t){return o.toByteArray(function(t){var e;if((t=(e=t,e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function K(t,e,n,o){for(var s=0;s=e.length||s>=t.length);++s)e[s+n]=t[s];return s}}).call(this,e(18))},function(t,e,n){"use strict";e.__esModule=!0,e.RTCUser=void 0;var o=n(0),s=function(){function t(t){this.avatar="",o.isFalsy(t)||(this.uid=t.toString())}return t.prototype.setUID=function(t){this.uid=t?t.toString():""},t.prototype.getUID=function(){return this.uid.toString()},t.prototype.setName=function(t){this.name=t?t.toString():""},t.prototype.getName=function(){return this.name.toString()},t.prototype.setAvatar=function(t){this.avatar=t?t.toString():""},t.prototype.getAvatar=function(){return this.avatar.toString()},t.prototype.setJWT=function(t){this.jwt=t?t.toString():""},t.prototype.getJWT=function(){return this.jwt.toString()},t.prototype.setResource=function(t){this.resource=t?t.toString():""},t.prototype.getResource=function(){return this.resource.toString()},t}();e.RTCUser=s},function(t,e){t.exports=s},function(t,e,n){"use strict";e.__esModule=!0,e.AudioMode=void 0;var o=n(0),s=function(){function t(t,e){this.isSelected=!1,this.mode="",o.isFalsy(t)||(this.mode=t.toString()),this.isSelected=e||!1}return t.prototype.setMode=function(t){this.mode=t?t.toString():""},t.prototype.getMode=function(){return this.mode.toString()},t.prototype.setIsSelected=function(t){this.isSelected=t||!1},t.prototype.getIsSelected=function(){return this.isSelected},t}();e.AudioMode=s},function(t,e,n){"use strict";e.__esModule=!0,e.GroupsRequestBuilder=e.GroupsRequest=void 0;var s=n(5),o=n(0),r=n(2),i=n(17),a=n(1),E=function(){function t(t){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.hasJoined=0,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(t)||(o.isFalsy(t.limit)||(this.limit=t.limit),o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.hasJoined)||(this.hasJoined=1),o.isFalsy(t.tags)||(this.tags=t.tags),o.isFalsy(t.showTags)||(this.withTags=t.showTags))}return t.prototype.validateGroupBuilder=function(){if(void 0===this.limit)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>a.DEFAULT_VALUES.GROUPS_MAX_LIMIT)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.GROUPS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=100,t.DEFAULT_LIMIT=30,t}();e.GroupsRequest=E;var c=function(){function t(){}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.joinedOnly=function(t){return this.hasJoined=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.showTags=t,this},t.prototype.build=function(){return new E(this)},t}();e.GroupsRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.GroupMembersRequestBuilder=e.GroupMembersRequest=void 0;var s=n(5),o=n(0),r=n(14),i=n(2),a=n(41),E=n(1),c=function(){function t(t){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},this.store=r.LocalStorage.getInstance(),o.isFalsy(t)||(this.limit=t.limit,this.guid=t.guid,o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.scopes)||(this.scopes=t.scopes))}return t.prototype.validateGroupMembersBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>E.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",E.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();e.GroupMembersRequest=c;var u=function(){function t(t){this.guid=t}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setScopes=function(t){return this.scopes=t,this},t.prototype.build=function(){return new c(this)},t}();e.GroupMembersRequestBuilder=u},function(t,e,n){"use strict";e.__esModule=!0,e.BannedMembersRequestBuilder=e.BannedMembersRequest=void 0;var s=n(5),o=n(0),r=n(2),i=n(41),a=n(1),E=function(){function t(t){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(t)||(this.limit=t.limit,this.guid=t.guid,o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.scopes)||(this.scopes=t.scopes))}return t.prototype.validateBannedMembersBuilder=function(){if(void 0===this.limit)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>a.DEFAULT_VALUES.USERS_MAX_LIMIT)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();e.BannedMembersRequest=E;var c=function(){function t(t){this.guid=t}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setScopes=function(t){return this.scopes=t,this},t.prototype.build=function(){return new E(this)},t}();e.BannedMembersRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.UsersRequestBuilder=e.UsersRequest=void 0;var s=n(5),o=n(0),r=n(12),i=n(2),a=n(56),E=n(1),c=function(){function e(t){this.next_page=1,this.current_page=1,this.total_pages=-1,this.hideBlockedUsers=!1,this.friendsOnly=!1,this.fetchingInProgress=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},e.userStore=a.UserStore.getInstance(),o.isFalsy(t)||(this.limit=t.limit,o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.status)||(t.status==e.USER_STATUS.ONLINE?this.status=E.PresenceConstatnts.STATUS.AVAILABLE:this.status=t.status),o.isFalsy(t.shouldHideBlockedUsers)||(this.hideBlockedUsers=t.shouldHideBlockedUsers),o.isFalsy(t.showFriendsOnly)||(this.friendsOnly=t.showFriendsOnly),o.isFalsy(t.showTags)||(this.withTags=t.showTags),o.isFalsy(t.role)||(this.role=t.role),o.isFalsy(t.roles)||(this.roles=t.roles),o.isFalsy(t.tags)||(this.tags=t.tags),o.isFalsy(t.UIDs)||(this.UIDs=t.UIDs),o.isFalsy(t.SortBy)||(this.sortBy=t.SortBy),o.isFalsy(t.SearchIn)||(this.searchIn=t.SearchIn),o.isFalsy(t.SortOrder)||(this.sortOrder=t.SortOrder))}return e.prototype.validateUserBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>E.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",E.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},e.USER_STATUS={ONLINE:E.PresenceConstatnts.STATUS.ONLINE,OFFLINE:E.PresenceConstatnts.STATUS.OFFLINE},e}();e.UsersRequest=c;var u=function(){function t(){this.shouldHideBlockedUsers=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setStatus=function(t){return this.status=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.hideBlockedUsers=function(t){return this.shouldHideBlockedUsers=t,this},t.prototype.setRole=function(t){return this.role=t,this},t.prototype.setRoles=function(t){return this.roles=t,this},t.prototype.friendsOnly=function(t){return this.showFriendsOnly=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.showTags=t,this},t.prototype.setUIDs=function(t){return this.UIDs=t,this},t.prototype.sortBy=function(t){return this.SortBy=t,this},t.prototype.sortByOrder=function(t){return this.SortOrder=t,this},t.prototype.searchIn=function(t){return this.SearchIn=t,this},t.prototype.build=function(){return this.role&&this.roles&&this.roles.push(this.role),new c(this)},t}();e.UsersRequestBuilder=u},function(t,e,n){"use strict";e.__esModule=!0,e.UserStore=void 0;var r=n(0),i=n(1),a=n(2),o=n(13),s=function(){function t(t){this.store=i.constants.DEFAULT_STORE,r.isFalsy(t)||(this.store=t);try{this.userStore=o.default}catch(t){r.Logger.error("UserStore: constructor",{e:t})}}return t.getInstance=function(){return null==t.UserStore&&(t.UserStore=new t),t.UserStore},t.prototype.set=function(t,e){var n=r.getKeyprefix(i.LOCAL_STORE.USERS_STORE,t);return this.userStore.setItem(n,JSON.stringify(e))},t.prototype.get=function(t){var o=this,s=r.getKeyprefix(i.LOCAL_STORE.USERS_STORE,t);return new Promise(function(n,e){try{o.userStore.getItem(s).then(function(e){try{n(JSON.parse(e))}catch(t){n(e)}},function(t){e(t)})}catch(t){e(new a.CometChatException(t))}})},t.prototype.clear=function(t){},t.prototype.selectStore=function(t){this.store=t},t.prototype.storeUsers=function(t){var e=this;return t.map(function(t){e.set(t.getUid(),t)}),!0},t.prototype.storeUser=function(t){return this.set(t.getUid(),t),!0},t}();e.UserStore=s},function(t,e,n){"use strict";e.__esModule=!0,e.ConversationsRequestBuilder=e.ConversationsRequest=void 0;var s=n(5),o=n(0),r=n(2),i=n(31),a=n(1),E=function(){function t(t){this.limit=100,this.next_page=1,this.current_page=1,this.total_pages=-1,this.fetchingInProgress=!1,this.getUserAndGroupTags=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(t)||(this.limit=t.limit,o.isFalsy(t.conversationType)||(this.conversationType=t.conversationType)),o.isFalsy(t.getUserAndGroupTags)||(this.getUserAndGroupTags=t.getUserAndGroupTags),t.tags&&(this.tags=t.tags),o.isFalsy(t.WithTags)||(this.withTags=t.WithTags),t.groupTags&&(this.groupTags=t.groupTags),t.userTags&&(this.userTags=t.userTags)}return t.prototype.validateConversationBuilder=function(){return void 0===this.limit?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit"))):isNaN(this.limit)?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))):this.limit>a.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT))):this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t}();e.ConversationsRequest=E;var c=function(){function t(){this.WithTags=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setConversationType=function(t){return this.conversationType=t,this},t.prototype.withUserAndGroupTags=function(t){return"boolean"==typeof t&&(this.getUserAndGroupTags=t),this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.WithTags=t,this},t.prototype.setGroupTags=function(t){return this.groupTags=t,this},t.prototype.setUserTags=function(t){return this.userTags=t,this},t.prototype.build=function(){return new E(this)},t}();e.ConversationsRequestBuilder=c},function(t,e,n){"use strict";var f=this&&this.__awaiter||function(t,i,a,E){return new(a||(a=Promise))(function(n,e){function o(t){try{r(E.next(t))}catch(t){e(t)}}function s(t){try{r(E.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):(e=t.value,e instanceof a?e:new a(function(t){t(e)})).then(o,s)}r((E=E.apply(t,i||[])).next())})},O=this&&this.__generator||function(n,o){var s,r,i,t,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(s)throw new TypeError("Generator is already executing.");for(;a;)try{if(s=1,r&&(i=2&e[0]?r.return:e[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,e[1])).done)return i;switch(r=0,i&&(e=[2&e[0],i.value]),e[0]){case 0:case 1:i=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,r=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]L.DEFAULT_VALUES.MSGS_MAX_LIMIT)return void e(new N.CometChatException(JSON.parse(M.format(JSON.stringify(L.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",L.DEFAULT_VALUES.MSGS_MAX_LIMIT))));if(Et&&v.MessageListnerMaping.getInstance().set(L.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(a.id))},function(t){v.MessageListnerMaping.getInstance().set(L.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(a.id))}),this.affix==L.MessageConstatnts.PAGINATION.AFFIX.APPEND?(this.idparseInt(a.id)&&(this.id=parseInt(a.id)),this.timestamp>a.sentAt&&(this.timestamp=a.sentAt),this.updatedAt>a.updatedAt&&(this.updatedAt=a.updatedAt)),this.id&&(this.paginationMeta[L.MessageConstatnts.PAGINATION.KEYS.ID]=this.id),this.timestamp&&(this.paginationMeta[L.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=this.timestamp),this.updatedAt&&(this.paginationMeta[L.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=this.updatedAt),a.category!==L.MessageConstatnts.CATEGORY.MESSAGE&&a.category!==L.MessageConstatnts.CATEGORY.CUSTOM||a.type===L.MessageConstatnts.TYPE.TEXT||!a.data.attachments||0===(null===(s=a.data.attachments)||void 0===s?void 0:s.length)?[3,2]:(null===(r=P.CometChat.user)||void 0===r?void 0:r.getFat())&&P.CometChat.SECURED_MEDIA_HOST?(e=P.CometChat.SECURED_MEDIA_HOST,n=null===(i=P.CometChat.user)||void 0===i?void 0:i.getFat(),[4,M.updatePropertiesWithDynamicValue(a,e,"?"+L.ADDITIONAL_CONSTANTS.SECURE_URL_PROPERTY+"="+n)]):[3,2];case 1:(o=t.sent())&&(a=o),t.label=2;case 2:return E.push(y.MessageController.trasformJSONMessge(a)),[2]}})})})):E=[],o(E),[2]})})},function(t){e(new N.CometChatException(t.error))})}catch(t){e(new N.CometChatException(t))}})},t.prototype.createEndpoint=function(){this.parentMessageId?(this.endpointName="getThreadMessages",this.listId=this.parentMessageId.toString(),this.hideReplies&&(this.hideReplies=!1,delete this.paginationMeta[L.MessageConstatnts.PAGINATION.KEYS.HIDE_REPLIES])):(M.isFalsy(this.guid)||M.isFalsy(this.uid))&&M.isFalsy(this.guid)?(M.isFalsy(this.uid)?this.endpointName="getMessages":this.endpointName="getUserMessages",this.listId=this.uid):(this.endpointName="getGroupMessages",this.listId=this.guid)},t.prototype.makeData=function(){var t={};t[L.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,t[L.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,(M.isFalsy(this.guid)||M.isFalsy(this.uid))&&M.isFalsy(this.guid)&&M.isFalsy(this.uid)},t.prototype.getFilteredPreviousDataByReceiverId=function(e){return f(this,void 0,void 0,function(){var n,o=this;return O(this,function(t){switch(t.label){case 0:switch(n=[],e){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,r.MessagesStore.getInstance().get(this.uid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 2:return t.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 4:t.sent(),t.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).filter(function(t){return e[t].sender.uid==o.uid}).map(function(t){n=s(n,[e[t]])})})];case 6:return t.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 8:return t.sent(),[3,9];case 9:return[2,n]}})})},t.prototype.getFilteredNextDataByReceiverId=function(e){return f(this,void 0,void 0,function(){var n,o=this;return O(this,function(t){switch(t.label){case 0:switch(n=[],e){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,r.MessagesStore.getInstance().get(this.uid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 2:return t.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 4:t.sent(),t.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).filter(function(t){return e[t].sender.uid==o.uid}).map(function(t){n=s(n,[e[t]])})})];case 6:return t.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 8:return t.sent(),[3,9];case 9:return[2,n]}})})},t}();e.MessagesRequest=o;var a=function(){function t(){this.maxLimit=L.DEFAULT_VALUES.MSGS_MAX_LIMIT,this.timestamp=0,this.id=L.DEFAULT_VALUES.DEFAULT_MSG_ID,this.unread=!1,this.HideMessagesFromBlockedUsers=!1,this.onlyUpdate=0,this.HideDeletedMessages=!1,this.WithTags=!1,this.myMentionsOnlyFlag=!1,this.mentionsWithTagInfoFlag=!1,this.mentionsWithBlockedInfoFlag=!1,this.interactionGoalCompletedOnly=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setGUID=function(t){return this.guid=t,this},t.prototype.setUID=function(t){return this.uid=t,this},t.prototype.setParentMessageId=function(t){return this.parentMessageId=t,this},t.prototype.setTimestamp=function(t){return void 0===t&&(t=M.getCurrentTime()),this.timestamp=t,this},t.prototype.setMessageId=function(t){return void 0===t&&(t=L.DEFAULT_VALUES.DEFAULT_MSG_ID),this.id=t,this},t.prototype.setUnread=function(t){return void 0===t&&(t=!1),this.unread=t,this},t.prototype.hideMessagesFromBlockedUsers=function(t){return void 0===t&&(t=!1),this.HideMessagesFromBlockedUsers=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKey=t,this},t.prototype.setUpdatedAfter=function(t){return this.updatedAt=t,this},t.prototype.updatesOnly=function(t){return t&&(this.onlyUpdate=1),this},t.prototype.setCategory=function(t){return this.category=t,this},t.prototype.setCategories=function(t){return this.categories=t,this},t.prototype.setType=function(t){return this.type=t,this},t.prototype.setTypes=function(t){return this.types=t,this},t.prototype.hideReplies=function(t){return this.HideReplies=t,this},t.prototype.hideDeletedMessages=function(t){return this.HideDeletedMessages=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.WithTags=t,this},t.prototype.myMentionsOnly=function(t){return void 0===t&&(t=!1),this.myMentionsOnlyFlag=t,this},t.prototype.mentionsWithTagInfo=function(t){return void 0===t&&(t=!1),this.mentionsWithTagInfoFlag=t,this},t.prototype.mentionsWithBlockedInfo=function(t){return void 0===t&&(t=!1),this.mentionsWithBlockedInfoFlag=t,this},t.prototype.setInteractionGoalCompletedOnly=function(t){return void 0===t&&(t=!1),this.interactionGoalCompletedOnly=t,this},t.prototype.build=function(){return this.category&&this.categories&&this.categories.push(this.category),this.type&&this.types&&this.types.push(this.type),new o(this)},t}();e.MessagesRequestBuilder=a},function(t,e,n){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,n=1,o=arguments.length;nt.getId()&&(i=parseInt(t.getId().toString())),oa.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t.directions=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS,t}();e.BlockedUsersRequest=E;var c=function(){function t(){}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setDirection=function(t){return this.direction=t,this},t.prototype.blockedByMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BLOCKED_BY_ME,this},t.prototype.hasBlockedMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.HAS_BLOCKED_ME,this},t.prototype.build=function(){return new E(this)},t}();e.BlockedUsersRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.AppSettingsBuilder=e.AppSettings=void 0;var o=n(1),s=function(){function e(t){this.subscriptionType=e.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=o.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null,this.subscriptionType=t.subscriptionType,this.roles=t.roles,this.region=t.region,this.autoJoinGroup=t.autoJoinGroup,this.establishSocketConnection=t.establishSocketConnection,this.adminHost=t.adminHost,this.clientHost=t.clientHost}return e.prototype.getSubscriptionType=function(){return this.subscriptionType},e.prototype.getRoles=function(){return this.roles},e.prototype.getRegion=function(){return this.region},e.prototype.getIsAutoJoinEnabled=function(){return this.autoJoinGroup},e.prototype.shouldAutoEstablishSocketConnection=function(){return this.establishSocketConnection},e.prototype.getAdminHost=function(){return this.adminHost},e.prototype.getClientHost=function(){return this.clientHost},e.SUBSCRIPTION_TYPE_NONE="NONE",e.SUBSCRIPTION_TYPE_ALL_USERS="ALL_USERS",e.SUBSCRIPTION_TYPE_ROLES="ROLES",e.SUBSCRIPTION_TYPE_FRIENDS="FRIENDS",e.REGION_EU=o.DEFAULT_VALUES.REGION_DEFAULT_EU,e.REGION_US=o.DEFAULT_VALUES.REGION_DEFAULT_US,e.REGION_IN=o.DEFAULT_VALUES.REGION_DEFAULT_IN,e.REGION_PRIVATE=o.DEFAULT_VALUES.REGION_DEFAULT_PRIVATE,e}();e.AppSettings=s;var r=function(){function t(){this.subscriptionType=s.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=o.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null}return t.prototype.subscribePresenceForAllUsers=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ALL_USERS,this},t.prototype.subscribePresenceForRoles=function(t){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ROLES,this.roles=t,this},t.prototype.subscribePresenceForFriends=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_FRIENDS,this},t.prototype.setRegion=function(t){return void 0===t&&(t=o.DEFAULT_VALUES.REGION_DEFAULT),this.region=t.toLowerCase(),this},t.prototype.enableAutoJoinForGroups=function(t){return void 0===t&&(t=!0),this.autoJoinGroup=t,this},t.prototype.autoEstablishSocketConnection=function(t){return void 0===t&&(t=!0),this.establishSocketConnection=t,this},t.prototype.overrideAdminHost=function(t){return this.adminHost=t,this},t.prototype.overrideClientHost=function(t){return this.clientHost=t,this},t.prototype.build=function(){return new s(this)},t}();e.AppSettingsBuilder=r},function(t,e,n){"use strict";var l=this&&this.__assign||function(){return(l=Object.assign||function(t){for(var e,n=1,o=arguments.length;ni[0]&&e[1]i[0]&&e[1]>16&255,r[i++]=e>>8&255,r[i++]=255&e;var c,u;2===s&&(e=p[t.charCodeAt(E)]<<2|p[t.charCodeAt(E+1)]>>4,r[i++]=255&e);1===s&&(e=p[t.charCodeAt(E)]<<10|p[t.charCodeAt(E+1)]<<4|p[t.charCodeAt(E+2)]>>2,r[i++]=e>>8&255,r[i++]=255&e);return r},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,s=[],r=0,i=n-o;r>2]+a[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],s.push(a[e>>10]+a[e>>4&63]+a[e<<2&63]+"="));return s.join("")};for(var a=[],p=[],S="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,r=o.length;s>18&63]+a[s>>12&63]+a[s>>6&63]+a[63&s]);return r.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,o,s){var r,i,a=8*s-o-1,E=(1<>1,u=-7,p=n?s-1:0,S=n?-1:1,C=t[e+p];for(p+=S,r=C&(1<<-u)-1,C>>=-u,u+=a;0>=-u,u+=o;0>1,S=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,C=o?0:r-1,l=o?1:-1,T=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,i=u):(i=Math.floor(Math.log(e)/Math.LN2),e*(E=Math.pow(2,-i))<1&&(i--,E*=2),2<=(e+=1<=i+p?S/E:S*Math.pow(2,1-p))*E&&(i++,E/=2),u<=i+p?(a=0,i=u):1<=i+p?(a=(e*E-1)*Math.pow(2,s),i+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,s),i=0));8<=s;t[n+C]=255&a,C+=l,a/=256,s-=8);for(i=i<i[0]&&e[1]i[0]&&e[1]>>((3&e)<<3)&255;return s}}},function(t,e){for(var s=[],n=0;n<256;++n)s[n]=(n+256).toString(16).substr(1);t.exports=function(t,e){var n=e||0,o=s;return[o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]]].join("")}}])}),function(){try{require("@cometchat/calls-sdk-react-native")&&require("@cometchat/calls-sdk-react-native").CometChatCalls&&(this.CometChatCallSDK=require("@cometchat/calls-sdk-react-native/package.json"),this.CometChatCalling={},this.CometChatCalling.isCallingComponentInstalled=!0,this.CometChatCalling.CallScreen=require("@cometchat/calls-sdk-react-native").default,this.CometChatCalling.CometChatRTC=require("@cometchat/calls-sdk-react-native").CometChatRTC,this.CometChatCalling.CometChatCalls=require("@cometchat/calls-sdk-react-native").CometChatCalls,this.CometChatCalling.CallEventListener=require("@cometchat/calls-sdk-react-native").CallEventListener)}catch(t){}try{require("@cometchat/chat-uikit-react-native")&&(this.CometChatUiKit=require("@cometchat/chat-uikit-react-native/package.json"))}catch(t){}}(); \ No newline at end of file diff --git a/package.json b/package.json index 3f01d39..580c0c7 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,14 @@ { "name": "@cometchat/chat-sdk-react-native", - "version": "4.0.3", + "version": "4.0.4", "description": "A complete chat solution.", "main": "CometChat.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, + + + "keywords": [ "CometChat", "chat",