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sBrS,GACpC,MAAQgS,YAAY,kBAAEoC,IAAwBpU,EAC9C,GAAKoU,EAIL,OAAOxP,EAAgB5E,EAAQoU,K,8CC/B1B,MAAM5H,EAAmBH,IAC9B,MAAM,SAAEwJ,EAAF,aAAYxI,EAAZ,SAA0BN,GAAa,IAAIL,IAAIL,GAErD,GAAiB,QAAbwJ,EAAoB,OAExB,MAAM,iBACJtI,EADI,mBAEJtF,EAFI,wBAGJuF,EAHI,aAIJ/F,EAJI,oBAKJsG,IACErE,EAAAA,EAAAA,MAEEoM,EAAS/I,EAASgJ,QAAQ,QAAS,IACnC5I,EAAiC,GAKvC,OAJAE,EAAalJ,SAAQ,CAAC6R,EAAOC,KAC3B9I,EAAO8I,GAAOD,KAGRF,GACN,IAAK,UAAW,CACd,MAAM,OACJI,EADI,KACIC,EADJ,QACUtI,EADV,UACmBI,EADnB,WAC8BC,GAChCf,EAEW,qBAAX+I,IACE/I,EAAOW,eAAe,cAAgBX,EAAOW,eAAe,cAC9DC,EAAoB,CAClB7I,SAAUgR,EACVlI,WAAYC,GAAaC,IAG3BjG,EAAmB,CACjB/C,SAAUgR,EACV1O,UAAWmG,OAAOwI,GAClBvI,UAAWD,OAAOE,MAIxB,MAEF,IAAK,cAAe,CAClB,MAAM,KACJsI,EADI,QACEhG,GACJhD,EAEJ1F,EAAa,CACXtG,QAASwM,OAAOwC,GAChB/O,GAAI+U,IAEN,MAEF,IAAK,KAIH,MAEF,IAAK,OAAQ,CACX,MAAM,OAAEC,GAAWjJ,EAEnBI,EAAiB,CAAEnB,KAAMgK,IACzB,MAEF,IAAK,cAAe,CAClB,MAAM,IAAEC,GAAQlJ,EAEhBK,EAAwB,CACtBC,oBAAqB4I,IAEvB","sources":["webpack://telegram-t/./src/components/right/DeleteMemberModal.tsx","webpack://telegram-t/./src/hooks/useThrottle.ts","webpack://telegram-t/./src/modules/actions/api/chats.ts","webpack://telegram-t/./src/modules/actions/ui/calls.ts","webpack://telegram-t/./src/modules/reducers/calls.ts","webpack://telegram-t/./src/modules/selectors/calls.ts","webpack://telegram-t/./src/util/deeplink.ts"],"sourcesContent":["import React, { FC, useCallback, memo } from '../../lib/teact/teact';\nimport { withGlobal } from '../../lib/teact/teactn';\n\nimport { GlobalActions } from '../../global/types';\nimport { ApiChat } from '../../api/types';\n\nimport { pick } from '../../util/iteratees';\nimport { selectCurrentChat, selectUser } from '../../modules/selectors';\nimport { getUserFirstOrLastName } from '../../modules/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n userId?: string;\n onClose: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n contactName?: string;\n};\n\ntype DispatchProps = Pick;\n\nconst DeleteMemberModal: FC = ({\n isOpen,\n chat,\n userId,\n contactName,\n onClose,\n deleteChatMember,\n}) => {\n const lang = useLang();\n\n const handleDeleteChatMember = useCallback(() => {\n deleteChatMember({ chatId: chat!.id, userId });\n onClose();\n }, [chat, deleteChatMember, onClose, userId]);\n\n if (!chat || !userId) {\n return undefined;\n }\n\n return (\n \n

{renderText(lang('PeerInfo.Confirm.RemovePeer', contactName))}

