From 7e50dbf7704b46f730bd90e8f2fbf8d55264f47b Mon Sep 17 00:00:00 2001 From: Mathews Date: Wed, 10 Jul 2024 19:19:30 +0530 Subject: [PATCH] v4.0.8 --- CometChat.d.ts | 142 ++++++++++++++++++++++++++++++++++++++++++++++--- CometChat.js | 2 +- README.md | 137 +++++------------------------------------------ package.json | 2 +- 4 files changed, 150 insertions(+), 133 deletions(-) diff --git a/CometChat.d.ts b/CometChat.d.ts index 2a21296..f114687 100644 --- a/CometChat.d.ts +++ b/CometChat.d.ts @@ -1670,6 +1670,12 @@ export class CometChat { * @memberof CometChat */ static getActiveCall(): Call; + /** + * Function to clear any active call. + * @returns {void} + * @memberof CometChat + */ + static clearActiveCall(): void; /** * Function to start a call. * @param {CallSettings | string} callSettings @@ -1989,31 +1995,64 @@ export class CometChatNotifications { static MutedConversationType: typeof MutedConversationType; static PushPlatforms: typeof PushPlatforms; static DaySchedule: typeof DaySchedule; + /** + * @deprecated This property is deprecated as of version 4.0.8 due to newer property 'NotificationPreferences'. + * It will be removed in subsequent versions. + */ static PushPreferences: typeof PushPreferences; static GroupPreferences: typeof GroupPreferences; static OneOnOnePreferences: typeof OneOnOnePreferences; static MutePreferences: typeof MutePreferences; static MutedConversation: typeof MutedConversation; static UnmutedConversation: typeof UnmutedConversation; + static NotificationPreferences: typeof NotificationPreferences; /** * Function to get preferences set for the logged-in user. * @returns {Promise} * @memberof CometChatNotifications + * @deprecated + * + * This method is deprecated as of version 4.0.8 due to newer method 'fetchPreferences'. It will be removed in subsequent versions. */ static fetchPushPreferences(): Promise; + /** + * Function to get preferences set for the logged-in user. + * @returns {Promise} + * @memberof CometChatNotifications + */ + static fetchPreferences(): Promise; /** * Function to update preferences for the logged-in user. * @param {PushPreferences} pushPreferences * @returns {Promise} * @memberof CometChatNotifications + * @deprecated + * + * This method is deprecated as of version 4.0.8 due to newer method 'updatePreferences'. It will be removed in subsequent versions. */ static updatePushPreferences(pushPreferences: PushPreferences): Promise; + /** + * Function to update preferences for the logged-in user. + * @param {NotificationPreferences} notificationPreferences + * @returns {Promise} + * @memberof CometChatNotifications + */ + static updatePreferences(notificationPreferences: NotificationPreferences): Promise; /** * Function to reset preferences for the logged-in user. * @returns {Promise} * @memberof CometChatNotifications + * @deprecated + * + * This method is deprecated as of version 4.0.8 due to newer method 'resetPreferences'. It will be removed in subsequent versions. */ static resetPushPreferences(): Promise; + /** + * Function to reset preferences for the logged-in user. + * @returns {Promise} + * @memberof CometChatNotifications + */ + static resetPreferences(): Promise; /** * Function to register push token for the current authToken of the logged-in user. * @returns {Promise} @@ -2049,6 +2088,21 @@ export class CometChatNotifications { * @memberof CometChatNotifications */ static getMutedConversations(): Promise; + /** + * Function to update timezone for the logged-in user. + * @returns {Promise} + * @param {string} timezone + * @memberof CometChatNotifications + */ + static updateTimezone(timezone: String): Promise; + /** + * Function to get timezone for the logged-in user. + * @returns {Promise<{timezone: string} | string>} A promise that resolves to an object containing the timezone or a string in case of an error. + * @memberof CometChatNotifications + */ + static getTimezone(): Promise<{ + timezone: string; + } | string>; } /** @@ -4423,6 +4477,8 @@ export class CallController { /** @internal */ onCallStarted(call: Call): Promise; /** @internal */ + clearActiveCall(): void; + /** @internal */ endCallSession(): void; /** @internal */ startCall(callsettings: CallSettings, view: HTMLElement): void; @@ -5188,8 +5244,8 @@ export class ConversationsRequestBuilder { /** @private */ WithTags: boolean; /** @private */ groupTags: Array; /** @private */ userTags: Array; - /** @private */ includeBlockedUsers: boolean; - /** @private */ withBlockedInfo: boolean; + /** @private */ IncludeBlockedUsers: boolean; + /** @private */ WithBlockedInfo: boolean; /** * * @param {number} limit @@ -5237,16 +5293,33 @@ export class ConversationsRequestBuilder { setUserTags(userTags: Array): this; /** * A method to include blocked users in the list of conversations. - * @param {boolean} userTags + * @param {boolean} _includeBlockedUsers + * @returns + * @deprecated This method is deprecated as of version 4.0.8 due to newer method 'includeBlockedUsers'. + * It will be removed in subsequent versions. + */ + setIncludeBlockedUsers(_includeBlockedUsers: boolean): this; + /** + * A method to include blocked users in the list of conversations. + * @param {boolean} _includeBlockedUsers * @returns */ - setIncludeBlockedUsers(_includeBlockedUsers: any): this; + includeBlockedUsers(_includeBlockedUsers: boolean): this; /** * A method to include blocked users information in the list of conversations. - * @param {boolean} userTags + * @param {boolean} _withBlockedInfo + * @returns + * + * @deprecated This method is deprecated as of version 4.0.8 due to newer method 'withBlockedInfo'. + * It will be removed in subsequent versions. + */ + setWithBlockedInfo(_withBlockedInfo: boolean): this; + /** + * A method to include blocked users information in the list of conversations. + * @param {boolean} _withBlockedInfo * @returns */ - setWithBlockedInfo(_withBlockedInfo: any): this; + withBlockedInfo(_withBlockedInfo: boolean): this; /** * This method will return an object of the ConversationsRequest class. * @returns {ConversationsRequest} @@ -7060,6 +7133,8 @@ export const APIConstants: { KEY_MUTED_CONVERSATIONS: string; KEY_FROM: string; KEY_TO: string; + KEY_GET_TIMEZONE: string; + KEY_UPDATE_TIMEZONE: string; }; export const APIResponseConstants: { TOKEN_REGISTER_SUCCESS: string; @@ -7070,6 +7145,9 @@ export const APIResponseConstants: { MUTE_CONVERSATION_ERROR: string; UNMUTE_CONVERSATION_SUCCESS: string; UNMUTE_CONVERSATION_ERROR: string; + TIMEZONE_UPDATE_SUCCESS: string; + TIMEZONE_UPDATE_ERROR: string; + TIMEZONE_FETCH_ERROR: string; }; export const DEFAULT_PROVIDER_ID = "default"; @@ -7291,6 +7369,54 @@ export class MutePreferences { static fromJSON(jsonData: Object): MutePreferences; } +export class NotificationPreferences { + /** + * Get the OneOnOne preferences. + * @returns {OneOnOnePreferences} + */ + getOneOnOnePreferences(): OneOnOnePreferences; + /** + * @param {OneOnOnePreferences} oneOnOnePreferences + * Set the OneOnOne preferences. + */ + setOneOnOnePreferences(oneOnOnePreferences: OneOnOnePreferences): void; + /** + * Get the Muted preferences. + * @returns {MutePreferences} + */ + getMutePreferences(): MutePreferences; + /** + * @param {MutePreferences} mutePreferences + * Set the Mute preferences. + */ + setMutePreferences(mutePreferences: MutePreferences): void; + /** + * Get the Group preferences. + * @returns {GroupPreferences} + */ + getGroupPreferences(): GroupPreferences; + /** + * @param {GroupPreferences} groupPreferences + * Set the Group preferences. + */ + setGroupPreferences(groupPreferences: GroupPreferences): void; + /** + * Returns whether to use privacy template or not. + * @returns {boolean} + */ + getUsePrivacyTemplate(): boolean; + /** + * @param {boolean} usePrivacyTemplate + * Set whether to use privacy template or not. + */ + setUsePrivacyTemplate(usePrivacyTemplate: boolean): void; + /** + * @param {Object} jsonData + * Convert JSON object to NotificationPreferences. + */ + static fromJSON(jsonData: Object): NotificationPreferences; +} + export class OneOnOnePreferences { /** * Get the reactions preferences for groups. @@ -7329,6 +7455,10 @@ export class OneOnOnePreferences { static fromJSON(jsonData: Object): OneOnOnePreferences; } +/** + * @deprecated This class is deprecated as of version 4.0.8 due to newer class 'NotificationPreferences'. + * It will be removed in subsequent versions. + */ export class PushPreferences { /** * Get the OneOnOne preferences. diff --git a/CometChat.js b/CometChat.js index 9c0e982..641171a 100644 --- a/CometChat.js +++ b/CometChat.js @@ -1 +1 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,function(){return function(n){var o={};function s(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,s),t.l=!0,t.exports}return s.m=n,s.c=o,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)s.d(n,o,function(e){return t[e]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=34)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateQuestion=t.updatePropertiesWithDynamicValue=t.validateConversationType=t.validateUpdateUser=t.validateCreateUser=t.validateMessage=t.validateChatType=t.validateMsgId=t.validateArray=t.validateHideMessagesFromBlockedUsers=t.validateId=t.validateCreateGroup=t.validateJoinGroup=t.validateUpdateGroup=t.validateScope=t.isAudio=t.isVideo=t.isImage=t.getUpdatedSettings=t.getAppSettings=t.getCurrentTime=t.Logger=t.createUidFromJid=t.format=t.getOrdinalSuffix=t.isFalsy=t.isTruthy=t.isObject=t.getJidHost=t.getChatHost=void 0;var o=n(15),i=n(1),s=n(6),a=n(2),E=n(17),c=n(19),u=n(21),r=n(5),S=n(10),p=n(22);function C(e){return null!=e&&("string"==typeof e&&(e=e.trim()),"object"==typeof e&&0===Object.keys(e).length&&(e=void 0)),["",0,"0",!1,null,"null",void 0,"undefined"].includes(e)}function l(e){for(var o=[],t=1;ti[0]&&t[1] All store cleared successfully","true"),e(!0)})}catch(e){w.Logger.error("CometChat: clearCache",e),t(e)}})},G.connect=function(){G.user&&(ce.connection||(G.disconnectedByUser=!1,G.WSLogin(G.user)),G.didAnalyticsPingStart()||G.isAnalyticsDisabled||(G.pingAnalytics(),G.startAnalyticsPingTimer()))},G.disconnect=function(){G.user&&(G.disconnectedByUser=!0,ce.connection&&ce.WSLogout(),G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer())},G.prototype.internalRestart=function(e){G.internalRestart||G.getInstance().internalLogout(!1).then(function(){G.internalRestart=!0,G.login(e).then(function(e){G.shouldConnectToWS=!0,G.internalRestart=!1},function(e){w.Logger.error("CometChat: internalRestart :: login",e),G.internalRestart=!1})},function(e){w.Logger.error("CometChat: internalRestart :: internalLogout",e)})},G.prototype.internalLogout=function(n){return void 0===n&&(n=!0),new Promise(function(e,t){try{G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer(),G.WSReconnectionInProgress&&G.clearWSReconnectionTimer(),G.isLoggedOut=!0,G.WSReconnectionInProgress=!1,G.isAnalyticsDisabled=!1,G.clearCache().then(function(){G.apiKey=void 0,G.user=void 0,G.authToken=void 0,G.cometChat=void 0,G.mode=void 0,ce.WSLogout(),n&&G.pushToLoginListener("","Logout_Success"),e(!0)})}catch(e){w.Logger.error("CometChat: internalLogout",e),t(e)}})},G.markAsInteracted=function(e,o){return new Promise(function(n,t){try{w.isFalsy(e)?t(new K.CometChatException(R.ERRORS.PARAMETER_MISSING)):_.makeApiCall("markInteracted",{messageId:e},{interactions:[o]}).then(function(e){var t;t=e&&e.data&&e.data.message?e.data.message:"Marked interacted",n(t)},function(e){t(new K.CometChatException(e.error))})}catch(e){t(new K.CometChatException(e))}})},G.getConversationUpdateSettings=function(){return E(this,void 0,void 0,function(){var t;return c(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,w.getAppSettings()];case 1:return t=e.sent(),[2,ae.ConversationUpdateSettings.fromJSON(t)];case 2:return e.sent(),[2,new ae.ConversationUpdateSettings];case 3:return[2]}})})},G.GroupType=b.GroupType,G.GroupMemberScope=b.GroupMemberScope,G.ResponseConstants=b.ResponseConstants,G.CallConstants=b.CallConstants,G.ActionConstatnts=b.ActionConstatnts,G.CALL_ERROR=b.CALL_ERROR,G.MessageConstatnts=b.MessageConstatnts,G.APP_SETTINGS=b.APP_SETTINGS,G.GroupConstants=b.GroupConstants,G.TYPING_NOTIFICATION=b.TYPING_NOTIFICATION,G.PresenceConstatnts=b.PresenceConstatnts,G.APPINFO=b.APPINFO,G.UserConstants=b.UserConstants,G.GENERAL_ERROR=b.GENERAL_ERROR,G.ConversationErrors=b.ConversationErrors,G.LOCAL_STORE=b.LOCAL_STORE,G.SDKHeader=b.SDKHeader,G.Errors=b.Errors,G.SESSION_STORE=b.SESSION_STORE,G.REACTION_ACTION=b.REACTION_ACTION,G.ExtensionErrors=b.ExtensionErrors,G.FeatureRestrictionErrors=b.FeatureRestrictionErrors,G.WS=b.WS,G.JWT_API=b.JWT_API,G.PROSODY_API=b.PROSODY_API,G.ProsodyApiErrors=b.ProsodyApiErrors,G.ONLINE_MEMBER_COUNT_API=b.ONLINE_MEMBER_COUNT_API,G.ReceiptErrors=b.ReceiptErrors,G.ANALYTICS=b.ANALYTICS,G.API_ERROR_CODES=b.API_ERROR_CODES,G.ATTACHMENTS_CONSTANTS=b.ATTACHMENTS_CONSTANTS,G.BlockedUsersConstants=b.BlockedUsersConstants,G.CALLING_COMPONENT_VERSION=b.CALLING_COMPONENT_VERSION,G.COMMON_UTILITY_CONSTANTS=b.COMMON_UTILITY_CONSTANTS,G.DEFAULT_VALUES=b.DEFAULT_VALUES,G.DELIVERY_RECEIPTS=b.DELIVERY_RECEIPTS,G.GroupErrors=b.GroupErrors,G.GroupMemersConstans=b.GroupMemersConstans,G.MessageCategory=b.MessageCategory,G.MessageErrors=b.MessageErrors,G.PARAMETER_ERROR=b.PARAMETER_ERROR,G.READ_RECEIPTS=b.READ_RECEIPTS,G.UserErrors=b.UserErrors,G.constants=b.constants,G.GoalType=b.GoalType,G.initialzed=!1,G.CometChatException=K.CometChatException,G.TextMessage=T.TextMessage,G.MediaMessage=S.MediaMessage,G.CustomMessage=L.CustomMessage,G.BaseMessage=p.BaseMessage,G.Action=i.Action,G.Call=s.Call,G.TypingIndicator=M.TypingIndicator,G.TransientMessage=z.TransientMessage,G.InteractiveMessage=Z.InteractiveMessage,G.InteractionGoal=$.InteractionGoal,G.Interaction=ee.Interaction,G.InteractionReceipt=te.InteractionReceipt,G.Group=a.Group,G.User=l.User,G.GroupMember=D.GroupMember,G.Conversation=V.Conversation,G.ReactionCount=se.ReactionCount,G.ReactionEvent=re.ReactionEvent,G.Reaction=ie.Reaction,G.USER_STATUS={ONLINE:b.PresenceConstatnts.STATUS.ONLINE,OFFLINE:b.PresenceConstatnts.STATUS.OFFLINE},G.MessagesRequest=m.MessagesRequest,G.MessagesRequestBuilder=m.MessagesRequestBuilder,G.ReactionsRequest=oe.ReactionsRequest,G.ReactionsRequestBuilder=oe.ReactionsRequestBuilder,G.UsersRequest=N.UsersRequest,G.UsersRequestBuilder=N.UsersRequestBuilder,G.ConversationsRequest=y.ConversationsRequest,G.ConversationsRequestBuilder=y.ConversationsRequestBuilder,G.BlockedUsersRequest=U.BlockedUsersRequest,G.BlockedUsersRequestBuilder=U.BlockedUsersRequestBuilder,G.GroupsRequest=I.GroupsRequest,G.GroupsRequestBuilder=I.GroupsRequestBuilder,G.GroupMembersRequest=f.GroupMembersRequest,G.GroupMembersRequestBuilder=f.GroupMembersRequestBuilder,G.BannedMembersRequest=O.BannedMembersRequest,G.BannedMembersRequestBuilder=O.BannedMembersRequestBuilder,G.CallSettings=J.CallSettings,G.CallSettingsBuilder=J.CallSettingsBuilder,G.MainVideoContainerSetting=J.MainVideoContainerSetting,G.VirtualBackground=J.VirtualBackground,G.VirtualBackgroundBuilder=J.VirtualBackgroundBuilder,G.AppSettings=Y.AppSettings,G.AppSettingsBuilder=Y.AppSettingsBuilder,G.MessageListener=o.MessageListener,G.UserListener=o.UserListener,G.GroupListener=o.GroupListener,G.OngoingCallListener=o.OngoingCallListener,G.CallListener=o.CallListener,G.ConnectionListener=o.ConnectionListener,G.LoginListener=o.LoginListener,G.CallController=B.CallController,G.CometChatHelper=F.CometChatHelper,G.Attachment=k.Attachment,G.MediaDevice=Q.MediaDevice,G.MESSAGE_TYPE=b.MessageConstatnts.TYPE,G.CATEGORY_MESSAGE=b.MessageConstatnts.CATEGORY.MESSAGE,G.CATEGORY_ACTION=b.MessageConstatnts.CATEGORY.ACTION,G.CATEGORY_CALL=b.MessageConstatnts.CATEGORY.CALL,G.CATEGORY_CUSTOM=b.MessageConstatnts.CATEGORY.CUSTOM,G.CATEGORY_INTERACTIVE=b.MessageConstatnts.CATEGORY.INTERACTIVE,G.ACTION_TYPE=b.ActionConstatnts.ACTIONS,G.CALL_TYPE=b.CallConstants.CALL_TYPE,G.SORT_BY=b.UserConstants.SORT_BY,G.SORT_ORDER=b.UserConstants.SORT_ORDER,G.CALL_MODE=b.CallConstants.CALL_MODE,G.RECEIVER_TYPE=b.MessageConstatnts.RECEIVER_TYPE,G.CONNECTION_STATUS=b.CONNECTION_STATUS,G.CALL_STATUS=b.CallConstants.CALL_STATUS,G.GROUP_MEMBER_SCOPE=b.GROUP_MEMBER_SCOPE,G.GROUP_TYPE=b.GROUP_TYPE,G.MESSAGE_REQUEST=b.MessageConstatnts.PAGINATION.CURSOR_FILEDS,G.WSReconnectionInProgress=!1,G.WSReconnectionTimerInterval=5e3,G.currentConnectionStatus=b.CONNECTION_STATUS.DISCONNECTED,G.isConnectingFromInit=!1,G.loginInProgress=!1,G.internalRestart=!1,G.settingsInterval=6e4,G.isAnalyticsPingStarted=!1,G.isLoggedOut=!0,G.isAnalyticsDisabled=!1,G.disconnectedByUser=!1,G.shouldConnectToWS=!0,G}();t.CometChat=Se},function(e,t,n){"use strict";var u=this&&this.__assign||function(){return(u=Object.assign||function(e){for(var t,n=1,o=arguments.length;ne.db.version;if(o&&(e.version,e.version=e.db.version),s||n){if(n){var r=e.db.version+1;r>e.version&&(e.version=r)}return!0}return!1}function N(e){var t=function(e){for(var t=e.length,n=new ArrayBuffer(t),o=new Uint8Array(n),s=0;s>4,u[E++]=(15&o)<<4|s>>2,u[E++]=(3&s)<<6|63&r;return c}function B(e){var t,n=new Uint8Array(e),o="";for(t=0;t>2],o+=v[(3&n[t])<<4|n[t+1]>>4],o+=v[(15&n[t+1])<<2|n[t+2]>>6],o+=v[63&n[t+2]];return n.length%3==2?o=o.substring(0,o.length-1)+"=":n.length%3==1&&(o=o.substring(0,o.length-2)+"=="),o}var F={serialize:function(t,n){var e="";if(t&&(e=K.call(t)),t&&("[object ArrayBuffer]"===e||t.buffer&&"[object ArrayBuffer]"===K.call(t.buffer))){var o,s=D;t instanceof ArrayBuffer?(o=t,s+=Y):(o=t.buffer,"[object Int8Array]"===e?s+="si08":"[object Uint8Array]"===e?s+="ui08":"[object Uint8ClampedArray]"===e?s+="uic8":"[object Int16Array]"===e?s+="si16":"[object Uint16Array]"===e?s+="ur16":"[object Int32Array]"===e?s+="si32":"[object Uint32Array]"===e?s+="ui32":"[object Float32Array]"===e?s+="fl32":"[object Float64Array]"===e?s+="fl64":n(new Error("Failed to get type for BinaryArray"))),n(s+B(o))}else if("[object Blob]"===e){var r=new FileReader;r.onload=function(){var e="~~local_forage_type~"+t.type+"~"+B(this.result);n(D+G+e)},r.readAsArrayBuffer(t)}else try{n(JSON.stringify(t))}catch(e){n(null,e)}},deserialize:function(e){if(e.substring(0,U)!==D)return JSON.parse(e);var t,n=e.substring(w),o=e.substring(U,w);if(o===G&&L.test(n)){var s=n.match(L);t=s[1],n=n.substring(s[0].length)}var r=b(n);switch(o){case Y:return r;case G:return i([r],{type:t});case"si08":return new Int8Array(r);case"ui08":return new Uint8Array(r);case"uic8":return new Uint8ClampedArray(r);case"si16":return new Int16Array(r);case"ur16":return new Uint16Array(r);case"si32":return new Int32Array(r);case"ui32":return new Uint32Array(r);case"fl32":return new Float32Array(r);case"fl64":return new Float64Array(r);default:throw new Error("Unkown type: "+o)}},stringToBuffer:b,bufferToString:B};function V(e,t,n,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,o)}function x(e,o,s,r,i,a){e.executeSql(s,r,i,function(e,n){n.code===n.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[o.storeName],function(e,t){t.rows.length?a(e,n):V(e,o,function(){e.executeSql(s,r,i,a)},a)},a):a(e,n)},a)}function k(i,e,a,E){var c=this;i=u(i);var t=new S(function(s,r){c.ready().then(function(){void 0===e&&(e=null);var n=e,o=c._dbInfo;o.serializer.serialize(e,function(t,e){e?r(e):o.db.transaction(function(e){x(e,o,"INSERT OR REPLACE INTO "+o.storeName+" (key, value) VALUES (?, ?)",[i,t],function(){s(n)},function(e,t){r(t)})},function(e){if(e.code===e.QUOTA_ERR){if(0 '__WebKitDatabaseInfoTable__'",[],function(e,t){for(var n=[],o=0;o"}},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"},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},getPushPreferences:{endpoint:"notifications/push/v1/preferences",method:"GET"},updatePushPreferences:{endpoint:"notifications/push/v1/preferences",method:"PATCH"},resetPushPreferences:{endpoint:"notifications/push/v1/preferences",method:"DELETE"},registerToken:{endpoint:"notifications/push/v1/tokens",method:"POST"},unregisterToken:{endpoint:"notifications/push/v1/tokens",method:"DELETE"},muteConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"PUT"},unmuteConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"DELETE"},getMutedConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"GET"}}}return E.prototype.getEndpointData=function(a){return new Promise(function(s,t){try{var r=S.CometChat.appSettings.getAdminHost(),i=S.CometChat.appSettings.getClientHost();o.LocalStorage.getInstance().get(u.LOCAL_STORE.KEY_APP_SETTINGS).then(function(e){if(c.isFalsy(e)){var t={};if((new E).uriEndpoints.hasOwnProperty(a))if((t=(new E).uriEndpoints[a]).hasOwnProperty("isAdminApi"))if(c.isFalsy(r)){var n=c.format((new E).adminApiUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new E).adminApiVersion+"/"+t.endpoint;t.endpoint=n,s(t)}else{n="https://"+r+"/"+t.endpoint;t.endpoint=n,s(t)}else if(c.isFalsy(i)){n=c.format((new E).baseUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new E).apiVersion+"/"+t.endpoint;t.endpoint=n,s(t)}else{n="https://"+i+"/"+t.endpoint;t.endpoint=n,s(t)}}else{t={};if((new E).uriEndpoints.hasOwnProperty(a))if((t=(new E).uriEndpoints[a]).hasOwnProperty("isAdminApi")){var o="https://"+e[u.APP_SETTINGS.KEYS.ADMIN_API_HOST]+"/"+e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+t.endpoint;t.endpoint=o,s(t)}else{o="https://"+e[u.APP_SETTINGS.KEYS.CLIENT_API_HOST]+"/"+e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+t.endpoint;t.endpoint=o,s(t)}}},function(e){var t;if((new E).uriEndpoints.hasOwnProperty(a))if((t=(new E).uriEndpoints[a]).hasOwnProperty(["isAdminApi"]))if(c.isFalsy(r)){var n=c.format((new E).adminApiUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new E).adminApiVersion+"/"+t.endpoint;t.endpoint=n,s(t)}else t.endpoint="https://"+r+"/"+t.endpoint,s(t);else if(c.isFalsy(i)){n=c.format((new E).baseUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new E).apiVersion+"/"+t.endpoint;t.endpoint=n,s(t)}else t.endpoint="https://"+i+"/"+t.endpoint,s(t)})}catch(e){t(new p.CometChatException(e))}})},E}();t.EndpointFactory=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEndPoint=void 0;var o=n(35),i=n(2);t.getEndPoint=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=new o.EndpointFactory;return new Promise(function(o,s){try{t.getEndpointData(e).then(function(e){var t=e;if(t){for(var n in r)t.endpoint=t.endpoint.replace("{{"+n+"}}",r[n]);o(t)}else s({error:"Unknown endPoint name."})})}catch(e){s(new i.CometChatException(e))}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InteractionGoal=void 0;var o=function(){function e(e,t){this.elementIds=[],this.type=e,this.elementIds=t}return e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e.prototype.getElementIds=function(){return this.elementIds},e.prototype.setElementIds=function(e){this.elementIds=e},e}();t.InteractionGoal=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallController=void 0;var g=n(1),A=n(0),R=n(5),s=n(2),o=n(28),r=n(39),I=n(3),f=n(6),i=function(){function h(){this.TAG="calling Log",this.CALL_NO_ANSWER_INTERVAL=45e3,this.view=void 0,this.isDev=!1}return h.prototype.getCallListner=function(){return h.callListner},h.prototype.setCallListner=function(e){h.callListner=new o.UserCallListener(e)},h.getInstance=function(){try{return null!=this.callController&&null!=this.callController||(this.callController=new h),this.callController}catch(e){A.Logger.error("CallController: getInstance",e)}},h.prototype.getActiveCall=function(){try{return A.isFalsy(this.call)?null:this.call}catch(e){A.Logger.error("CallController: getActiveCall",e)}},h.prototype.initiateCall=function(n){var o=this;return new Promise(function(e,t){try{A.isFalsy(o.call)?null!=n&&null!=n?(o.call=n,o.startCallTimer(),e(n)):t(new s.CometChatException(g.CALL_ERROR.ERROR_IN_CALLING)):t(new s.CometChatException(g.CALL_ERROR.CALL_ALREADY_INITIATED))}catch(e){t(new s.CometChatException(e))}})},h.prototype.endCall=function(e){var t=this;try{document.getElementsByName("frame").forEach(function(e){t.view&&(t.view.removeChild(e),t.view=void 0)}),this.endCallSession()}catch(e){A.Logger.error("CallController: endCall",e)}},h.prototype.onCallStarted=function(n){var o=this;return new Promise(function(e,t){try{A.isFalsy(o.call)?null!=n&&null!=n?e(o.call=n):t(new s.CometChatException(g.CALL_ERROR.ERROR_IN_CALLING)):t(new s.CometChatException(g.CALL_ERROR.CALL_ALREADY_INITIATED))}catch(e){t(new s.CometChatException(e))}})},h.prototype.endCallSession=function(){try{this.call=void 0,h.callController=void 0,this.timer&&this.stopCallTimer(),this.view=void 0,this.removeListener(),h.callScreen=null,h.callSettings=null}catch(e){A.Logger.error("CallController:EndCallSession",{e:e})}},h.prototype.startCallTimer=function(){var t=this;try{this.timer=setTimeout(function(){t.call?R.CometChat.sendUnansweredResponse(t.call.getSessionId()).then(function(e){t.endCallSession()},function(e){t.endCallSession()}):t.endCallSession()},this.CALL_NO_ANSWER_INTERVAL)}catch(e){A.Logger.error("CallController: startCallTimer",e)}},h.prototype.stopCallTimer=function(){try{clearTimeout(this.timer)}catch(e){A.Logger.error("CallController: stopCallTimer",e)}},h.prototype.startCall=function(t,n){var o=this;try{this.timer&&this.stopCallTimer();var s=document.createElement("iframe");this.getCallUrl().then(function(e){s.src=e+"",s.name="frame",s.setAttribute("allow","camera; microphone; display-capture;"),s.setAttribute("width","100%"),s.setAttribute("height","100%"),h.callScreen=s,h.callSettings=t,n&&(o.view=n),n.appendChild(s),o.addListener()})}catch(e){A.Logger.error("CallController: startCall",e)}},h.prototype.addListener=function(){window.addEventListener("message",this.handler,!0)},h.prototype.removeListener=function(){window.removeEventListener("message",this.handler,!0)},h.prototype.handler=function(e){var t,n=this,o=h.callSettings,s=h.callScreen,r=h.getInstance().getActiveCall();try{if(void 0!==(t=JSON.parse(e.data))&&t.type==g.CallConstants.POST_MESSAGES.TYPES.HANGUP)h.deviceList=null,r?(A.Logger.info(this.TAG,h.callListner),window.setTimeout(function(){R.CometChat.endCall(r.getSessionId(),!0).then(function(e){A.Logger.info(n.TAG,{call:e})}).catch(function(e){A.Logger.info(n.TAG,"The Call Was Already Ended")})},1e3)):R.CometChat.endCall(o.getSessionId(),!0).then(function(e){A.Logger.info(n.TAG,{call:e})}).catch(function(e){A.Logger.info(n.TAG,"The Call Was Already Ended")});else if(void 0!==t&&t.type==g.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&t.action==g.CallConstants.POST_MESSAGES.ACTIONS.USER_JOINED){if(t.value){var i=void 0,a=t.value;A.isFalsy(a.uid)||A.isFalsy(a.name)||((i=new I.User(a)).setStatus("online"),R.CometChat.user.getUid().toLowerCase()!=i.getUid().toLowerCase()&&h.callListner&&(A.isFalsy(h.callListner._eventListener.onUserJoined)||h.callListner._eventListener.onUserJoined(i)))}}else if(void 0!==t&&t.type==g.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&t.action==g.CallConstants.POST_MESSAGES.ACTIONS.USER_LEFT){if(t.value){i=void 0,a=t.value;A.isFalsy(a.uid)||A.isFalsy(a.name)||((i=new I.User(a)).setStatus("online"),R.CometChat.user.getUid().toLowerCase()!=i.getUid().toLowerCase()&&h.callListner&&(A.isFalsy(h.callListner._eventListener.onUserLeft)||h.callListner._eventListener.onUserLeft(i)))}}else if(void 0!==t&&t.type==g.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&t.action==g.CallConstants.POST_MESSAGES.ACTIONS.USER_LIST_CHANGED){var E=[];if(t.value&&0a.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 e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=100,e.DEFAULT_LIMIT=30,e}();t.GroupsRequest=E;var c=function(){function e(){}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.joinedOnly=function(e){return this.hasJoined=e,this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.showTags=e,this},e.prototype.build=function(){return new E(this)},e}();t.GroupsRequestBuilder=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GroupMembersRequestBuilder=t.GroupMembersRequest=void 0;var s=n(6),o=n(0),r=n(15),i=n(2),a=n(40),E=n(1),c=function(){function e(e){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(e)||(this.limit=e.limit,this.guid=e.guid,o.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),o.isFalsy(e.scopes)||(this.scopes=e.scopes))}return e.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 e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=2,e.DEFAULT_LIMIT=1,e}();t.GroupMembersRequest=c;var u=function(){function e(e){this.guid=e}return e.prototype.setGuid=function(e){return this.guid=e,this},e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.setScopes=function(e){return this.scopes=e,this},e.prototype.build=function(){return new c(this)},e}();t.GroupMembersRequestBuilder=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BannedMembersRequestBuilder=t.BannedMembersRequest=void 0;var s=n(6),o=n(0),r=n(2),i=n(40),a=n(1),E=function(){function e(e){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(e)||(this.limit=e.limit,this.guid=e.guid,o.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),o.isFalsy(e.scopes)||(this.scopes=e.scopes))}return e.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 e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=2,e.DEFAULT_LIMIT=1,e}();t.BannedMembersRequest=E;var c=function(){function e(e){this.guid=e}return e.prototype.setGuid=function(e){return this.guid=e,this},e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.setScopes=function(e){return this.scopes=e,this},e.prototype.build=function(){return new E(this)},e}();t.BannedMembersRequestBuilder=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UsersRequestBuilder=t.UsersRequest=void 0;var s=n(6),o=n(0),r=n(12),i=n(2),a=n(53),E=n(1),c=function(){function t(e){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:[]},t.userStore=a.UserStore.getInstance(),o.isFalsy(e)||(this.limit=e.limit,o.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),o.isFalsy(e.status)||(e.status==t.USER_STATUS.ONLINE?this.status=E.PresenceConstatnts.STATUS.AVAILABLE:this.status=e.status),o.isFalsy(e.shouldHideBlockedUsers)||(this.hideBlockedUsers=e.shouldHideBlockedUsers),o.isFalsy(e.showFriendsOnly)||(this.friendsOnly=e.showFriendsOnly),o.isFalsy(e.showTags)||(this.withTags=e.showTags),o.isFalsy(e.role)||(this.role=e.role),o.isFalsy(e.roles)||(this.roles=e.roles),o.isFalsy(e.tags)||(this.tags=e.tags),o.isFalsy(e.UIDs)||(this.UIDs=e.UIDs),o.isFalsy(e.SortBy)||(this.sortBy=e.SortBy),o.isFalsy(e.SearchIn)||(this.searchIn=e.SearchIn),o.isFalsy(e.SortOrder)||(this.sortOrder=e.SortOrder))}return t.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 e.page=this.next_page,e;e.page=this.next_page++}return e},t.USER_STATUS={ONLINE:E.PresenceConstatnts.STATUS.ONLINE,OFFLINE:E.PresenceConstatnts.STATUS.OFFLINE},t}();t.UsersRequest=c;var u=function(){function e(){this.shouldHideBlockedUsers=!1}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setStatus=function(e){return this.status=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.hideBlockedUsers=function(e){return this.shouldHideBlockedUsers=e,this},e.prototype.setRole=function(e){return this.role=e,this},e.prototype.setRoles=function(e){return this.roles=e,this},e.prototype.friendsOnly=function(e){return this.showFriendsOnly=e,this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.showTags=e,this},e.prototype.setUIDs=function(e){return this.UIDs=e,this},e.prototype.sortBy=function(e){return this.SortBy=e,this},e.prototype.sortByOrder=function(e){return this.SortOrder=e,this},e.prototype.searchIn=function(e){return this.SearchIn=e,this},e.prototype.build=function(){return this.role&&this.roles&&this.roles.push(this.role),new c(this)},e}();t.UsersRequestBuilder=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserStore=void 0;var o=n(5),s=n(0),r=n(1),i=n(13),a=function(){function e(e){this.store=r.constants.DEFAULT_STORE,s.isFalsy(e)||(this.store=e),this.userStore=i.createInstance({name:s.format(r.LOCAL_STORE.STORE_STRING,o.CometChat.getAppId(),r.LOCAL_STORE.USERS_STORE)}),this.userStore.setDriver([i.LOCALSTORAGE,i.INDEXEDDB,i.WEBSQL])}return e.getInstance=function(){return null==e.UserStore&&(e.UserStore=new e),e.UserStore},e.prototype.set=function(e,t){return this.userStore.setItem(e,t)},e.prototype.remove=function(e){this.userStore.removeItem(e)},e.prototype.get=function(e){return this.userStore.getItem(e)},e.prototype.clearStore=function(){var n=this;return new Promise(function(e,t){n.userStore.clear().then(function(){e(!0)}).catch(function(e){t(e)})})},e.prototype.clear=function(e){},e.prototype.selectStore=function(e){this.store=e},e.prototype.storeUsers=function(e){var t=this;return e.map(function(e){t.set(e.getUid(),e)}),!0},e.prototype.storeUser=function(e){return this.set(e.getUid(),e),!0},e}();t.UserStore=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationsRequestBuilder=t.ConversationsRequest=void 0;var s=n(6),o=n(0),r=n(2),i=n(29),a=n(1),E=function(){function e(e){this.limit=30,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(e)||(this.limit=e.limit,o.isFalsy(e.conversationType)||(this.conversationType=e.conversationType),o.isFalsy(e.getUserAndGroupTags)||(this.getUserAndGroupTags=e.getUserAndGroupTags),e.tags&&(this.tags=e.tags),o.isFalsy(e.WithTags)||(this.withTags=e.WithTags),e.groupTags&&(this.groupTags=e.groupTags),e.userTags&&(this.userTags=e.userTags),e.includeBlockedUsers&&(this.includeBlockedUsers=e.includeBlockedUsers),e.withBlockedInfo&&(this.withBlockedInfo=e.withBlockedInfo))}return e.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 e.page=this.next_page,e;e.page=this.next_page++}return e},e.prototype.isIncludeBlockedUsers=function(){return this.includeBlockedUsers},e.prototype.isWithBlockedInfo=function(){return this.withBlockedInfo},e.prototype.getLimit=function(){return this.limit},e.prototype.getConversationType=function(){return this.conversationType},e.prototype.isWithUserAndGroupTags=function(){return this.getUserAndGroupTags},e.prototype.getTags=function(){return this.tags},e.prototype.isWithTags=function(){return this.withTags},e.prototype.getGroupTags=function(){return this.groupTags},e.prototype.getUserTags=function(){return this.userTags},e}();t.ConversationsRequest=E;var c=function(){function e(){this.WithTags=!1,this.includeBlockedUsers=!1,this.withBlockedInfo=!1}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setConversationType=function(e){return this.conversationType=e,this},e.prototype.withUserAndGroupTags=function(e){return"boolean"==typeof e&&(this.getUserAndGroupTags=e),this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.WithTags=e,this},e.prototype.setGroupTags=function(e){return this.groupTags=e,this},e.prototype.setUserTags=function(e){return this.userTags=e,this},e.prototype.setIncludeBlockedUsers=function(e){return this.includeBlockedUsers=e,this},e.prototype.setWithBlockedInfo=function(e){return this.withBlockedInfo=e,this},e.prototype.build=function(){return new E(this)},e}();t.ConversationsRequestBuilder=c},function(e,t,n){"use strict";var I=this&&this.__awaiter||function(e,i,a,E){return new(a||(a=Promise))(function(n,t){function o(e){try{r(E.next(e))}catch(e){t(e)}}function s(e){try{r(E.throw(e))}catch(e){t(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(o,s)}r((E=E.apply(e,i||[])).next())})},f=this&&this.__generator||function(n,o){var s,r,i,e,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(s)throw new TypeError("Generator is already executing.");for(;a;)try{if(s=1,r&&(i=2&t[0]?r.return:t[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,t[1])).done)return i;switch(r=0,i&&(t=[2&t[0],i.value]),t[0]){case 0:case 1:i=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,r=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]P.DEFAULT_VALUES.MSGS_MAX_LIMIT)return void t(new O.CometChatException(JSON.parse(m.format(JSON.stringify(P.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",P.DEFAULT_VALUES.MSGS_MAX_LIMIT))));if(ee&&M.MessageListnerMaping.getInstance().set(P.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(t.id))},function(e){M.MessageListnerMaping.getInstance().set(P.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(t.id))}),this.affix==P.MessageConstatnts.PAGINATION.AFFIX.APPEND?(this.idparseInt(t.id)&&(this.id=parseInt(t.id)),this.timestamp>t.sentAt&&(this.timestamp=t.sentAt),this.updatedAt>t.updatedAt&&(this.updatedAt=t.updatedAt)),this.id&&(this.paginationMeta[P.MessageConstatnts.PAGINATION.KEYS.ID]=this.id),this.timestamp&&(this.paginationMeta[P.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=this.timestamp),this.updatedAt&&(this.paginationMeta[P.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=this.updatedAt),n.push(y.MessageController.trasformJSONMessge(t)),[2]})})})):n=[],s(n),[2]})})},function(e){t(new O.CometChatException(e.error))})}catch(e){t(new O.CometChatException(e))}})},e.prototype.createEndpoint=function(){this.parentMessageId?(this.endpointName="getThreadMessages",this.listId=this.parentMessageId.toString(),this.hideReplies&&(this.hideReplies=!1,delete this.paginationMeta[P.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)},e.prototype.makeData=function(){var e={};e[P.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,e[P.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,(m.isFalsy(this.guid)||m.isFalsy(this.uid))&&m.isFalsy(this.guid)&&m.isFalsy(this.uid)},e.prototype.getFilteredPreviousDataByReceiverId=function(t){return I(this,void 0,void 0,function(){var n,o=this;return f(this,function(e){switch(e.label){case 0:switch(n=[],t){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(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 2:return e.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 4:e.sent(),e.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).filter(function(e){return t[e].sender.uid==o.uid}).map(function(e){n=s(n,[t[e]])})})];case 6:return e.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 8:return e.sent(),[3,9];case 9:return[2,n]}})})},e.prototype.getFilteredNextDataByReceiverId=function(t){return I(this,void 0,void 0,function(){var n,o=this;return f(this,function(e){switch(e.label){case 0:switch(n=[],t){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(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 2:return e.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 4:e.sent(),e.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).filter(function(e){return t[e].sender.uid==o.uid}).map(function(e){n=s(n,[t[e]])})})];case 6:return e.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 8:return e.sent(),[3,9];case 9:return[2,n]}})})},e}();t.MessagesRequest=o;var a=function(){function e(){this.maxLimit=P.DEFAULT_VALUES.MSGS_MAX_LIMIT,this.timestamp=0,this.id=P.DEFAULT_VALUES.DEFAULT_MSG_ID,this.unread=!1,this.HideMessagesFromBlockedUsers=!1,this.onlyUpdate=0,this.HideDeletedMessages=!1,this.WithTags=!1,this.interactionGoalCompletedOnly=!1,this.mentionsWithUserTags=!1,this.mentionsWithBlockedRelation=!1}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setGUID=function(e){return this.guid=e,this},e.prototype.setUID=function(e){return this.uid=e,this},e.prototype.setParentMessageId=function(e){return this.parentMessageId=e,this},e.prototype.setTimestamp=function(e){return void 0===e&&(e=m.getCurrentTime()),this.timestamp=e,this},e.prototype.setMessageId=function(e){return void 0===e&&(e=P.DEFAULT_VALUES.DEFAULT_MSG_ID),this.id=e,this},e.prototype.setUnread=function(e){return void 0===e&&(e=!1),this.unread=e,this},e.prototype.hideMessagesFromBlockedUsers=function(e){return void 0===e&&(e=!1),this.HideMessagesFromBlockedUsers=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKey=e,this},e.prototype.setUpdatedAfter=function(e){return this.updatedAt=e,this},e.prototype.updatesOnly=function(e){return e&&(this.onlyUpdate=1),this},e.prototype.setCategory=function(e){return this.category=e,this},e.prototype.setCategories=function(e){return this.categories=e,this},e.prototype.setType=function(e){return this.type=e,this},e.prototype.setTypes=function(e){return this.types=e,this},e.prototype.hideReplies=function(e){return this.HideReplies=e,this},e.prototype.hideDeletedMessages=function(e){return this.HideDeletedMessages=e,this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.WithTags=e,this},e.prototype.mentionsWithTagInfo=function(e){return void 0===e&&(e=!1),this.mentionsWithUserTags=e,this},e.prototype.mentionsWithBlockedInfo=function(e){return void 0===e&&(e=!1),this.mentionsWithBlockedRelation=e,this},e.prototype.setInteractionGoalCompletedOnly=function(e){return void 0===e&&(e=!1),this.interactionGoalCompletedOnly=e,this},e.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)},e}();t.MessagesRequestBuilder=a},function(e,t,n){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;ne.getId()&&(i=parseInt(e.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 e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=2,e.DEFAULT_LIMIT=1,e.directions=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS,e}();t.BlockedUsersRequest=E;var c=function(){function e(){}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.setDirection=function(e){return this.direction=e,this},e.prototype.blockedByMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BLOCKED_BY_ME,this},e.prototype.hasBlockedMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.HAS_BLOCKED_ME,this},e.prototype.build=function(){return new E(this)},e}();t.BlockedUsersRequestBuilder=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AppSettingsBuilder=t.AppSettings=void 0;var o=n(1),s=function(){function t(e){this.subscriptionType=t.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=e.subscriptionType,this.roles=e.roles,this.region=e.region,this.autoJoinGroup=e.autoJoinGroup,this.establishSocketConnection=e.establishSocketConnection,this.adminHost=e.adminHost,this.clientHost=e.clientHost}return t.prototype.getSubscriptionType=function(){return this.subscriptionType},t.prototype.getRoles=function(){return this.roles},t.prototype.getRegion=function(){return this.region},t.prototype.getIsAutoJoinEnabled=function(){return this.autoJoinGroup},t.prototype.shouldAutoEstablishSocketConnection=function(){return this.establishSocketConnection},t.prototype.getAdminHost=function(){return this.adminHost},t.prototype.getClientHost=function(){return this.clientHost},t.SUBSCRIPTION_TYPE_NONE="NONE",t.SUBSCRIPTION_TYPE_ALL_USERS="ALL_USERS",t.SUBSCRIPTION_TYPE_ROLES="ROLES",t.SUBSCRIPTION_TYPE_FRIENDS="FRIENDS",t.REGION_EU=o.DEFAULT_VALUES.REGION_DEFAULT_EU,t.REGION_US=o.DEFAULT_VALUES.REGION_DEFAULT_US,t.REGION_IN=o.DEFAULT_VALUES.REGION_DEFAULT_IN,t.REGION_PRIVATE=o.DEFAULT_VALUES.REGION_DEFAULT_PRIVATE,t}();t.AppSettings=s;var r=function(){function e(){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 e.prototype.subscribePresenceForAllUsers=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ALL_USERS,this},e.prototype.subscribePresenceForRoles=function(e){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ROLES,this.roles=e,this},e.prototype.subscribePresenceForFriends=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_FRIENDS,this},e.prototype.setRegion=function(e){return void 0===e&&(e=o.DEFAULT_VALUES.REGION_DEFAULT),this.region=e.toLowerCase(),this},e.prototype.enableAutoJoinForGroups=function(e){return void 0===e&&(e=!0),this.autoJoinGroup=e,this},e.prototype.autoEstablishSocketConnection=function(e){return void 0===e&&(e=!0),this.establishSocketConnection=e,this},e.prototype.overrideAdminHost=function(e){return this.adminHost=e,this},e.prototype.overrideClientHost=function(e){return this.clientHost=e,this},e.prototype.build=function(){return new s(this)},e}();t.AppSettingsBuilder=r},function(e,t,n){"use strict";var S=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;ti[0]&&t[1]i[0]&&t[1]i[0]&&t[1]C.DEFAULT_VALUES.REACTIONS_MAX_LIMIT)return void t(new S.CometChatException(JSON.parse(p.format(JSON.stringify(C.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",C.DEFAULT_VALUES.REACTIONS_MAX_LIMIT))));if(e>>((3&t)<<3)&255;return s}}},function(e,t){for(var s=[],n=0;n<256;++n)s[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,o=s;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CometChatNotifications=void 0;var u=n(1),S=n(0),p=n(2),C=n(6),l=n(14),o=n(47),_=n(81),s=n(82),d=n(83),T=n(84),h=n(85),r=n(86),i=function(){function E(){}return E.fetchPushPreferences=function(){return new Promise(function(i,t){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_GET_PREFERENCES,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?T.OneOnOnePreferences.fromJSON(e.data):new T.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?d.MutePreferences.fromJSON(e.data):new d.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=h.PushPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new h.PushPreferences)},function(e){return t(new p.CometChatException(e.error))})},function(e){return t(new p.CometChatException(e))})}catch(e){return t(new p.CometChatException(e))}})},E.updatePushPreferences=function(c){return new Promise(function(a,E){try{S.getAppSettings().then(function(e){var t,n=((t={})[l.APIConstants.KEY_GROUP_PREFERENCES]={},t[l.APIConstants.KEY_MUTE_PREFERENCES]={},t[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]={},t),o=c.getGroupPreferences(),s=c.getMutePreferences(),r=c.getOneOnOnePreferences(),i=c.getUsePrivacyTemplate();o&&(o.getMessagesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MESSAGES]=o.getMessagesPreference()),o.getReactionsPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REACTIONS]=o.getReactionsPreference()),o.getRepliesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REPLIES]=o.getRepliesPreference()),o.getMemberAddedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_ADDED]=o.getMemberAddedPreference()),o.getMemberBannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_BANNED]=o.getMemberBannedPreference()),o.getMemberJoinedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_JOINED]=o.getMemberJoinedPreference()),o.getMemberKickedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_KICKED]=o.getMemberKickedPreference()),o.getMemberLeftPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_LEFT]=o.getMemberLeftPreference()),o.getMemberScopeChangedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_SCOPE_CHANGED]=o.getMemberScopeChangedPreference()),o.getMemberUnbannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_UNBANNED]=o.getMemberUnbannedPreference())),s&&(s.getDNDPreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_DND]=s.getDNDPreference()),s.getSchedulePreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_SCHEDULE]=s.getSchedulePreference())),r&&(r.getMessagesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_MESSAGES]=r.getMessagesPreference()),r.getReactionsPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REACTIONS]=r.getReactionsPreference()),r.getRepliesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REPLIES]=r.getRepliesPreference())),null!=i&&(n[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE]=i),0===Object.keys(n[l.APIConstants.KEY_GROUP_PREFERENCES]).length&&delete n[l.APIConstants.KEY_GROUP_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_MUTE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_MUTE_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES],C.makeApiCall(l.APIConstants.KEY_UPDATE_PREFERENCES,null,n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?T.OneOnOnePreferences.fromJSON(e.data):new T.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?d.MutePreferences.fromJSON(e.data):new d.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=h.PushPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return a(r)}return a(new h.PushPreferences)},function(e){return E(new p.CometChatException(e.error))})},function(e){return E(new p.CometChatException(e))})}catch(e){return E(new p.CometChatException(e))}})},E.resetPushPreferences=function(){return new Promise(function(i,t){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_RESET_PREFERENCES,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?T.OneOnOnePreferences.fromJSON(e.data):new T.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?d.MutePreferences.fromJSON(e.data):new d.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=h.PushPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new h.PushPreferences)},function(e){return t(new p.CometChatException(e.error))})},function(e){return t(new p.CometChatException(e))})}catch(e){return t(new p.CometChatException(e))}})},E.getTokensForRequest=function(e,t,n,o){var s={};return s[l.APIConstants.KEY_PROVIDER_ID]=null!=o?o:l.DEFAULT_PROVIDER_ID,s[l.APIConstants.KEY_TIMEZONE]=e,n===l.PushPlatforms.FCM_WEB&&(s[l.APIConstants.KEY_FCM_TOKEN]=t),s[l.APIConstants.KEY_PLATFORM]=n,s},E.registerPushToken=function(r,i,a){return new Promise(function(o,s){try{S.getAppSettings().then(function(e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=E.getTokensForRequest(t,r,i,a);C.makeApiCall(l.APIConstants.KEY_REGISTER_TOKEN,null,n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?o(l.APIResponseConstants.TOKEN_REGISTER_SUCCESS):o(l.APIResponseConstants.TOKEN_REGISTER_ERROR)},function(e){return s(new p.CometChatException(e.error))})},function(e){return s(new p.CometChatException(e))})}catch(e){return s(new p.CometChatException(e))}})},E.unregisterPushToken=function(){return new Promise(function(t,n){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_UNREGISTER_TOKEN,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?t(l.APIResponseConstants.TOKEN_UNREGISTER_SUCCESS):t(l.APIResponseConstants.TOKEN_UNREGISTER_ERROR)},function(e){return n(new p.CometChatException(e.error))})},function(e){return n(new p.CometChatException(e))})}catch(e){return n(new p.CometChatException(e))}})},E.muteConversations=function(r){return new Promise(function(o,s){try{S.getAppSettings().then(function(e){var t,n=((t={})[l.APIConstants.KEY_CONVERSATIONS]=r,t);C.makeApiCall(l.APIConstants.KEY_MUTE_CONVERSATIONS,null,n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?o(l.APIResponseConstants.MUTE_CONVERSATION_SUCCESS):o(l.APIResponseConstants.MUTE_CONVERSATION_ERROR)},function(e){return s(new p.CometChatException(e.error))})},function(e){return s(new p.CometChatException(e))})}catch(e){return s(new p.CometChatException(e))}})},E.unmuteConversations=function(r){return new Promise(function(o,s){try{S.getAppSettings().then(function(e){var t,n=((t={})[l.APIConstants.KEY_CONVERSATIONS]=r,t);C.makeApiCall(l.APIConstants.KEY_UNMUTE_CONVERSATIONS,null,n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?o(l.APIResponseConstants.UNMUTE_CONVERSATION_SUCCESS):o(l.APIResponseConstants.UNMUTE_CONVERSATION_ERROR)},function(e){return s(new p.CometChatException(e.error))})},function(e){return s(new p.CometChatException(e))})}catch(e){return s(new p.CometChatException(e))}})},E.getMutedConversations=function(){return new Promise(function(t,n){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_GET_MUTED_CONVERSATIONS,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){var n=[];return e.hasOwnProperty("data")&&e.data.hasOwnProperty(l.APIConstants.KEY_MUTED_CONVERSATIONS)&&e.data[l.APIConstants.KEY_MUTED_CONVERSATIONS].forEach(function(e){var t=new s.MutedConversation;t.setId(e.id),t.setType(e.type),t.setUntil(e.until),n.push(t)}),t(n)},function(e){return n(new p.CometChatException(e.error))})},function(e){return n(new p.CometChatException(e))})}catch(e){return n(new p.CometChatException(e))}})},E.MessagesOptions=l.MessagesOptions,E.RepliesOptions=l.RepliesOptions,E.ReactionsOptions=l.ReactionsOptions,E.MemberActionsOptions=l.MemberActionsOptions,E.DayOfWeek=l.DayOfWeek,E.DNDOptions=l.DNDOptions,E.MutedConversationType=l.MutedConversationType,E.PushPlatforms=l.PushPlatforms,E.DaySchedule=o.DaySchedule,E.PushPreferences=h.PushPreferences,E.GroupPreferences=_.GroupPreferences,E.OneOnOnePreferences=T.OneOnOnePreferences,E.MutePreferences=d.MutePreferences,E.MutedConversation=s.MutedConversation,E.UnmutedConversation=r.UnmutedConversation,E}();t.CometChatNotifications=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GroupPreferences=void 0;var o=n(14),s=function(){function n(){}return n.prototype.getMessagesPreference=function(){return this.groupMessages},n.prototype.getRepliesPreference=function(){return this.groupReplies},n.prototype.getReactionsPreference=function(){return this.groupReactions},n.prototype.getMemberLeftPreference=function(){return this.groupMemberLeft},n.prototype.getMemberAddedPreference=function(){return this.groupMemberAdded},n.prototype.getMemberJoinedPreference=function(){return this.groupMemberJoined},n.prototype.getMemberKickedPreference=function(){return this.groupMemberKicked},n.prototype.getMemberBannedPreference=function(){return this.groupMemberBanned},n.prototype.getMemberUnbannedPreference=function(){return this.groupMemberUnbanned},n.prototype.getMemberScopeChangedPreference=function(){return this.groupMemberScopeChanged},n.prototype.setMessagesPreference=function(e){this.groupMessages=e},n.prototype.setRepliesPreference=function(e){this.groupReplies=e},n.prototype.setReactionsPreference=function(e){this.groupReactions=e},n.prototype.setMemberLeftPreference=function(e){this.groupMemberLeft=e},n.prototype.setMemberAddedPreference=function(e){this.groupMemberAdded=e},n.prototype.setMemberJoinedPreference=function(e){this.groupMemberJoined=e},n.prototype.setMemberKickedPreference=function(e){this.groupMemberKicked=e},n.prototype.setMemberBannedPreference=function(e){this.groupMemberBanned=e},n.prototype.setMemberUnbannedPreference=function(e){this.groupMemberUnbanned=e},n.prototype.setMemberScopeChangedPreference=function(e){this.groupMemberScopeChanged=e},n.fromJSON=function(e){var t=new n;return t.setMessagesPreference(o.MessagesOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MESSAGES]]),t.setRepliesPreference(o.RepliesOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_REPLIES]]),t.setReactionsPreference(o.ReactionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_REACTIONS]]),t.setMemberAddedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_ADDED]]),t.setMemberJoinedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_JOINED]]),t.setMemberBannedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_BANNED]]),t.setMemberKickedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_KICKED]]),t.setMemberLeftPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_LEFT]]),t.setMemberScopeChangedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_SCOPE_CHANGED]]),t.setMemberUnbannedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_UNBANNED]]),t},n}();t.GroupPreferences=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MutedConversation=void 0;var o=function(){function e(){}return e.prototype.getId=function(){return this.id},e.prototype.setId=function(e){this.id=e},e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e.prototype.getUntil=function(){return this.until},e.prototype.setUntil=function(e){this.until=e},e}();t.MutedConversation=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MutePreferences=void 0;var S=n(14),p=n(47),o=function(){function u(){}return u.prototype.getDNDPreference=function(){return this.dnd},u.prototype.setDNDPreference=function(e){this.dnd=e},u.prototype.getSchedulePreference=function(){return this.schedule},u.prototype.setSchedulePreference=function(e){this.schedule=e},u.prototype.getScheduleFor=function(e){return this.schedule.get(e)},u.prototype.setScheduleFor=function(e,t){this.schedule.set(e,t)},u.fromJSON=function(e){var t=new u;t.setDNDPreference(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_DND]);var n=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.MONDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.MONDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.MONDAY][S.APIConstants.KEY_MUTE_DND]),o=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.TUESDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.TUESDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.TUESDAY][S.APIConstants.KEY_MUTE_DND]),s=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.WEDNESDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.WEDNESDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.WEDNESDAY][S.APIConstants.KEY_MUTE_DND]),r=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.THURSDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.THURSDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.THURSDAY][S.APIConstants.KEY_MUTE_DND]),i=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.FRIDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.FRIDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.FRIDAY][S.APIConstants.KEY_MUTE_DND]),a=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SATURDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SATURDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SATURDAY][S.APIConstants.KEY_MUTE_DND]),E=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SUNDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SUNDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SUNDAY][S.APIConstants.KEY_MUTE_DND]),c=new Map([[S.DayOfWeek.MONDAY,n],[S.DayOfWeek.TUESDAY,o],[S.DayOfWeek.WEDNESDAY,s],[S.DayOfWeek.THURSDAY,r],[S.DayOfWeek.FRIDAY,i],[S.DayOfWeek.SATURDAY,a],[S.DayOfWeek.SUNDAY,E]]);return t.setSchedulePreference(c),t},u}();t.MutePreferences=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OneOnOnePreferences=void 0;var o=n(14),s=function(){function n(){}return n.prototype.getReactionsPreference=function(){return this.oneOnOneMessageReactions},n.prototype.setReactionsPreference=function(e){this.oneOnOneMessageReactions=e},n.prototype.getRepliesPreference=function(){return this.oneOnOneReplies},n.prototype.setRepliesPreference=function(e){this.oneOnOneReplies=e},n.prototype.getMessagesPreference=function(){return this.oneOnOneMessages},n.prototype.setMessagesPreference=function(e){this.oneOnOneMessages=e},n.fromJSON=function(e){var t=new n;return t.setMessagesPreference(o.MessagesOptions[e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_MESSAGES]]),t.setRepliesPreference(o.RepliesOptions[e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_REPLIES]]),t.setReactionsPreference(o.ReactionsOptions[e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_REACTIONS]]),t},n}();t.OneOnOnePreferences=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PushPreferences=void 0;var o=n(14),s=function(){function n(){}return n.prototype.getOneOnOnePreferences=function(){return this.oneOnOnePreferences},n.prototype.setOneOnOnePreferences=function(e){this.oneOnOnePreferences=e},n.prototype.getMutePreferences=function(){return this.mutePreferences},n.prototype.setMutePreferences=function(e){this.mutePreferences=e},n.prototype.getGroupPreferences=function(){return this.groupPreferences},n.prototype.setGroupPreferences=function(e){this.groupPreferences=e},n.prototype.getUsePrivacyTemplate=function(){return this.usePrivacyTemplate},n.prototype.setUsePrivacyTemplate=function(e){this.usePrivacyTemplate=e},n.fromJSON=function(e){var t=new n;return e.hasOwnProperty(o.APIConstants.KEY_MUTE_PREFERENCES)&&t.setMutePreferences(e[o.APIConstants.KEY_MUTE_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_GROUP_PREFERENCES)&&t.setGroupPreferences(e[o.APIConstants.KEY_GROUP_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)&&t.setOneOnOnePreferences(e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&t.setUsePrivacyTemplate(e[o.APIConstants.KEY_USE_PRIVACY_TEMPLATE]),t},n}();t.PushPreferences=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnmutedConversation=void 0;var o=function(){function e(){}return e.prototype.getId=function(){return this.id},e.prototype.setId=function(e){this.id=e},e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e}();t.UnmutedConversation=o}])}); \ No newline at end of file +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,function(){return function(n){var o={};function s(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,s),t.l=!0,t.exports}return s.m=n,s.c=o,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)s.d(n,o,function(e){return t[e]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=34)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateQuestion=t.updatePropertiesWithDynamicValue=t.validateConversationType=t.validateUpdateUser=t.validateCreateUser=t.validateMessage=t.validateChatType=t.validateMsgId=t.validateArray=t.validateHideMessagesFromBlockedUsers=t.validateId=t.validateCreateGroup=t.validateJoinGroup=t.validateUpdateGroup=t.validateScope=t.isAudio=t.isVideo=t.isImage=t.getUpdatedSettings=t.getAppSettings=t.getCurrentTime=t.Logger=t.createUidFromJid=t.format=t.getOrdinalSuffix=t.isFalsy=t.isTruthy=t.isObject=t.getJidHost=t.getChatHost=void 0;var o=n(15),i=n(1),s=n(6),a=n(2),E=n(17),c=n(19),u=n(21),r=n(5),S=n(10),p=n(22);function C(e){return null!=e&&("string"==typeof e&&(e=e.trim()),"object"==typeof e&&0===Object.keys(e).length&&(e=void 0)),["",0,"0",!1,null,"null",void 0,"undefined"].includes(e)}function l(e){for(var o=[],t=1;ti[0]&&t[1] All store cleared successfully","true"),e(!0)})}catch(e){w.Logger.error("CometChat: clearCache",e),t(e)}})},G.connect=function(){G.user&&(ce.connection||(G.disconnectedByUser=!1,G.WSLogin(G.user)),G.didAnalyticsPingStart()||G.isAnalyticsDisabled||(G.pingAnalytics(),G.startAnalyticsPingTimer()))},G.disconnect=function(){G.user&&(G.disconnectedByUser=!0,ce.connection&&ce.WSLogout(),G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer())},G.prototype.internalRestart=function(e){G.internalRestart||G.getInstance().internalLogout(!1).then(function(){G.internalRestart=!0,G.login(e).then(function(e){G.shouldConnectToWS=!0,G.internalRestart=!1},function(e){w.Logger.error("CometChat: internalRestart :: login",e),G.internalRestart=!1})},function(e){w.Logger.error("CometChat: internalRestart :: internalLogout",e)})},G.prototype.internalLogout=function(n){return void 0===n&&(n=!0),new Promise(function(e,t){try{G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer(),G.WSReconnectionInProgress&&G.clearWSReconnectionTimer(),G.isLoggedOut=!0,G.WSReconnectionInProgress=!1,G.isAnalyticsDisabled=!1,G.clearCache().then(function(){G.apiKey=void 0,G.user=void 0,G.authToken=void 0,G.cometChat=void 0,G.mode=void 0,ce.WSLogout(),n&&G.pushToLoginListener("","Logout_Success"),e(!0)})}catch(e){w.Logger.error("CometChat: internalLogout",e),t(e)}})},G.markAsInteracted=function(e,o){return new Promise(function(n,t){try{w.isFalsy(e)?t(new K.CometChatException(R.ERRORS.PARAMETER_MISSING)):_.makeApiCall("markInteracted",{messageId:e},{interactions:[o]}).then(function(e){var t;t=e&&e.data&&e.data.message?e.data.message:"Marked interacted",n(t)},function(e){t(new K.CometChatException(e.error))})}catch(e){t(new K.CometChatException(e))}})},G.getConversationUpdateSettings=function(){return E(this,void 0,void 0,function(){var t;return c(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,w.getAppSettings()];case 1:return t=e.sent(),[2,ae.ConversationUpdateSettings.fromJSON(t)];case 2:return e.sent(),[2,new ae.ConversationUpdateSettings];case 3:return[2]}})})},G.GroupType=b.GroupType,G.GroupMemberScope=b.GroupMemberScope,G.ResponseConstants=b.ResponseConstants,G.CallConstants=b.CallConstants,G.ActionConstatnts=b.ActionConstatnts,G.CALL_ERROR=b.CALL_ERROR,G.MessageConstatnts=b.MessageConstatnts,G.APP_SETTINGS=b.APP_SETTINGS,G.GroupConstants=b.GroupConstants,G.TYPING_NOTIFICATION=b.TYPING_NOTIFICATION,G.PresenceConstatnts=b.PresenceConstatnts,G.APPINFO=b.APPINFO,G.UserConstants=b.UserConstants,G.GENERAL_ERROR=b.GENERAL_ERROR,G.ConversationErrors=b.ConversationErrors,G.LOCAL_STORE=b.LOCAL_STORE,G.SDKHeader=b.SDKHeader,G.Errors=b.Errors,G.SESSION_STORE=b.SESSION_STORE,G.REACTION_ACTION=b.REACTION_ACTION,G.ExtensionErrors=b.ExtensionErrors,G.FeatureRestrictionErrors=b.FeatureRestrictionErrors,G.WS=b.WS,G.JWT_API=b.JWT_API,G.PROSODY_API=b.PROSODY_API,G.ProsodyApiErrors=b.ProsodyApiErrors,G.ONLINE_MEMBER_COUNT_API=b.ONLINE_MEMBER_COUNT_API,G.ReceiptErrors=b.ReceiptErrors,G.ANALYTICS=b.ANALYTICS,G.API_ERROR_CODES=b.API_ERROR_CODES,G.ATTACHMENTS_CONSTANTS=b.ATTACHMENTS_CONSTANTS,G.BlockedUsersConstants=b.BlockedUsersConstants,G.CALLING_COMPONENT_VERSION=b.CALLING_COMPONENT_VERSION,G.COMMON_UTILITY_CONSTANTS=b.COMMON_UTILITY_CONSTANTS,G.DEFAULT_VALUES=b.DEFAULT_VALUES,G.DELIVERY_RECEIPTS=b.DELIVERY_RECEIPTS,G.GroupErrors=b.GroupErrors,G.GroupMemersConstans=b.GroupMemersConstans,G.MessageCategory=b.MessageCategory,G.MessageErrors=b.MessageErrors,G.PARAMETER_ERROR=b.PARAMETER_ERROR,G.READ_RECEIPTS=b.READ_RECEIPTS,G.UserErrors=b.UserErrors,G.constants=b.constants,G.GoalType=b.GoalType,G.initialzed=!1,G.CometChatException=K.CometChatException,G.TextMessage=T.TextMessage,G.MediaMessage=S.MediaMessage,G.CustomMessage=L.CustomMessage,G.BaseMessage=p.BaseMessage,G.Action=i.Action,G.Call=s.Call,G.TypingIndicator=M.TypingIndicator,G.TransientMessage=Q.TransientMessage,G.InteractiveMessage=Z.InteractiveMessage,G.InteractionGoal=$.InteractionGoal,G.Interaction=ee.Interaction,G.InteractionReceipt=te.InteractionReceipt,G.Group=a.Group,G.User=l.User,G.GroupMember=D.GroupMember,G.Conversation=V.Conversation,G.ReactionCount=se.ReactionCount,G.ReactionEvent=re.ReactionEvent,G.Reaction=ie.Reaction,G.USER_STATUS={ONLINE:b.PresenceConstatnts.STATUS.ONLINE,OFFLINE:b.PresenceConstatnts.STATUS.OFFLINE},G.MessagesRequest=P.MessagesRequest,G.MessagesRequestBuilder=P.MessagesRequestBuilder,G.ReactionsRequest=oe.ReactionsRequest,G.ReactionsRequestBuilder=oe.ReactionsRequestBuilder,G.UsersRequest=N.UsersRequest,G.UsersRequestBuilder=N.UsersRequestBuilder,G.ConversationsRequest=y.ConversationsRequest,G.ConversationsRequestBuilder=y.ConversationsRequestBuilder,G.BlockedUsersRequest=U.BlockedUsersRequest,G.BlockedUsersRequestBuilder=U.BlockedUsersRequestBuilder,G.GroupsRequest=I.GroupsRequest,G.GroupsRequestBuilder=I.GroupsRequestBuilder,G.GroupMembersRequest=f.GroupMembersRequest,G.GroupMembersRequestBuilder=f.GroupMembersRequestBuilder,G.BannedMembersRequest=O.BannedMembersRequest,G.BannedMembersRequestBuilder=O.BannedMembersRequestBuilder,G.CallSettings=J.CallSettings,G.CallSettingsBuilder=J.CallSettingsBuilder,G.MainVideoContainerSetting=J.MainVideoContainerSetting,G.VirtualBackground=J.VirtualBackground,G.VirtualBackgroundBuilder=J.VirtualBackgroundBuilder,G.AppSettings=Y.AppSettings,G.AppSettingsBuilder=Y.AppSettingsBuilder,G.MessageListener=o.MessageListener,G.UserListener=o.UserListener,G.GroupListener=o.GroupListener,G.OngoingCallListener=o.OngoingCallListener,G.CallListener=o.CallListener,G.ConnectionListener=o.ConnectionListener,G.LoginListener=o.LoginListener,G.CallController=B.CallController,G.CometChatHelper=F.CometChatHelper,G.Attachment=k.Attachment,G.MediaDevice=z.MediaDevice,G.MESSAGE_TYPE=b.MessageConstatnts.TYPE,G.CATEGORY_MESSAGE=b.MessageConstatnts.CATEGORY.MESSAGE,G.CATEGORY_ACTION=b.MessageConstatnts.CATEGORY.ACTION,G.CATEGORY_CALL=b.MessageConstatnts.CATEGORY.CALL,G.CATEGORY_CUSTOM=b.MessageConstatnts.CATEGORY.CUSTOM,G.CATEGORY_INTERACTIVE=b.MessageConstatnts.CATEGORY.INTERACTIVE,G.ACTION_TYPE=b.ActionConstatnts.ACTIONS,G.CALL_TYPE=b.CallConstants.CALL_TYPE,G.SORT_BY=b.UserConstants.SORT_BY,G.SORT_ORDER=b.UserConstants.SORT_ORDER,G.CALL_MODE=b.CallConstants.CALL_MODE,G.RECEIVER_TYPE=b.MessageConstatnts.RECEIVER_TYPE,G.CONNECTION_STATUS=b.CONNECTION_STATUS,G.CALL_STATUS=b.CallConstants.CALL_STATUS,G.GROUP_MEMBER_SCOPE=b.GROUP_MEMBER_SCOPE,G.GROUP_TYPE=b.GROUP_TYPE,G.MESSAGE_REQUEST=b.MessageConstatnts.PAGINATION.CURSOR_FILEDS,G.WSReconnectionInProgress=!1,G.WSReconnectionTimerInterval=5e3,G.currentConnectionStatus=b.CONNECTION_STATUS.DISCONNECTED,G.isConnectingFromInit=!1,G.loginInProgress=!1,G.internalRestart=!1,G.settingsInterval=6e4,G.isAnalyticsPingStarted=!1,G.isLoggedOut=!0,G.isAnalyticsDisabled=!1,G.disconnectedByUser=!1,G.shouldConnectToWS=!0,G}();t.CometChat=Se},function(e,t,n){"use strict";var u=this&&this.__assign||function(){return(u=Object.assign||function(e){for(var t,n=1,o=arguments.length;ne.db.version;if(o&&(e.version,e.version=e.db.version),s||n){if(n){var r=e.db.version+1;r>e.version&&(e.version=r)}return!0}return!1}function N(e){var t=function(e){for(var t=e.length,n=new ArrayBuffer(t),o=new Uint8Array(n),s=0;s>4,u[E++]=(15&o)<<4|s>>2,u[E++]=(3&s)<<6|63&r;return c}function B(e){var t,n=new Uint8Array(e),o="";for(t=0;t>2],o+=v[(3&n[t])<<4|n[t+1]>>4],o+=v[(15&n[t+1])<<2|n[t+2]>>6],o+=v[63&n[t+2]];return n.length%3==2?o=o.substring(0,o.length-1)+"=":n.length%3==1&&(o=o.substring(0,o.length-2)+"=="),o}var F={serialize:function(t,n){var e="";if(t&&(e=K.call(t)),t&&("[object ArrayBuffer]"===e||t.buffer&&"[object ArrayBuffer]"===K.call(t.buffer))){var o,s=D;t instanceof ArrayBuffer?(o=t,s+=Y):(o=t.buffer,"[object Int8Array]"===e?s+="si08":"[object Uint8Array]"===e?s+="ui08":"[object Uint8ClampedArray]"===e?s+="uic8":"[object Int16Array]"===e?s+="si16":"[object Uint16Array]"===e?s+="ur16":"[object Int32Array]"===e?s+="si32":"[object Uint32Array]"===e?s+="ui32":"[object Float32Array]"===e?s+="fl32":"[object Float64Array]"===e?s+="fl64":n(new Error("Failed to get type for BinaryArray"))),n(s+B(o))}else if("[object Blob]"===e){var r=new FileReader;r.onload=function(){var e="~~local_forage_type~"+t.type+"~"+B(this.result);n(D+G+e)},r.readAsArrayBuffer(t)}else try{n(JSON.stringify(t))}catch(e){n(null,e)}},deserialize:function(e){if(e.substring(0,U)!==D)return JSON.parse(e);var t,n=e.substring(w),o=e.substring(U,w);if(o===G&&L.test(n)){var s=n.match(L);t=s[1],n=n.substring(s[0].length)}var r=b(n);switch(o){case Y:return r;case G:return i([r],{type:t});case"si08":return new Int8Array(r);case"ui08":return new Uint8Array(r);case"uic8":return new Uint8ClampedArray(r);case"si16":return new Int16Array(r);case"ur16":return new Uint16Array(r);case"si32":return new Int32Array(r);case"ui32":return new Uint32Array(r);case"fl32":return new Float32Array(r);case"fl64":return new Float64Array(r);default:throw new Error("Unkown type: "+o)}},stringToBuffer:b,bufferToString:B};function V(e,t,n,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,o)}function x(e,o,s,r,i,a){e.executeSql(s,r,i,function(e,n){n.code===n.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[o.storeName],function(e,t){t.rows.length?a(e,n):V(e,o,function(){e.executeSql(s,r,i,a)},a)},a):a(e,n)},a)}function k(i,e,a,E){var c=this;i=u(i);var t=new S(function(s,r){c.ready().then(function(){void 0===e&&(e=null);var n=e,o=c._dbInfo;o.serializer.serialize(e,function(t,e){e?r(e):o.db.transaction(function(e){x(e,o,"INSERT OR REPLACE INTO "+o.storeName+" (key, value) VALUES (?, ?)",[i,t],function(){s(n)},function(e,t){r(t)})},function(e){if(e.code===e.QUOTA_ERR){if(0 '__WebKitDatabaseInfoTable__'",[],function(e,t){for(var n=[],o=0;o"}},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"},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},getPushPreferences:{endpoint:"notifications/push/v1/preferences",method:"GET"},updatePushPreferences:{endpoint:"notifications/push/v1/preferences",method:"PATCH"},resetPushPreferences:{endpoint:"notifications/push/v1/preferences",method:"DELETE"},registerToken:{endpoint:"notifications/push/v1/tokens",method:"POST"},unregisterToken:{endpoint:"notifications/push/v1/tokens",method:"DELETE"},muteConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"PUT"},unmuteConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"DELETE"},getMutedConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"GET"},updateTimezone:{endpoint:"notifications/v1/preferences/timezone",method:"PATCH"},getTimezone:{endpoint:"notifications/v1/preferences/timezone",method:"GET"}}}return E.prototype.getEndpointData=function(a){return new Promise(function(s,t){try{var r=S.CometChat.appSettings.getAdminHost(),i=S.CometChat.appSettings.getClientHost();o.LocalStorage.getInstance().get(u.LOCAL_STORE.KEY_APP_SETTINGS).then(function(e){if(c.isFalsy(e)){var t={};if((new E).uriEndpoints.hasOwnProperty(a))if((t=(new E).uriEndpoints[a]).hasOwnProperty("isAdminApi"))if(c.isFalsy(r)){var n=c.format((new E).adminApiUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new E).adminApiVersion+"/"+t.endpoint;t.endpoint=n,s(t)}else{n="https://"+r+"/"+t.endpoint;t.endpoint=n,s(t)}else if(c.isFalsy(i)){n=c.format((new E).baseUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new E).apiVersion+"/"+t.endpoint;t.endpoint=n,s(t)}else{n="https://"+i+"/"+t.endpoint;t.endpoint=n,s(t)}}else{t={};if((new E).uriEndpoints.hasOwnProperty(a))if((t=(new E).uriEndpoints[a]).hasOwnProperty("isAdminApi")){var o="https://"+e[u.APP_SETTINGS.KEYS.ADMIN_API_HOST]+"/"+e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+t.endpoint;t.endpoint=o,s(t)}else{o="https://"+e[u.APP_SETTINGS.KEYS.CLIENT_API_HOST]+"/"+e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+t.endpoint;t.endpoint=o,s(t)}}},function(e){var t;if((new E).uriEndpoints.hasOwnProperty(a))if((t=(new E).uriEndpoints[a]).hasOwnProperty(["isAdminApi"]))if(c.isFalsy(r)){var n=c.format((new E).adminApiUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new E).adminApiVersion+"/"+t.endpoint;t.endpoint=n,s(t)}else t.endpoint="https://"+r+"/"+t.endpoint,s(t);else if(c.isFalsy(i)){n=c.format((new E).baseUrl,S.CometChat.getAppId(),S.CometChat.appSettings.getRegion())+(new E).apiVersion+"/"+t.endpoint;t.endpoint=n,s(t)}else t.endpoint="https://"+i+"/"+t.endpoint,s(t)})}catch(e){t(new p.CometChatException(e))}})},E}();t.EndpointFactory=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEndPoint=void 0;var o=n(35),i=n(2);t.getEndPoint=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=new o.EndpointFactory;return new Promise(function(o,s){try{t.getEndpointData(e).then(function(e){var t=e;if(t){for(var n in r)t.endpoint=t.endpoint.replace("{{"+n+"}}",r[n]);o(t)}else s({error:"Unknown endPoint name."})})}catch(e){s(new i.CometChatException(e))}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InteractionGoal=void 0;var o=function(){function e(e,t){this.elementIds=[],this.type=e,this.elementIds=t}return e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e.prototype.getElementIds=function(){return this.elementIds},e.prototype.setElementIds=function(e){this.elementIds=e},e}();t.InteractionGoal=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallController=void 0;var g=n(1),A=n(0),R=n(5),s=n(2),o=n(28),r=n(39),I=n(3),f=n(6),i=function(){function h(){this.TAG="calling Log",this.CALL_NO_ANSWER_INTERVAL=45e3,this.view=void 0,this.isDev=!1}return h.prototype.getCallListner=function(){return h.callListner},h.prototype.setCallListner=function(e){h.callListner=new o.UserCallListener(e)},h.getInstance=function(){try{return null!=this.callController&&null!=this.callController||(this.callController=new h),this.callController}catch(e){A.Logger.error("CallController: getInstance",e)}},h.prototype.getActiveCall=function(){try{return A.isFalsy(this.call)?null:this.call}catch(e){A.Logger.error("CallController: getActiveCall",e)}},h.prototype.initiateCall=function(n){var o=this;return new Promise(function(e,t){try{A.isFalsy(o.call)?null!=n&&null!=n?(o.call=n,o.startCallTimer(),e(n)):t(new s.CometChatException(g.CALL_ERROR.ERROR_IN_CALLING)):t(new s.CometChatException(g.CALL_ERROR.CALL_ALREADY_INITIATED))}catch(e){t(new s.CometChatException(e))}})},h.prototype.endCall=function(e){var t=this;try{document.getElementsByName("frame").forEach(function(e){t.view&&(t.view.removeChild(e),t.view=void 0)}),this.endCallSession()}catch(e){A.Logger.error("CallController: endCall",e)}},h.prototype.onCallStarted=function(n){var o=this;return new Promise(function(e,t){try{A.isFalsy(o.call)?null!=n&&null!=n?e(o.call=n):t(new s.CometChatException(g.CALL_ERROR.ERROR_IN_CALLING)):t(new s.CometChatException(g.CALL_ERROR.CALL_ALREADY_INITIATED))}catch(e){t(new s.CometChatException(e))}})},h.prototype.clearActiveCall=function(){this.call=void 0,h.callController=void 0,this.timer&&this.stopCallTimer(),this.view=void 0,this.removeListener(),h.callScreen=null,h.callSettings=null},h.prototype.endCallSession=function(){try{this.call=void 0,h.callController=void 0,this.timer&&this.stopCallTimer(),this.view=void 0,this.removeListener(),h.callScreen=null,h.callSettings=null}catch(e){A.Logger.error("CallController:EndCallSession",{e:e})}},h.prototype.startCallTimer=function(){var t=this;try{this.timer=setTimeout(function(){t.call?R.CometChat.sendUnansweredResponse(t.call.getSessionId()).then(function(e){t.endCallSession()},function(e){t.endCallSession()}):t.endCallSession()},this.CALL_NO_ANSWER_INTERVAL)}catch(e){A.Logger.error("CallController: startCallTimer",e)}},h.prototype.stopCallTimer=function(){try{clearTimeout(this.timer)}catch(e){A.Logger.error("CallController: stopCallTimer",e)}},h.prototype.startCall=function(t,n){var o=this;try{this.timer&&this.stopCallTimer();var s=document.createElement("iframe");this.getCallUrl().then(function(e){s.src=e+"",s.name="frame",s.setAttribute("allow","camera; microphone; display-capture;"),s.setAttribute("width","100%"),s.setAttribute("height","100%"),h.callScreen=s,h.callSettings=t,n&&(o.view=n),n.appendChild(s),o.addListener()})}catch(e){A.Logger.error("CallController: startCall",e)}},h.prototype.addListener=function(){window.addEventListener("message",this.handler,!0)},h.prototype.removeListener=function(){window.removeEventListener("message",this.handler,!0)},h.prototype.handler=function(e){var t,n=this,o=h.callSettings,s=h.callScreen,r=h.getInstance().getActiveCall();try{if(void 0!==(t=JSON.parse(e.data))&&t.type==g.CallConstants.POST_MESSAGES.TYPES.HANGUP)h.deviceList=null,r?(A.Logger.info(this.TAG,h.callListner),window.setTimeout(function(){R.CometChat.endCall(r.getSessionId(),!0).then(function(e){A.Logger.info(n.TAG,{call:e})}).catch(function(e){A.Logger.info(n.TAG,"The Call Was Already Ended")})},1e3)):R.CometChat.endCall(o.getSessionId(),!0).then(function(e){A.Logger.info(n.TAG,{call:e})}).catch(function(e){A.Logger.info(n.TAG,"The Call Was Already Ended")});else if(void 0!==t&&t.type==g.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&t.action==g.CallConstants.POST_MESSAGES.ACTIONS.USER_JOINED){if(t.value){var i=void 0,a=t.value;A.isFalsy(a.uid)||A.isFalsy(a.name)||((i=new I.User(a)).setStatus("online"),R.CometChat.user.getUid().toLowerCase()!=i.getUid().toLowerCase()&&h.callListner&&(A.isFalsy(h.callListner._eventListener.onUserJoined)||h.callListner._eventListener.onUserJoined(i)))}}else if(void 0!==t&&t.type==g.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&t.action==g.CallConstants.POST_MESSAGES.ACTIONS.USER_LEFT){if(t.value){i=void 0,a=t.value;A.isFalsy(a.uid)||A.isFalsy(a.name)||((i=new I.User(a)).setStatus("online"),R.CometChat.user.getUid().toLowerCase()!=i.getUid().toLowerCase()&&h.callListner&&(A.isFalsy(h.callListner._eventListener.onUserLeft)||h.callListner._eventListener.onUserLeft(i)))}}else if(void 0!==t&&t.type==g.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&t.action==g.CallConstants.POST_MESSAGES.ACTIONS.USER_LIST_CHANGED){var E=[];if(t.value&&0a.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 e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=100,e.DEFAULT_LIMIT=30,e}();t.GroupsRequest=E;var c=function(){function e(){}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.joinedOnly=function(e){return this.hasJoined=e,this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.showTags=e,this},e.prototype.build=function(){return new E(this)},e}();t.GroupsRequestBuilder=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GroupMembersRequestBuilder=t.GroupMembersRequest=void 0;var s=n(6),o=n(0),r=n(15),i=n(2),a=n(40),E=n(1),c=function(){function e(e){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(e)||(this.limit=e.limit,this.guid=e.guid,o.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),o.isFalsy(e.scopes)||(this.scopes=e.scopes))}return e.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 e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=2,e.DEFAULT_LIMIT=1,e}();t.GroupMembersRequest=c;var u=function(){function e(e){this.guid=e}return e.prototype.setGuid=function(e){return this.guid=e,this},e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.setScopes=function(e){return this.scopes=e,this},e.prototype.build=function(){return new c(this)},e}();t.GroupMembersRequestBuilder=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BannedMembersRequestBuilder=t.BannedMembersRequest=void 0;var s=n(6),o=n(0),r=n(2),i=n(40),a=n(1),E=function(){function e(e){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(e)||(this.limit=e.limit,this.guid=e.guid,o.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),o.isFalsy(e.scopes)||(this.scopes=e.scopes))}return e.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 e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=2,e.DEFAULT_LIMIT=1,e}();t.BannedMembersRequest=E;var c=function(){function e(e){this.guid=e}return e.prototype.setGuid=function(e){return this.guid=e,this},e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.setScopes=function(e){return this.scopes=e,this},e.prototype.build=function(){return new E(this)},e}();t.BannedMembersRequestBuilder=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UsersRequestBuilder=t.UsersRequest=void 0;var s=n(6),o=n(0),r=n(12),i=n(2),a=n(53),E=n(1),c=function(){function t(e){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:[]},t.userStore=a.UserStore.getInstance(),o.isFalsy(e)||(this.limit=e.limit,o.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),o.isFalsy(e.status)||(e.status==t.USER_STATUS.ONLINE?this.status=E.PresenceConstatnts.STATUS.AVAILABLE:this.status=e.status),o.isFalsy(e.shouldHideBlockedUsers)||(this.hideBlockedUsers=e.shouldHideBlockedUsers),o.isFalsy(e.showFriendsOnly)||(this.friendsOnly=e.showFriendsOnly),o.isFalsy(e.showTags)||(this.withTags=e.showTags),o.isFalsy(e.role)||(this.role=e.role),o.isFalsy(e.roles)||(this.roles=e.roles),o.isFalsy(e.tags)||(this.tags=e.tags),o.isFalsy(e.UIDs)||(this.UIDs=e.UIDs),o.isFalsy(e.SortBy)||(this.sortBy=e.SortBy),o.isFalsy(e.SearchIn)||(this.searchIn=e.SearchIn),o.isFalsy(e.SortOrder)||(this.sortOrder=e.SortOrder))}return t.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 e.page=this.next_page,e;e.page=this.next_page++}return e},t.USER_STATUS={ONLINE:E.PresenceConstatnts.STATUS.ONLINE,OFFLINE:E.PresenceConstatnts.STATUS.OFFLINE},t}();t.UsersRequest=c;var u=function(){function e(){this.shouldHideBlockedUsers=!1}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setStatus=function(e){return this.status=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.hideBlockedUsers=function(e){return this.shouldHideBlockedUsers=e,this},e.prototype.setRole=function(e){return this.role=e,this},e.prototype.setRoles=function(e){return this.roles=e,this},e.prototype.friendsOnly=function(e){return this.showFriendsOnly=e,this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.showTags=e,this},e.prototype.setUIDs=function(e){return this.UIDs=e,this},e.prototype.sortBy=function(e){return this.SortBy=e,this},e.prototype.sortByOrder=function(e){return this.SortOrder=e,this},e.prototype.searchIn=function(e){return this.SearchIn=e,this},e.prototype.build=function(){return this.role&&this.roles&&this.roles.push(this.role),new c(this)},e}();t.UsersRequestBuilder=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserStore=void 0;var o=n(5),s=n(0),r=n(1),i=n(14),a=function(){function e(e){this.store=r.constants.DEFAULT_STORE,s.isFalsy(e)||(this.store=e),this.userStore=i.createInstance({name:s.format(r.LOCAL_STORE.STORE_STRING,o.CometChat.getAppId(),r.LOCAL_STORE.USERS_STORE)}),this.userStore.setDriver([i.LOCALSTORAGE,i.INDEXEDDB,i.WEBSQL])}return e.getInstance=function(){return null==e.UserStore&&(e.UserStore=new e),e.UserStore},e.prototype.set=function(e,t){return this.userStore.setItem(e,t)},e.prototype.remove=function(e){this.userStore.removeItem(e)},e.prototype.get=function(e){return this.userStore.getItem(e)},e.prototype.clearStore=function(){var n=this;return new Promise(function(e,t){n.userStore.clear().then(function(){e(!0)}).catch(function(e){t(e)})})},e.prototype.clear=function(e){},e.prototype.selectStore=function(e){this.store=e},e.prototype.storeUsers=function(e){var t=this;return e.map(function(e){t.set(e.getUid(),e)}),!0},e.prototype.storeUser=function(e){return this.set(e.getUid(),e),!0},e}();t.UserStore=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationsRequestBuilder=t.ConversationsRequest=void 0;var s=n(6),o=n(0),r=n(2),i=n(29),a=n(1),E=function(){function e(e){this.limit=30,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(e)||(this.limit=e.limit,o.isFalsy(e.conversationType)||(this.conversationType=e.conversationType),o.isFalsy(e.getUserAndGroupTags)||(this.getUserAndGroupTags=e.getUserAndGroupTags),e.tags&&(this.tags=e.tags),o.isFalsy(e.WithTags)||(this.withTags=e.WithTags),e.groupTags&&(this.groupTags=e.groupTags),e.userTags&&(this.userTags=e.userTags),e.IncludeBlockedUsers&&(this.includeBlockedUsers=e.IncludeBlockedUsers),e.WithBlockedInfo&&(this.withBlockedInfo=e.WithBlockedInfo))}return e.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 e.page=this.next_page,e;e.page=this.next_page++}return e},e.prototype.isIncludeBlockedUsers=function(){return this.includeBlockedUsers},e.prototype.isWithBlockedInfo=function(){return this.withBlockedInfo},e.prototype.getLimit=function(){return this.limit},e.prototype.getConversationType=function(){return this.conversationType},e.prototype.isWithUserAndGroupTags=function(){return this.getUserAndGroupTags},e.prototype.getTags=function(){return this.tags},e.prototype.isWithTags=function(){return this.withTags},e.prototype.getGroupTags=function(){return this.groupTags},e.prototype.getUserTags=function(){return this.userTags},e}();t.ConversationsRequest=E;var c=function(){function e(){this.WithTags=!1,this.IncludeBlockedUsers=!1,this.WithBlockedInfo=!1}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setConversationType=function(e){return this.conversationType=e,this},e.prototype.withUserAndGroupTags=function(e){return"boolean"==typeof e&&(this.getUserAndGroupTags=e),this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.WithTags=e,this},e.prototype.setGroupTags=function(e){return this.groupTags=e,this},e.prototype.setUserTags=function(e){return this.userTags=e,this},e.prototype.setIncludeBlockedUsers=function(e){return this.IncludeBlockedUsers=e,this},e.prototype.includeBlockedUsers=function(e){return this.IncludeBlockedUsers=e,this},e.prototype.setWithBlockedInfo=function(e){return this.WithBlockedInfo=e,this},e.prototype.withBlockedInfo=function(e){return this.WithBlockedInfo=e,this},e.prototype.build=function(){return new E(this)},e}();t.ConversationsRequestBuilder=c},function(e,t,n){"use strict";var I=this&&this.__awaiter||function(e,i,a,E){return new(a||(a=Promise))(function(n,t){function o(e){try{r(E.next(e))}catch(e){t(e)}}function s(e){try{r(E.throw(e))}catch(e){t(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(o,s)}r((E=E.apply(e,i||[])).next())})},f=this&&this.__generator||function(n,o){var s,r,i,e,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(s)throw new TypeError("Generator is already executing.");for(;a;)try{if(s=1,r&&(i=2&t[0]?r.return:t[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,t[1])).done)return i;switch(r=0,i&&(t=[2&t[0],i.value]),t[0]){case 0:case 1:i=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,r=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]m.DEFAULT_VALUES.MSGS_MAX_LIMIT)return void t(new O.CometChatException(JSON.parse(P.format(JSON.stringify(m.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",m.DEFAULT_VALUES.MSGS_MAX_LIMIT))));if(ee&&M.MessageListnerMaping.getInstance().set(m.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(t.id))},function(e){M.MessageListnerMaping.getInstance().set(m.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(t.id))}),this.affix==m.MessageConstatnts.PAGINATION.AFFIX.APPEND?(this.idparseInt(t.id)&&(this.id=parseInt(t.id)),this.timestamp>t.sentAt&&(this.timestamp=t.sentAt),this.updatedAt>t.updatedAt&&(this.updatedAt=t.updatedAt)),this.id&&(this.paginationMeta[m.MessageConstatnts.PAGINATION.KEYS.ID]=this.id),this.timestamp&&(this.paginationMeta[m.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=this.timestamp),this.updatedAt&&(this.paginationMeta[m.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=this.updatedAt),n.push(y.MessageController.trasformJSONMessge(t)),[2]})})})):n=[],s(n),[2]})})},function(e){t(new O.CometChatException(e.error))})}catch(e){t(new O.CometChatException(e))}})},e.prototype.createEndpoint=function(){this.parentMessageId?(this.endpointName="getThreadMessages",this.listId=this.parentMessageId.toString(),this.hideReplies&&(this.hideReplies=!1,delete this.paginationMeta[m.MessageConstatnts.PAGINATION.KEYS.HIDE_REPLIES])):(P.isFalsy(this.guid)||P.isFalsy(this.uid))&&P.isFalsy(this.guid)?(P.isFalsy(this.uid)?this.endpointName="getMessages":this.endpointName="getUserMessages",this.listId=this.uid):(this.endpointName="getGroupMessages",this.listId=this.guid)},e.prototype.makeData=function(){var e={};e[m.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,e[m.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,(P.isFalsy(this.guid)||P.isFalsy(this.uid))&&P.isFalsy(this.guid)&&P.isFalsy(this.uid)},e.prototype.getFilteredPreviousDataByReceiverId=function(t){return I(this,void 0,void 0,function(){var n,o=this;return f(this,function(e){switch(e.label){case 0:switch(n=[],t){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(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 2:return e.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 4:e.sent(),e.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).filter(function(e){return t[e].sender.uid==o.uid}).map(function(e){n=s(n,[t[e]])})})];case 6:return e.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 8:return e.sent(),[3,9];case 9:return[2,n]}})})},e.prototype.getFilteredNextDataByReceiverId=function(t){return I(this,void 0,void 0,function(){var n,o=this;return f(this,function(e){switch(e.label){case 0:switch(n=[],t){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(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 2:return e.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 4:e.sent(),e.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).filter(function(e){return t[e].sender.uid==o.uid}).map(function(e){n=s(n,[t[e]])})})];case 6:return e.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 8:return e.sent(),[3,9];case 9:return[2,n]}})})},e}();t.MessagesRequest=o;var a=function(){function e(){this.maxLimit=m.DEFAULT_VALUES.MSGS_MAX_LIMIT,this.timestamp=0,this.id=m.DEFAULT_VALUES.DEFAULT_MSG_ID,this.unread=!1,this.HideMessagesFromBlockedUsers=!1,this.onlyUpdate=0,this.HideDeletedMessages=!1,this.WithTags=!1,this.interactionGoalCompletedOnly=!1,this.mentionsWithUserTags=!1,this.mentionsWithBlockedRelation=!1}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setGUID=function(e){return this.guid=e,this},e.prototype.setUID=function(e){return this.uid=e,this},e.prototype.setParentMessageId=function(e){return this.parentMessageId=e,this},e.prototype.setTimestamp=function(e){return void 0===e&&(e=P.getCurrentTime()),this.timestamp=e,this},e.prototype.setMessageId=function(e){return void 0===e&&(e=m.DEFAULT_VALUES.DEFAULT_MSG_ID),this.id=e,this},e.prototype.setUnread=function(e){return void 0===e&&(e=!1),this.unread=e,this},e.prototype.hideMessagesFromBlockedUsers=function(e){return void 0===e&&(e=!1),this.HideMessagesFromBlockedUsers=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKey=e,this},e.prototype.setUpdatedAfter=function(e){return this.updatedAt=e,this},e.prototype.updatesOnly=function(e){return e&&(this.onlyUpdate=1),this},e.prototype.setCategory=function(e){return this.category=e,this},e.prototype.setCategories=function(e){return this.categories=e,this},e.prototype.setType=function(e){return this.type=e,this},e.prototype.setTypes=function(e){return this.types=e,this},e.prototype.hideReplies=function(e){return this.HideReplies=e,this},e.prototype.hideDeletedMessages=function(e){return this.HideDeletedMessages=e,this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.WithTags=e,this},e.prototype.mentionsWithTagInfo=function(e){return void 0===e&&(e=!1),this.mentionsWithUserTags=e,this},e.prototype.mentionsWithBlockedInfo=function(e){return void 0===e&&(e=!1),this.mentionsWithBlockedRelation=e,this},e.prototype.setInteractionGoalCompletedOnly=function(e){return void 0===e&&(e=!1),this.interactionGoalCompletedOnly=e,this},e.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)},e}();t.MessagesRequestBuilder=a},function(e,t,n){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;ne.getId()&&(i=parseInt(e.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 e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=2,e.DEFAULT_LIMIT=1,e.directions=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS,e}();t.BlockedUsersRequest=E;var c=function(){function e(){}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.setDirection=function(e){return this.direction=e,this},e.prototype.blockedByMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BLOCKED_BY_ME,this},e.prototype.hasBlockedMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.HAS_BLOCKED_ME,this},e.prototype.build=function(){return new E(this)},e}();t.BlockedUsersRequestBuilder=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AppSettingsBuilder=t.AppSettings=void 0;var o=n(1),s=function(){function t(e){this.subscriptionType=t.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=e.subscriptionType,this.roles=e.roles,this.region=e.region,this.autoJoinGroup=e.autoJoinGroup,this.establishSocketConnection=e.establishSocketConnection,this.adminHost=e.adminHost,this.clientHost=e.clientHost}return t.prototype.getSubscriptionType=function(){return this.subscriptionType},t.prototype.getRoles=function(){return this.roles},t.prototype.getRegion=function(){return this.region},t.prototype.getIsAutoJoinEnabled=function(){return this.autoJoinGroup},t.prototype.shouldAutoEstablishSocketConnection=function(){return this.establishSocketConnection},t.prototype.getAdminHost=function(){return this.adminHost},t.prototype.getClientHost=function(){return this.clientHost},t.SUBSCRIPTION_TYPE_NONE="NONE",t.SUBSCRIPTION_TYPE_ALL_USERS="ALL_USERS",t.SUBSCRIPTION_TYPE_ROLES="ROLES",t.SUBSCRIPTION_TYPE_FRIENDS="FRIENDS",t.REGION_EU=o.DEFAULT_VALUES.REGION_DEFAULT_EU,t.REGION_US=o.DEFAULT_VALUES.REGION_DEFAULT_US,t.REGION_IN=o.DEFAULT_VALUES.REGION_DEFAULT_IN,t.REGION_PRIVATE=o.DEFAULT_VALUES.REGION_DEFAULT_PRIVATE,t}();t.AppSettings=s;var r=function(){function e(){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 e.prototype.subscribePresenceForAllUsers=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ALL_USERS,this},e.prototype.subscribePresenceForRoles=function(e){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ROLES,this.roles=e,this},e.prototype.subscribePresenceForFriends=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_FRIENDS,this},e.prototype.setRegion=function(e){return void 0===e&&(e=o.DEFAULT_VALUES.REGION_DEFAULT),this.region=e.toLowerCase(),this},e.prototype.enableAutoJoinForGroups=function(e){return void 0===e&&(e=!0),this.autoJoinGroup=e,this},e.prototype.autoEstablishSocketConnection=function(e){return void 0===e&&(e=!0),this.establishSocketConnection=e,this},e.prototype.overrideAdminHost=function(e){return this.adminHost=e,this},e.prototype.overrideClientHost=function(e){return this.clientHost=e,this},e.prototype.build=function(){return new s(this)},e}();t.AppSettingsBuilder=r},function(e,t,n){"use strict";var S=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;ti[0]&&t[1]i[0]&&t[1]i[0]&&t[1]C.DEFAULT_VALUES.REACTIONS_MAX_LIMIT)return void t(new S.CometChatException(JSON.parse(p.format(JSON.stringify(C.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",C.DEFAULT_VALUES.REACTIONS_MAX_LIMIT))));if(e>>((3&t)<<3)&255;return s}}},function(e,t){for(var s=[],n=0;n<256;++n)s[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,o=s;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CometChatNotifications=void 0;var u=n(1),S=n(0),p=n(2),C=n(6),l=n(13),o=n(47),_=n(81),s=n(82),d=n(83),T=n(84),h=n(85),g=n(86),r=n(87),i=function(){function E(){}return E.fetchPushPreferences=function(){return new Promise(function(i,t){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_GET_PREFERENCES,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?d.MutePreferences.fromJSON(e.data):new d.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=g.PushPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new g.PushPreferences)},function(e){return t(new p.CometChatException(e.error))})},function(e){return t(new p.CometChatException(e))})}catch(e){return t(new p.CometChatException(e))}})},E.fetchPreferences=function(){return new Promise(function(i,t){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_GET_PREFERENCES,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?d.MutePreferences.fromJSON(e.data):new d.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=T.NotificationPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new T.NotificationPreferences)},function(e){return t(new p.CometChatException(e.error))})},function(e){return t(new p.CometChatException(e))})}catch(e){return t(new p.CometChatException(e))}})},E.updatePushPreferences=function(c){return new Promise(function(a,E){try{S.getAppSettings().then(function(e){var t,n=((t={})[l.APIConstants.KEY_GROUP_PREFERENCES]={},t[l.APIConstants.KEY_MUTE_PREFERENCES]={},t[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]={},t),o=c.getGroupPreferences(),s=c.getMutePreferences(),r=c.getOneOnOnePreferences(),i=c.getUsePrivacyTemplate();o&&(o.getMessagesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MESSAGES]=o.getMessagesPreference()),o.getReactionsPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REACTIONS]=o.getReactionsPreference()),o.getRepliesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REPLIES]=o.getRepliesPreference()),o.getMemberAddedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_ADDED]=o.getMemberAddedPreference()),o.getMemberBannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_BANNED]=o.getMemberBannedPreference()),o.getMemberJoinedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_JOINED]=o.getMemberJoinedPreference()),o.getMemberKickedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_KICKED]=o.getMemberKickedPreference()),o.getMemberLeftPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_LEFT]=o.getMemberLeftPreference()),o.getMemberScopeChangedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_SCOPE_CHANGED]=o.getMemberScopeChangedPreference()),o.getMemberUnbannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_UNBANNED]=o.getMemberUnbannedPreference())),s&&(s.getDNDPreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_DND]=s.getDNDPreference()),s.getSchedulePreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_SCHEDULE]=s.getSchedulePreference())),r&&(r.getMessagesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_MESSAGES]=r.getMessagesPreference()),r.getReactionsPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REACTIONS]=r.getReactionsPreference()),r.getRepliesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REPLIES]=r.getRepliesPreference())),null!=i&&(n[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE]=i),0===Object.keys(n[l.APIConstants.KEY_GROUP_PREFERENCES]).length&&delete n[l.APIConstants.KEY_GROUP_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_MUTE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_MUTE_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES],C.makeApiCall(l.APIConstants.KEY_UPDATE_PREFERENCES,null,n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?d.MutePreferences.fromJSON(e.data):new d.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=g.PushPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return a(r)}return a(new g.PushPreferences)},function(e){return E(new p.CometChatException(e.error))})},function(e){return E(new p.CometChatException(e))})}catch(e){return E(new p.CometChatException(e))}})},E.updatePreferences=function(c){return new Promise(function(a,E){try{S.getAppSettings().then(function(e){var t,n=((t={})[l.APIConstants.KEY_GROUP_PREFERENCES]={},t[l.APIConstants.KEY_MUTE_PREFERENCES]={},t[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]={},t),o=c.getGroupPreferences(),s=c.getMutePreferences(),r=c.getOneOnOnePreferences(),i=c.getUsePrivacyTemplate();o&&(o.getMessagesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MESSAGES]=o.getMessagesPreference()),o.getReactionsPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REACTIONS]=o.getReactionsPreference()),o.getRepliesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REPLIES]=o.getRepliesPreference()),o.getMemberAddedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_ADDED]=o.getMemberAddedPreference()),o.getMemberBannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_BANNED]=o.getMemberBannedPreference()),o.getMemberJoinedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_JOINED]=o.getMemberJoinedPreference()),o.getMemberKickedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_KICKED]=o.getMemberKickedPreference()),o.getMemberLeftPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_LEFT]=o.getMemberLeftPreference()),o.getMemberScopeChangedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_SCOPE_CHANGED]=o.getMemberScopeChangedPreference()),o.getMemberUnbannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_UNBANNED]=o.getMemberUnbannedPreference())),s&&(s.getDNDPreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_DND]=s.getDNDPreference()),s.getSchedulePreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_SCHEDULE]=s.getSchedulePreference())),r&&(r.getMessagesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_MESSAGES]=r.getMessagesPreference()),r.getReactionsPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REACTIONS]=r.getReactionsPreference()),r.getRepliesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REPLIES]=r.getRepliesPreference())),null!=i&&(n[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE]=i),0===Object.keys(n[l.APIConstants.KEY_GROUP_PREFERENCES]).length&&delete n[l.APIConstants.KEY_GROUP_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_MUTE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_MUTE_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES],C.makeApiCall(l.APIConstants.KEY_UPDATE_PREFERENCES,null,n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?d.MutePreferences.fromJSON(e.data):new d.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=T.NotificationPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return a(r)}return a(new T.NotificationPreferences)},function(e){return E(new p.CometChatException(e.error))})},function(e){return E(new p.CometChatException(e))})}catch(e){return E(new p.CometChatException(e))}})},E.resetPushPreferences=function(){return new Promise(function(i,t){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_RESET_PREFERENCES,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?d.MutePreferences.fromJSON(e.data):new d.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=g.PushPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new g.PushPreferences)},function(e){return t(new p.CometChatException(e.error))})},function(e){return t(new p.CometChatException(e))})}catch(e){return t(new p.CometChatException(e))}})},E.resetPreferences=function(){return new Promise(function(i,t){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_RESET_PREFERENCES,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?d.MutePreferences.fromJSON(e.data):new d.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=T.NotificationPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new T.NotificationPreferences)},function(e){return t(new p.CometChatException(e.error))})},function(e){return t(new p.CometChatException(e))})}catch(e){return t(new p.CometChatException(e))}})},E.getTokensForRequest=function(e,t,n,o){var s={};return s[l.APIConstants.KEY_PROVIDER_ID]=null!=o?o:l.DEFAULT_PROVIDER_ID,s[l.APIConstants.KEY_TIMEZONE]=e,n===l.PushPlatforms.FCM_WEB&&(s[l.APIConstants.KEY_FCM_TOKEN]=t),s[l.APIConstants.KEY_PLATFORM]=n,s},E.registerPushToken=function(r,i,a){return new Promise(function(o,s){try{S.getAppSettings().then(function(e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=E.getTokensForRequest(t,r,i,a);C.makeApiCall(l.APIConstants.KEY_REGISTER_TOKEN,null,n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?o(l.APIResponseConstants.TOKEN_REGISTER_SUCCESS):o(l.APIResponseConstants.TOKEN_REGISTER_ERROR)},function(e){return s(new p.CometChatException(e.error))})},function(e){return s(new p.CometChatException(e))})}catch(e){return s(new p.CometChatException(e))}})},E.unregisterPushToken=function(){return new Promise(function(t,n){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_UNREGISTER_TOKEN,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?t(l.APIResponseConstants.TOKEN_UNREGISTER_SUCCESS):t(l.APIResponseConstants.TOKEN_UNREGISTER_ERROR)},function(e){return n(new p.CometChatException(e.error))})},function(e){return n(new p.CometChatException(e))})}catch(e){return n(new p.CometChatException(e))}})},E.muteConversations=function(r){return new Promise(function(o,s){try{S.getAppSettings().then(function(e){var t,n=((t={})[l.APIConstants.KEY_CONVERSATIONS]=r,t);C.makeApiCall(l.APIConstants.KEY_MUTE_CONVERSATIONS,null,n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?o(l.APIResponseConstants.MUTE_CONVERSATION_SUCCESS):o(l.APIResponseConstants.MUTE_CONVERSATION_ERROR)},function(e){return s(new p.CometChatException(e.error))})},function(e){return s(new p.CometChatException(e))})}catch(e){return s(new p.CometChatException(e))}})},E.unmuteConversations=function(r){return new Promise(function(o,s){try{S.getAppSettings().then(function(e){var t,n=((t={})[l.APIConstants.KEY_CONVERSATIONS]=r,t);C.makeApiCall(l.APIConstants.KEY_UNMUTE_CONVERSATIONS,null,n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?o(l.APIResponseConstants.UNMUTE_CONVERSATION_SUCCESS):o(l.APIResponseConstants.UNMUTE_CONVERSATION_ERROR)},function(e){return s(new p.CometChatException(e.error))})},function(e){return s(new p.CometChatException(e))})}catch(e){return s(new p.CometChatException(e))}})},E.getMutedConversations=function(){return new Promise(function(t,n){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_GET_MUTED_CONVERSATIONS,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){var n=[];return e.hasOwnProperty("data")&&e.data.hasOwnProperty(l.APIConstants.KEY_MUTED_CONVERSATIONS)&&e.data[l.APIConstants.KEY_MUTED_CONVERSATIONS].forEach(function(e){var t=new s.MutedConversation;t.setId(e.id),t.setType(e.type),t.setUntil(e.until),n.push(t)}),t(n)},function(e){return n(new p.CometChatException(e.error))})},function(e){return n(new p.CometChatException(e))})}catch(e){return n(new p.CometChatException(e))}})},E.updateTimezone=function(o){return new Promise(function(t,n){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_UPDATE_TIMEZONE,null,{timezone:o},!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?t(l.APIResponseConstants.TIMEZONE_UPDATE_SUCCESS):t(l.APIResponseConstants.TIMEZONE_UPDATE_ERROR)},function(e){return n(new p.CometChatException(e.error))})},function(e){return n(new p.CometChatException(e))})}catch(e){return n(new p.CometChatException(e))}})},E.getTimezone=function(){return new Promise(function(t,n){try{S.getAppSettings().then(function(e){C.makeApiCall(l.APIConstants.KEY_GET_TIMEZONE,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?t(e.data):t(l.APIResponseConstants.TIMEZONE_FETCH_ERROR)},function(e){return n(new p.CometChatException(e.error))})},function(e){return n(new p.CometChatException(e))})}catch(e){return n(new p.CometChatException(e))}})},E.MessagesOptions=l.MessagesOptions,E.RepliesOptions=l.RepliesOptions,E.ReactionsOptions=l.ReactionsOptions,E.MemberActionsOptions=l.MemberActionsOptions,E.DayOfWeek=l.DayOfWeek,E.DNDOptions=l.DNDOptions,E.MutedConversationType=l.MutedConversationType,E.PushPlatforms=l.PushPlatforms,E.DaySchedule=o.DaySchedule,E.PushPreferences=g.PushPreferences,E.GroupPreferences=_.GroupPreferences,E.OneOnOnePreferences=h.OneOnOnePreferences,E.MutePreferences=d.MutePreferences,E.MutedConversation=s.MutedConversation,E.UnmutedConversation=r.UnmutedConversation,E.NotificationPreferences=T.NotificationPreferences,E}();t.CometChatNotifications=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GroupPreferences=void 0;var o=n(13),s=function(){function n(){}return n.prototype.getMessagesPreference=function(){return this.groupMessages},n.prototype.getRepliesPreference=function(){return this.groupReplies},n.prototype.getReactionsPreference=function(){return this.groupReactions},n.prototype.getMemberLeftPreference=function(){return this.groupMemberLeft},n.prototype.getMemberAddedPreference=function(){return this.groupMemberAdded},n.prototype.getMemberJoinedPreference=function(){return this.groupMemberJoined},n.prototype.getMemberKickedPreference=function(){return this.groupMemberKicked},n.prototype.getMemberBannedPreference=function(){return this.groupMemberBanned},n.prototype.getMemberUnbannedPreference=function(){return this.groupMemberUnbanned},n.prototype.getMemberScopeChangedPreference=function(){return this.groupMemberScopeChanged},n.prototype.setMessagesPreference=function(e){this.groupMessages=e},n.prototype.setRepliesPreference=function(e){this.groupReplies=e},n.prototype.setReactionsPreference=function(e){this.groupReactions=e},n.prototype.setMemberLeftPreference=function(e){this.groupMemberLeft=e},n.prototype.setMemberAddedPreference=function(e){this.groupMemberAdded=e},n.prototype.setMemberJoinedPreference=function(e){this.groupMemberJoined=e},n.prototype.setMemberKickedPreference=function(e){this.groupMemberKicked=e},n.prototype.setMemberBannedPreference=function(e){this.groupMemberBanned=e},n.prototype.setMemberUnbannedPreference=function(e){this.groupMemberUnbanned=e},n.prototype.setMemberScopeChangedPreference=function(e){this.groupMemberScopeChanged=e},n.fromJSON=function(e){var t=new n;return t.setMessagesPreference(o.MessagesOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MESSAGES]]),t.setRepliesPreference(o.RepliesOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_REPLIES]]),t.setReactionsPreference(o.ReactionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_REACTIONS]]),t.setMemberAddedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_ADDED]]),t.setMemberJoinedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_JOINED]]),t.setMemberBannedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_BANNED]]),t.setMemberKickedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_KICKED]]),t.setMemberLeftPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_LEFT]]),t.setMemberScopeChangedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_SCOPE_CHANGED]]),t.setMemberUnbannedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_UNBANNED]]),t},n}();t.GroupPreferences=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MutedConversation=void 0;var o=function(){function e(){}return e.prototype.getId=function(){return this.id},e.prototype.setId=function(e){this.id=e},e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e.prototype.getUntil=function(){return this.until},e.prototype.setUntil=function(e){this.until=e},e}();t.MutedConversation=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MutePreferences=void 0;var S=n(13),p=n(47),o=function(){function u(){}return u.prototype.getDNDPreference=function(){return this.dnd},u.prototype.setDNDPreference=function(e){this.dnd=e},u.prototype.getSchedulePreference=function(){return this.schedule},u.prototype.setSchedulePreference=function(e){this.schedule=e},u.prototype.getScheduleFor=function(e){return this.schedule.get(e)},u.prototype.setScheduleFor=function(e,t){this.schedule.set(e,t)},u.fromJSON=function(e){var t=new u;t.setDNDPreference(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_DND]);var n=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.MONDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.MONDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.MONDAY][S.APIConstants.KEY_MUTE_DND]),o=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.TUESDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.TUESDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.TUESDAY][S.APIConstants.KEY_MUTE_DND]),s=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.WEDNESDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.WEDNESDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.WEDNESDAY][S.APIConstants.KEY_MUTE_DND]),r=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.THURSDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.THURSDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.THURSDAY][S.APIConstants.KEY_MUTE_DND]),i=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.FRIDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.FRIDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.FRIDAY][S.APIConstants.KEY_MUTE_DND]),a=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SATURDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SATURDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SATURDAY][S.APIConstants.KEY_MUTE_DND]),E=new p.DaySchedule(e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SUNDAY][S.APIConstants.KEY_FROM],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SUNDAY][S.APIConstants.KEY_TO],e[S.APIConstants.KEY_MUTE_PREFERENCES][S.APIConstants.KEY_MUTE_SCHEDULE][S.DayOfWeek.SUNDAY][S.APIConstants.KEY_MUTE_DND]),c=new Map([[S.DayOfWeek.MONDAY,n],[S.DayOfWeek.TUESDAY,o],[S.DayOfWeek.WEDNESDAY,s],[S.DayOfWeek.THURSDAY,r],[S.DayOfWeek.FRIDAY,i],[S.DayOfWeek.SATURDAY,a],[S.DayOfWeek.SUNDAY,E]]);return t.setSchedulePreference(c),t},u}();t.MutePreferences=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationPreferences=void 0;var o=n(13),s=function(){function n(){}return n.prototype.getOneOnOnePreferences=function(){return this.oneOnOnePreferences},n.prototype.setOneOnOnePreferences=function(e){this.oneOnOnePreferences=e},n.prototype.getMutePreferences=function(){return this.mutePreferences},n.prototype.setMutePreferences=function(e){this.mutePreferences=e},n.prototype.getGroupPreferences=function(){return this.groupPreferences},n.prototype.setGroupPreferences=function(e){this.groupPreferences=e},n.prototype.getUsePrivacyTemplate=function(){return this.usePrivacyTemplate},n.prototype.setUsePrivacyTemplate=function(e){this.usePrivacyTemplate=e},n.fromJSON=function(e){var t=new n;return e.hasOwnProperty(o.APIConstants.KEY_MUTE_PREFERENCES)&&t.setMutePreferences(e[o.APIConstants.KEY_MUTE_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_GROUP_PREFERENCES)&&t.setGroupPreferences(e[o.APIConstants.KEY_GROUP_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)&&t.setOneOnOnePreferences(e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&t.setUsePrivacyTemplate(e[o.APIConstants.KEY_USE_PRIVACY_TEMPLATE]),t},n}();t.NotificationPreferences=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OneOnOnePreferences=void 0;var o=n(13),s=function(){function n(){}return n.prototype.getReactionsPreference=function(){return this.oneOnOneMessageReactions},n.prototype.setReactionsPreference=function(e){this.oneOnOneMessageReactions=e},n.prototype.getRepliesPreference=function(){return this.oneOnOneReplies},n.prototype.setRepliesPreference=function(e){this.oneOnOneReplies=e},n.prototype.getMessagesPreference=function(){return this.oneOnOneMessages},n.prototype.setMessagesPreference=function(e){this.oneOnOneMessages=e},n.fromJSON=function(e){var t=new n;return t.setMessagesPreference(o.MessagesOptions[e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_MESSAGES]]),t.setRepliesPreference(o.RepliesOptions[e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_REPLIES]]),t.setReactionsPreference(o.ReactionsOptions[e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_REACTIONS]]),t},n}();t.OneOnOnePreferences=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PushPreferences=void 0;var o=n(13),s=function(){function n(){}return n.prototype.getOneOnOnePreferences=function(){return this.oneOnOnePreferences},n.prototype.setOneOnOnePreferences=function(e){this.oneOnOnePreferences=e},n.prototype.getMutePreferences=function(){return this.mutePreferences},n.prototype.setMutePreferences=function(e){this.mutePreferences=e},n.prototype.getGroupPreferences=function(){return this.groupPreferences},n.prototype.setGroupPreferences=function(e){this.groupPreferences=e},n.prototype.getUsePrivacyTemplate=function(){return this.usePrivacyTemplate},n.prototype.setUsePrivacyTemplate=function(e){this.usePrivacyTemplate=e},n.fromJSON=function(e){var t=new n;return e.hasOwnProperty(o.APIConstants.KEY_MUTE_PREFERENCES)&&t.setMutePreferences(e[o.APIConstants.KEY_MUTE_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_GROUP_PREFERENCES)&&t.setGroupPreferences(e[o.APIConstants.KEY_GROUP_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)&&t.setOneOnOnePreferences(e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&t.setUsePrivacyTemplate(e[o.APIConstants.KEY_USE_PRIVACY_TEMPLATE]),t},n}();t.PushPreferences=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnmutedConversation=void 0;var o=function(){function e(){}return e.prototype.getId=function(){return this.id},e.prototype.setId=function(e){this.id=e},e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e}();t.UnmutedConversation=o}])}); \ No newline at end of file diff --git a/README.md b/README.md index aa70ea5..360449a 100644 --- a/README.md +++ b/README.md @@ -2,134 +2,21 @@ CometChat

-# CometChat Javascript SDK +# CometChat SDK for Javascript +The CometChat SDK is a robust toolkit that developers can utilize to swiftly incorporate a reliable and fully-featured chat functionality into an existing or new application. It removes the complexity of building a chat infrastructure from scratch, thus accelerating the development process and reducing time to market. -CometChat enables you to add voice, video & text chat for your website & app. -This guide demonstrates how to add chat to a WebSite using CometChat. +## Prerequisites +- [`Visual Studio Code`](https://code.visualstudio.com/) or any other code editor +- [`npm`](https://www.npmjs.com/get-npm) -## Prerequisites :star: -Before you begin, ensure you have met the following requirements:
- ✅   You have [`Visual Studio Code`](https://code.visualstudio.com/) or any other code editor installed in your machine.
- ✅   You have [`npm`](https://www.npmjs.com/get-npm) installed in your machine.
- ✅   You have read [CometChat Key Concepts](https://prodocs.cometchat.com/docs/concepts).
- -
- -## Installing CometChat Javascript SDK -## Setup :wrench: - -To setup Javascript SDK, you need to first register on CometChat Dashboard. [Click here to sign up](https://app.cometchat.com/login). - -### i. Get your Application Keys :key: - -Signup for CometChat and then: - -1. Create a new app: Click **Add App** option available → Enter App Name & other information → Create App -2. At the Top in **QuickStart** section you will find **Auth Key** & **App ID** or else you can head over to the **API & Auth Keys** section and note the **Auth Key** and **App ID** - - -
- -### ii. Add the CometChat Dependency -
    -
  • -Install via NPM
    -1. Run the following command to install the CometChat Javascript SDK
    - -```javascript - npm install @cometchat/chat-sdk-javascript@latest --save -``` -
  • - -
  • -Import via CDN
    -1. Include the CometChat Javascript library in your HTML code.
    - -```html - -``` - - You can refer to the below link for instructions on how to do so:
    -[📝 Add CometChat Dependency](https://prodocs.cometchat.com/docs/js-quick-start#add-the-cometchat-dependency) -
  • -
-
- -## Configure CometChat Javascript SDK - -### i. Initialize CometChat 🌟 -We suggest you call the init() method on app startup, preferably in the index.js file. - -```javascript -var appID = "APP_ID"; -var region = "REGION"; -var appSetting = new CometChat.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region).build(); -CometChat.init(appID, appSetting).then( - () => { - console.log("Initialization completed successfully"); - }, - error => { - console.log("Initialization failed with error:", error); - } -); -``` - -| :information_source:   Note: Make sure to replace `region` and `appID` with your credentials. | -|------------------------------------------------------------------------------------------------------------| - -### ii. Create User 👤 -Once initialisation is successful, you will need to create a user. You need to use createUser() method to create user on the fly. -```javascript -let authKey = "AUTH_KEY"; -var uid = "user1"; -var name = "Kevin"; - -var user = new CometChat.User(uid); - -user.setName(name); - -CometChat.createUser(user, authKey).then( - user => { - console.log("user created", user); - },error => { - console.log("error", error); - } -); -``` ->:information_source: Note: Make sure that UID and name are specified as these are mandatory fields to create a user. -
- -### iii. Login User 👤 -Once you have created the user successfully, you will need to log the user into CometChat using the login() method. -```javascript -var UID = "SUPERHERO1"; -var authKey = "AUTH_KEY"; - -CometChat.getLoggedinUser().then( - user => { - if(!user){ - CometChat.login(UID, authKey).then( - user => { - console.log("Login Successful:", { user }); - }, - error => { - console.log("Login failed with exception:", { error }); - } - ); - }else{ - // User already logged in - } - }, error => { - console.log("getLoggedinUser failed with exception:", { error }); - } -); -``` - -| :information_source:   Note - The login() method needs to be called only once. Also replace `AUTH_KEY` with Auth Key from your app. | -|------------------------------------------------------------------------------------------------------------| - +## Getting Started +To set up Javascript SDK and utilize CometChat for your chat and calls functionality, you'll need to follow these steps: +- Register at the [CometChat Dashboard](https://app.cometchat.com/) to create an account. +- After registering, log into your CometChat account and create a new app. Once created, CometChat will generate an Auth Key and App ID for you. Keep these credentials secure as you'll need them later. +- Check the [key concepts](https://cometchat.com/docs/sdk/javascript/key-concepts) to understand the basic components of CometChat. +- Refer to the [Integration Steps](https://cometchat.com/docs/sdk/javascript/setup) in our documentation to integrate the SDK into your app. ## Help and Support -For issues running the project or integrating with our UI Kits, consult our [documentation](https://www.cometchat.com/docs/javascript-chat-sdk/overview) or create a [support ticket](https://help.cometchat.com/hc/en-us) or seek real-time support via the [CometChat Dashboard](https://app.cometchat.com/). +For issues running the project or integrating with our SDK, consult our [documentation](https://www.cometchat.com/docs/sdk/javascript/overview) or create a [support ticket](https://help.cometchat.com/hc/en-us) or seek real-time support via the [CometChat Dashboard](https://app.cometchat.com/). \ No newline at end of file diff --git a/package.json b/package.json index 3180e49..e4a95a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cometchat/chat-sdk-javascript", - "version": "4.0.7", + "version": "4.0.8", "description": "A complete chat solution.", "main": "CometChat.js", "scripts": {