@cometchat/chat-sdk-react-native
Version:
A complete chat solution.
1 lines • 427 kB
JavaScript
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@react-native-async-storage/async-storage"),require("react-native"),require("react"));else if("function"==typeof define&&define.amd)define(["@react-native-async-storage/async-storage","react-native","react"],t);else{var n="object"==typeof exports?t(require("@react-native-async-storage/async-storage"),require("react-native"),require("react")):t(e["@react-native-async-storage/async-storage"],e["react-native"],e.react);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,function(n,o,s){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=52)}([function(e,W,r){"use strict";(function(K){W.__esModule=!0,W.validateQuestion=W.updatePropertiesWithDynamicValue=W.getCallSettings=W.isCallingComponentInstalled=W.getKeyprefix=W.validateConversationType=W.validateUpdateUser=W.validateCreateUser=W.validateMessage=W.validateChatType=W.validateMsgId=W.validateArray=W.validateHideMessagesFromBlockedUsers=W.validateId=W.validateCreateGroup=W.validateJoinGroup=W.validateUpdateGroup=W.validateScope=W.isAudio=W.isVideo=W.isImage=W.getUpdatedSettings=W.getAppSettings=W.getCurrentTime=W.Logger=W.createUidFromJid=W.format=W.getOrdinalSuffix=W.isFalsy=W.isTruthy=W.isObject=W.getJidHost=W.getChatHost=void 0;var o=r(15),B=r(1),e=r(5),F=r(2),i=r(20),a=r(22),E=r(24),b=r(6),t=r(10),x=r(39),V=r(53),J=r(16),c=r(26);function k(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 u(e){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return e.split("%s").reduce(function(e,t,n){return e+t+(o[n]||"")},"")}W.getChatHost=function(e){return e[B.APP_SETTINGS.KEYS.CHAT_HOST_OVERRIDE]?e[B.APP_SETTINGS.KEYS.CHAT_HOST_OVERRIDE]:e[B.APP_SETTINGS.KEYS.CHAT_HOST_APP_SPECIFIC]?e[B.APP_SETTINGS.KEYS.CHAT_HOST_APP_SPECIFIC]:e[B.APP_SETTINGS.KEYS.CHAT_HOST]},W.getJidHost=function(e){return e[B.APP_SETTINGS.KEYS.JID_HOST_OVERRIDE]?e[B.APP_SETTINGS.KEYS.JID_HOST_OVERRIDE]:e[B.APP_SETTINGS.KEYS.CHAT_HOST]},W.isObject=function(e){return e instanceof Object&&e.constructor===Object},W.isTruthy=function(e){return[!0,1,"1","true","TRUE"].includes(e)},W.isFalsy=k,W.getOrdinalSuffix=function(e){var t=e%10,n=e%100;return 1==t&&11!=n?e+"st":2==t&&12!=n?e+"nd":3==t&&13!=n?e+"rd":e+"th"},W.format=u,W.createUidFromJid=function(e){return e.substring(e.lastIndexOf("]")+1,e.lastIndexOf("@"))};var n=function(){function e(){}return e.log=function(e,t){},e.error=function(e,t){},e.info=function(e,t){},e}();function H(){return new Promise(function(t,n){o.LocalStorage.getInstance().get(B.LOCAL_STORE.KEY_APP_SETTINGS).then(function(e){k(e)?s().then(function(e){t(e)},function(e){n(e)}):t(e)},function(e){n(e)})})}function s(){return new Promise(function(t,n){e.makeApiCall("appSettings").then(function(e){o.LocalStorage.getInstance().set(B.LOCAL_STORE.KEY_APP_SETTINGS,e.data),e.data.MODE&&b.CometChat.setMode(e.data.MODE),t(e.data)},function(e){n(new F.CometChatException(e.error))})})}W.Logger=n,W.getCurrentTime=function(){return(new Date).getTime()},W.getAppSettings=H,W.getUpdatedSettings=s,W.isImage=function(e){var t;return e.type&&e.type.toLowerCase().includes("image")&&(t=!0),t},W.isVideo=function(e){var t;return e.type&&e.type.toLowerCase().includes("video")&&(t=!0),t},W.isAudio=function(e){var t;return e.type&&e.type.toLowerCase().includes("audio")&&(t=!0),t},W.validateScope=function(e){return typeof e!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"SCOPE","SCOPE","Scope"))):k(e)?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"SCOPE","SCOPE","scope","scope"))):e!=b.CometChat.GROUP_MEMBER_SCOPE.ADMIN&&e!=b.CometChat.GROUP_MEMBER_SCOPE.MODERATOR&&e!=b.CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT?new F.CometChatException(B.GroupErrors.INVALID_SCOPE):void 0},W.validateUpdateGroup=function(e){return e.hasOwnProperty(B.GroupConstants.KEYS.GUID)?typeof e[B.GroupConstants.KEYS.GUID]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID"))):k(e[B.GroupConstants.KEYS.GUID])?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID"))):e.hasOwnProperty(B.GroupConstants.KEYS.NAME)&&""===e[B.GroupConstants.KEYS.NAME]?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.EMPTY_STRING),"GROUP_NAME","GROUP_NAME","Group name"))):void 0:new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.PARAMETER_COMPULSORY),"GUID","GUID","GUID","GUID")))},W.validateJoinGroup=function(e,t,n){if(typeof e==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.OBJECT){if(!e.hasOwnProperty(B.GroupConstants.KEYS.GUID))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.PARAMETER_COMPULSORY),"GUID","GUID","GUID","GUID")));if(typeof e[B.GroupConstants.KEYS.GUID]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(k(e[B.GroupConstants.KEYS.GUID]))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID")));if(!e.hasOwnProperty(B.GroupConstants.KEYS.TYPE))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.PARAMETER_COMPULSORY),"GROUP_TYPE","GROUP_TYPE","Group type","Group type")));if(typeof e[B.GroupConstants.KEYS.TYPE]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_TYPE","GROUP_TYPE","Group type")));if(k(e[B.GroupConstants.KEYS.TYPE]))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_TYPE","GROUP_TYPE","type","type")));if(e[B.GroupConstants.KEYS.TYPE].toLowerCase()!=b.CometChat.GROUP_TYPE.PUBLIC&&e[B.GroupConstants.KEYS.TYPE].toLowerCase()!=b.CometChat.GROUP_TYPE.PASSWORD&&e[B.GroupConstants.KEYS.TYPE].toLowerCase()!=b.CometChat.GROUP_TYPE.PROTECTED&&e[B.GroupConstants.KEYS.TYPE].toLowerCase()!=b.CometChat.GROUP_TYPE.PRIVATE)return new F.CometChatException(B.GroupErrors.INVALID_GROUP_TYPE);if(e[B.GroupConstants.KEYS.TYPE].toLowerCase()==b.CometChat.GROUP_TYPE.PASSWORD){if(!e.hasOwnProperty(B.GroupConstants.KEYS.PASSWORD))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.PASSWORD_COMPULSORY),"PASSWORD","PASSWORD")));if(typeof e[B.GroupConstants.KEYS.PASSWORD]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"PASSWORD","PASSWORD","Password")));if(k(e[B.GroupConstants.KEYS.PASSWORD]))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"PASSWORD","PASSWORD","password","password")))}}else{if(void 0!==e){if(typeof e!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(k(e))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID")))}if(void 0!==t){if(typeof t!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_TYPE","GROUP_TYPE","Group type")));if(k(t))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_TYPE","GROUP_TYPE","type","type")));if(t.toLowerCase()!=b.CometChat.GROUP_TYPE.PUBLIC&&t.toLowerCase()!=b.CometChat.GROUP_TYPE.PASSWORD&&t.toLowerCase()!=b.CometChat.GROUP_TYPE.PROTECTED&&t.toLowerCase()!=b.CometChat.GROUP_TYPE.PRIVATE)return new F.CometChatException(B.GroupErrors.INVALID_GROUP_TYPE);if(t.toLowerCase()==b.CometChat.GROUP_TYPE.PASSWORD){if(typeof n!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"PASSWORD","PASSWORD","Password")));if(k(n))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"PASSWORD","PASSWORD","password","password")))}}}},W.validateCreateGroup=function(e){if(!e.hasOwnProperty(B.GroupConstants.KEYS.GUID))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.PARAMETER_COMPULSORY),"GUID","GUID","GUID","GUID")));if(typeof e[B.GroupConstants.KEYS.GUID]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(k(e[B.GroupConstants.KEYS.GUID]))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID")));if(!e.hasOwnProperty(B.GroupConstants.KEYS.NAME))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.PARAMETER_COMPULSORY),"GROUP_NAME","GROUP_NAME","Group name","Group name")));if(typeof e[B.GroupConstants.KEYS.NAME]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_NAME","GROUP_NAME","Group name")));if(k(e[B.GroupConstants.KEYS.NAME]))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_NAME","GROUP_NAME","name","name")));if(!e.hasOwnProperty(B.GroupConstants.KEYS.TYPE))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.PARAMETER_COMPULSORY),"GROUP_TYPE","GROUP_TYPE","Group type","Group type")));if(typeof e[B.GroupConstants.KEYS.TYPE]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_TYPE","GROUP_TYPE","Group type")));if(k(e[B.GroupConstants.KEYS.TYPE]))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_TYPE","GROUP_TYPE","type","type")));if(e[B.GroupConstants.KEYS.TYPE].toLowerCase()!=b.CometChat.GROUP_TYPE.PUBLIC&&e[B.GroupConstants.KEYS.TYPE].toLowerCase()!=b.CometChat.GROUP_TYPE.PASSWORD&&e[B.GroupConstants.KEYS.TYPE].toLowerCase()!=b.CometChat.GROUP_TYPE.PROTECTED&&e[B.GroupConstants.KEYS.TYPE].toLowerCase()!=b.CometChat.GROUP_TYPE.PRIVATE)return new F.CometChatException(B.GroupErrors.INVALID_GROUP_TYPE);if(e[B.GroupConstants.KEYS.TYPE].toLowerCase()==b.CometChat.GROUP_TYPE.PASSWORD){if(!e.hasOwnProperty(B.GroupConstants.KEYS.PASSWORD))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.PASSWORD_COMPULSORY),"PASSWORD","PASSWORD")));if(typeof e[B.GroupConstants.KEYS.PASSWORD]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"PASSWORD","PASSWORD","Password")));if(k(e[B.GroupConstants.KEYS.PASSWORD]))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"PASSWORD","PASSWORD","password","password")))}if(e.hasOwnProperty(B.GroupConstants.KEYS.TAGS)){if(!Array.isArray(e[B.GroupConstants.KEYS.TAGS]))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_AN_ARRAY),"GROUP_TAGS","GROUP_TAGS","Group tags")));if(0===e[B.GroupConstants.KEYS.TAGS].length)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.EMPTY_ARRAY),"GROUP_TAGS","GROUP_TAGS","Group tags")))}},W.validateId=function(e,t){if("user"===t){if(typeof e!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"UID","UID","UID")));if(k(e))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"UID","UID","UID","UID")))}if("group"===t){if(typeof e!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(k(e))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"GUID","GUID","GUID","GUID")))}if("bot"===t){if(typeof e!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"BOT_ID","BOT_ID","BOT_ID")));if(k(e))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"BOT_ID","BOT_ID","BOT_ID","BOT_ID")))}},W.validateHideMessagesFromBlockedUsers=function(e){if(typeof e!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_BOOLEAN),"HIDE_MESSAGES_FROM_BLOCKED_USERS","HIDE_MESSAGES_FROM_BLOCKED_USERS","hideMessagesFromBlockedUsers")))},W.validateArray=function(e,t){var n="List should be an array.";return n="blockUsers"===t?"blockUsers() method accepts an array of users.":"unblockUsers"===t?"unblockUsers() method accepts an array of users.":"groupMembers"===t?"addMembersToGroup() method accepts members list as an array of users.":"addMembersToGroup() method accepts bannedMembers list as an array of users.",typeof e!=B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.OBJECT?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_ARRAY),"USER_LIST","USER_LIST",n))):Array.isArray(e)?void 0:new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_ARRAY),"USER_LIST","USER_LIST",n)))},W.validateMsgId=function(e){return isNaN(e)?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_NUMBER),"MESSAGE_ID","MESSAGE_ID","Message Id"))):k(e)?new F.CometChatException(t.ERRORS.PARAMETER_MISSING):void 0},W.validateChatType=function(e){return typeof e!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"RECEIVER_TYPE","RECEIVER_TYPE","Receiver type"))):k(e)?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"RECEIVER_TYPE","RECEIVER_TYPE","receiver type","receiver type"))):e!=B.MessageConstatnts.RECEIVER_TYPE.GROUP&&e!=B.MessageConstatnts.RECEIVER_TYPE.USER?new F.CometChatException(B.MessageErrors.INVALID_RECEIVER_TYPE):void 0},W.validateMessage=function(e){var t=e;if(typeof t.getReceiverId()!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"RECEIVER_ID","RECEIVER_ID","Receiver Id")));if(k(t.getReceiverId()))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"RECEIVER_ID","RECEIVER_ID","receiver id","receiver id")));if(typeof t.getReceiverType()!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"RECEIVER_TYPE","RECEIVER_TYPE","Receiver Type")));if(k(t.getReceiverType()))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"RECEIVER_TYPE","RECEIVER_TYPE","receiver type","receiver type")));if(t.getReceiverType()!=B.MessageConstatnts.RECEIVER_TYPE.GROUP&&t.getReceiverType()!=B.MessageConstatnts.RECEIVER_TYPE.USER)return new F.CometChatException(B.MessageErrors.INVALID_RECEIVER_TYPE);if(e instanceof i.TextMessage){var n=e;if(typeof n.getText()!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"MESSAGE_TEXT","MESSAGE_TEXT","Message text")));if(""===n.getText().trim())return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.EMPTY_STRING),"MESSAGE_TEXT","MESSAGE_TEXT","Message text")))}if(e instanceof a.MediaMessage){var o=e;if(o.getData()&&o.getData().hasOwnProperty("attachments"))for(var s=o.getAttachments(),r=0;r<s.length;r++){if(!s[r].getExtension())return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MISSING_KEY),"extension","Attachment")));if(!s[r].getMimeType())return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MISSING_KEY),"mimeType","Attachment")));if(!s[r].getName())return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MISSING_KEY),"name","Attachment")));if(!s[r].getUrl())return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MISSING_KEY),"url","Attachment")))}if(o.hasOwnProperty("files"))for(r=0;r<o.files.length;r++){if(typeof o.files[r]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.OBJECT)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_OBJECT),"MEDIA_OBJECT","MEDIA_OBJECT","Media object")));if(k(o.files[r])&&!(o.files[r]instanceof Blob))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"MEDIA_OBJECT","MEDIA_OBJECT","Media object","Media object")))}}if(e instanceof E.CustomMessage&&k(e.getCustomData()))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"CUSTOM_DATA","CUSTOM_DATA","custom data","custom data")));if(e instanceof c.InteractiveMessage&&k(e.getInteractiveData()))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"INTERACTIVE_DATA","INTERACTIVE_DATA","interactive data","interactive data")))},W.validateCreateUser=function(e){if(!e.hasOwnProperty(B.UserConstants.UID))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.PARAMETER_COMPULSORY),"UID","UID","UID","UID")));if(typeof e[B.UserConstants.UID]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"UID","UID","UID")));if(k(e[B.UserConstants.UID]))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_USER_PROPERTY),"UID","UID","UID","UID")));if(!e.hasOwnProperty(B.UserConstants.NAME))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.PARAMETER_COMPULSORY),"USER_NAME","USER_NAME","User name","User name")));if(typeof e[B.UserConstants.NAME]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"USER_NAME","USER_NAME","User name")));if(k(e[B.UserConstants.NAME]))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_USER_PROPERTY),"USER_NAME","USER_NAME","name","name")));if(e.hasOwnProperty(B.UserConstants.AVATAR)&&""===e[B.UserConstants.AVATAR])return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.EMPTY_STRING),"USER_AVATAR","USER_AVATAR","User avatar")));if(e.hasOwnProperty(B.UserConstants.META_DATA)&&""===e[B.UserConstants.META_DATA])return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.EMPTY_STRING),"USER_METADATA","USER_METADATA","User metadata")));if(e.hasOwnProperty(B.UserConstants.LINK)&&""===e[B.UserConstants.LINK])return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.EMPTY_STRING),"USER_LINK","USER_LINK","User link")));if(e.hasOwnProperty(B.UserConstants.STATUS_MESSAGE)&&""===e[B.UserConstants.STATUS_MESSAGE])return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.EMPTY_STRING),"USER_STATUS_MESSAGE","USER_STATUS_MESSAGE","User status message")));if(e.hasOwnProperty(B.UserConstants.ROLE)&&""===e[B.UserConstants.ROLE])return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.EMPTY_STRING),"USER_ROLE","USER_ROLE","User role")));if(e.hasOwnProperty(B.UserConstants.TAGS)){if(!Array.isArray(e[B.UserConstants.TAGS]))return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_AN_ARRAY),"USER_TAGS","USER_TAGS","User tags")));if(0===e[B.UserConstants.TAGS].length)return new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.EMPTY_ARRAY),"USER_TAGS","USER_TAGS","User tags")))}},W.validateUpdateUser=function(e){return e.hasOwnProperty(B.UserConstants.UID)?typeof e[B.UserConstants.UID]!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"UID","UID","UID"))):k(e[B.UserConstants.UID])?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID_USER_PROPERTY),"UID","UID","UID","UID"))):e.hasOwnProperty(B.UserConstants.NAME)&&""===e[B.UserConstants.NAME]?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.EMPTY_STRING),"USER_NAME","USER_NAME","User name"))):void 0:new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.PARAMETER_COMPULSORY),"UID","UID","UID","UID")))},W.validateConversationType=function(e){return typeof e!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"CONVERSATION_TYPE","CONVERSATION_TYPE","Conversation type"))):k(e)?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"CONVERSATION_TYPE","CONVERSATION_TYPE","conversation type","conversation type"))):(e=e.toLowerCase())!=b.CometChat.RECEIVER_TYPE.USER&&e!=b.CometChat.RECEIVER_TYPE.GROUP?new F.CometChatException(B.ConversationErrors.INVALID_CONVERSATION_TYPE):void 0},W.getKeyprefix=function(e,t){switch(e){case B.LOCAL_STORE.COMMON_STORE:return u(B.LOCAL_STORE.KEY_STRING,u(B.LOCAL_STORE.STORE_STRING,b.CometChat.getAppId(),B.LOCAL_STORE.COMMON_STORE),t);case B.LOCAL_STORE.KEYS_STORE:return u(B.LOCAL_STORE.KEY_STRING,u(B.LOCAL_STORE.STORE_STRING,b.CometChat.getAppId(),B.LOCAL_STORE.KEYS_STORE),t);case B.LOCAL_STORE.MESSAGES_STORE:return u(B.LOCAL_STORE.KEY_STRING,u(B.LOCAL_STORE.STORE_STRING,b.CometChat.getAppId(),B.LOCAL_STORE.MESSAGES_STORE),t);case B.LOCAL_STORE.MESSAGE_LISTENERS_LIST:return u(B.LOCAL_STORE.KEY_STRING,u(B.LOCAL_STORE.STORE_STRING,b.CometChat.getAppId(),B.LOCAL_STORE.MESSAGE_LISTENERS_LIST),t);case B.LOCAL_STORE.USERS_STORE:return u(B.LOCAL_STORE.KEY_STRING,u(B.LOCAL_STORE.STORE_STRING,b.CometChat.getAppId(),B.LOCAL_STORE.USERS_STORE),t)}},W.isCallingComponentInstalled=function(){return!!(K.hasOwnProperty("CometChatCalling")&&K.CometChatCalling&&K.CometChatCalling.hasOwnProperty("isCallingComponentInstalled")&&K.CometChatCalling.isCallingComponentInstalled)},W.getCallSettings=function(w){return new Promise(function(o,e){var s,r,i,a,E,c,u,p,C,S,l,_={};i=b.CometChat.getActiveCall(),E=b.CometChat.user;var T,d,h,R,g,A,I,f,O,N,m,P,y,M,v,L,U,D,Y,G=!0;H().then(function(e){if(u=e[B.APP_SETTINGS.KEYS.WEBRTC_HOST],_[B.APP_SETTINGS.KEYS.ANALYTICS_HOST]=e[B.APP_SETTINGS.KEYS.ANALYTICS_HOST],_[B.APP_SETTINGS.KEYS.ANALYTICS_VERSION]=e[B.APP_SETTINGS.KEYS.ANALYTICS_VERSION],_[B.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED]=e[B.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED],_[B.APP_SETTINGS.KEYS.ANALYTICS_USE_SSL]=e[B.APP_SETTINGS.KEYS.ANALYTICS_USE_SSL],s=e[B.APP_SETTINGS.KEYS.REGION],w.getCallEventListener()&&J.CallController.getInstance().setCallListner(w.getCallEventListener()),W.isCallingComponentInstalled())if(p=K.CometChatCalling.CometChatCalls,C=K.CometChatCalling.CallEventListener,S=K.CometChatCalling.CallScreen,l=K.CometChatCalling.CometChatRTC,k(b.CometChat.appSettings))J.CallController.getInstance().getCallListner()&&J.CallController.getInstance().getCallListner()._eventListener.onError(new F.CometChatException(B.CALL_ERROR.NOT_INITIALIZED));else{if(!s)return G=!1,void(J.CallController.getInstance().getCallListner()&&J.CallController.getInstance().getCallListner()._eventListener.onError(new F.CometChatException(B.CALL_ERROR.NOT_INITIALIZED)));if(b.CometChat.getAppId()){if(r=b.CometChat.getAppId(),!E)return G=!1,void(J.CallController.getInstance().getCallListner()&&J.CallController.getInstance().getCallListner()._eventListener.onError(new F.CometChatException(B.CALL_ERROR.NOT_LOGGED_IN)));if(i){var t=i.getType();T=t===B.CallConstants.CALL_TYPE.AUDIO,d=i.getSessionId()}else{if(T=w.isAudioOnlyCall(),k(w.getSessionId()))return void(J.CallController.getInstance().getCallListner()&&J.CallController.getInstance().getCallListner()._eventListener.onError(new F.CometChatException(B.CALL_ERROR.SESSION_ID_REQUIRED)));d=("v1."+s+"."+b.CometChat.getAppId()+"."+w.getSessionId()).toLowerCase()}if(!d)return G=!1,void(J.CallController.getInstance().getCallListner()&&J.CallController.getInstance().getCallListner()._eventListener.onError(new F.CometChatException(B.CALL_ERROR.SESSION_ID_REQUIRED)));if(h=w.isDefaultLayoutEnabled(),R=w.isAudioModeButtonEnabled(),g=w.isPauseVideoButtonEnabled(),A=w.isMuteAudioButtonEnabled(),I=w.isSwitchCameraButtonEnabled(),f=w.isEndCallButtonEnabled(),O=w.getMode(),N=w.getStartWithAudioMuted(),m=w.getStartWithVideoMuted(),P=w.getDefaultAudioMode(),y=!!T&&w.isAudioToVideoButtonEnabled(),M=w.getAvatarMode(),v=w.isRecordingButtonEnabled(),L=w.shouldStartRecordingOnCallStart(),U=w.getMainVideoContainerSetting(),D=w.isVideoTileClickEnabled(),Y=w.isVideoTileDragEnabled(),G){var n={uid:E.getUid(),sessionId:d};b.CometChat.getInstance().getJWT(n).then(function(e){e.hasOwnProperty("token")?((c=new V.RTCUser(E.getUid())).setName(E.getName()),c.setAvatar(E.getAvatar()),c.setResource(b.CometChat.getSessionId()),c.setJWT(e.token),a=(new x.CallSettingsBuilder).setSessionID(d).enableDefaultLayout(h).setIsAudioOnlyCall(T).setUser(c).setRegion(s).setAppId(r).setDomain(u).showAudioModeButton(R).showEndCallButton(f).showMuteAudioButton(A).showPauseVideoButton(g).showSwitchCameraButton(I).setMode(O).setAnalyticsSettings(_).startWithAudioMuted(N).startWithVideoMuted(m).setDefaultAudioMode(P).showSwitchToVideoCallButton(y).setAvatarMode(M).showRecordingButton(v).startRecordingOnCallStart(L).setMainVideoContainerSetting(U).enableVideoTileClick(D).enableVideoTileDrag(Y).build(),J.CallController.getInstance().callStarted(),o({callSettingsNew:a,call:i,CometChatCalls:p,CallEventListener:C,CallScreen:S,CometChatRTC:l})):J.CallController.getInstance().getCallListner()&&J.CallController.getInstance().getCallListner()._eventListener.onError(new F.CometChatException(B.CALL_ERROR.JWT_NOT_FOUND))},function(e){J.CallController.getInstance().getCallListner()&&J.CallController.getInstance().getCallListner()._eventListener.onError(new F.CometChatException(e))})}}else J.CallController.getInstance().getCallListner()&&J.CallController.getInstance().getCallListner()._eventListener.onError(new F.CometChatException(B.CALL_ERROR.NOT_INITIALIZED))}else J.CallController.getInstance().getCallListner()&&J.CallController.getInstance().getCallListner()._eventListener.onError(new F.CometChatException(B.CALL_ERROR.MODULE_NOT_INSTALLED))})})},W.updatePropertiesWithDynamicValue=function(e,o,s){return function e(t){for(var n in t)t.hasOwnProperty(n)&&("object"==typeof t[n]?e(t[n]):"string"==typeof t[n]&&t[n].includes(o)&&!t[n].includes(B.ADDITIONAL_CONSTANTS.SECURE_URL_PROPERTY)&&(t[n]+=s))}(e),e},W.validateQuestion=function(e){return typeof e!==B.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.MUST_BE_A_STRING),"QUESTION","QUESTION","Question"))):k(e)?new F.CometChatException(JSON.parse(u(JSON.stringify(B.GENERAL_ERROR.INVALID),"QUESTION","QUESTION","question","question"))):void 0}}).call(this,r(19))},function(e,t,n){"use strict";t.__esModule=!0,t.AI_SLUG_ENABLED=t.AI_SLUG_ACCESSIBLE=t.AI_FEATURE_ENABLED=t.AI_FEATURE_ACCESSIBLE=t.ADDITIONAL_CONSTANTS=t.ONLINE_MEMBER_COUNT_API=t.JWT_API=t.ProsodyApiErrors=t.PROSODY_API=t.API_ERROR_CODES=t.REACTION_ACTION=t.CONNECTION_STATUS=t.COMMON_UTILITY_CONSTANTS=t.APP_SETTINGS=t.PresenceConstatnts=t.FeatureRestrictionErrors=t.MessageErrors=t.AIFeatureError=t.ExtensionErrors=t.AIErrors=t.ConversationErrors=t.GroupErrors=t.UserErrors=t.ReceiptErrors=t.GENERAL_ERROR=t.PARAMETER_ERROR=t.CALL_ERROR=t.Errors=t.UserConstants=t.GroupMemersConstans=t.GroupConstants=t.CallConstants=t.BlockedUsersConstants=t.ActionConstatnts=t.TYPING_NOTIFICATION=t.GoalType=t.MessageCategory=t.ATTACHMENTS_CONSTANTS=t.MessageConstatnts=t.READ_RECEIPTS=t.DELIVERY_RECEIPTS=t.ResponseConstants=t.LOCAL_STORE=t.ANALYTICS=t.WS=t.SDKHeader=t.APPINFO=t.GROUP_MEMBER_SCOPE=t.GroupMemberScope=t.GROUP_TYPE=t.GroupType=t.DEFAULT_VALUES=t.constants=void 0;var o,s,r,i,a,E=n(2);t.constants={DEFAULT_STORE:"cometchat",MSG_VER_PRE:"store-ver-pre",MSG_VER_POST:"store-ver-post"},t.DEFAULT_VALUES={ZERO:0,MSGS_LIMIT:30,REACTIONS_LIMIT:10,MSGS_MAX_LIMIT:100,USERS_LIMIT:30,USERS_MAX_LIMIT:100,GROUPS_LIMIT:30,GROUPS_MAX_LIMIT:100,CONVERSATION_MAX_LIMIT:50,CALL_TIMEOUT:45,DEFAULT_MSG_ID:0,DEFAULT_MAX_TYPING_INDICATOR_LIMIT:5,REGION_DEFAULT:"eu",REGION_DEFAULT_EU:"eu",REGION_DEFAULT_US:"us",REGION_DEFAULT_IN:"in",REGION_DEFAULT_PRIVATE:"private",REACTIONS_MAX_LIMIT:20},(o=t.GroupType||(t.GroupType={})).Public="public",o.Private="private",o.Protected="protected",o.Password="password",t.GROUP_TYPE={PUBLIC:"public",PRIVATE:"private",PROTECTED:"password",PASSWORD:"password"},(s=t.GroupMemberScope||(t.GroupMemberScope={})).Admin="admin",s.Moderator="moderator",s.Member="member",t.GROUP_MEMBER_SCOPE={ADMIN:"admin",MODERATOR:"moderator",PARTICIPANT:"participant"},t.APPINFO={platform:"REACT_NATIVE",sdkVersion:"v4.0.12",apiVersion:"v3.0",sdkVersionWithUnderScore:"4_0_12",userAgent:"cc_react_native_sdk"},t.SDKHeader={platform:"react-native",sdkVersion:"4.0.12",sdk:"%s@%s"},t.WS={CONVERSATION:{TYPE:{CHAT:"chat",GROUP_CHAT:"groupchat"}}},t.ANALYTICS={analyticsHost:"metrics-%s.cometchat.io",analyticsVersion:"v1"},t.LOCAL_STORE={COMMON_STORE:"common_store",MESSAGE_LISTENERS_LIST:"message_listeners_list",USERS_STORE:"users_store",MESSAGES_STORE:"messages_store",KEYS_STORE:"keys_store",STORE_STRING:"%s:%s",KEY_STRING:"%s/%s",KEY_USER:"user",KEY_APP_SETTINGS:"app_settings",KEY_APP_ID:"appId",KEY_DEVICE_ID:"deviceId",KEY_SESSION_ID:"sessionId",KEY_MESSAGE_LISTENER_LIST:"all"},t.ResponseConstants={RESPONSE_KEYS:{KEY_DATA:"data",KEY_META:"meta",KEY_CURSOR:"cursor",KEY_NEXT:"next",KEY_PREVIOUS:"previous",KEY_ACTION:"action",KEY_MESSAGE:"message",KEY_ERROR:"error",KEY_ERROR_DETAILS:"details",KEY_ERROR_CODE:"code",KEY_ERROR_MESSAGE:"message",KEY_AUTH_TOKEN:"authToken",KEY_WS_CHANNEL:"wsChannel",KEY_IDENTITY:"identity",KEY_SERVICE:"identity",KEY_ENTITIES:"entities",KEY_REACTIONS:"reactions",KEY_ENTITITY:"entity",KEY_ENTITYTYPE:"entityType",KEY_ATTACHMENTS:"attachments",CODE_REQUEST_OK:200,CODE_BAD_REQUEST:401,UNREAD_UNDELIVERED_KEYS:{ENTITY:"entity",ENTITY_TYPE:"entityType",ENTITY_Id:"entityId",COUNT:"count"},GROUP_MEMBERS_RESPONSE:{SUCCESS:"success",ERROR:"error",MESSAGE:"message"},KEY_ENTITY_TYPE:{USER:"user",GROUP:"group"},KEY_CONVERSATION_STARTER:"conversation-starter",KEY_SMART_REPLIES:"smart-replies",KEY_CONVERSATION_SUMMARY:"conversation-summary",KEY_BOT_REPLY:"bot-reply"}},t.DELIVERY_RECEIPTS={RECEIVER_ID:"receiverId",RECEIVER_TYPE:"type",RECIPIENT:"recipient",MESSAGE_ID:"messageId",RECEIVED:"delivered",DELIVERED_AT:"deliveredAt",ID:"id",TIME:"time",DELIVERED_TO_ME_AT:"deliveredToMeAt"},t.READ_RECEIPTS={RECEIVER_ID:"receiverId",RECEIVER_TYPE:"type",RECIPIENT:"recipient",MESSAGE_ID:"messageId",READ:"read",READ_AT:"readAt",ID:"id",TIME:"time",READ_BY_ME_AT:"readByMeAt"},t.MessageConstatnts={TYPE:{TEXT:"text",MEDIA:"media",IMAGE:"image",VIDEO:"video",AUDIO:"audio",FILE:"file",CUSTOM:"custom"},CATEGORY:{MESSAGE:"message",ACTION:"action",CALL:"call",CUSTOM:"custom",INTERACTIVE:"interactive"},RECEIVER_TYPE:{USER:"user",GROUP:"group"},KEYS:{ATTATCHMENT:"attatchment",ATTATCHMENTS:"attachments",ACTION:"action",TYPE:"type",DATA:"data",ID:"id",MUID:"muid",SENDER:"sender",RECEIVER:"receiver",RECEIVER_ID:"receiverId",CATEGORY:"category",RECEIVER_TYPE:"receiverType",SENT_AT:"sentAt",STATUS:"status",TEXT:"text",URL:"url",METADATA:"metadata",RECEIPTS:"receipts",MY_RECEIPTS:"myReceipt",CUSTOM_DATA:"customData",CUSTOM_SUB_TYPE:"subType",RESOURCE:"resource",MENTIONS:"mentions",INTERACTIVE_DATA:"interactiveData",INTERACTION_GOAL:"interactionGoal",INTERACTIONS:"interactions",ALLOW_SENDER_INTERACTION:"allowSenderInteraction",ELEMENT_ID:"elementId",INTERACTED_AT:"interactedAt",ELEMENT_IDS:"elementIds"},KNOWN_MEDIA_TYPE:{IMAGE:[],VIDEO:[],AUDIO:[],FILE:[]},PAGINATION:{AFFIX:{APPEND:"append",PREPEND:"prepend"},CURSOR_FILEDS:{ID:"id",SENT_AT:"sentAt"},CURSOR_AFFIX_DEFAULT:"prepend",CURSOR_FIELD_DEFAULT:"sentAt",KEYS:{PER_PAGE:"per_page",CURSOR_AFFIX:"cursorAffix",AFFIX:"affix",CURSOR_FIELD:"cursorField",CURSOR_VALUE:"cursorValue",UID:"uid",SENT_AT:"sentAt",ID:"id",CURRENT_PAGE:"page",UNREAD:"unread",HIDE_MESSAGES_FROM_BLOCKED_USER:"hideMessagesFromBlockedUsers",SEARCH_KEY:"searchKey",ONLY_UPDATES:"onlyUpdates",UPDATED_AT:"updatedAt",CATEGORY:"category",CATEGORIES:"categories",TYPE:"type",TYPES:"types",HIDE_REPLIES:"hideReplies",HIDE_DELETED_MESSAGES:"hideDeleted",WITH_TAGS:"withTags",TAGS:"tags",MENTIONS_WITH_TAG_INFO:"mentionsWithTagInfo",MENTIONS_WITH_BLOCKED_INFO:"mentionsWithBlockedInfo",ONLY_INTERACTION_GOAL_COMPLETED:"onlyInteractionGoalCompleted"}}},t.ATTACHMENTS_CONSTANTS={KEYS:{EXTENSION:"extension",MIME_TYPE:"mimeType",NAME:"name",SIZE:"size",URL:"url"}},(r=t.MessageCategory||(t.MessageCategory={})).ACTION="action",r.MESSAGE="message",r.CALL="call",r.CUSTOM="custom",r.INTERACTIVE="interactive",(i=t.GoalType||(t.GoalType={})).ANY_ACTION="anyAction",i.ANY_OF="anyOf",i.ALL_OF="allOf",i.NONE="none",t.TYPING_NOTIFICATION={RECEIVER_ID:"receiverId",RECEIVER_TYPE:"receiverType",META:"metadata",KEYS:{TYPING_NOTIFICATION:"typingNotification",TIMESTAMP:"timestamp"},ACTIONS:{STARTED:"started",ENDED:"ended"}},t.ActionConstatnts={ACTION_SUBJECTS:{ACTION_ON:"on",ACTION_BY:"by",ACTION_FOR:"for"},ACTION_ENTITY_TYPE:{GROUP_USER:"groupuser",USER:"user",GROUP:"group",MESSAGE:"message"},ACTION_KEYS:{ACTION_CREATED:"created",ACTION_UPDATED:"updated",ACTION_DELETED:"deleted",ENTITIES:"entities",ENTITY:"entity",ENTITY_TYPE:"entityType",TYPE_MEMBER_JOINED:"joined",TYPE_MEMBER_LEFT:"left",TYPE_MEMBER_KICKED:"kicked",TYPE_MEMBER_BANNED:"banned",TYPE_MEMBER_UNBANNED:"unbanned",TYPE_MEMBER_INVITED:"invited",TYPE_MEMBER_ADDED:"added",ACTION_SCOPE_CHANGED:"scopeChanged",ACTION_TYPE_USER:"user",ACTION_TYPE_GROUP:"group",ACTION_TYPE_GROUP_MEMBER:"groupMember",TYPE_MESSAGE_EDITED:"edited",TYPE_MESSAGE_DELETED:"deleted",ACTION_TYPE_CALL:"call",EXTRAS:"extras",SCOPE:"scope",NEW:"new",OLD:"old"},ActionMessages:{ACTION_GROUP_JOINED_MESSAGE:"%s joined",ACTION_GROUP_LEFT_MESSAGE:"%s left",ACTION_MEMBER_KICKED_MESSAGE:"%s kicked %s",ACTION_MEMBER_BANNED_MESSAGE:"%s banned %s",ACTION_MEMBER_UNBANNED_MESSAGE:"%s unbanned %s",ACTION_MEMBER_INVITED_MESSAGE:"%s banned %s",ACTION_MESSAGE_EDITED_MESSAGE:" Message Edited",ACTION_MESSAGE_DELETED_MESSAGE:"Message Deleted",ACTION_MEMBER_SCOPE_CHANGED:"%s made %s %s",ACTION_MEMBER_ADDED_TO_GROUP:"%s added %s"},ACTION_TYPE:{TYPE_MEMBER_JOINED:"joined",TYPE_MEMBER_LEFT:"left",TYPE_MEMBER_KICKED:"kicked",TYPE_MEMBER_BANNED:"banned",TYPE_MEMBER_UNBANNED:"unbanned",TYPE_MEMBER_INVITED:"invited",TYPE_MEMBER_SCOPE_CHANGED:"scopeChanged",TYPE_MESSAGE:"message",TYPE_MESSAGE_EDITED:"edited",TYPE_MESSAGE_DELETED:"deleted",TYPE_MEMBER_ADDED:"added"},ACTIONS:{MEMBER_ADDED:"added",MEMBER_JOINED:"joined",MEMBER_LEFT:"left",MEMBER_KICKED:"kicked",MEMBER_BANNED:"banned",MEMBER_UNBANNED:"unbanned",MEMBER_INVITED:"invited",MEMBER_SCOPE_CHANGED:"scopeChanged",MESSAGE_EDITED:"edited",MESSSAGE_DELETED:"deleted",TYPE_USER:"user",TYPE_GROUP:"group",TYPE_GROUP_MEMBER:"groupMember"}},t.BlockedUsersConstants={REQUEST_KEYS:{DIRECTIONS:{BOTH:"both",HAS_BLOCKED_ME:"hasBlockedMe",BLOCKED_BY_ME:"blockedByMe"}}},t.CallConstants={CALL_MODE:{DEFAULT:"DEFAULT",SPOTLIGHT:"SPOTLIGHT",SINGLE:"SINGLE"},AUDIO_MODE:{SPEAKER:"SPEAKER",EARPIECE:"EARPIECE",BLUETOOTH:"BLUETOOTH",HEADPHONES:"HEADPHONES"},CALL_TYPE:{AUDIO:"audio",VIDEO:"video"},RECEIVER_TYPE_GROUP:"group",RECEIVER_TYPE_USER:"user",CALL_KEYS:{CALL_DATA:"data",CALL_ID:"id",CALL_SESSION_ID:"sessionid",CALL_RECEIVER:"receiver",CALL_SENDER:"sender",CALL_RECEIVER_TYPE:"receiverType",CALL_STATUS:"status",CALL_TYPE:"type",CALL_INITIATED_AT:"initiatedAt",CALL_JOINED_AT:"joinedAt",CALL_LEFT_AT:"leftAt",CALL_METADATA:"metadata",CALL_ENTITIES:"entities",CALL_ENTITY_TYPE:"entityType",CALL_ENTITY:"entity",CALL_ENTITY_USER:"user",CALL_ENTITY_GROUP:"group"},CALL_STATUS:{INITIATED:"initiated",ONGOING:"ongoing",UNANSWERED:"unanswered",REJECTED:"rejected",BUSY:"busy",CANCELLED:"cancelled",ENDED:"ended"},ZOOM_BUTTON_DEFAULT_PARAMS:{position:"bottom-right",visible:!0},FULL_SCREEN_BUTTON_DEFAULT_PARAMS:{position:"bottom-right",visible:!0},USER_LIST_BUTTON_DEFAULT_PARAMS:{position:"bottom-right",visible:!0},NAME_LABEL_DEFAULT_PARAMS:{position:"bottom-left",visible:!0,color:"#333333"},MAIN_VIDEO_CONTAINER_SETTINGS:{KEYS:{POSITION:"position",VISIBILITY:"visibility",COLOR:"color"}}},t.GroupConstants={KEYS:{NAME:"name",GUID:"guid",TYPE:"type",PASSWORD:"password",ICON:"icon",DESCRIPTION:"description",OWNER:"owner",METADATA:"metadata",CREATED_AT:"createdAt",UPDATED_AT:"updatedAt",HAS_JOINED:"hasJoined",WS_CHANNEL:"wsChannel",TAGS:"tags"}},t.GroupMemersConstans={KEYS:{SCOPE:"scope",UID:"uid",GUID:"guid",USER:"user",NAME:"name"}},t.UserConstants={UID:"uid",NAME:"name",AUTH_TOKEN:"authToken",AVATAR:"avatar",LAST_ACTIVE_AT:"lastActiveAt",LINK:"link",META_DATA:"metadata",ROLE:"role",STATUS:"status",STATUS_MESSAGE:"statusMessage",USER_NAME:"user_name",TAGS:"tags",SORT_BY:{NAME:"name",STATUS:"status"},SORT_ORDER:{ASCENDING:"asc",DESCENDING:"desc"}},t.Errors={ERROR_IO_EXCEPTION:"ERROR_IO_EXCEPTION",ERROR_JSON_EXCEPTION:"ERROR_JSON_EXCEPTION",ERROR_PASSWORD_MISSING:"ERROR_PASSWORD_MISSING",ERROR_LIMIT_EXCEEDED:"ERROR_LIMIT_EXCEEDED",ERROR_USER_NOT_LOGGED_IN:"ERROR_USER_NOT_LOGGED_IN",ERROR_INVALID_GUID:"ERROR_INVALID_GUID",ERROR_PASSWORD_MISSING_MESSAGE:"Password is mandatory for a password group",ERROR_LIMIT_EXCEEDED_MESSAGE:"Limit Exceeded Max limit of %s",ERROR_USER_NOT_LOGGED_IN_MESSAGE:"Please log in to CometChat before calling this method",ERROR_INVALID_GUID_MESSAGE:"Please provide a valid GUID",ERROR_DEFAULT_MESSAGE:"Something went wrong",ERR_SETTINGS_HASH_OUTDATED:"ERR_SETTINGS_HASH_OUTDATED",ERR_NO_AUTH:"ERR_NO_AUTH"},t.CALL_ERROR={CALL_ALREADY_INITIATED:{code:"CALL_ALREADY_INITIATED",name:"CALL_ALREADY_INITIATED",message:"There is already call in progress",details:{}},ERROR_IN_CALLING:{code:"CALL_IN_PROGRESS",name:"CALL_ALREADY_INITIATED",message:"There is already call in progress",details:{}},CANNOT_ACCEPT_CALL:{code:"OTHER_CALL_ONGOING",name:"OTHER_CALL_ONGOING",message:"There is already a call in progress",details:{}},NOT_INITIALIZED:{code:"NOT_INITIALIZED",name:"NOT_INITIALIZED",message:"Please call the CometChat.init() method before calling any other methods related to CometChat.",details:{}},NOT_LOGGED_IN:{code:"NOT_LOGGED_IN",name:"NOT_LOGGED_IN",message:"Please login before starting a call.",details:{}},SESSION_ID_REQUIRED:{code:"SESSION_ID_REQUIRED",name:"SESSION_ID_REQUIRED",message:"Please make sure you are passing correct session id.",details:{}},JWT_NOT_FOUND:{code:"JWT_NOT_FOUND",name:"JWT_NOT_FOUND",message:"There was some issue while fetching JWT from API.",details:{}},MODULE_NOT_INSTALLED:{code:"ERROR_CALL_MODULE_NOT_FOUND",name:"ERROR_CALL_MODULE_NOT_FOUND",message:"CometChat Calling module not found. Please add the CometChat Calling dependency and try again.",details:{}}},t.PARAMETER_ERROR={PARAMETER_REQUIRED:{code:"%s_NOT_PROVIDED",name:"%s_NOT_PROVIDED",message:"please provide the %s.",details:{}}},t.GENERAL_ERROR={MUST_BE_A_STRING:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a string.",details:{}},MUST_BE_A_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a number.",details:{}},MUST_BE_A_OBJECT:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a object.",details:{}},MUST_BE_AN_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be an array.",details:{}},MUST_BE_A_BOOLEAN:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a boolean.",details:{}},MUST_BE_A_BLOB:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a blob.",details:{}},INVALID:{code:"INVALID_%s",name:"INVALID_%s",message:"Invalid %s. Please provide a valid %s.",details:{}},METHOD_COMPULSORY:{code:"%s_IS_COMPULSORY",name:"%s_IS_COMPULSORY",message:"%s is required.",details:{}},LIMIT_EXCEEDED:{code:"ERROR_%s_EXCEEDED",name:"ERROR_%s_EXCEEDED",message:"Limit exceeded max limit of %s.",details:{}},MUST_BE_A_POSITIVE_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a postive integer greater than 0.",details:{}},INVALID_MEDIA_FILE:{code:"INVALID_%s",name:"INVALID_%s",message:"The message type does not match the file's mime type.",details:{}},EMPTY_STRING:{code:"INVALID_%s",name:"INVALID_%s",message:"%s cannot be empty.",details:{}},MISSING_KEY:{code:"MISSING_KEY",name:"MISSING_KEY",message:"The key %s is missing from the %s object.",details:{}},EMPTY_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"The parameter %s should be an array and it cannot be empty.",details:{}},INVALID_SEARCH_KEYWORD:{code:"INVALID_SEARCH_KEYWORD",name:"INVALID_SEARCH_KEYWORD",message:"Invalid search keyword. Please provide a valid search keyword.",details:{}},INVALID_GROUP_PROPERTY:{code:"INVALID_%s",name:"INVALID_%s",message:"Invalid %s provided for the group. Please provide a valid %s.",details:{}},INVALID_USER_PROPERTY:{code:"INVALID_%s",name:"INVALID_%s",message:"Invalid %s provided for a user. Please provide a valid %s.",details:{}},PARAMETER_MUST_BE_A_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as a number.",details:{}},PARAMETER_MUST_BE_AN_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as an array.",details:{}},PARAMETER_MUST_BE_A_BOOLEAN:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as a boolean.",details:{}},PARAMETER_MUST_BE_A_POSITIVE_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter to be a positive number greater than 0.",details:{}},PARAMETER_MUST_BE_A_STRING:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as a string.",details:{}},PARAMETER_COMPULSORY:{code:"%s_IS_COMPULSORY",name:"%s_IS_COMPULSORY",message:"%s cannot be blank. Please provide a valid %s.",details:{}},PASSWORD_COMPULSORY:{code:"%s_IS_COMPULSORY",name:"%s_IS_COMPULSORY",message:"Password is mandatory for a password group.",details:{}},INVALID_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"%s",details:{}}},t.ReceiptErrors={MISSING_PARAMETERS:{code:"MISSING_PARAMETERS",name:"MISSING_PARAMETERS",message:"Expected 4 parameters received 3",details:{}},INVALID_PARAMETER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s",details:{}},NO_WEBSOCKET_CONNECTION:{code:"NO_WEBSOCKET_CONNECTION",name:"NO_WEBSOCKET_CONNECTION",message:"Connection to our Websockets server is broken. Please retry after some time.",details:{}},RECEIPTS_TEMPORARILY_BLOCKED:{code:"RECEIPTS_TEMPORARILY_BLOCKED",name:"RECEIPTS_TEMPORARILY_BLOCKED",message:"Due to high load. Receipts have been blocked for your app.",details:{}},UNKNOWN_ERROR_OCCURRED:{code:"UNKNOWN_ERROR_OCCURRED",name:"UNKNOWN_ERROR_OCCURRED",message:"Unknown error occurred while marking a message as read.",details:{}}},t.UserErrors={INVALID_STATUS:new E.CometChatException({code:"INVALID_STATUS_VALUE",name:"INVALID_STATUS_VALUE",message:"The `status` parameter accepts only `online` or `offline`.",details:""}),INVALID_DIRECTION:new E.CometChatException({code:"INVALID_DIRECTION_VALUE",name:"INVALID_DIRECTION_VALUE",message:"The `direction` parameter accepts only `both`, `blockeyByMe` or `hasBlockedMe`.",details:""}),USER_NOT_LOGGED_IN:new E.CometChatException({code:"USER_NOT_LOGGED_IN",name:"USER_NOT_LOGGED_IN",message:"Please log in to CometChat before calling this method.",details:""})},t.GroupErrors={NOT_A_GROUP:new E.CometChatException({code:"NOT_A_GROUP",message:"Please use group class to construct a new group."}),INVALID_SCOPE:new E.CometChatException({code:"INVALID_SCOPE_VALUE",name:"INVALID_SCOPE_VALUE",message:"Scope can be `admin`, `moderator` or `participant`.",details:""}),INVALID_GROUP_TYPE:new E.CometChatException({code:"INVALID_GROUP_TYPE",name:"INVALID_GROUP_TYPE",message:"Group type can be `public`, `private`, `protected` or `password`.",details:""})},t.ConversationErrors={INVALID_CONVERSATION_TYPE:{code:"INVALID_CONVERSATION_TYPE",name:"INVALID_CONVERSATION_TYPE",message:"Conversation type can be `user` or `group`.",details:"Please check the value of conversationType."},CONVERSATION_NOT_FOUND:{code:"CONVERSATION_NOT_FOUND",name:"CONVERSATION_NOT_FOUND",message:"Conversation for %s %s not found.",details:"Please check the value of conversationWith and conversationType."}},t.AIErrors={NO_CONVERSATION_STARTER:{code:"NO_CONVERSATION_STARTER",name:"NO_CONVERSATION_STARTER",message:"Unable to get conversation starter for this conversation.",details:""},NO_SMART_REPLY:{code:"NO_SMART_REPLY",name:"NO_SMART_REPLY",message:"Unable to get smart reply for this conversation.",details:""},NO_CONVERSATION_SUMMARY:{code:"NO_CONVERSATION_SUMMARY",name:"NO_CONVERSATION_SUMMARY",message:"Unable to get summary of the conversation.",details:""},NO_ASSISTANCE:{code:"EMPTY_RESPONSE",name:"EMPTY_RESPONSE",message:"Unable to get a suggestion.",details:""}},t.ExtensionErrors={INVALID_EXTENSION:{code:"ERROR_INVALID_EXTENSION",name:"ERROR_INVALID_EXTENSION",message:"The provided extension cannot be null or empty. Please provide a valid extension.",details:{}},EXTENSION_NOT_FOUND:{code:"ERROR_EXTENSION_NOT_FOUND",name:"ERROR_EXTENSION_NOT_FOUND",message:"The provided extension could not be found.",details:{}}},t.AIFeatureError={INVALID_AI_FEATURE:{code:"ERROR_INVALID_AI_FEATURE",name:"ERROR_INVALID_AI_FEATURE",message:"The provided AI Feature cannot be null or empty. Please provide a valid AI Feature.",details:{}}},t.MessageErrors={INVALID_RECEIVER_TYPE:{code:"INVALID_RECEIVER_TYPE",name:"INVALID_RECEIVER_TYPE",message:"Receiver type can be `user` or `group`.",details:"Please check the value of receiverType."}},t.FeatureRestrictionErrors={INVALID_FEATURE:{code:"ERROR_INVALID_FEATURE",name:"ERROR_INVALID_FEATURE",message:"The provided feature cannot be null or empty. Please provide a valid feature.",details:{}},FEATURE_NOT_FOUND:{code:"ERROR_FEATURE_NOT_FOUND",name:"ERROR_FEATURE_NOT_FOUND",message:"The provided feature could not be found.",details:{}}},t.PresenceConstatnts={STATUS:{ONLINE:"online",AVAILABLE:"available",OFFLINE:"offline",JOINED:"JOINED",LEFT:"LEFT"}},t.APP_SETTINGS={APP_SETTINGS:"app_settings",KEYS:{CHAT_HOST:"CHAT_HOST",CHAT_USE_SSL:"CHAT_USE_SSL",GROUP_SERVICE:"GROUP_SERVICE",CALL_SERVICE:"CALL_SERVICE",CHAT_WS_PORT:"CHAT_WS_PORT",CHAT_WSS_PORT:"CHAT_WSS_PORT",CHAT_HTTP_BIND_PORT:"CHAT_HTTP_BIND_PORT",CHAT_HTTPS_BIND_PORT:"CHAT_HTTPS_BIND_PORT",ADMIN_API_HOST:"ADMIN_API_HOST",CLIENT_API_HOST:"CLIENT_API_HOST",WEBRTC_HOST:"WEBRTC_HOST",WEBRTC_USE_SSL:"WEBRTC_USE_SSL",WEBRTC_WS_PORT:"WEBRTC_WS_PORT",WEBRTC_WSS_PORT:"WEBRTC_WSS_PORT",WEBRTC_HTTP_BIND_PORT:"WEBRTC_HTTP_BIND_PORT",WEBRTC_HTTPS_BIND_PORT:"WEBRTC_HTTPS_BIND_PORT",EXTENSION_LIST:"extensions",EXTENSION_KEYS:{ID:"id",NAME:"name"},JID_HOST_OVERRIDE:"JID_HOST_OVERRIDE",CHAT_HOST_OVERRIDE:"CHAT_HOST_OVERRIDE",CHAT_HOST_APP_SPECIFIC:"CHAT_HOST_APP_SPECIFIC",MODE:"MODE",CONNECTION_TYPE:"connection_type",DEFAULT_MODE:"DEFAULT",LIMITED_TRANSIENT:"LIMITED_TRANSIENT",NO_TRANSIENT:"NO_TRANSIENT",POLLING_ENABLED:"POLLING_ENABLED",POLLING_INTERVAL:"POLLING_INTERVAL",ANALYTICS_PING_DISABLED:"ANALYTICS_PING_DISABLED",ANALYTICS_HOST:"ANALYTICS_HOST",ANALYTICS_VERSION:"ANALYTICS_VERSION",ANALYTICS_USE_SSL:"ANALYTICS_USE_SSL",SETTINGS_HASH:"settingsHash",SETTINGS_HASH_RECEIVED_AT:"settingsHashReceivedAt",DENY_FALLBACK_TO_POLLING:"DENY_FALLBACK_TO_POLLING",APP_VERSION:"APP_VERSION",MAIN_DOMAIN:"MAIN_DOMAIN",CHAT_API_VERSION:"CHAT_API_VERSION",WS_API_VERSION:"WS_API_VERSION",REGION:"REGION",EXTENSION_DOMAIN:"EXTENSION_DOMAIN",WEBRTC_API_SUBDOMAIN:"WEBRTC_API_SUBDOMAIN",SECURED_MEDIA_HOST:"SECURED_MEDIA_HOST",PARAMETERS:"parameters",CORE_CONVERSATIONS_UPDATE_ON_CALL_ACTIVITIES:"core.conversations.updateOnCallActivity",CORE_CONVERSATIONS_UPDATE_ON_GROUP_ACTIONS:"core.conversations.updateOnGroupActions",CORE_CONVERSATIONS_UPDATE_ON_CUSTOM_MESSAGES:"core.conversations.updateOnCustomMessage",CORE_CONVERSATIONS_UPDATE_ON_REPLIES:"core.conversations.updateOnReplies"}},t.COMMON_UTILITY_CONSTANTS={TYPE_CONSTANTS:{BOOLEAN:"boolean",STRING:"string",OBJECT:"object",NUMBER:"number"}},t.CONNECTION_STATUS={CONNECTED:"connected",CONNECTING:"connecting",DISCONNECTED:"disconnected",FEATURE_THROTTLED:"featureThrottled"},(a=t.REACTION_ACTION||(t.REACTION_ACTION={})).REACTION_ADDED="message_reaction_added",a.REACTION_REMOVED="message_reaction_removed",t.API_ERROR_CODES={AUTH_ERR_AUTH_TOKEN_NOT_FOUND:"AUTH_ERR_AUTH_TOKEN_NOT_FOUND"},t.PROSODY_API={DOMAIN_PREFIX:"xmpp",PATH:{ROOM:"room",ROOM_SIZE:"roo