\n \n \n \n );\n};\n\nexport default memo(withGlobal(\n (global, { userId }): StateProps => {\n const chat = selectCurrentChat(global);\n const user = userId && selectUser(global, userId);\n const contactName = user ? getUserFirstOrLastName(user) : undefined;\n\n return {\n chat,\n contactName,\n };\n },\n (setGlobal, actions): DispatchProps => pick(actions, ['deleteChatMember']),\n)(DeleteMemberModal));\n","import { useMemo } from '../lib/teact/teact';\n\nimport { throttle } from '../util/schedulers';\n\nexport default (ms: number, noFirst = false) => {\n return useMemo(() => {\n return throttle((cb) => cb(), ms, !noFirst);\n }, [ms, noFirst]);\n};\n","import {\n addReducer, getDispatch, getGlobal, setGlobal,\n} from '../../../lib/teact/teactn';\n\nimport {\n ApiChat, ApiUser, ApiChatFolder, MAIN_THREAD_ID,\n} from '../../../api/types';\nimport { NewChatMembersProgress, ChatCreationProgress, ManagementProgress } from '../../../types';\nimport { GlobalActions } from '../../../global/types';\n\nimport {\n ARCHIVED_FOLDER_ID,\n TOP_CHAT_MESSAGES_PRELOAD_LIMIT,\n CHAT_LIST_LOAD_SLICE,\n TIPS_USERNAME,\n LOCALIZED_TIPS,\n RE_TG_LINK,\n SERVICE_NOTIFICATIONS_USER_ID,\n TMP_CHAT_ID,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n addChats,\n addUsers,\n replaceThreadParam,\n updateChatListIds,\n updateChats,\n updateChat,\n updateChatListSecondaryInfo,\n updateManagementProgress,\n leaveChat,\n} from '../../reducers';\nimport {\n selectChat,\n selectUser,\n selectChatListType,\n selectIsChatPinned,\n selectChatFolder,\n selectSupportChat,\n selectChatByUsername,\n selectThreadTopMessageId,\n selectCurrentMessageList,\n selectThreadInfo, selectCurrentChat, selectLastServiceNotification,\n} from '../../selectors';\nimport { buildCollectionByKey, omit } from '../../../util/iteratees';\nimport { debounce, pause, throttle } from '../../../util/schedulers';\nimport {\n isChatSummaryOnly, isChatArchived, prepareChatList, isChatBasicGroup,\n} from '../../helpers';\nimport { processDeepLink } from '../../../util/deeplink';\nimport { updateGroupCall } from '../../reducers/calls';\nimport { selectGroupCall } from '../../selectors/calls';\n\nconst TOP_CHAT_MESSAGES_PRELOAD_INTERVAL = 100;\nconst CHATS_PRELOAD_INTERVAL = 300;\n\nconst runThrottledForLoadChats = throttle((cb) => cb(), CHATS_PRELOAD_INTERVAL, true);\nconst runThrottledForLoadTopChats = throttle((cb) => cb(), 3000, true);\nconst runDebouncedForLoadFullChat = debounce((cb) => cb(), 500, false, true);\n\naddReducer('preloadTopChatMessages', (global, actions) => {\n (async () => {\n const preloadedChatIds: string[] = [];\n\n for (let i = 0; i < TOP_CHAT_MESSAGES_PRELOAD_LIMIT; i++) {\n await pause(TOP_CHAT_MESSAGES_PRELOAD_INTERVAL);\n\n const {\n byId,\n listIds: { active: listIds },\n orderedPinnedIds: { active: orderedPinnedIds },\n } = getGlobal().chats;\n if (!listIds) {\n return;\n }\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const { pinnedChats, otherChats } = prepareChatList(byId, listIds, orderedPinnedIds);\n const topChats = [...pinnedChats, ...otherChats];\n const chatToPreload = topChats.find(({ id }) => id !== currentChatId && !preloadedChatIds.includes(id));\n if (!chatToPreload) {\n return;\n }\n\n preloadedChatIds.push(chatToPreload.id);\n\n actions.loadViewportMessages({ chatId: chatToPreload.id, threadId: MAIN_THREAD_ID });\n }\n })();\n});\n\naddReducer('openChat', (global, actions, payload) => {\n const { id, threadId } = payload!;\n const { currentUserId } = global;\n const chat = selectChat(global, id);\n\n if (chat?.hasUnreadMark) {\n actions.toggleChatUnread({ id });\n }\n\n // Please telegram send us some updates about linked chat 🙏\n if (chat && chat.lastMessage && chat.lastMessage.threadInfo) {\n actions.requestThreadInfoUpdate({\n chatId: chat.lastMessage.threadInfo.chatId,\n threadId: chat.lastMessage.threadInfo.threadId,\n });\n }\n\n if (!chat) {\n if (id === currentUserId) {\n void callApi('fetchChat', { type: 'self' });\n } else {\n const user = selectUser(global, id);\n if (user) {\n void callApi('fetchChat', { type: 'user', user });\n }\n }\n } else if (isChatSummaryOnly(chat) && !chat.isMin) {\n actions.requestChatUpdate({ chatId: id });\n }\n\n if (threadId !== MAIN_THREAD_ID) {\n const topMessageId = selectThreadTopMessageId(global, id, threadId);\n if (!topMessageId) {\n actions.requestThreadInfoUpdate({ chatId: id, threadId });\n }\n }\n});\n\naddReducer('openLinkedChat', (global, actions, payload) => {\n const { id } = payload!;\n const chat = selectChat(global, id);\n if (!chat) {\n return;\n }\n\n (async () => {\n const chatFullInfo = await callApi('fetchFullChat', chat);\n\n if (chatFullInfo?.fullInfo?.linkedChatId) {\n actions.openChat({ id: chatFullInfo.fullInfo.linkedChatId });\n }\n })();\n});\n\naddReducer('focusMessageInComments', (global, actions, payload) => {\n const { chatId, threadId, messageId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('requestThreadInfoUpdate', { chat, threadId });\n if (!result) {\n return;\n }\n\n actions.focusMessage({ chatId, threadId, messageId });\n })();\n});\n\naddReducer('openSupportChat', (global, actions) => {\n const chat = selectSupportChat(global);\n if (chat) {\n actions.openChat({ id: chat.id, shouldReplaceHistory: true });\n return;\n }\n\n actions.openChat({ id: TMP_CHAT_ID, shouldReplaceHistory: true });\n\n (async () => {\n const result = await callApi('fetchChat', { type: 'support' });\n if (result) {\n actions.openChat({ id: result.chatId, shouldReplaceHistory: true });\n }\n })();\n});\n\naddReducer('openTipsChat', (global, actions, payload) => {\n const { langCode } = payload;\n\n const usernamePostfix = langCode === 'pt-br'\n ? 'BR'\n : LOCALIZED_TIPS.includes(langCode) ? (langCode as string).toUpperCase() : '';\n\n actions.openChatByUsername({ username: `${TIPS_USERNAME}${usernamePostfix}` });\n});\n\naddReducer('loadMoreChats', (global, actions, payload) => {\n const { listType = 'active' } = payload!;\n const listIds = global.chats.listIds[listType as ('active' | 'archived')];\n const isFullyLoaded = global.chats.isFullyLoaded[listType as ('active' | 'archived')];\n\n if (isFullyLoaded) {\n return;\n }\n\n const oldestChat = listIds\n ? listIds\n .map((id) => global.chats.byId[id])\n .filter((chat) => Boolean(chat?.lastMessage) && !selectIsChatPinned(global, chat.id))\n .sort((chat1, chat2) => (chat1.lastMessage!.date - chat2.lastMessage!.date))[0]\n : undefined;\n\n if (oldestChat) {\n runThrottledForLoadChats(() => loadChats(listType, oldestChat.id, oldestChat.lastMessage!.date));\n } else {\n runThrottledForLoadChats(() => loadChats(listType));\n }\n});\n\naddReducer('preloadArchivedChats', () => {\n (async () => {\n while (!getGlobal().chats.isFullyLoaded.archived) {\n const currentGlobal = getGlobal();\n const listIds = currentGlobal.chats.listIds.archived;\n const oldestChat = listIds\n ? listIds\n .map((id) => currentGlobal.chats.byId[id])\n .filter((chat) => Boolean(chat?.lastMessage) && !selectIsChatPinned(currentGlobal, chat.id))\n .sort((chat1, chat2) => (chat1.lastMessage!.date - chat2.lastMessage!.date))[0]\n : undefined;\n\n await loadChats('archived', oldestChat?.id, oldestChat?.lastMessage!.date);\n await pause(CHATS_PRELOAD_INTERVAL);\n }\n })();\n});\n\naddReducer('loadFullChat', (global, actions, payload) => {\n const { chatId, force } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n if (force) {\n loadFullChat(chat);\n } else {\n runDebouncedForLoadFullChat(() => loadFullChat(chat));\n }\n});\n\naddReducer('loadTopChats', () => {\n runThrottledForLoadTopChats(() => loadChats('active'));\n});\n\naddReducer('requestChatUpdate', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void callApi('requestChatUpdate', {\n chat,\n serverTimeOffset,\n ...(chatId === SERVICE_NOTIFICATIONS_USER_ID && {\n lastLocalMessage: selectLastServiceNotification(global)?.message,\n }),\n });\n});\n\naddReducer('updateChatMutedState', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId, isMuted } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n setGlobal(updateChat(global, chatId, { isMuted }));\n void callApi('updateChatMutedState', { chat, isMuted, serverTimeOffset });\n});\n\naddReducer('createChannel', (global, actions, payload) => {\n const {\n title, about, photo, memberIds,\n } = payload!;\n\n const members = (memberIds as string[])\n .map((id) => selectUser(global, id))\n .filter(Boolean as any);\n\n void createChannel(title, members, about, photo);\n});\n\naddReducer('joinChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const { id: channelId, accessHash } = chat;\n\n if (channelId && accessHash) {\n void callApi('joinChannel', { channelId, accessHash });\n }\n});\n\naddReducer('deleteChatUser', (global, actions, payload) => {\n const { chatId, userId }: { chatId: string; userId: string } = payload!;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n if (!chat || !user) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n void callApi('deleteChatUser', { chat, user });\n});\n\naddReducer('deleteChat', (global, actions, payload) => {\n const { chatId }: { chatId: string } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n void callApi('deleteChat', { chatId: chat.id });\n});\n\naddReducer('leaveChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n const { id: channelId, accessHash } = chat;\n if (channelId && accessHash) {\n void callApi('leaveChannel', { channelId, accessHash });\n }\n});\n\naddReducer('deleteChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n const { id: channelId, accessHash } = chat;\n if (channelId && accessHash) {\n void callApi('deleteChannel', { channelId, accessHash });\n }\n});\n\naddReducer('createGroupChat', (global, actions, payload) => {\n const { title, memberIds, photo } = payload!;\n const members = (memberIds as string[])\n .map((id) => selectUser(global, id))\n .filter(Boolean as any);\n\n void createGroupChat(title, members, photo);\n});\n\naddReducer('toggleChatPinned', (global, actions, payload) => {\n const { id, folderId } = payload!;\n const chat = selectChat(global, id);\n if (!chat) {\n return;\n }\n\n if (folderId) {\n const folder = selectChatFolder(global, folderId);\n if (folder) {\n const shouldBePinned = !selectIsChatPinned(global, id, folderId);\n\n const { pinnedChatIds, includedChatIds } = folder;\n const newPinnedIds = shouldBePinned\n ? [id, ...(pinnedChatIds || [])]\n : (pinnedChatIds || []).filter((pinnedId) => pinnedId !== id);\n\n // With both Pin and Unpin we need to re-add a user to the included group\n const newIncludedChatIds = [id, ...includedChatIds];\n\n void callApi('editChatFolder', {\n id: folderId,\n folderUpdate: {\n ...folder,\n pinnedChatIds: newPinnedIds,\n includedChatIds: newIncludedChatIds,\n },\n });\n }\n } else {\n const listType = selectChatListType(global, id);\n const isPinned = selectIsChatPinned(global, id, listType === 'archived' ? ARCHIVED_FOLDER_ID : undefined);\n void callApi('toggleChatPinned', { chat, shouldBePinned: !isPinned });\n }\n});\n\naddReducer('toggleChatArchived', (global, actions, payload) => {\n const { id } = payload!;\n const chat = selectChat(global, id);\n if (chat) {\n void callApi('toggleChatArchived', {\n chat,\n folderId: isChatArchived(chat) ? 0 : ARCHIVED_FOLDER_ID,\n });\n }\n});\n\naddReducer('loadChatFolders', () => {\n void loadChatFolders();\n});\n\naddReducer('loadRecommendedChatFolders', () => {\n void loadRecommendedChatFolders();\n});\n\naddReducer('editChatFolders', (global, actions, payload) => {\n const { chatId, idsToRemove, idsToAdd } = payload!;\n\n (idsToRemove as number[]).forEach(async (id) => {\n const folder = selectChatFolder(global, id);\n if (folder) {\n await callApi('editChatFolder', {\n id,\n folderUpdate: {\n ...folder,\n pinnedChatIds: folder.pinnedChatIds?.filter((pinnedId) => pinnedId !== chatId),\n includedChatIds: folder.includedChatIds.filter((includedId) => includedId !== chatId),\n },\n });\n }\n });\n\n (idsToAdd as number[]).forEach(async (id) => {\n const folder = selectChatFolder(global, id);\n if (folder) {\n await callApi('editChatFolder', {\n id,\n folderUpdate: {\n ...folder,\n includedChatIds: folder.includedChatIds.concat(chatId),\n },\n });\n }\n });\n});\n\naddReducer('editChatFolder', (global, actions, payload) => {\n const { id, folderUpdate } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void callApi('editChatFolder', {\n id,\n folderUpdate: {\n id,\n emoticon: folder.emoticon,\n pinnedChatIds: folder.pinnedChatIds,\n ...folderUpdate,\n },\n });\n }\n});\n\naddReducer('addChatFolder', (global, actions, payload) => {\n const { folder } = payload!;\n const { orderedIds } = global.chatFolders;\n const maxId = orderedIds?.length ? Math.max.apply(Math.max, orderedIds) : ARCHIVED_FOLDER_ID;\n\n void createChatFolder(folder, maxId);\n});\n\naddReducer('deleteChatFolder', (global, actions, payload) => {\n const { id } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void deleteChatFolder(id);\n }\n});\n\naddReducer('toggleChatUnread', (global, actions, payload) => {\n const { id } = payload!;\n const { serverTimeOffset } = global;\n const chat = selectChat(global, id);\n if (chat) {\n if (chat.unreadCount) {\n void callApi('markMessageListRead', { serverTimeOffset, chat, threadId: MAIN_THREAD_ID });\n } else {\n void callApi('toggleDialogUnread', {\n chat,\n hasUnreadMark: !chat.hasUnreadMark,\n });\n }\n }\n});\n\naddReducer('openChatByInvite', (global, actions, payload) => {\n const { hash } = payload!;\n\n (async () => {\n const result = await callApi('openChatByInvite', hash);\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.chatId });\n })();\n});\n\naddReducer('openTelegramLink', (global, actions, payload) => {\n const { url } = payload!;\n if (url.match(RE_TG_LINK)) {\n processDeepLink(url.match(RE_TG_LINK)[0]);\n return;\n }\n\n const uri = new URL(url.startsWith('http') ? url : `https://${url}`);\n const [part1, part2, part3] = uri.pathname.split('/').filter(Boolean).map((l) => decodeURI(l));\n const params = Object.fromEntries(uri.searchParams);\n\n let hash: string | undefined;\n if (part1 === 'joinchat') {\n hash = part2;\n }\n\n if (part1.startsWith(' ') || part1.startsWith('+')) {\n hash = part1.substr(1, part1.length - 1);\n }\n\n if (hash) {\n actions.openChatByInvite({ hash });\n return;\n }\n\n if (part1 === 'addstickers') {\n actions.openStickerSetShortName({\n stickerSetShortName: part2,\n });\n return;\n }\n\n const chatOrChannelPostId = part2 ? Number(part2) : undefined;\n const messageId = part3 ? Number(part3) : undefined;\n const commentId = params.comment ? Number(params.comment) : undefined;\n\n if (params.hasOwnProperty('voicechat') || params.hasOwnProperty('livestream')) {\n actions.joinVoiceChatByLink({\n username: part1,\n inviteHash: params.voicechat || params.livestream,\n });\n } else if (part1 === 'c' && chatOrChannelPostId && messageId) {\n actions.focusMessage({\n chatId: -chatOrChannelPostId,\n messageId,\n });\n } else {\n actions.openChatByUsername({\n username: part1,\n messageId: messageId || chatOrChannelPostId,\n commentId,\n });\n }\n});\n\naddReducer('acceptInviteConfirmation', (global, actions, payload) => {\n const { hash } = payload!;\n (async () => {\n const result = await callApi('importChatInvite', { hash });\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.id });\n })();\n});\n\naddReducer('openChatByUsername', (global, actions, payload) => {\n const { username, messageId, commentId } = payload!;\n\n (async () => {\n const chat = selectCurrentChat(global);\n\n if (!commentId) {\n if (chat && chat.username === username) {\n actions.focusMessage({ chatId: chat.id, messageId });\n return;\n }\n await openChatByUsername(actions, username, messageId);\n return;\n }\n\n const { chatId, type } = selectCurrentMessageList(global) || {};\n const usernameChat = selectChatByUsername(global, username);\n if (chatId && usernameChat && type === 'thread') {\n const threadInfo = selectThreadInfo(global, chatId, messageId);\n\n if (threadInfo && threadInfo.chatId === chatId) {\n actions.focusMessage({\n chatId: threadInfo.chatId,\n threadId: threadInfo.threadId,\n messageId: commentId,\n });\n return;\n }\n }\n\n if (!messageId) return;\n\n await openCommentsByUsername(actions, username, messageId, commentId);\n })();\n});\n\naddReducer('togglePreHistoryHidden', (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n let chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n void callApi('togglePreHistoryHidden', { chat, isEnabled });\n })();\n});\n\naddReducer('updateChatDefaultBannedRights', (global, actions, payload) => {\n const { chatId, bannedRights } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('updateChatDefaultBannedRights', { chat, bannedRights });\n});\n\naddReducer('updateChatMemberBannedRights', (global, actions, payload) => {\n const { chatId, userId, bannedRights } = payload!;\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatMemberBannedRights', { chat, user, bannedRights });\n\n const newGlobal = getGlobal();\n const chatAfterUpdate = selectChat(newGlobal, chatId);\n\n if (!chatAfterUpdate || !chatAfterUpdate.fullInfo) {\n return;\n }\n\n const { members, kickedMembers } = chatAfterUpdate.fullInfo;\n\n const isBanned = !!bannedRights.viewMessages;\n const isUnblocked = !Object.keys(bannedRights).length;\n\n setGlobal(updateChat(newGlobal, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(members && isBanned && {\n members: members.filter((m) => m.userId !== userId),\n }),\n ...(members && !isBanned && {\n members: members.map((m) => (\n m.userId === userId\n ? { ...m, bannedRights }\n : m\n )),\n }),\n ...(isUnblocked && kickedMembers && {\n kickedMembers: kickedMembers.filter((m) => m.userId !== userId),\n }),\n },\n }));\n })();\n});\n\naddReducer('updateChatAdmin', (global, actions, payload) => {\n const {\n chatId, userId, adminRights, customTitle,\n } = payload!;\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatAdmin', {\n chat, user, adminRights, customTitle,\n });\n\n const newGlobal = getGlobal();\n const chatAfterUpdate = selectChat(newGlobal, chatId);\n\n if (!chatAfterUpdate || !chatAfterUpdate.fullInfo) {\n return;\n }\n\n const { adminMembers } = chatAfterUpdate.fullInfo;\n\n const isDismissed = !Object.keys(adminRights).length;\n\n setGlobal(updateChat(newGlobal, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(adminMembers && isDismissed && {\n adminMembers: adminMembers.filter((m) => m.userId !== userId),\n }),\n ...(adminMembers && !isDismissed && {\n adminMembers: adminMembers.map((m) => (\n m.userId === userId\n ? { ...m, adminRights, customTitle }\n : m\n )),\n }),\n },\n }));\n })();\n});\n\naddReducer('updateChat', (global, actions, payload) => {\n const {\n chatId, title, about, photo,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.InProgress));\n\n await Promise.all([\n chat.title !== title\n ? callApi('updateChatTitle', chat, title)\n : undefined,\n chat.fullInfo && chat.fullInfo.about !== about\n ? callApi('updateChatAbout', chat, about)\n : undefined,\n photo\n ? callApi('editChatPhoto', { chatId, accessHash: chat.accessHash, photo })\n : undefined,\n ]);\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.Complete));\n })();\n});\n\naddReducer('toggleSignatures', (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('toggleSignatures', { chat, isEnabled });\n});\n\naddReducer('loadGroupsForDiscussion', () => {\n (async () => {\n const groups = await callApi('fetchGroupsForDiscussion');\n if (!groups) {\n return;\n }\n\n const addedById = groups.reduce((result, group) => {\n if (group) {\n result[group.id] = group;\n }\n\n return result;\n }, {} as Record);\n\n const global = addChats(getGlobal(), addedById);\n setGlobal({\n ...global,\n chats: {\n ...global.chats,\n forDiscussionIds: Object.keys(addedById),\n },\n });\n })();\n});\n\naddReducer('linkDiscussionGroup', (global, actions, payload) => {\n const { channelId, chatId } = payload!;\n\n const channel = selectChat(global, channelId);\n let chat = selectChat(global, chatId);\n if (!channel || !chat) {\n return;\n }\n\n (async () => {\n if (isChatBasicGroup(chat)) {\n chat = await callApi('migrateChat', chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n let { fullInfo } = chat;\n if (!fullInfo) {\n const fullChat = await callApi('fetchFullChat', chat);\n if (!fullChat) {\n return;\n }\n\n fullInfo = fullChat.fullInfo;\n }\n\n if (fullInfo!.isPreHistoryHidden) {\n await callApi('togglePreHistoryHidden', { chat, isEnabled: false });\n }\n\n void callApi('setDiscussionGroup', { channel, chat });\n })();\n});\n\naddReducer('unlinkDiscussionGroup', (global, actions, payload) => {\n const { channelId } = payload!;\n\n const channel = selectChat(global, channelId);\n if (!channel) {\n return;\n }\n\n let chat: ApiChat | undefined;\n if (channel.fullInfo?.linkedChatId) {\n chat = selectChat(global, channel.fullInfo.linkedChatId);\n }\n\n (async () => {\n await callApi('setDiscussionGroup', { channel });\n if (chat) {\n loadFullChat(chat);\n }\n })();\n});\n\naddReducer('setActiveChatFolder', (global, actions, payload) => {\n return {\n ...global,\n chatFolders: {\n ...global.chatFolders,\n activeChatFolder: payload,\n },\n };\n});\n\naddReducer('loadMoreMembers', (global) => {\n (async () => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n if (!chat || isChatBasicGroup(chat)) {\n return;\n }\n\n const offset = (chat.fullInfo?.members?.length) || undefined;\n const result = await callApi('fetchMembers', chat.id, chat.accessHash!, 'recent', offset);\n if (!result) {\n return;\n }\n\n const { members, users } = result;\n if (!members || !members.length) {\n return;\n }\n\n global = getGlobal();\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = updateChat(global, chat.id, {\n fullInfo: {\n ...chat.fullInfo,\n members: [\n ...((chat.fullInfo || {}).members || []),\n ...(members || []),\n ],\n },\n });\n setGlobal(global);\n })();\n});\n\naddReducer('addChatMembers', (global, actions, payload) => {\n const { chatId, memberIds } = payload;\n const chat = selectChat(global, chatId);\n const users = (memberIds as string[]).map((userId) => selectUser(global, userId)).filter(Boolean as any);\n\n if (!chat || !users.length) {\n return;\n }\n\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Loading);\n (async () => {\n await callApi('addChatMembers', chat, users);\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Closed);\n loadFullChat(chat);\n })();\n});\n\naddReducer('deleteChatMember', (global, actions, payload) => {\n const { chatId, userId } = payload;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n (async () => {\n await callApi('deleteChatMember', chat, user);\n loadFullChat(chat);\n })();\n});\n\nasync function loadChats(listType: 'active' | 'archived', offsetId?: string, offsetDate?: number) {\n let global = getGlobal();\n\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n offsetDate,\n archived: listType === 'archived',\n withPinned: global.chats.orderedPinnedIds[listType] === undefined,\n serverTimeOffset: global.serverTimeOffset,\n lastLocalServiceMessage: selectLastServiceNotification(global)?.message,\n });\n\n if (!result) {\n return;\n }\n\n const { chatIds } = result;\n\n if (chatIds.length > 0 && chatIds[0] === offsetId) {\n chatIds.shift();\n }\n\n global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateChatListIds(global, listType, chatIds);\n global = updateChatListSecondaryInfo(global, listType, result);\n\n Object.keys(result.draftsById).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId],\n );\n });\n\n Object.keys(result.replyingToById).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\n });\n\n if (chatIds.length === 0 && !global.chats.isFullyLoaded[listType]) {\n global = {\n ...global,\n chats: {\n ...global.chats,\n isFullyLoaded: {\n ...global.chats.isFullyLoaded,\n [listType]: true,\n },\n },\n };\n }\n\n setGlobal(global);\n}\n\nexport async function loadFullChat(chat: ApiChat) {\n const result = await callApi('fetchFullChat', chat);\n if (!result) {\n return undefined;\n }\n\n const { users, fullInfo, groupCall } = result;\n\n let global = getGlobal();\n if (users) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n\n if (groupCall) {\n const existingGroupCall = selectGroupCall(global, groupCall.id!);\n global = updateGroupCall(\n global,\n groupCall.id!,\n omit(groupCall, ['connectionState']),\n undefined,\n existingGroupCall ? undefined : groupCall.participantsCount,\n );\n }\n\n global = updateChat(global, chat.id, { fullInfo });\n\n setGlobal(global);\n\n return result;\n}\n\nasync function createChannel(title: string, users: ApiUser[], about?: string, photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n const createdChannel = await callApi('createChannel', { title, about, users });\n if (!createdChannel) {\n return;\n }\n\n const { id: channelId, accessHash } = createdChannel;\n\n let global = getGlobal();\n global = updateChat(global, channelId, createdChannel);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChannel ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getDispatch().openChat({ id: channelId, shouldReplaceHistory: true });\n\n if (channelId && accessHash && photo) {\n await callApi('editChatPhoto', { chatId: channelId, accessHash, photo });\n }\n}\n\nasync function createGroupChat(title: string, users: ApiUser[], photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n try {\n const createdChat = await callApi('createGroupChat', {\n title,\n users,\n });\n\n if (!createdChat) {\n return;\n }\n\n const { id: chatId } = createdChat;\n\n let global = getGlobal();\n global = updateChat(global, chatId, createdChat);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChat ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getDispatch()\n .openChat({\n id: chatId,\n shouldReplaceHistory: true,\n });\n\n if (chatId && photo) {\n await callApi('editChatPhoto', {\n chatId,\n photo,\n });\n }\n } catch (e) {\n if (e.message === 'USERS_TOO_FEW') {\n const global = getGlobal();\n setGlobal({\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: ChatCreationProgress.Error,\n error: 'CreateGroupError',\n },\n });\n }\n }\n}\n\nasync function loadChatFolders() {\n const chatFolders = await callApi('fetchChatFolders');\n\n if (chatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n ...chatFolders,\n },\n });\n }\n}\n\nasync function loadRecommendedChatFolders() {\n const recommendedChatFolders = await callApi('fetchRecommendedChatFolders');\n\n if (recommendedChatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommendedChatFolders,\n },\n });\n }\n}\n\nasync function createChatFolder(folder: ApiChatFolder, maxId: number) {\n // Clear fields from recommended folders\n const { id: recommendedId, description, ...newFolder } = folder;\n\n await callApi('editChatFolder', {\n id: maxId + 1,\n folderUpdate: {\n id: maxId + 1,\n ...newFolder,\n },\n });\n\n if (!description) {\n return;\n }\n\n const global = getGlobal();\n const { recommended } = global.chatFolders;\n\n if (recommended) {\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommended.filter(({ id }) => id !== recommendedId),\n },\n });\n }\n}\n\nasync function deleteChatFolder(id: number) {\n await callApi('deleteChatFolder', id);\n}\n\nexport async function fetchChatByUsername(\n username: string,\n) {\n const global = getGlobal();\n const localChat = selectChatByUsername(global, username);\n if (localChat && !localChat.isMin) {\n return localChat;\n }\n\n const chat = await callApi('getChatByUsername', username);\n if (!chat) {\n return undefined;\n }\n\n setGlobal(updateChat(getGlobal(), chat.id, chat));\n\n return chat;\n}\n\nasync function openChatByUsername(\n actions: GlobalActions,\n username: string,\n channelPostId?: number,\n) {\n // Open temporary empty chat to make the click response feel faster\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await fetchChatByUsername(username);\n\n if (!chat) {\n actions.openPreviousChat();\n actions.showNotification({ message: 'User does not exist' });\n return;\n }\n\n if (channelPostId) {\n actions.focusMessage({ chatId: chat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: chat.id });\n }\n}\n\nasync function openCommentsByUsername(\n actions: GlobalActions,\n username: string,\n messageId: number,\n commentId: number,\n) {\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await fetchChatByUsername(username);\n\n if (!chat) return;\n\n const global = getGlobal();\n\n const threadInfo = selectThreadInfo(global, chat.id, messageId);\n let discussionChatId: string | undefined;\n\n if (!threadInfo) {\n const result = await callApi('requestThreadInfoUpdate', { chat, threadId: messageId });\n if (!result) return;\n\n discussionChatId = result.discussionChatId;\n } else {\n discussionChatId = threadInfo.chatId;\n }\n\n if (!discussionChatId) return;\n\n actions.focusMessage({\n chatId: discussionChatId,\n threadId: messageId,\n messageId: Number(commentId),\n });\n}\n","import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\nimport { selectActiveGroupCall, selectChatGroupCall, selectGroupCall } from '../../selectors/calls';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat } from '../../selectors';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport { ApiGroupCall } from '../../../api/types';\nimport { updateGroupCall } from '../../reducers/calls';\nimport { buildCollectionByKey, omit } from '../../../util/iteratees';\nimport { addChats, addUsers } from '../../reducers';\nimport { fetchChatByUsername, loadFullChat } from '../api/chats';\nimport safePlay from '../../../util/safePlay';\nimport { ARE_CALLS_SUPPORTED } from '../../../util/environment';\nimport * as langProvider from '../../../util/langProvider';\n\n// Workaround for Safari not playing audio without user interaction\nlet audioElement: HTMLAudioElement | undefined;\nlet audioContext: AudioContext | undefined;\n\nconst joinAudio = new Audio('./voicechat_join.mp3');\nconst connectingAudio = new Audio('./voicechat_connecting.mp3');\nconnectingAudio.loop = true;\nconst leaveAudio = new Audio('./voicechat_leave.mp3');\nconst allowTalkAudio = new Audio('./voicechat_onallowtalk.mp3');\n\nconst sounds: Record = {\n join: joinAudio,\n allowTalk: allowTalkAudio,\n leave: leaveAudio,\n connecting: connectingAudio,\n};\n\nlet initializationPromise: Promise | undefined = Promise.resolve();\n\nconst initializeSoundsForSafari = () => {\n if (!initializationPromise) return Promise.resolve();\n\n initializationPromise = Promise.all(Object.values(sounds).map((l) => {\n l.muted = true;\n l.volume = 0.0001;\n return l.play().then(() => {\n l.pause();\n l.volume = 1;\n l.currentTime = 0;\n l.muted = false;\n });\n })).then(() => {\n initializationPromise = undefined;\n });\n\n return initializationPromise;\n};\n\nasync function fetchGroupCall(groupCall: Partial) {\n const result = await callApi('getGroupCall', {\n call: groupCall,\n });\n\n if (!result) return undefined;\n\n let global = getGlobal();\n\n const existingGroupCall = selectGroupCall(global, groupCall.id!);\n\n global = updateGroupCall(global,\n groupCall.id!,\n omit(result.groupCall, ['connectionState']),\n undefined,\n existingGroupCall?.isLoaded ? undefined : result.groupCall.participantsCount);\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addChats(global, buildCollectionByKey(result.chats, 'id'));\n\n setGlobal(global);\n\n return result.groupCall;\n}\n\nasync function fetchGroupCallParticipants(groupCall: Partial, nextOffset?: string) {\n const result = await callApi('fetchGroupCallParticipants', {\n call: groupCall as ApiGroupCall,\n offset: nextOffset,\n });\n\n if (!result) return;\n\n let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addChats(global, buildCollectionByKey(result.chats, 'id'));\n\n setGlobal(global);\n}\n\naddReducer('toggleGroupCallPanel', (global) => {\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n isGroupCallPanelHidden: !global.groupCalls.isGroupCallPanelHidden,\n },\n };\n});\n\naddReducer('subscribeToGroupCallUpdates', (global, actions, payload) => {\n const { subscribed, id } = payload!;\n const groupCall = selectGroupCall(global, id);\n\n if (!groupCall) return;\n\n (async () => {\n if (subscribed) {\n await fetchGroupCall(groupCall);\n await fetchGroupCallParticipants(groupCall);\n }\n\n await callApi('toggleGroupCallStartSubscription', {\n subscribed,\n call: groupCall,\n });\n })();\n});\n\naddReducer('createGroupCall', (global, actions, payload) => {\n const { chatId } = payload;\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n (async () => {\n const result = await callApi('createGroupCall', {\n peer: chat,\n });\n\n if (!result) return;\n\n global = getGlobal();\n setGlobal(updateGroupCall(global, result.id, {\n ...result,\n chatId,\n }));\n\n actions.joinGroupCall({ id: result.id, accessHash: result.accessHash });\n })();\n});\n\naddReducer('createGroupCallInviteLink', (global, actions) => {\n const groupCall = selectActiveGroupCall(global);\n\n if (!groupCall) {\n return;\n }\n\n (async () => {\n const result = await callApi('exportGroupCallInvite', {\n call: groupCall,\n canSelfUnmute: false,\n });\n\n if (!result) return;\n\n copyTextToClipboard(result);\n actions.showNotification({\n message: 'Link copied to clipboard',\n });\n })();\n});\n\naddReducer('joinVoiceChatByLink', (global, actions, payload) => {\n const { username, inviteHash } = payload!;\n\n (async () => {\n const chat = await fetchChatByUsername(username);\n\n if (!chat) {\n actions.showNotification({ message: langProvider.getTranslation('NoUsernameFound') });\n return;\n }\n\n const full = await loadFullChat(chat);\n\n if (full?.groupCall) {\n actions.joinGroupCall({ id: full.groupCall.id, accessHash: full.groupCall.accessHash, inviteHash });\n }\n })();\n});\n\naddReducer('joinGroupCall', (global, actions, payload) => {\n if (!ARE_CALLS_SUPPORTED) return;\n\n const {\n chatId, id, accessHash, inviteHash,\n } = payload;\n\n createAudioElement();\n\n (async () => {\n await initializeSoundsForSafari();\n const { groupCalls: { activeGroupCallId } } = global;\n let groupCall = id ? selectGroupCall(global, id) : selectChatGroupCall(global, chatId);\n\n if (groupCall?.id === activeGroupCallId) {\n actions.toggleGroupCallPanel();\n return;\n }\n\n if (activeGroupCallId) {\n actions.leaveGroupCall({\n rejoin: payload,\n });\n return;\n }\n\n if (groupCall && activeGroupCallId === groupCall.id) {\n actions.toggleGroupCallPanel();\n return;\n }\n\n if (!groupCall && (!id || !accessHash)) {\n groupCall = await fetchGroupCall({\n id,\n accessHash,\n });\n }\n\n if (!groupCall) return;\n\n global = getGlobal();\n\n global = updateGroupCall(\n global,\n groupCall.id,\n {\n ...groupCall,\n inviteHash,\n },\n undefined,\n groupCall.participantsCount + 1,\n );\n\n setGlobal({\n ...global,\n groupCalls: {\n ...global.groupCalls,\n activeGroupCallId: groupCall.id,\n isGroupCallPanelHidden: false,\n },\n });\n })();\n});\n\naddReducer('playGroupCallSound', (global, actions, payload) => {\n const { sound } = payload!;\n\n if (!sounds[sound]) {\n return;\n }\n\n if (initializationPromise) {\n initializationPromise.then(() => {\n safePlay(sounds[sound]);\n });\n } else {\n if (sound !== 'connecting') {\n sounds.connecting.pause();\n }\n safePlay(sounds[sound]);\n }\n});\n\naddReducer('loadMoreGroupCallParticipants', (global) => {\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) {\n return;\n }\n\n void fetchGroupCallParticipants(groupCall, groupCall.nextOffset);\n});\n\nfunction createAudioContext() {\n return (new (window.AudioContext || (window as any).webkitAudioContext)());\n}\n\nconst silence = (ctx: AudioContext) => {\n const oscillator = ctx.createOscillator();\n const dst = oscillator.connect(ctx.createMediaStreamDestination());\n oscillator.start();\n return new MediaStream([Object.assign((dst as any).stream.getAudioTracks()[0], { enabled: false })]);\n};\n\nfunction createAudioElement() {\n const ctx = createAudioContext();\n audioElement = new Audio();\n audioContext = ctx;\n audioElement.srcObject = silence(ctx);\n safePlay(audioElement);\n}\n\nexport function getGroupCallAudioElement() {\n return audioElement;\n}\n\nexport function getGroupCallAudioContext() {\n return audioContext;\n}\n\nexport function removeGroupCallAudioElement() {\n audioElement?.pause();\n audioContext = undefined;\n audioElement = undefined;\n}\n","import { GroupCallParticipant } from '../../lib/secret-sauce';\nimport { GlobalState } from '../../global/types';\nimport { ApiGroupCall } from '../../api/types';\nimport { selectGroupCall } from '../selectors/calls';\nimport { omit } from '../../util/iteratees';\nimport { updateChat } from './chats';\nimport { selectChat } from '../selectors';\n\nexport function updateGroupCall(\n global: GlobalState,\n groupCallId: string,\n groupCallUpdate: Partial,\n addToParticipantCount?: number,\n resetParticipantCount?: number,\n): GlobalState {\n const unfiltered = Object.values({\n ...global.groupCalls.byId[groupCallId]?.participants,\n ...groupCallUpdate.participants,\n });\n const filtered = unfiltered.filter((l) => !l.isLeft);\n const participants = filtered.reduce((acc: Record, el) => {\n acc[el.id] = el;\n return acc;\n }, {});\n\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n byId: {\n ...global.groupCalls.byId,\n [groupCallId]: {\n ...global.groupCalls.byId[groupCallId],\n ...omit(groupCallUpdate, ['participantsCount']),\n ...(addToParticipantCount && {\n participantsCount: global.groupCalls.byId[groupCallId].participantsCount + addToParticipantCount,\n }),\n ...(resetParticipantCount !== undefined && {\n participantsCount: resetParticipantCount,\n }),\n participants,\n },\n },\n },\n };\n}\n\nexport function removeGroupCall(\n global: GlobalState,\n groupCallId: string,\n): GlobalState {\n const groupCall = selectGroupCall(global, groupCallId);\n if (groupCall && groupCall.chatId) {\n const chat = selectChat(global, groupCall.chatId);\n if (chat) {\n global = updateChat(global, groupCall.chatId, {\n fullInfo: {\n ...chat.fullInfo,\n groupCallId: undefined,\n },\n });\n }\n }\n\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n byId: {\n ...omit(global.groupCalls.byId, [groupCallId.toString()]),\n },\n },\n };\n}\n\nexport function updateActiveGroupCall(\n global: GlobalState,\n groupCallUpdate: Partial,\n resetParticipantCount?: number,\n): GlobalState {\n if (!global.groupCalls.activeGroupCallId) {\n return global;\n }\n\n return updateGroupCall(global,\n global.groupCalls.activeGroupCallId,\n groupCallUpdate,\n undefined,\n resetParticipantCount);\n}\n\nexport function updateGroupCallParticipant(\n global: GlobalState,\n groupCallId: string,\n userId: string,\n participantUpdate: Partial,\n noUpdateCount = false,\n) {\n const groupCall = selectGroupCall(global, groupCallId);\n if (!groupCall) {\n return global;\n }\n\n return updateGroupCall(global, groupCallId, {\n participants: {\n ...groupCall.participants,\n [userId]: {\n ...groupCall.participants[userId],\n ...participantUpdate,\n },\n },\n }, participantUpdate.isLeft\n ? (noUpdateCount ? 0 : -1)\n : (groupCall.participants[userId] || noUpdateCount ? 0 : 1));\n}\n","import { GlobalState } from '../../global/types';\nimport { selectChat } from './chats';\nimport { isChatBasicGroup } from '../helpers';\n\nexport function selectChatGroupCall(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.fullInfo || !chat.fullInfo.groupCallId) return undefined;\n\n return selectGroupCall(global, chat.fullInfo.groupCallId);\n}\n\nexport function selectGroupCall(global: GlobalState, groupCallId: string) {\n return global.groupCalls.byId[groupCallId];\n}\n\nexport function selectGroupCallParticipant(global: GlobalState, groupCallId: string, participantId: string) {\n return selectGroupCall(global, groupCallId)?.participants[participantId];\n}\n\nexport function selectIsAdminInActiveGroupCall(global: GlobalState): boolean {\n const chatId = selectActiveGroupCall(global)?.chatId;\n\n if (!chatId) return false;\n\n const chat = selectChat(global, chatId);\n if (!chat) return false;\n\n return (isChatBasicGroup(chat) && chat.isCreator) || !!chat.adminRights?.manageCall;\n}\n\nexport function selectActiveGroupCall(global: GlobalState) {\n const { groupCalls: { activeGroupCallId } } = global;\n if (!activeGroupCallId) {\n return undefined;\n }\n\n return selectGroupCall(global, activeGroupCallId);\n}\n","import { getDispatch } from '../lib/teact/teactn';\n\ntype DeepLinkMethod = 'resolve' | 'login' | 'passport' | 'settings' | 'join' | 'addstickers' | 'setlanguage' |\n'addtheme' | 'confirmphone' | 'socks' | 'proxy' | 'privatepost' | 'bg' | 'share' | 'msg' | 'msg_url';\n\nexport const processDeepLink = (url: string) => {\n const { protocol, searchParams, pathname } = new URL(url);\n\n if (protocol !== 'tg:') return;\n\n const {\n openChatByInvite,\n openChatByUsername,\n openStickerSetShortName,\n focusMessage,\n joinVoiceChatByLink,\n } = getDispatch();\n\n const method = pathname.replace(/^\\/\\//, '') as DeepLinkMethod;\n const params: Record = {};\n searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n switch (method) {\n case 'resolve': {\n const {\n domain, post, comment, voicechat, livestream,\n } = params;\n\n if (domain !== 'telegrampassport') {\n if (params.hasOwnProperty('voicechat') || params.hasOwnProperty('livestream')) {\n joinVoiceChatByLink({\n username: domain,\n inviteHash: voicechat || livestream,\n });\n } else {\n openChatByUsername({\n username: domain,\n messageId: Number(post),\n commentId: Number(comment),\n });\n }\n }\n break;\n }\n case 'privatepost': {\n const {\n post, channel,\n } = params;\n\n focusMessage({\n chatId: -Number(channel),\n id: post,\n });\n break;\n }\n case 'bg': {\n // const {\n // slug, color, rotation, mode, intensity, bg_color: bgColor, gradient,\n // } = params;\n break;\n }\n case 'join': {\n const { invite } = params;\n\n openChatByInvite({ hash: invite });\n break;\n }\n case 'addstickers': {\n const { set } = params;\n\n openStickerSetShortName({\n stickerSetShortName: set,\n });\n break;\n }\n case 'share':\n case 'msg': {\n // const { url, text } = params;\n break;\n }\n case 'login': {\n // const { code, token } = params;\n break;\n }\n default:\n // Unsupported deeplink\n\n break;\n }\n};\n"],"names":["memo","withGlobal","global","userId","chat","selectCurrentChat","user","selectUser","contactName","getUserFirstOrLastName","undefined","setGlobal","actions","pick","isOpen","onClose","deleteChatMember","lang","useLang","handleDeleteChatMember","useCallback","chatId","id","onEnter","className","title","renderText","color","isText","onClick","ms","noFirst","useMemo","throttle","cb","runThrottledForLoadChats","runThrottledForLoadTopChats","runDebouncedForLoadFullChat","debounce","async","loadChats","listType","offsetId","offsetDate","getGlobal","result","callApi","limit","CHAT_LIST_LOAD_SLICE","archived","withPinned","chats","orderedPinnedIds","serverTimeOffset","lastLocalServiceMessage","selectLastServiceNotification","message","chatIds","length","shift","addUsers","buildCollectionByKey","users","updateChats","updateChatListIds","updateChatListSecondaryInfo","Object","keys","draftsById","forEach","replaceThreadParam","MAIN_THREAD_ID","replyingToById","isFullyLoaded","loadFullChat","fullInfo","groupCall","existingGroupCall","selectGroupCall","updateGroupCall","omit","participantsCount","updateChat","fetchChatByUsername","username","localChat","selectChatByUsername","isMin","addReducer","preloadedChatIds","i","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","pause","byId","listIds","active","currentChatId","selectCurrentMessageList","pinnedChats","otherChats","prepareChatList","chatToPreload","find","includes","push","loadViewportMessages","threadId","payload","currentUserId","selectChat","hasUnreadMark","toggleChatUnread","lastMessage","threadInfo","requestThreadInfoUpdate","isChatSummaryOnly","requestChatUpdate","type","selectThreadTopMessageId","chatFullInfo","linkedChatId","openChat","messageId","focusMessage","selectSupportChat","shouldReplaceHistory","TMP_CHAT_ID","langCode","usernamePostfix","LOCALIZED_TIPS","toUpperCase","openChatByUsername","TIPS_USERNAME","oldestChat","map","filter","Boolean","selectIsChatPinned","sort","chat1","chat2","date","currentGlobal","force","SERVICE_NOTIFICATIONS_USER_ID","lastLocalMessage","isMuted","about","photo","memberIds","chatCreation","progress","ChatCreationProgress","createdChannel","channelId","accessHash","getDispatch","createChannel","leaveChat","createdChat","e","error","createGroupChat","folderId","folder","selectChatFolder","shouldBePinned","pinnedChatIds","includedChatIds","newPinnedIds","pinnedId","newIncludedChatIds","folderUpdate","selectChatListType","isPinned","ARCHIVED_FOLDER_ID","isChatArchived","chatFolders","loadChatFolders","recommendedChatFolders","recommended","loadRecommendedChatFolders","idsToRemove","idsToAdd","includedId","concat","emoticon","orderedIds","maxId","recommendedId","description","newFolder","createChatFolder","Math","max","apply","deleteChatFolder","unreadCount","hash","url","match","RE_TG_LINK","processDeepLink","uri","URL","startsWith","part1","part2","part3","pathname","split","l","decodeURI","params","fromEntries","searchParams","substr","openChatByInvite","openStickerSetShortName","stickerSetShortName","chatOrChannelPostId","Number","commentId","comment","hasOwnProperty","joinVoiceChatByLink","inviteHash","voicechat","livestream","channelPostId","openPreviousChat","showNotification","usernameChat","selectThreadInfo","discussionChatId","openCommentsByUsername","isEnabled","isChatBasicGroup","bannedRights","newGlobal","chatAfterUpdate","members","kickedMembers","isBanned","viewMessages","isUnblocked","m","adminRights","customTitle","adminMembers","isDismissed","updateManagementProgress","ManagementProgress","Promise","all","groups","addedById","reduce","group","addChats","forDiscussionIds","channel","fullChat","isPreHistoryHidden","activeChatFolder","offset","setNewChatMembersDialogState","NewChatMembersProgress","audioElement","audioContext","joinAudio","Audio","connectingAudio","loop","leaveAudio","sounds","join","allowTalk","leave","connecting","initializationPromise","resolve","fetchGroupCall","call","isLoaded","fetchGroupCallParticipants","nextOffset","getGroupCallAudioElement","getGroupCallAudioContext","removeGroupCallAudioElement","groupCalls","isGroupCallPanelHidden","subscribed","peer","joinGroupCall","selectActiveGroupCall","canSelfUnmute","copyTextToClipboard","langProvider","full","ARE_CALLS_SUPPORTED","ctx","window","AudioContext","webkitAudioContext","srcObject","oscillator","createOscillator","dst","connect","createMediaStreamDestination","start","MediaStream","assign","stream","getAudioTracks","enabled","silence","safePlay","createAudioElement","values","muted","volume","play","then","currentTime","activeGroupCallId","selectChatGroupCall","leaveGroupCall","rejoin","toggleGroupCallPanel","sound","groupCallId","groupCallUpdate","addToParticipantCount","resetParticipantCount","participants","isLeft","acc","el","removeGroupCall","toString","updateActiveGroupCall","updateGroupCallParticipant","participantUpdate","noUpdateCount","selectGroupCallParticipant","participantId","selectIsAdminInActiveGroupCall","isCreator","manageCall","protocol","method","replace","value","key","domain","post","invite","set"],"sourceRoot":""}